query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
============================ Getter & Setter ================================
public function getFileList() { return $this->fileList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function value()\n {\n }", "protected function __init__() { }", "public function setData() \n {\n // Empty, to be overridden \n }", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function set();", "public function get() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "public function __construct() {\n \n }", "protected function __construct() {\n \n }", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "public function __init(){}", "function __construct(){\n \n }", "public function value()\n {\n }", "public function value()\n {\n }", "public function value()\n {\n }", "public function value()\n {\n }", "public function get()\n {\n // TODO: Implement get() method.\n }", "protected function __construct () {}", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function __construct() {\r\n\t\t//\r\n\t}", "public function value() { }", "public function value() { }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "abstract public function get() ;", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function __construct() {\r\n\r\n\t\t}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "function __construct (){\n\t\t}", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function setContent()\n {\n }", "public function __construct() {\n\n\t\t}", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "protected function __construct() { }", "private function __() {\n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }", "public function __construct() {\n \n }" ]
[ "0.66932505", "0.65024287", "0.64458835", "0.64026207", "0.64026207", "0.64026207", "0.64026207", "0.64026207", "0.64026207", "0.64006186", "0.6399275", "0.63874996", "0.63874996", "0.63874996", "0.6367996", "0.6367996", "0.6367996", "0.6367996", "0.6367996", "0.63677704", "0.6348925", "0.6320974", "0.6320974", "0.6320974", "0.6310275", "0.6288855", "0.6283314", "0.6283314", "0.6283314", "0.62821996", "0.62599665", "0.62386096", "0.6238017", "0.6238017", "0.6238017", "0.62224656", "0.6221725", "0.6221725", "0.61928487", "0.61928487", "0.61928487", "0.61928487", "0.61928487", "0.6191201", "0.6188368", "0.6188368", "0.6187625", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6182758", "0.6156959", "0.6156959", "0.6156959", "0.615425", "0.6151986", "0.61495894", "0.61495894", "0.61495894", "0.61495894", "0.6146561", "0.6146561", "0.61343515", "0.61343515", "0.612403", "0.61174184", "0.61174184", "0.61174184", "0.61174184", "0.61171633", "0.61171633", "0.6109746", "0.6103575", "0.61009854", "0.61009854", "0.61009854", "0.61009854", "0.61009854", "0.61009854", "0.60927165", "0.6092407", "0.6092407", "0.6092407", "0.6092407", "0.6092407", "0.6092407", "0.6092407", "0.6092407", "0.6092407" ]
0.0
-1
Get the prepared query.
public function getQuery() { return $this->query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepare ($sql) {\n $this->query = $this->conn->prepare($sql);\n return $this->query;\n }", "protected function getStatement()\n\t{\n\t\tif (!isset($this->statement)) {\n\t\t\t$this->statement = $this->query->execute();\n\t\t}\n\n\t\treturn $this->statement;\n\t}", "public function GetPreparedStatement() : \\PDOStatement\r\n {\r\n return($this->preparedStatement);\r\n }", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "public function getSQL() {\n return $this->_connection->processQuery($this, true);\n }", "public function getQuerySql() {\n $sql = parent::getQuerySql();\n $connection = $this->model->getMeta()->getConnection();\n\n return $this->parseVariablesIntoSql($sql, $connection);\n }", "public function fetchSqlString()\n\t{\n\t\treturn $this->cur_query;\n\t}", "public function get_query(){\n return $this->build_query()->query;\n }", "function _getSQL(){\n\t\tif ( !isset($this->sql) ){\n\t\t\t$compiler =& $this->_getCompiler();\n\t\t\t$this->sql = $compiler->compile($this->sql_data);\n\t\t}\n\t\treturn $this->sql;\n\t}", "public function getSql() {\n\t\t$val = $this->myQuery;\n\t\t$this->myQuery = array();\n\t\treturn $val;\n\t}", "public function getStatement($query){\n return $this->pdo->query($query);\n }", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function get_compiled_sql()\n {\n $sql = $this->compile();\n $this->reset();\n return $sql;\n }", "protected function getQuery()\n {\n return self::$_query;\n }", "final protected function getSQL()\n {\n return $this->sql;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function getSql(){\n $val = $this->myQuery;\n $this->myQuery = array();\n return $val;\n }", "public function getStatement()\n {\n return Statement::getStatement($this->table);\n }", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getQuery(): string {\n\t\t// Store previous output before changing to temp\n\t\t$output = $this->get('output');\n\t\t\n\t\ttry {\n\t\t\t$this->set('output', SqlAdapter::SQL_QUERY);\n\t\t\t$result = $this->run();\n\t\t} finally {\n\t\t\t$this->set('output', $output);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getQUERY()\n {\n return $this->QUERY;\n }", "private function getQuery()\n {\n return $this->connection->table($this->table);\n }", "public function query()\n {\n return $this->_query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "function query()\n\t{\n\t\treturn $this->query;\n\t}", "protected function getQuery()\n {\n return $this->connection->table($this->table);\n }", "public function prepare_statement($query) {\n return ($this->mysqli->prepare($query));\n }", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "public function getQuery() {\n return $this->query;\n }", "public function runQuery($sql){\n $stmt = $this->pdo->prepare($sql);\n return $stmt;\n }", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "public function getQuery()\n {\n return $this->_query;\n }", "public function getQuery()\n {\n /* Return self->query */\n return $this->query;\n }", "public function getStatement()\n {\n return $this->statement;\n }", "public function getSql()\n {\n return $this->sql;\n }", "public function getQuery()\n {\n return $this->wrapped->getQuery();\n }", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "public function getSqlPreparedValues()\n {\n return $this->sqlPreparedValues;\n }", "function getSQL() {\n\t\treturn $this->sql;\n\t}", "public function getQuery() {\n return $this->query;\n }", "public function getStatement()\n\t\t{\n\t\t\treturn $this->statement;\n\t\t}", "protected function getQuery()\n {\n return $this->connection->table(\n $this->config['table']\n );\n }", "public function runQuery($sql){\n $stmt = $this->conn->prepare($sql);\n return $stmt;\n }", "public function get_sql() {\n return $this->sql;\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 }", "public function getQuery()\r\n {\r\n return $this->m_query;\r\n }", "public static function getQuery()\n {\n return self::$__query;\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "public function getquery(){\n\t\treturn $this->query;\n\t}", "public function queryString($bind = false){\r\n\t\t// Ensure we have at least a select statement\r\n\t\tif(empty($this->_sql)){\r\n\t\t\t$this->select(['*']);\r\n\t\t}\r\n\t\t$sql = $this->getSqlStatement();\r\n\t\tif($bind === true){\r\n\t\t\tforeach($this->_placeholders as $key => $value){\r\n\t\t\t\t$sql = str_replace($key, (is_string($value) ? \"'{$value}'\" : $value), $sql);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function getStatement(): PDOStatement\n {\n return $this->getAdapter()->getStatement();\n }", "function getQuery() {\n return $this->query;\n }", "public final function getQuery() {\n return $this->queryString;\n }", "public function getQuery()\n {\n return isset($this->query) ? $this->query : null;\n }", "protected function getStatementParts(/**\n * The queryParser will preparse the query to get the query's hash and parameters.\n * If the hash is found in the cache and useQueryCaching is enabled, extbase will\n * then take the string representation from cache and build a prepared query with\n * the parameters found.\n *\n * Otherwise extbase will parse the complete query, build the string representation\n * and run a usual query.\n */\n$query, /**\n * The queryParser will preparse the query to get the query's hash and parameters.\n * If the hash is found in the cache and useQueryCaching is enabled, extbase will\n * then take the string representation from cache and build a prepared query with\n * the parameters found.\n *\n * Otherwise extbase will parse the complete query, build the string representation\n * and run a usual query.\n */\n$resolveParameterPlaceholders = true) {}", "public function getQuery()\n {\n return $this->db->table(self::TABLE);\n }", "public function runQuery($sql)\n {\n $stmt = $this->conn->prepare($sql);\n return $stmt;\n }", "public function runQuery($sql)\n {\n $stmt = $this->conn->prepare($sql);\n return $stmt;\n }", "public function getSql() { \n return $this->sql;\n }", "public function query()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n if (count($bindings) == 1 and is_array($bindings[0])){\n $bindings = $bindings[0];\n }\n\n try{\n $query = $this->connection()->prepare($sql);\n\n foreach ($bindings as $key => $value){\n $query->bindValue($key + 1 , _e($value));\n }\n $query->execute();\n\n return $query;\n }\n catch (PDOException $e){\n echo $sql;\n pre($this->bindings);\n die($e->getMessage());\n }\n\n }", "public function getSQL(): string\n {\n return $this->getQuery()->getSQL();\n }", "function prepareQuery() {\n\t\t$q = \"SET \n\t\t\t\t\t`template` = '{$this->newIdt}',\n\t\t\t\t\t`description` = '{$this->description}',\n\t\t\t\t\t`PostsHeader` = '{$this->postsHeader}',\n\t\t\t\t\t`PostBody` = '{$this->postBody}',\n\t\t\t\t\t`PostsFooter` = '{$this->postsFooter}',\n\t\t\t\t\t`FormLogged` = '{$this->formLogged}',\n\t\t\t\t\t`Form` = '{$this->form}',\n\t\t\t\t\t`Navigation` = '{$this->navigation}',\n\t\t\t\t\t`Name` = '{$this->name}',\n\t\t\t\t\t`NameLin` = '{$this->nameLin}',\n\t\t\t\t\t`MemberName` = '{$this->memberName}',\n\t\t\t\t\t`Date` = '{$this->date}',\n\t\t\t\t\t`Time` = '{$this->time}',\n\t\t\t\t\t`NextPage` = '{$this->nextPage}',\n\t\t\t\t\t`PreviousPage` = '{$this->previousPage}',\n\t\t\t\t\t`FirstPage` = '{$this->firstPage}',\n\t\t\t\t\t`LastPage` = '{$this->lastPage}',\n\t\t\t\t\t`UrlsToLinks`\t=\t'\".($this->urlToLink ? 'yes' : 'no').\"',\n\t\t\t\t\t`EmoToImg` \t\t=\t'\".($this->emoToImg ? 'yes' : 'no').\"',\n\t\t\t\t\t`GravDefault`\t=\t'{$this->gravDefault}',\n\t\t\t\t\t`GravSize`\t\t=\t{$this->gravSize}\";\n\t\treturn $q;\n\n\t}", "public function get_sql()\n\t{\n\t\treturn $this->sql;\n\t}", "private function getOrPrepareQuery($stmt_num) {\n if (!isset($this->queries[$stmt_num]))\n $this->queries[$stmt_num] = $this->db->prepare(Airplane::STMT_SQL_CODE[$stmt_num]);\n return $this->queries[$stmt_num];\n }", "public function getQuery()\r\n {\r\n return $this->db->table(self::TABLE);\r\n }", "public function getQuery() {\n if ($this->query == null) {\n $this->query = new PgQuery();\n }\n return $this->query;\n }", "public function getStatment()\n\t{\n\t\tif($this->stmt === null)\n\t\t{\n\t\t\tif(!empty($this->values))\n\t\t\t{\n\t\t\t\t$len = count($this->values);\n\t\t\t\t$conditions = '';\n\n\t\t\t\tforeach($this->values as $i => $value)\n\t\t\t\t{\n\t\t\t\t\tswitch($value[self::TYPE])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . $value[self::VALUE];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' IN (' . implode(',', array_fill(0, count($value[self::VALUE]), '?')) . ')';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ?';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions.= ($i < $len - 1) ? ' ' . $value[self::CONJUNCTION] . ' ' : '';\n\t\t\t\t}\n\n\t\t\t\treturn $this->stmt = 'WHERE ' . $conditions;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->stmt = '';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->stmt;\n\t\t}\n\t}", "public function execute()\n {\n $query = $this->__toString();\n if (!empty($this->params)) {\n $statement = $this->pdo->prepare($query);\n $statement->execute($this->params);\n return $statement;\n }\n return $this->pdo->query($query);\n }", "public function prepare(): Query\n {\n if (null === $this->dbc) {\n throw new RuntimeException('No database connection set for query.');\n }\n $this->statement = $this->dbc->getStatement($this->generateQuery());\n return $this;\n }", "public function prepare_query()\n {\n }", "protected function build()\n {\n if (!is_null($this->rawSql)) {\n return $this->rawSql;\n }\n\n $query = null;\n\n if ($this->isDelete) {\n $query .= 'DELETE FROM ' . $this->table;\n if (!empty($this->where)) {\n $query .= ' WHERE ' . implode(' ', $this->where);\n }\n\n return $query;\n }\n\n if ($this->isInsert) {\n $fields = [];\n foreach (array_keys($this->insert) as $field) {\n $fields[] = $this->escapeField($field);\n }\n\n $values = array_values($this->insert);\n foreach ($values as $value) {\n $this->params[] = trim($value) != '' ? $value : null;\n }\n\n $query .= 'INSERT INTO ' . $this->tableWithoutAlias . ' ';\n $query .= '(' . implode(', ', $fields) . ')';\n $query .= ' VALUES ';\n $query .= '(' . implode(', ', array_fill(1, count($values), '?')) . ')';\n\n return $query;\n }\n\n if ($this->isUpdate) {\n $fields = [];\n foreach (array_keys($this->update) as $field) {\n $fields[] = $this->escapeField($field) . ' = ?';\n }\n\n $values = array_values($this->update);\n\n $params = [];\n foreach ($values as $value) {\n $params[] = trim($value) != '' ? $value : null;\n }\n\n $this->params = array_merge($params, $this->params);\n\n $query .= 'UPDATE ' . $this->table;\n $query .= ' SET ' . implode(', ', $fields);\n if (!empty($this->where)) {\n $query .= ' WHERE ' . implode(' ', $this->where);\n }\n\n return $query;\n }\n\n $query .= 'SELECT ';\n $query .= trim($this->select['prefunction'] . ' ');\n $query .= implode(', ', $this->select['fields']);\n\n $query .= ' FROM ' . $this->table;\n\n if (!empty($this->join)) {\n $query .= ' ' . implode(' ', $this->join);\n }\n\n if (!empty($this->where)) {\n $query .= ' WHERE ' . implode(' ', $this->where);\n }\n\n if (!empty($this->groupBy)) {\n $query .= ' GROUP BY ' . implode(', ', $this->groupBy);\n }\n\n if (!empty($this->having)) {\n $query .= ' HAVING ' . implode(' ', $this->having);\n }\n\n if (!empty($this->orderBy)) {\n $query .= ' ORDER BY ' . implode(', ', $this->orderBy);\n }\n\n if (!empty($this->limit)) {\n $query .= ' LIMIT ' . implode(', ', $this->limit);\n }\n\n return $query;\n }", "public function prepare($sql) {\n return $this->conn->prepare($sql);\n }", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "public function getStatement(): PDOStatement\n {\n return $this->statement;\n }", "public function sql () {\n\n return $this->_sql;\n }", "public function getPrepared(string $sql): ?\\PDOStatement\n {\n if ($this->level === 0) {\n return null;\n }\n\n for ($i = 0; $i <= $this->level; $i++) {\n if (isset($this->statements[$i][$sql])) {\n return $this->statements[$i][$sql];\n }\n }\n\n return null;\n }", "public function GetSqlStatement(){\n return $this->sqlStatement;\n }", "public function GET_STATEMENT()\r\n {\r\n # code...\r\n return $this->statement;\r\n }", "public function getSqlStatement($reset = true)\n {\n $sqlStatementsSequence = [\n 'Select',\n 'Union',\n 'Into',\n 'From',\n 'Join',\n 'Where',\n 'Having',\n 'GroupBy',\n 'OrderBy',\n 'Limit',\n ];\n\n if (empty($this->builderCache->getStatement())) {\n $sqlStatement = [];\n foreach ($sqlStatementsSequence as $compileMethod) {\n $sqlStatement[] = trim(call_user_func([&$this, 'compile' . $compileMethod . 'Statement']));\n }\n\n $sqlStatement = implode(PHP_EOL, array_filter($sqlStatement));\n\n if ($reset) {\n $this->builderCache->reset();\n\n return $sqlStatement;\n }\n\n $this->builderCache->setStatement($sqlStatement);\n }\n\n return $this->builderCache->getStatement();\n }", "public function _prepare() {\n if( !DBwrite::connected() ) {\n DBwrite::connect();\n }\n\n $query = $this->query;\n foreach( $this->key_value_map as $key => $value ) {\n $query = str_replace(\n '#'.$key, \n $this->sanitizeValue( $key, $value ),\n $query\n );\n }\n \n $this->real_query = $query;\n return $this->real_query;\n }", "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "public function getQuery($new = false)\n\t{\n\t\treturn $this->sql;\n\t}", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "public final function getQueryDebug()\n {\n $sql = $this->buildSqlString();\n\n $out = '\n\t\t<div class=\"debug\">\n\t\t\t<h3>SQL</h3>\n\t\t\t<p>' . $sql . '</p>\n\t\t\t<h3>Params</h3>\n\t\t\t' . $this->debug($this->param) . '\n\t\t\t<h3>Full query</h3>\n\t\t\t' . $this->db->quote($sql, $this->param) . '\n\t\t</div>';\n\n return $out;\n }", "public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}", "public function getSql() : string {\n return $this->sql;\n }", "protected function queryPrepare($sql) {\n\n $conn = $this->connect();\n\n if (!$stmt = $conn->prepare($sql)) {\n\n $this->msgBox = $conn->error;\n return FALSE;\n }\n\n return $stmt;\n }", "public function prepare($sql) {\n return $this->connection->prepare($sql);\n }", "protected function getQuery()\n {\n $query = $this->database->select()->from($this->table);\n \n foreach ($this->join as $join) {\n if (!is_array($join[2])) {\n $join[2] = array($join[2]);\n }\n \n $where = array_shift($join[2]);\n if (!empty($join[2])) {\n foreach ($join[2] as $i => $value) {\n $join[2][$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $join[2]);\n }\n \n $query->join($join[0], $join[1], $where, $join[3]);\n }\n \n foreach ($this->filter as $i => $filter) {\n //array('post_id=%s AND post_title IN %s', 123, array('asd'));\n $where = array_shift($filter);\n if (!empty($filter)) {\n foreach ($filter as $i => $value) {\n $filter[$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $filter);\n }\n \n $query->where($where);\n }\n \n return $query;\n }" ]
[ "0.6924066", "0.6894078", "0.6860894", "0.683684", "0.68015456", "0.6790052", "0.67423975", "0.666574", "0.662164", "0.6617027", "0.6606028", "0.65688884", "0.6531254", "0.65259767", "0.651858", "0.65165323", "0.6500339", "0.6493874", "0.64797777", "0.6449437", "0.6442156", "0.64307344", "0.64268917", "0.64214414", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.6412961", "0.64081407", "0.640574", "0.64031404", "0.63675636", "0.6365629", "0.6350368", "0.6344371", "0.6342351", "0.6329981", "0.6325535", "0.6325009", "0.6324598", "0.632436", "0.6323923", "0.63217765", "0.6318428", "0.6317886", "0.631033", "0.63040745", "0.6303656", "0.629732", "0.62886494", "0.6272071", "0.6270391", "0.6265185", "0.62608576", "0.6257817", "0.6256082", "0.62420577", "0.623278", "0.6214754", "0.62135965", "0.6213145", "0.6213145", "0.6205977", "0.6204367", "0.61993104", "0.61987454", "0.61908853", "0.6184257", "0.6180709", "0.6175467", "0.61434025", "0.61409193", "0.6128804", "0.61276895", "0.61036503", "0.61029136", "0.6100026", "0.60911477", "0.60806537", "0.6074981", "0.60657865", "0.6057464", "0.6054483", "0.60523593", "0.6033304", "0.60310644", "0.6029011", "0.6017474", "0.6013161", "0.60066855", "0.60003227", "0.5999535", "0.5988583", "0.5984224" ]
0.62455636
62
Set the prepared query.
public function setQuery(SearchQueryInterface $query) { $this->query = $query; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "public function prepareQuery($query)\n {\n $this->statement = $this->db_handler->prepare($query);\n }", "final public function setToPrepared()\n {\n $this->prepared = true;\n }", "private function prepare ($sql) {\n $this->query = $this->connection->prepare($sql);\n }", "public function query($query)\n {\n $this->dbStmt = $this->dbHandler->prepare($query);\n }", "public function prepare_query()\n {\n }", "function set_query($query) {\n\t\t\t// it just sets the query with which to get a recordset\n\t\t\t$this->query = $query;\n\t\t}", "public function query($query)\n {\n $this->stmt = $this->dbh->prepare($query);\n }", "public function prepare($query, $cacheStatement = false)\n\t{\n\t\tif($cacheStatement) {\n\t\t\t$this->currentStatement = $this->db->prepare($query);\n\t\t} else {\n\t\t\t$this->currentStatement = $this->setCachedStatement($query);\n\t\t}\n\t}", "protected function prepareQuery($query) {}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "public function prepare($query)\n {\n }", "public function query($query) {\n $this->result = $this->dbHandler->prepare($query);\n }", "public function query($sql) {\n $this->statement = $this->dbHandler->prepare($sql);\n }", "public function query($sql){\r\n $this->stmt = $this->dbh->prepare($sql);\r\n }", "public function query(string $sql) {\n //Store the new prepared statement object in $this->_pstmt;\n\n $this->_pstmt = $this->_dbh->prepare($sql);\n }", "public function query($sql) {\n $this->stmt = $this->dbh->prepare($sql);\n }", "protected function prepareSelectStatement() {}", "private function setCachedStatement($query) {\n\t\t$cacheHash = md5(strtolower($query));\n\t\tif(isset($this->statementCache[$cacheHash])) {\n\t\t\treturn $this->statementCache[$cacheHash];\n\t\t}\n\t\t$preparedStmt = $this->db->prepare($query);\n\t\tif($preparedStmt !== false) {\n\t\t\t$this->statementCache[$cacheHash] = $preparedStmt;\n\t\t}\n\t\treturn $preparedStmt;\n\t}", "public function prepare( $sql ){\n $this->stmt = $this->pdo->prepare( $sql );\n }", "public function setQuery($query) {\r\n $this->query = $query;\r\n }", "function prepareQuery() {\n\t\t$q = \"SET \n\t\t\t\t\t`template` = '{$this->newIdt}',\n\t\t\t\t\t`description` = '{$this->description}',\n\t\t\t\t\t`PostsHeader` = '{$this->postsHeader}',\n\t\t\t\t\t`PostBody` = '{$this->postBody}',\n\t\t\t\t\t`PostsFooter` = '{$this->postsFooter}',\n\t\t\t\t\t`FormLogged` = '{$this->formLogged}',\n\t\t\t\t\t`Form` = '{$this->form}',\n\t\t\t\t\t`Navigation` = '{$this->navigation}',\n\t\t\t\t\t`Name` = '{$this->name}',\n\t\t\t\t\t`NameLin` = '{$this->nameLin}',\n\t\t\t\t\t`MemberName` = '{$this->memberName}',\n\t\t\t\t\t`Date` = '{$this->date}',\n\t\t\t\t\t`Time` = '{$this->time}',\n\t\t\t\t\t`NextPage` = '{$this->nextPage}',\n\t\t\t\t\t`PreviousPage` = '{$this->previousPage}',\n\t\t\t\t\t`FirstPage` = '{$this->firstPage}',\n\t\t\t\t\t`LastPage` = '{$this->lastPage}',\n\t\t\t\t\t`UrlsToLinks`\t=\t'\".($this->urlToLink ? 'yes' : 'no').\"',\n\t\t\t\t\t`EmoToImg` \t\t=\t'\".($this->emoToImg ? 'yes' : 'no').\"',\n\t\t\t\t\t`GravDefault`\t=\t'{$this->gravDefault}',\n\t\t\t\t\t`GravSize`\t\t=\t{$this->gravSize}\";\n\t\treturn $q;\n\n\t}", "public function setQuery($query);", "private function setQuery($sql){\n $this->isStatement = false;\n return $this->sqli->query($sql);\n }", "public function prepare ($sql) {\n $this->query = $this->conn->prepare($sql);\n return $this->query;\n }", "public function prepare($sql);", "public function prepare(): Query\n {\n if (null === $this->dbc) {\n throw new RuntimeException('No database connection set for query.');\n }\n $this->statement = $this->dbc->getStatement($this->generateQuery());\n return $this;\n }", "public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "public function setQuery($query)\n {\n $this->query = $query;\n }", "public function setQuery($query, $bind = null)\n {\n if (null !== $bind) {\n $helper = new Helper();\n $query = $helper->assemble($query, $bind);\n }\n\n return $this->setOption('query', $query);\n }", "public function prepare($query)\n\t{\n\t\t$this->myQuery = $query;\n\t\t$result = parent::prepare($query);\n\n\t\tif(!$result)\n\t\t\t$this->throwError('Unable to prepare statement');\n\n\t\treturn $result;\n\t}", "public function setQuery($query)\n {\n $this->parameters['query'] = $query;\n }", "public function setPrepared(string $sql, \\PDOStatement $statement)\n {\n if ($this->level === 0 || $this->statements[$this->level] === null) {\n return;\n }\n\n $this->statements[$this->level][$sql] = $statement;\n }", "public function prepare_statement($query) {\n return ($this->mysqli->prepare($query));\n }", "public function prepare($sql)\n {\n $this->objectMysqli = $this->mysqli->prepare();\n }", "public function setQuery( $query ){\n \n $this->query = $query;\n \n }", "public function setQuery(Query $query) \n\t{\n\t\t$this->query = $query;\n\t}", "public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}", "public function prepare($query) {\r\n\t\t// store query in query variable\r\n\t\t$this->query = $query;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "function prepare($pquery){\n if ( ! $this->initDB() ) return false; \n return $this->dbh->prepare($pquery);\n }", "protected function set_query($sql) {\n $this->open_link();\n $this->conx->query($sql);\n $this->close_link();\n }", "function setQuery($sql, $onlyFirstInstance = false)\n\t{\n\t\tif( !empty($this->dbprefix) )\n\t\t{\n\t\t\t// Substitute the db prefix\n\t\t\tif(!$onlyFirstInstance)\n\t\t\t{\n\t\t\t\t$sql = str_replace('#__', $this->dbprefix, $sql);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pos = strpos($sql, '#__');\n\t\t\t\t// # FIX 2.3.1 -- It is possible that the #__ doesn't exist. Stupid me!\n\t\t\t\tif($pos !== false)\n\t\t\t\t\t$sql = substr_replace( $sql, $this->dbprefix, $pos, 3);\n\t\t\t}\n\t\t}\n\n\t\t$this->sql = $sql;\n\t}", "public function prepare(/*# string */ $sql)/*# : bool */;", "public function setQuery($query){\n\t $this->instance->setQuery($query);\n\t\treturn true;\n\t}", "protected function prepareQuery()\n {\n if (false === $this->isQueryPrepared) {\n $options = array(\n SelectorSourceInterface::RESULT => SelectorSourceInterface::RESULT_IDENTIFIERS,\n SelectorSourceInterface::LIMIT => $this->limit,\n SelectorSourceInterface::OFFSET => $this->offset,\n SelectorSourceInterface::ORDERBY => $this->orderBy,\n SelectorSourceInterface::GROUPBY => $this->groupBy,\n );\n $this->setIdsArray(\n $this->source->loadIds(\n $this->criterias,\n array_merge($this->options, $options)\n ),\n array_merge($this->options, $options)\n );\n $this->isQueryPrepared = true;\n }\n\n return $this;\n }", "public static function setQuery(string $query)\n {\n self::$__query = $query;\n }", "public function prepare()\n {\n // Define column parameters\n $columns = func_get_args();\n if (!empty($columns)){\n\n // clear current parameters\n unset($this->parameters);\n $this->parameters = array();\n foreach ($columns as $column) {\n $this->parameters[$column] = null;\n } \n }\n\n // build query\n parent::prepare(); \n return $this;\n }", "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 setQuery(rbQuery &$query) {\n $this->query =& $query;\n }", "public function _prepare() {\n if( !DBwrite::connected() ) {\n DBwrite::connect();\n }\n\n $query = $this->query;\n foreach( $this->key_value_map as $key => $value ) {\n $query = str_replace(\n '#'.$key, \n $this->sanitizeValue( $key, $value ),\n $query\n );\n }\n \n $this->real_query = $query;\n return $this->real_query;\n }", "public function setQueryVar($query = true){\n\t\t$this->queryVar = $query;\n\t}", "public function prepareQuery($query)\n {\n $query = (string)$query;\n try {\n //if not successful returns either false or PDOException depending on error handling method. We use PDOException\n //if successful returns PDOStatement\n $this->stmt = $this->PDO->prepare($query);\n } catch (PDOException $e) {\n MyErrorHandler::exceptionLogger($e, fileName);\n }\n }", "public function query($sql)\n\t{\n\t\t$this->stm = $this->dbh->prepare($sql);\n\t}", "public function setStatement($statement)\n\t\t{\n\t\t\t$this->statement = (is_object($statement)) ? $statement : $this->connection->prepare($statement) ;\n\t\t\t$this->statement = $statement;\n\n\t\t\treturn $this;\n\t\t}", "private function prepareStatement()\n {\n $columns = '';\n $fields = '';\n foreach ($this->fields as $key => $f) {\n if ($key == 0) {\n $columns .= \"$f\";\n $fields .= \":$f\";\n continue;\n }\n\n $columns .= \", $f\";\n $fields .= \", :$f\";\n }\n\n $this->statement = $this->pdo->prepare(\n 'INSERT INTO `' . $this->table . '` (' . $columns . ') VALUES (' . $fields . ')'\n );\n }", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "abstract public function prepareSelect();", "public function setQUERY($QUERY)\n {\n $this->QUERY = $QUERY;\n }", "protected function updateSql()\n {\n $sql = \"UPDATE \" . $this->dbName . \".\" . $this->table . \" SET \";\n $preparedPlaceholders = $this->prepareNamedPlaceholder();\n\n $sql.= $preparedPlaceholders . \" WHERE \" . $this->tablePK . \"=:id;\";\n\n $this->query = $sql;\n }", "public function prepare($sql, $params);", "public function query($query){\r\n $args = func_get_args();\r\n array_shift($args); //first element is not an argument but the query itself, should removed\r\n\r\n $reponse = parent::prepare($query);\r\n $reponse->execute($args);\r\n return $reponse;\r\n\r\n }", "public function set_query($query_string) {\n\t\t\n\t\t$query_type = 'SELECT';\n\t\t$trimmed_query = '';\n\t\t\n\t\tif ($query_string) {\n\t\t\t\n\t\t\t$trimmed_query = trim($query_string); \n\t\t\t\n\t\t\t$query_type = strtoupper(substr($trimmed_query,0,6) );\n\t\t\t\n\t\t\t$this->QUERY = $trimmed_query;\t\n\t\t\t$this->QUERY_TYPE = $query_type;\n\t\t\t\n\t\t\t// clear out the query args\n $this->clear_arguments();\n\t\t\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$this->except(MYSQLI_ERR_MISSING_QUERY);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn True;\n\t\t\n\t}", "public function prepare($query)\n {\n // Store the query\n $this->query = $query;\n \n // Get arguments\n $arguments = func_get_args();\n \n // Replace the arugmnets in\n for($argIndex = 0; $argIndex < func_num_args(); $argIndex ++)\n {\n // Find argument\n $argValue = func_get_arg($argIndex);\n \n // Replace content\n $this->query = str_replace('{' . $argIndex . '}', $argValue, $this->query);\n $this->query = str_replace('{int:' . $argIndex . '}', intval($argValue), $this->query);\n }\n \n return $this;\n }", "public function set($sql, $execArr = array())\n {\n $stmt = $this->db->prepare($sql);\n $stmt->execute($execArr);\n }", "public function setQueryString($sql):self\n {\n $this->querystring=$sql;\n return $this;\n }", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "public function prepareStatement($rawSql);", "public function set_simple_query($query) {\n $this->query = \"\";\n $this->query = $query;\n //print $this->query;\n $this->execute_single_query();\n if(empty($this->err)):\n $this->err = 6;\n $this->msj = \"La transaccion se registro correctamente. \";\n endif; \n \n }", "protected function prepareUpdateStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Fields to update.\n $fields = [];\n foreach (array_diff($this->columns, $this->uniqueColumns) as $field) {\n $fields[] = \"$field = :$field\";\n }\n $fields = implode(',', $fields);\n\n // Prepare our statement.\n return $this->connection->prepare(\"UPDATE {$this->table} SET $fields WHERE $clauses\");\n }", "protected function prepareQueryForLogging(string &$query): void\n {\n }", "public function setquery($c = \"No comment!\", $query = \"NONEE\", $data_array = array(), $run = true){\n\t\t$this->comment = $c;\n\t\t$query = $this->securestring($query,$data_array);\n\t\t$this->query = $query;\n\t\t\n\t\tif($run)\n\t\t\treturn $this->resultset = $this->query($query);\n\t}", "function setQuery($where, $limit, $orderBy, $varName, $allowOrderByOveride=true) {\n $this->query_where = $where;\n if($this->getSessionVariable(\"query\", \"where\") != $where) {\n $this->query_where_has_changed = true;\n $this->setSessionVariable(\"query\", \"where\", $where);\n }\n\n $this->query_limit = $limit;\n if(!$allowOrderByOveride) {\n $this->query_orderby = $orderBy;\n return;\n }\n $this->getOrderBy($varName, $orderBy);\n\n $this->setLocalSessionVariable($varName, \"QUERY_WHERE\", $where);\n}", "public function execute()\n {\n if (!$this->sessionSet && $this->platform instanceof MySqlPlatform) {\n $this->connection->exec(\"SET @@SESSION.sql_mode = '';\");\n $this->sessionSet = true;\n }\n\n // Take a local copy so that we don't modify the original query and cause issues later\n $query = $this->replacePrefix((string) $this->sql);\n\n if (!($this->sql instanceof \\JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) {\n // @TODO\n if ($this->offset > 0) {\n $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit;\n } else {\n $query .= ' LIMIT ' . $this->limit;\n }\n }\n\n $this->prepared = $this->connection->prepare($query);\n\n // Increment the query counter.\n $this->count++;\n\n // Reset the error values.\n $this->errorNum = 0;\n $this->errorMsg = '';\n $memoryBefore = null;\n\n // If debugging is enabled then let's log the query.\n if ($this->debug) {\n // Add the query to the object queue.\n $this->log[] = $query;\n\n \\JLog::add($query, \\JLog::DEBUG, 'databasequery');\n\n $this->timings[] = microtime(true);\n }\n\n // Execute the query.\n $this->executed = false;\n $previous = null;\n\n if ($this->prepared instanceof Statement) {\n // Bind the variables:\n if ($this->sql instanceof JDatabaseQueryPreparable) {\n $bounded = $this->sql->getBounded();\n\n foreach ($bounded as $key => $obj) {\n $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);\n }\n }\n\n try {\n $this->executed = $this->prepared->execute();\n } catch (\\Exception $previous) {\n }\n }\n\n if ($this->debug) {\n $this->timings[] = microtime(true);\n\n if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {\n $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n } else {\n $this->callStacks[] = debug_backtrace();\n }\n }\n\n // If an error occurred handle it.\n if (!$this->executed) {\n // Get the error number and message before we execute any more queries.\n $errorNum = (int) $this->connection->errorCode();\n $errorMsg = (string) 'SQL: ' . implode(\", \", $this->connection->errorInfo());\n\n // Get the error number and message from before we tried to reconnect.\n $this->errorNum = $errorNum;\n $this->errorMsg = $errorMsg;\n\n // Throw the normal query exception.\n \\JLog::add(\n \\JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg),\n \\JLog::ERROR,\n 'databasequery'\n );\n throw new RuntimeException($this->errorMsg, $this->errorNum, $previous);\n }\n\n return $this->prepared;\n }", "public function prepare()\n\t{\n\t\tif ($this->pdoStatement == null) {\n\t\t\t$sql = $this->getSql();\n\t\t\ttry {\n\t\t\t\t$this->pdoStatement = $this->connection->pdo->prepare($sql);\n\t\t\t\t$this->_paramLog = array();\n\t\t\t}\n\t\t\tcatch(\\Exception $e) {\n\t\t\t\t\\Yii::error(\"Failed to prepare SQL ($sql): \" . $e->getMessage(), __CLASS__);\n $errorInfo = $e instanceof \\PDOException ? $e->errorInfo : null;\n\t\t\t\t$message = YII_DEBUG ? 'Failed to prepare SQL: ' . $e->getMessage() : 'Failed to prepare SQL.';\n\t\t\t\tthrow new Exception($message, (int)$e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }", "public function GetPreparedStatement() : \\PDOStatement\r\n {\r\n return($this->preparedStatement);\r\n }", "public function PREPARE_STATEMENT($PREPARED_SQL)\r\n {\r\n return $this->statement = $this->Connection->prepare($PREPARED_SQL);\r\n }", "public function setQuery(array $query);", "public function prepare(string $query)\n {\n return $this->db->prepare($query);\n }", "public function &prepare($q)\n {\n self::$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\n $st = self::$db->prepare($q);\n $st->setFetchMode(PDO::FETCH_CLASS, 'stdClass');\n //$st->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n return $st;\n }", "public function runQuery($sql){\n $stmt = $this->conn->prepare($sql);\n return $stmt;\n }", "public function runQuery($sql){\n $stmt = $this->pdo->prepare($sql);\n return $stmt;\n }", "private function initializeStatement( $clear = false )\r\n {\r\n if ( isset( $this->stmt ) && $this->stmt instanceof PDOStatement && !$clear ) {\r\n return;\r\n }\r\n $sql = $this->sql . \" LIMIT ? OFFSET ?\";\r\n $this->logger->log ( $sql );\r\n $this->stmt = $this->conn->prepare( $sql );\r\n $nextIndex = 1;\r\n if ( $this->mode == self::MODE_PARAMETERIZED ) {\r\n for ( $i = 0; $i < count( $this->values); $i++) {\r\n if ( is_bool( $this->values[$i] ) ) {\r\n $this->stmt->bindValue( $i+1, $this->values[$i], PDO::PARAM_BOOL );\r\n } else {\r\n $this->stmt->bindValue( $i+1, $this->values[$i] );\r\n }\r\n }\r\n $nextIndex = ++$i;\r\n }\r\n $this->index['max'] = $nextIndex++;\r\n $this->index['start'] = $nextIndex++;\r\n }", "public function setQuery($p_query)\r\n {\r\n $this->m_query = $p_query;\r\n\r\n return $this;\r\n }", "public function prepare($query, ...$args)\n {\n }", "public function setQueryData($query_data) {}", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "public function prepare(\n string $query,\n array $globalArgs = null\n ): QueryInterface;", "public function setQuery($query)\n {\n throw new Exception('The setQuery() method is not supported by ' . get_class($this));\n }", "public function setGridQuery ($value)\r\n\t{\r\n\t\t$this->gridQuery = $value;\r\n\t}", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "public function prepareAndExecute (PDO $connection, string $query, array $params = []);", "public function prepare();", "public function prepare();", "function prepareSQLStatement($connection, $query){\n\tif (!($sqlPrep = $connection->prepare($query))) {\n\t\techo \"Prepare of the statement <b> $query </b> failed: (\" . $connection->errno . \") \" . $connection->error;\n\t}\n\telse{\n\t\treturn $sqlPrep;\n\t}\n}", "public function __invoke($query, $sqlValues = array()) {\n return $this->prepare($query, $sqlValues);\n }", "function setQuery( $sql, $prefix='#__' ) {\n $sql = trim( $sql );\n\n $inQuote = false;\n $escaped = false;\n $quoteChar = '';\n\n $n = strlen( $sql );\n $np = strlen( $prefix );\n $literal = '';\n\n for ($j=0; $j < $n; $j++ ) {\n $c = $sql{$j};\n $test = substr( $sql, $j, $np );\n\n # If not already in a string, look for the start of one.\n if (!$inQuote) {\n if ($c == '\"' || $c == \"'\") {\n $inQuote = true;\n $escaped = false;\n $quoteChar = $c;\n }\n } else {\n # Already in a string, look for end and copy characters.\n if ($c == $quoteChar && !$escaped) {\n $inQuote = false;\n } else if ($c == \"\\\\\" && !$escaped) {\n $escaped = true;\n } else {\n $escaped = false;\n }\n }\n if ($test == $prefix && !$inQuote) {\n $literal .= $this->_table_prefix;\n $j += $np-1;\n } else {\n $literal .= $c;\n }\n }\n $this->_sql = $literal;\n }\n \n /**\n * @return string The current value of the internal SQL vairable\n */\n function getQuery() {\n return \"<pre>\" . htmlspecialchars( $this->_sql ) . \"</pre>\";\n }\n\n /**\n * Execute the query\n * @return mixed A database resource if successful, FALSE if not.\n */\n function query() {\n $this->_errorNum = 0;\n $this->_errorMsg = '';\n $this->_cursor = mysql_query( $this->_sql, $this->_resource );\n if (!$this->_cursor) {\n $this->_errorNum = mysql_errno( $this->_resource );\n $this->_errorMsg = mysql_error( $this->_resource ).\" SQL=$this->_sql\";\n if ($this->_debug) {\n handle_error(mysql_error( $this->_resource ), E_USER_NOTICE);\n }\n return false;\n }\n return $this->_cursor;\n }\n\n\t/**\n\t* Executes a batch of queries within a single transaction\n\t* \n\t* @return the error state\n\t*/\n\tfunction query_batch( $abort_on_error=true, $p_transaction_safe = false) {\n $this->_errorNum = 0;\n $this->_errorMsg = '';\n if ($p_transaction_safe) {\n $si = mysql_get_server_info();\n preg_match_all( \"/(\\d+)\\.(\\d+)\\.(\\d+)/i\", $si, $m );\n if ($m[1] >= 4) {\n $this->_sql = 'START TRANSACTION;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 19) {\n $this->_sql = 'BEGIN WORK;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 17) {\n $this->_sql = 'BEGIN;' . $this->_sql . '; COMMIT;';\n }\n }\n\n $query_split = preg_split (\"/[;]+/\", $this->_sql);\n $error = 0;\n $counter = 0;\n foreach ($query_split as $command_line) {\n $counter++;\n $command_line = trim( $command_line );\n if ($command_line != '') {\n $this->_cursor = mysql_query( $command_line, $this->_resource );\n if (!$this->_cursor) {\n $error = 1;\n $this->_errorNum .= mysql_errno( $this->_resource ) . ' ';\n $this->_errorMsg .= mysql_error( $this->_resource ).\" SQL=$command_line <br />\";\n\n if ($abort_on_error) {\n handle_error($this->getPrettyErrorMessage());\n return $this->_cursor;\n }\n }\n }\n }\n return $error ? false : true;\n\t}\n\n\t/**\n\t* Diagnostic function\n\t*/\n\tfunction explain() {\n\t\t$temp = $this->_sql;\n\t\t$this->_sql = \"EXPLAIN $this->_sql\";\n\t\t$this->query();\n\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$first = true;\n\n\t\t$buf = \"<table cellspacing=\\\"1\\\" cellpadding=\\\"2\\\" border=\\\"0\\\" bgcolor=\\\"#000000\\\" align=\\\"center\\\">\";\n\t\t$buf .= $this->getQuery();\n\t\twhile ($row = mysql_fetch_assoc( $cur )) {\n\t\t\tif ($first) {\n\t\t\t\t$buf .= \"<tr>\";\n\t\t\t\tforeach ($row as $k=>$v) {\n\t\t\t\t\t$buf .= \"<th bgcolor=\\\"#ffffff\\\">$k</th>\";\n\t\t\t\t}\n\t\t\t\t$buf .= \"</tr>\";\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\t$buf .= \"<tr>\";\n\t\t\tforeach ($row as $k=>$v) {\n\t\t\t\t$buf .= \"<td bgcolor=\\\"#ffffff\\\">$v</td>\";\n\t\t\t}\n\t\t\t$buf .= \"</tr>\";\n\t\t}\n\t\t$buf .= \"</table><br />&nbsp;\";\n\t\tmysql_free_result( $cur );\n\n\t\t$this->_sql = $temp;\n\n\t\treturn \"<div style=\\\"background-color:#FFFFCC\\\" align=\\\"left\\\">$buf</div>\";\n\t}\n\n\t/**\n\t* @return int The number of rows returned from the most recent query.\n\t*/\n\tfunction getNumRows( $cur=null ) {\n\t\treturn mysql_num_rows( $cur ? $cur : $this->_cursor );\n\t}\n\n\t/**\n\t* This method loads the first field of the first row returned by the query.\n\t*\n\t* @return The value returned in the query or null if the query failed.\n\t*/\n\tfunction loadResult() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row[0];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}\n\t/**\n\t* Load an array of single field results into an array\n\t*/\n\tfunction loadResultArray($numinarray = 0) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_row( $cur )) {\n\t\t\t$array[] = $row[$numinarray];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t/**\n\t* Load a assoc list of database rows\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t*/\n\tfunction loadAssocList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_assoc( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row->$key] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t\n\t/**\n\t* This global function loads the first row of a query into an object\n\t*\n\t* If an object is passed to this function, the returned row is bound to the existing elements of <var>object</var>.\n\t* If <var>object</var> has a value of null, then all of the returned query fields returned in the object.\n\t* @param string The SQL query\n\t* @param object The address of variable\n\t*/\n\tfunction loadObject( &$object ) {\n\t\tif ($object != null) {\n\t\t\tif (!($cur = $this->query())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($array = mysql_fetch_assoc( $cur )) {\n\t\t\t\tmysql_free_result( $cur );\n\t\t\t\tmosBindArrayToObject( $array, $object, null, null, false );\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($cur = $this->query()) {\n\t\t\t\tif ($object = mysql_fetch_object( $cur )) {\n\t\t\t\t\tmysql_free_result( $cur );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$object = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t* Load a list of database objects\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t* If <var>key</var> is not empty then the returned array is indexed by the value\n\t* the database key. Returns <var>null</var> if the query fails.\n\t*/\n\tfunction loadObjectList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_object( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row->$key] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t\n\t/**\n\t* @return The first row of the query.\n\t*/\n\tfunction loadRow() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row;\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}\n\t/**\n\t* Load a list of database rows (numeric column indexing)\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t* If <var>key</var> is not empty then the returned array is indexed by the value\n\t* the database key. Returns <var>null</var> if the query fails.\n\t*/\n\tfunction loadRowList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_array( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row[$key]] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t/**\n\t* Document::db_insertObject()\n\t*\n\t* { Description }\n\t*\n\t* @param [type] $keyName\n\t* @param [type] $verbose\n\t*/\n\tfunction insertObject( $table, &$object, $keyName = NULL, $verbose=false ) {\n\t\t$fmtsql = \"INSERT INTO $table ( %s ) VALUES ( %s ) \";\n\t\t$fields = array();\n\t\t\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\n\n\t\t\tif (is_array($v) or is_object($v)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($k[0] == '_') { // internal field\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$fields[] = \"`$k`\";\n\t\t\t$values[] = \"'\" . $this->getEscaped( $v ) . \"'\";\n\t\t}\n\t\t$sSQL = sprintf( $fmtsql, implode( \",\", $fields ) , implode( \",\", $values ) ) ;\n\t\t$this->setQuery($sSQL);\n\t\t($verbose) && print \"$sql<br />\\n\";\n\t\tif (!$this->query()) {\n\t\t\treturn false;\n\t\t}\n\t\t$id = mysql_insert_id();\n\t\t($verbose) && print \"id=[$id]<br />\\n\";\n\t\tif ($keyName && $id) {\n\t\t\t$object->$keyName = $id;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t* Document::db_updateObject()\n\t*\n\t* { Description }\n\t*\n\t* @param [type] $updateNulls\n\t*/\n\tfunction updateObject( $table, &$object, $keyName, $updateNulls=true ) {\n\t\t$fmtsql = \"UPDATE $table SET %s WHERE %s\";\n\t\t$tmp = array();\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\n\t\t\tif( is_array($v) or is_object($v) or $k[0] == '_' ) { // internal or NA field\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif( $k == $keyName ) { // PK not to be updated\n\t\t\t\t$where = \"$keyName='\" . $this->getEscaped( $v ) . \"'\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($v === NULL && !$updateNulls) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif( $v == '' ) {\n\t\t\t\t$val = \"''\";\n\t\t\t} else {\n\t\t\t\t$val = \"'\" . $this->getEscaped( $v ) . \"'\";\n\t\t\t}\n\t\t\t$tmp[] = \"`$k`=$val\";\n\t\t}\n\t\t$this->setQuery( sprintf( $fmtsql, implode( \",\", $tmp ) , $where ) );\n\t\treturn $this->query();\n\t}\n\n\t/**\n\t* @param boolean If TRUE, displays the last SQL statement sent to the database\n\t* @return string A standised error message\n\t*/\n\tfunction stderr( $showSQL = false ) {\n\t\treturn \"DB function failed with error number $this->_errorNum\"\n\t\t.\"<br /><font color=\\\"red\\\">$this->_errorMsg</font>\"\n\t\t.($showSQL ? \"<br />SQL = <pre>$this->_sql</pre>\" : '');\n\t}\n\n\tfunction show_error($class){\n\t\t$msg = $this->stderr(true);\n\t\tdebug(\"[ERROR]\");\n\t\tdebug(\"[class]$class\");\n\t\tdebug(\"[database error number]\" . $this->_errorNum);\n\t\tdebug(\"[database error messsage]\" . $this->_errorMsg);\n\t\tdebug(\"[last sql]\" . $this->_sql);\n\t}\n\t\t\n\tfunction insertid()\n\t{\n\t\treturn mysql_insert_id();\n\t}\n\n\tfunction getVersion()\n\t{\n\t\treturn mysql_get_server_info();\n\t}\n\n\t/**\n\t* Fudge method for ADOdb compatibility\n\t*/\n\tfunction GenID( $foo1=null, $foo2=null ) {\n\t\treturn '0';\n\t}\n\t/**\n\t* @return array A list of all the tables in the database\n\t*/\n\tfunction getTableList() {\n\t\t$this->setQuery( 'SHOW tables' );\n\t\t$this->query();\n\t\treturn $this->loadResultArray();\n\t}\n\t/**\n\t* @param array A list of table names\n\t* @return array A list the create SQL for the tables\n\t*/\n\tfunction getTableCreate( $tables ) {\n\t\t$result = array();\n\n\t\tforeach ($tables as $tblval) {\n\t\t\t$this->setQuery( 'SHOW CREATE table ' . $tblval );\n\t\t\t$this->query();\n\t\t\t$result[$tblval] = $this->loadResultArray( 1 );\n\t\t}\n\n\t\treturn $result;\n\t}\n\t/**\n\t* @param array A list of table names\n\t* @return array An array of fields by table\n\t*/\n\tfunction getTableFields( $tables ) {\n\t\t$result = array();\n\n\t\tforeach ($tables as $tblval) {\n\t\t\t$this->setQuery( 'SHOW FIELDS FROM ' . $tblval );\n\t\t\t$this->query();\n\t\t\t$fields = $this->loadObjectList();\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$result[$tblval][$field->Field] = preg_replace(\"/[(0-9)]/\",'', $field->Type );\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\n\tpublic function schema_version_okay(){\n return (Setting::get(\"db_schema_version\") == DATABASE_SCHEMA_VERSION);\n\t}\n\t\n\t/**\n\t * upgrades the database to the required schema\n\t * @return boolean the success of the opetation\n\t */\n\tpublic function execute_db_install_step($schema_to_install){\n $file_name = dirname(__FILE__) . \"/../../database/upgrade_to_$schema_to_install.sql\";\n return $this->execute_db_file($file_name, $schema_to_install);\n\t}\n\n\tpublic function execute_db_uninstall_step($schema_to_install){\n $file_name = dirname(__FILE__) . \"/../../database/downgrade_to_$schema_to_install.sql\";\n return $this->execute_db_file($file_name, $schema_to_install);\n\t}\n\n\t/**\n\t * This function will execute as a query batch the SQL contained in an\n\t * upgrade or down grade file. These files are found in the /db folder\n\t * @param $file_name String the absolute path to the file to execute\n\t * @param $new_version the version number that the databse schema will be if the file exwecutes correctly.\n\t * @return Boolean the success status\n\t */\n\tprivate function execute_db_file($file_name, $new_version){\n if (!file_exists($file_name)){\n return false;\n }\n\n $file = fopen( $file_name,\"r+\");\n $size = filesize($file_name);\n\t\tif ($size == 0){\n \t Setting::put(\"db_schema_version\", $new_version );\n return true;\n\t\t}\n\t\t$SQL = fread($file,$size);\n\t\t$this->setQuery ( $SQL );\n if ($this->query_batch()){\n Setting::put(\"db_schema_version\", $new_version );\n return true;\n }\n\t\telse{\n handle_error($this->getPrettyErrorMessage() . \" cannot execute $SQL\");\n return false;\n\t\t}\n\t}\n\n\tpublic function upgrade_to_db_schema_version(){\n\t\tdebug(\"upgrade to db schema version \");\n\n\t\t$schema_version = Setting::get(\"db_schema_version\");\n\t\tif ($schema_version==NULL){\n $schema_to_install = 0;\n\t\t}\n\t\telse{\n $schema_to_install = $schema_version + 1;\n\t\t}\n\n\t\twhile ($schema_to_install<=DATABASE_SCHEMA_VERSION){\n $this->execute_db_install_step($schema_to_install);\n $schema_to_install = Setting::get(\"db_schema_version\") + 1;\n\t\t}\n\t}\n\n\t/**\n\t * Determins from the settings if the database has been installed corerctly.\n\t *\n\t * @return Boolean true if the database is installed to the correct version\n\t */\n\tpublic static function database_installed(){\n if (Setting::get(\"db_schema_version\")==NULL){\n return false;\n }\n if (Setting::get(\"db_schema_version\")!= DATABASE_SCHEMA_VERSION){\n return false;\n }\n return true;\n\t}\n\n\n\n\n}", "public function setQuery($query, $offset = null, $limit = null, array $driverOptions = [])\n {\n $this->connect();\n\n /*\n if ($query instanceof \\JDatabaseQueryLimitable && !is_null($this->limit) && !is_null($this->offset)) {\n $query->setLimit($this->limit, $this->offset);\n }\n */\n\n // Store reference to the JDatabaseQuery instance:\n parent::setQuery($query, $offset, $limit);\n\n return $this;\n }", "public function prepare(\n $query,\n array $args = array()\n )\n {\n \n }", "private function prepareQuery(Query $query)\n {\n // Pass the compiled query to mysqli_prepare\n $stmt = $this->client->prepare($query->compiled);\n\n // If mysqli_prepare returns false, or the returned value is not\n // a mysqli_stmt, then an error has occurred\n if ($stmt === false || !($stmt instanceof Statement)) {\n throw new QueryExecutionException('Mysqli error '.$this->client->errno.': '.$this->client->error);\n }\n\n // We only need to bind parameters if vars exist\n if (count($query->vars) > 0) {\n $this->bindParams($stmt, $query->vars);\n }\n\n // Return the prepared statement\n return $stmt;\n }" ]
[ "0.7215524", "0.7029267", "0.6962272", "0.68686205", "0.68474835", "0.6839244", "0.6771084", "0.67177594", "0.6673548", "0.6638473", "0.6616246", "0.66161925", "0.6562165", "0.6553815", "0.65346503", "0.6531755", "0.6462597", "0.6450706", "0.6449676", "0.6365678", "0.63627774", "0.6362025", "0.6361769", "0.63266414", "0.63184327", "0.62833893", "0.6280595", "0.626173", "0.62510043", "0.6248822", "0.6240036", "0.6208194", "0.61781436", "0.61631906", "0.61126065", "0.6102841", "0.60998267", "0.6094938", "0.6051858", "0.6048204", "0.6037878", "0.60275215", "0.60036355", "0.60032535", "0.5983768", "0.59742326", "0.59578025", "0.5956855", "0.5946417", "0.59304416", "0.5926626", "0.5918544", "0.59163415", "0.591105", "0.5893469", "0.5890567", "0.58561885", "0.5852247", "0.5850393", "0.58383477", "0.5836143", "0.58114696", "0.5804573", "0.5780653", "0.5775796", "0.57644105", "0.575811", "0.57575184", "0.5747992", "0.5731232", "0.57111776", "0.57083905", "0.5699051", "0.5693891", "0.5693393", "0.56895363", "0.56714606", "0.56679684", "0.5659751", "0.5658535", "0.56582826", "0.5655279", "0.5652319", "0.5627682", "0.56264883", "0.5625011", "0.5606208", "0.5576772", "0.5572035", "0.5571953", "0.55665565", "0.5562368", "0.5552295", "0.5538999", "0.5538999", "0.5538071", "0.55354637", "0.5530108", "0.55244416", "0.55216104", "0.551652" ]
0.0
-1
Adds additional entries to the `dependencies` option.
public function addDependencies(array $dependencies) { $this->add('dependencies', $dependencies); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_dependencies(self ...$plugins): static;", "public function configureDependencies(DependencyBuilder $dependencies)\n {\n }", "public function addDevDependencies(array $dependencies)\n {\n $this->add('devDependencies', $dependencies);\n }", "public function add($field, array $dependencies)\n {\n if (! file_exists($this->file)) {\n throw new RuntimeException(\"Could not add dependencies, `package.json` file do not exists.\");\n }\n\n $packages = json_decode(file_get_contents($this->file), true);\n\n $packages[$field] = $dependencies + $packages[$field];\n\n ksort($packages[$field]);\n\n file_put_contents($this->file, json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL);\n }", "public function setDependencies($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Helmgate\\Dependency::class);\n $this->dependencies = $arr;\n\n return $this;\n }", "private function setup_dependencies($deps) {\n\t\tif (isset($deps['info'])) {\n\t\t\t$this->info = $deps['info'];\n\t\t}\n\t}", "public function mergeDependencies()\n {\n $this->dependencies = array_merge($this->dependencies, $this->commonDependencies);\n }", "function get_dependencies();", "public function deps( string ...$deps ): self {\n\t\t$this->deps = $deps;\n\t\treturn $this;\n\t}", "public function addDependency($dependency)\n {\n $this->dependencies[$dependency] = array(\"dependencyGuid\" => $dependency);\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'Conversr',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'chat',\n 'mysql',\n ),\n 'recommends' => array(\n ),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'iotds',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "function setDepends($depends) {\n if ($depends !== ($oldDepends = $this->depends)) {\n $this->depends = $depends;\n }\n }", "public static function dependencies($package = NULL) {\n\n // install dependancies and check if installed before\n // \n \n if(!is_null($package)) {\n echo \"hello dependency\";\n }\n }", "public function set_dependencies( $deps ) {\n\t\t$this->items[ $this->id ]['deps'] = $deps;\n\t\treturn $this;\n\t}", "public function add($handle, $src, $deps = array(), $ver = \\false, $args = \\null)\n {\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'wiki',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "function add_options_packages() {\n $this->configure_propack();\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 get_dependencies()\n\t{\n\t\treturn array();\n\t}", "protected function setDependencies($package, array $dependencies)\n\t{\n\t\t$db = JFactory::getDbo();\n\n\t\t$query = $db->getQuery(true)\n\t\t\t->delete('#__akeeba_common')\n\t\t\t->where($db->qn('key') . ' = ' . $db->q($package));\n\n\t\ttry\n\t\t{\n\t\t\t$db->setQuery($query)->execute();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Do nothing if the old key wasn't found\n\t\t}\n\n\t\t$object = (object) array(\n\t\t\t'key' => $package,\n\t\t\t'value' => json_encode($dependencies),\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\t$db->insertObject('#__akeeba_common', $object, 'key');\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Do nothing if the old key wasn't found\n\t\t}\n\t}", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'JavaScript enabled',\n 'points',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function addCacheableDependencies(array $dependencies) {\n foreach ($dependencies as $dependency) {\n $this->addCacheableDependency($dependency);\n }\n }", "public function configureDependencies(DependencyBuilder $dependencies): void\n {\n $dependencies\n ->addClassDependency(OverblogGraphQLBundle::class, 'overblog/graphql-bundle');\n }", "public function configureDependencies(DependencyBuilder $dependencies): void\n {\n $dependencies\n ->addClassDependency(OverblogGraphQLBundle::class, 'overblog/graphql-bundle');\n }", "public function getDependencies() {}", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public static function add_options(){\n\n \t\t$settings = array(\n \t\t\t'foundation' => 0\n \t\t);\n\n \t\tadd_option( 'zip_downloads', $settings ); \n\t}", "public function getDependencies(): array;", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "public function configureDependencies(DependencyBuilder $dependencies)\n {\n $dependencies->addClassDependency(\n AbstractType::class,\n 'form'\n );\n\n $dependencies->addClassDependency(\n Validation::class,\n 'validator'\n );\n }", "public function available_add($path, $handle='', $dependencies=[]){\n\t\t$path = Url::resolve_relative($path);\n\t\t$add = [$path, $handle, $dependencies];\n\t\tif($handle){\n\t\t\t$this->available[$handle] = &$add;\n\t\t}\n\t\t$this->available_paths[$path] = &$add;\n\t}", "public function __addRequire($v)\n{\n\tif(!in_array($v,$this->__extrafiles)) $this->__extrafiles[] = $v;\n}", "public function getComposerDependencies(): array;", "public function getDependencies();", "public static function addRequires($requires)\n {\n if (!is_array($requires)) {\n $requires = [$requires];\n }\n foreach ($requires as $require) {\n if (in_array($require, static::$_requires)) {\n continue;\n }\n static::$_requires[] = $require;\n }\n }", "public function getDependencies()\n {\n return array(\n 'related' => t('Related'),\n );\n }", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "public function getDependenciesList();", "public function addDeferredServices(array $services): void\n {\n $this->deferredServices = array_merge($this->deferredServices, $services);\n }", "public function modifyConstructorDependencies(array $dependencies);", "public function updateDependencies()\n {\n $db = Codeli::getInstance()->getDB();\n $db->query(\"DELETE FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n if (count($this->dependencies) < 1)\n {\n return;\n }\n\n $values = array();\n foreach ($this->dependencies as $dep => $data)\n {\n $values[] = \" ('$this->guid', '$dep') \";\n }\n\n $sql = \"INSERT INTO \" . SystemTables::MODULE_DEPENDENCY . \" (guid, dependencyGuid) VALUES \" . implode(\",\", $values);\n return $db->query($sql);\n }", "function addOptions(GetOpt $_options)\n {\n $_options->addOptions(array(\n array(null, \"cmd\", GetOpt::NO_ARGUMENT, \"ConsoleOutput - Wenn die Ausgabe per CMD Fenster oder Terminal erfolgt.\\n\")\n ));\n }", "public function getComposerRequires(): array;", "private function setDependencies()\n {\n $base = 'blocks/' . $this->getId();\n\n $this->dependencies = [\n 'style' => [\n 'public' => file_exists(assetFile($base . '/public.css')) ? assetPath($base . '/public.css') : '',\n 'admin' => file_exists(assetFile($base . '/admin.css')) ? assetPath($base . '/admin.css') : ''\n ],\n 'script' => [\n 'public' => file_exists(assetFile($base . '/public.js')) ? assetPath($base . '/public.js') : '',\n 'admin' => file_exists(assetFile($base . '/admin.js')) ? assetPath($base . '/admin.js') : ''\n ],\n 'images' => [],\n 'svg' => [],\n 'template' => file_exists($this->path . 'template.blade.php') ? templatePath($this->path . 'template.blade.php') : ''\n ];\n\n if (file_exists($this->path . 'images/')) {\n foreach (scandir($this->path . 'images/') as $file) {\n if (preg_match(\"#\\.(jpe?g|png)$# i\", $file)) {\n $this->dependencies['images'][$file] = assetPath($base . '/images/' . $file);\n }\n }\n }\n\n if (file_exists($this->path . 'svg/')) {\n foreach (scandir($this->path . 'svg/') as $file) {\n if (preg_match(\"#\\.(svg)$# i\", $file)) {\n $this->dependencies['svg'][$file] = assetPath($base . '/images/' . $file);\n }\n }\n }\n }", "public function dependencyProvider() {\n return [\n // Just one migration, with no dependencies.\n [\n [\n 'm1' => [\n 'dependencies' => [],\n 'result_requirements' => [],\n ],\n ],\n ['m1'],\n ],\n\n // Just one migration, with required dependencies.\n [\n [\n 'm1' => [\n 'dependencies' => [\n 'required' => ['required1', 'required2'],\n ],\n 'result_requirements' => ['required1', 'required2'],\n ],\n ],\n ['m1'],\n ],\n\n // Just one migration, with optional dependencies.\n [\n [\n 'm1' => [\n 'dependencies' => [\n 'optional' => ['optional1'],\n ],\n 'result_requirements' => [],\n ],\n ],\n ['m1'],\n ],\n\n // Multiple migrations.\n [\n [\n 'm1' => [\n 'dependencies' => [\n 'required' => ['required1', 'required2'],\n ],\n 'result_requirements' => ['required1', 'required2'],\n ],\n 'm2' => [\n 'dependencies' => [\n 'optional' => ['optional1'],\n ],\n 'result_requirements' => [],\n ],\n ],\n ['m1', 'm2'],\n ],\n\n // Multiple migrations, reordered due to optional requirement.\n [\n [\n 'm1' => [\n 'dependencies' => [\n 'optional' => ['m2'],\n ],\n 'result_requirements' => [],\n ],\n 'm2' => [\n 'dependencies' => [\n 'optional' => ['optional1'],\n ],\n 'result_requirements' => [],\n ],\n ],\n ['m2', 'm1'],\n ],\n\n // Ensure that optional requirements aren't turned into required ones,\n // if the last migration has no optional deps.\n [\n [\n 'm1' => [\n 'dependencies' => [\n 'optional' => ['m2'],\n ],\n 'result_requirements' => [],\n ],\n 'm2' => [\n 'dependencies' => [],\n 'result_requirements' => [],\n ],\n ],\n ['m2', 'm1'],\n ],\n ];\n }", "public function getDependencies(): array\r\n {\r\n return [\r\n ];\r\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n ],\n ];\n }", "protected function addDependency($package, $dependency)\n\t{\n\t\t$dependencies = $this->getDependencies($package);\n\n\t\tif (!in_array($dependency, $dependencies))\n\t\t{\n\t\t\t$dependencies[] = $dependency;\n\n\t\t\t$this->setDependencies($package, $dependencies);\n\t\t}\n\t}", "public function getDependencies()\n {\n return [];\n }", "public function addJavascriptDependency($filename)\n\t{\n\t\t$this->javascriptDependencies[] = $filename;\n\t}", "private function addRequirePackages()\n {\n $devPackages = [\n \"orangehill/iseed:*\",\n \"barryvdh/laravel-debugbar:*\",\n \"barryvdh/laravel-ide-helper:*\",\n \"laravel/dusk:*\",\n \"mediactive-digital/laravel:*\",\n \"mediactive-digital/migrations-generator:*\"\n ];\n $this->doCommand(\"composer require \" . implode(' ', $devPackages) . \" --dev\");\n\n if ($this->hasOption('theme')) {\n $this->doCommand('composer require ' . $this->option('theme').'');\n }\n }", "public function getDependencies(): DependencyCollection;", "function getDepends() {\n return $this->depends;\n }", "public function getDependencies(){ return array(); }", "public function addOptions(...$options)\n {\n foreach ($options as $option) {\n $this->addOption($option);\n }\n }", "public function with(...$dependencies)\n {\n $this->registerInjectedDependencies($dependencies);\n }", "protected function sortAvailablePackagesByDependencies() {}", "public function add_gw214_js_dependencies( $deps ) {\n\t\t\tif ( ! is_array( $deps ) ) {\n\t\t\t\t$deps = array();\n\t\t\t}\n\n\t\t\treturn array_merge( $deps, array(\n\t\t\t\t'ttfmake-sections/js/models/hero-block.js',\n\t\t\t\t'ttfmake-sections/js/views/hero-block.js',\n\t\t\t\t'ttfmake-sections/js/views/hero.js',\n\t\t\t) );\n\t\t}", "public static function dependsOn(): iterable;", "public function add($path, $handle=false, $dependencies=[]){\n\t\tUrl::resolve_relative($path);\n\t\tif($this->check_added_path($path)){\n\t\t\treturn false;\n\t\t}\n\t\tforeach($dependencies as $dependency){\n\t\t\tif(!$this->check_added($dependency)){\n\t\t\t\t$this->add_from_available($dependency);\n\t\t\t}\n\t\t}\n\n\t\t$add = [$path, $handle, $dependencies];;\n\t\t$this->added[] = &$add;\n\t\t$this->added_paths[$add[0]] = &$add;\n\t\tif($handle){\n\t\t\t$this->added_handles[$add[1]] = &$add;\n\t\t}\n\t}", "public function dependencies()\n {\n return $this->bundle['dependencies'] ?? [];\n }", "function GetDependencies()\n {\n return array();\n }", "private function addDependency(string $table, string $dependsOnTable = null): void\n {\n if (!array_key_exists($table, $this->dependencies)) {\n $this->dependencies[$table] = [];\n }\n\n if ($dependsOnTable) {\n $this->dependencies[$table][] = $dependsOnTable;\n }\n }", "public function getDependencies()\n {\n return [\n 'Chaplean\\Bundle\\CmsBundle\\DataFixtures\\Liip\\DefaultData\\LoadFileExtensionImageData'\n ];\n }", "public function setDeps($deps) {\n\t\t$this->deps = $deps;\n\n\t\treturn $this;\n\t}", "private function setDependencies($requireJson, Project $p, $recursive = false)\n {\n if ($recursive) {\n foreach ($requireJson as $projectName => $version) {\n try {\n $d = $this->getDependency($projectName, $version, false); \n } catch (InvalidNameException $e) {\n // could be a dependency like \"php\" or an extension\n continue;\n }\n \n $p->addDependency($d);\n } \n }\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'MShopAddTypeDataDefault' );\n\t}", "public function getDependencies()\n {\n return array(\n new ModuleDependency('files'),\n new ModuleDependency('user'),\n new ModuleDependency('db'),\n new ModuleDependency('orm'),\n new ModuleDependency('scriptcollector'),\n new ModuleDependency('search'),\n new ModuleDependency('word')\n );\n }", "public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)\n\t{\n\t}", "public function addDependency(string $dependency)\n {\n $dependency = $this->canonicalUrl($dependency);\n $this->dependencies[] = $dependency;\n }", "private function registerInjectedDependencies(array $dependencies)\n {\n self::$_instances[$this->current]['dependencies'] = $dependencies;\n }", "public static function getDependencies()\n {\n return [];\n }", "public static function getDependencies()\n {\n return [];\n }", "public function dependencies_names(): Collection;", "function _getDependencies( &$xmlrpc, &$dependencies, $id )\r\n {\r\n $temp = $xmlrpc->getDependencies( $id );\r\n foreach ($temp as $package) {\r\n if (isset( $dependencies[$package['name']] )) {\r\n if ($dependencies[$package['name']]['version'] < $package['version']) {\r\n $dependencies[$package['name']] = $package;\r\n $this->_getDependencies( $xmlrpc, $dependencies, $package['id'] );\r\n }\r\n } else {\r\n $dependencies[$package['name']] = $package;\r\n $this->_getDependencies( $xmlrpc, $dependencies, $package['id'] );\r\n }\r\n }\r\n }", "public function getDependencies() : array\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n \\PageRoute\\Form\\RouteWriteForm::class => \\PageRoute\\Form\\Factory\\RouteWriteServiceFormFactory::class,\n \\PageRoute\\Form\\RouterWriteForm::class => \\PageRoute\\Form\\Factory\\FactoryRouterWriteServiceFormFactory::class,\n ],\n ];\n }", "public function getDependencies(): array\n {\n return $this->dependencies;\n }", "public function getDependencies(): array\n {\n return $this->dependencies;\n }", "function add_option($option, $value = '', $deprecated = '', $autoload = 'yes')\n {\n }", "public function getDependencies(): array\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n // third party\n Adapter::class => AdapterServiceFactory::class,\n CorsMiddleware::class => Middleware\\CorsMiddlewareFactory::class,\n // Handler\n Handler\\AuthorizationTokenHandler::class => Handler\\AuthorizationTokenFactory::class,\n Handler\\ObtainCalcResultHandler::class => Handler\\ObtainCalcResultFactory::class,\n Handler\\StoreCalcResultHandler::class => Handler\\StoreCalcResultFactory::class,\n // Service\n Service\\PreserveNumberOfResultsService::class => Service\\PreserveNumberOfResultsFactory::class,\n Service\\CalcResultExtractingService::class => Service\\CalcResultExtractingFactory::class,\n // Repository\n Repository\\CalcResultsRepository::class => Repository\\CalcResultsFactory::class,\n ],\n ];\n }", "public function getDependencies()\n {\n return array(\n MongoServiceProvider::SERVICE_NAME\n );\n }", "protected function setDependencies(Container $container)\n {\n parent::setDependencies($container);\n\n // Satisfies TranslatorAwareTrait dependencies\n $this->setTranslator($container['translator']);\n\n // Satisfies AuthAwareInterface + SecurityTrait dependencies\n $this->setAuthenticator($container['admin/authenticator']);\n $this->setAuthorizer($container['admin/authorizer']);\n\n // Satisfies AdminTrait dependencies\n $this->setDebug($container['config']);\n $this->setAppConfig($container['config']);\n $this->setAdminConfig($container['admin/config']);\n\n // Satisfies BaseUrlTrait dependencies\n $this->setBaseUrl($container['base-url']);\n $this->setAdminUrl($container['admin/base-url']);\n\n\n // Satisfies AdminAction dependencies\n $this->setSiteName($container['config']['project_name']);\n $this->setModelFactory($container['model/factory']);\n }", "public function getDependencyConfig(): array\n {\n return [\n 'invokables' => ['DoctrineModule\\Authentication\\Storage\\Session' => LaminasSessionStorage::class],\n 'factories' => ['doctrine.cli' => Service\\CliFactory::class],\n 'abstract_factories' => ['DoctrineModule' => ServiceFactory\\AbstractDoctrineServiceFactory::class],\n ];\n }", "function getDependencies($mode)\n {\n return array(\"person\");\n }", "function GetDependencies() {\n\t\treturn array();\n\t}", "public function setDependencies(Container $container)\n {\n parent::setDependencies($container);\n\n $this->setBasePath($container['config']['base_path']);\n $this->setSourceLanguage($container['translator/config']->defaultLanguage());\n $this->setLanguages($container['translator/locales']->availableLanguages());\n }", "private function missingDependencies() {\n }", "private static function set_dependencies( $field, $args ) {\n\t\tif ( ! isset( $args['dep'] ) || empty( $args['dep'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dependency = '';\n\t\t$relation = 'OR';\n\n\t\tif ( 'relation' === key( $args['dep'] ) ) {\n\t\t\t$relation = current( $args['dep'] );\n\t\t\tunset( $args['dep']['relation'] );\n\t\t}\n\n\t\tforeach ( $args['dep'] as $dependence ) {\n\t\t\t$compasrison = isset( $dependence[2] ) ? $dependence[2] : '=';\n\t\t\t$dependency .= '<span class=\"hidden\" data-field=\"' . $dependence[0] . '\" data-comparison=\"' . $compasrison . '\" data-value=\"' . $dependence[1] . '\"></span>';\n\t\t}\n\n\t\t$where = 'group' === $args['type'] ? 'after_group' : 'after_field';\n\t\t$field->args[ $where ] = '<div class=\"rank-math-cmb-dependency hidden\" data-relation=\"' . strtolower( $relation ) . '\">' . $dependency . '</div>';\n\t}", "private function load_dependencies()\n\t{\n\t\t$dependencies = [\n\t\t\t'Routing',\n\t\t\t'Loader',\n\t\t\t'Base',\n\t\t];\n\n\t\tforeach($dependencies as $file)\n\t\t{\n\t\t\trequire_once plugin_dir_path(__FILE__) . $file . '.php';\n\t\t}\n\t}", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('depends', '');\n $this->addOption('add_empty', true);\n // ajax\n $this->addOption('ajax', false);\n $this->addOption('cache', true);\n $this->addOption('params', array());\n $this->addOption('url', sfContext::getInstance()->getController()->genUrl('sfDependentSelectAuto/_ajax'));\n // source\n $this->addRequiredOption('source_class', '');\n $this->addOption('source_params', array());\n \n parent::configure($options, $attributes);\n }", "public function __construct($dependencies = array())\n {\n if (!is_null($dependencies)) {\n $this->assignDependencies($dependencies);\n }\n }", "static function get_dependencies ($meta, $update = false) {\n\t\t/**\n\t\t * No `meta.json` - nothing to check, allow it\n\t\t */\n\t\tif (!$meta) {\n\t\t\treturn [];\n\t\t}\n\t\t$meta = self::normalize_meta($meta);\n\t\t$Config = Config::instance();\n\t\t$dependencies = [];\n\t\t/**\n\t\t * Check for compatibility with modules\n\t\t */\n\t\tforeach (array_keys($Config->components['modules']) as $module) {\n\t\t\t/**\n\t\t\t * If module uninstalled - we do not care about it\n\t\t\t */\n\t\t\tif ($Config->module($module)->uninstalled()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/**\n\t\t\t * Stub for the case if there is no `meta.json`\n\t\t\t */\n\t\t\t$module_meta = [\n\t\t\t\t'package' => $module,\n\t\t\t\t'category' => 'modules',\n\t\t\t\t'version' => 0\n\t\t\t];\n\t\t\tif (file_exists(MODULES.\"/$module/meta.json\")) {\n\t\t\t\t$module_meta = file_get_json(MODULES.\"/$module/meta.json\");\n\t\t\t}\n\t\t\tself::common_checks($dependencies, $meta, $module_meta, $update);\n\t\t}\n\t\tunset($module, $module_meta);\n\t\t/**\n\t\t * If some required packages still missing\n\t\t */\n\t\tforeach ($meta['require'] as $package => $details) {\n\t\t\t$dependencies['require']['unknown'][] = [\n\t\t\t\t'name' => $package,\n\t\t\t\t'required' => $details\n\t\t\t];\n\t\t}\n\t\tunset($package, $details);\n\t\tif (!self::check_dependencies_db($meta['db_support'])) {\n\t\t\t$dependencies['db_support'] = $meta['db_support'];\n\t\t}\n\t\tif (!self::check_dependencies_storage($meta['storage_support'])) {\n\t\t\t$dependencies['storage_support'] = $meta['storage_support'];\n\t\t}\n\t\treturn $dependencies;\n\t}", "public function dependencies($value)\n {\n $this->setProperty('dependencies', $value);\n return $this;\n }", "public function addOptions(Getopt $_options)\n {\n\n }", "public function getDependencies(): array\n {\n return ['Dravencms\\Model\\Locale\\Fixtures\\CurrencyFixtures', 'Dravencms\\Model\\Location\\Fixtures\\CountryFixtures'];\n }", "public function install(array $module_list, $enable_dependencies = TRUE);" ]
[ "0.6254967", "0.6019367", "0.6013622", "0.59439564", "0.5775454", "0.57066584", "0.56225526", "0.556659", "0.5558864", "0.54927766", "0.5428987", "0.5427373", "0.54099107", "0.5399456", "0.53858376", "0.5379771", "0.5350694", "0.5330845", "0.53156006", "0.5287463", "0.52391917", "0.52294046", "0.52221936", "0.5204361", "0.5189957", "0.5189957", "0.51875913", "0.5180907", "0.5180907", "0.5180907", "0.518065", "0.51534724", "0.5137733", "0.51186746", "0.51064235", "0.5102827", "0.50863487", "0.50747937", "0.5065855", "0.5027574", "0.50230664", "0.5021124", "0.5018096", "0.5013289", "0.4989333", "0.49776405", "0.4963553", "0.49619046", "0.49521905", "0.49422175", "0.49287602", "0.4915694", "0.49070352", "0.48794696", "0.48776132", "0.48675662", "0.48579913", "0.48495778", "0.48480868", "0.48461777", "0.48397085", "0.48358282", "0.48201343", "0.48144966", "0.47873348", "0.4781707", "0.47744372", "0.47717205", "0.47705942", "0.47605985", "0.47577968", "0.47458842", "0.47453192", "0.47391862", "0.47370583", "0.472914", "0.472914", "0.472052", "0.47173145", "0.47093982", "0.47064036", "0.47064036", "0.47009653", "0.46791455", "0.46765605", "0.46753928", "0.46728954", "0.466566", "0.46631932", "0.46619236", "0.4659102", "0.4647474", "0.46471453", "0.46437022", "0.46311334", "0.46301416", "0.4614504", "0.46096224", "0.46032476", "0.46009767" ]
0.6559166
0
Adds additional entries to the `devDependencies` option.
public function addDevDependencies(array $dependencies) { $this->add('devDependencies', $dependencies); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addRequirePackages()\n {\n $devPackages = [\n \"orangehill/iseed:*\",\n \"barryvdh/laravel-debugbar:*\",\n \"barryvdh/laravel-ide-helper:*\",\n \"laravel/dusk:*\",\n \"mediactive-digital/laravel:*\",\n \"mediactive-digital/migrations-generator:*\"\n ];\n $this->doCommand(\"composer require \" . implode(' ', $devPackages) . \" --dev\");\n\n if ($this->hasOption('theme')) {\n $this->doCommand('composer require ' . $this->option('theme').'');\n }\n }", "protected function composerRequireDev() :string\n {\n $require = [\n \"engage-php/luminary:0.*\",\n \"squizlabs/php_codesniffer:3.*\",\n \"fzaninotto/faker:~1.4\",\n \"phpunit/phpunit:~6.0\",\n \"mockery/mockery:~0.9\"\n ];\n\n return \" --require-dev=\" . implode(\" --require-dev=\", $require);\n }", "public function addDependency(string $name, bool $dev = false) : void\n {\n if (!$this->hasDependency($name)) {\n $dev = $dev ? ' -D' : '';\n if ($this->yarn) {\n exec(\"yarn add$dev $name\");\n } else {\n exec(\"npm install$dev $name\");\n }\n }\n }", "public function getDevDependencies()\n {\n return isset($this->composerJson['require-dev']) ? array_keys($this->composerJson['require-dev']) : [];\n }", "function add_options_packages() {\n $this->configure_propack();\n }", "protected static function updatePackages($dev = true)\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n \n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n \n $dependencies = static::updatePackageArray(\n $packages\n );\n\n $packages['dependencies'] = $dependencies['dependencies'];\n $packages['devDependencies'] = $dependencies['devDependencies'];\n\n ksort($packages['dependencies']);\n ksort($packages['devDependencies']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function addDependencies(array $dependencies)\n {\n $this->add('dependencies', $dependencies);\n }", "public function add_dependencies(self ...$plugins): static;", "function dev_missing_dependencies() { ?>\n\t<div class=\"error\">\n <p><?php printf( __( 'Awesome Support dependencies are missing. The plugin can’t be loaded properly. Please run %s before anything else. If you don’t know what this is you should <a href=\"%s\" class=\"thickbox\">install the production version</a> of this plugin instead.', 'awesome-support' ), '<a href=\"https://getcomposer.org/doc/00-intro.md#using-composer\" target=\"_blank\"><code>composer install</code></a>', esc_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'awesome-support', 'TB_iframe' => 'true', 'width' => '772', 'height' => '935' ), admin_url( 'plugin-install.php' ) ) ) ); ?></p>\n </div>\n<?php }", "public static function dependencies($package = NULL) {\n\n // install dependancies and check if installed before\n // \n \n if(!is_null($package)) {\n echo \"hello dependency\";\n }\n }", "protected static function updateComposerPackages(bool $dev = true): void\n {\n if (! file_exists(base_path('composer.json'))) {\n return;\n }\n\n $configurationKey = $dev ? 'require-dev' : 'require';\n\n $composer = json_decode(file_get_contents(base_path('composer.json')), true);\n\n $composer[$configurationKey] = static::updateComposerPackageArray(\n array_key_exists($configurationKey, $composer) ? $composer[$configurationKey] : [],\n $configurationKey\n );\n\n ksort($composer[$configurationKey]);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($composer, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function add($field, array $dependencies)\n {\n if (! file_exists($this->file)) {\n throw new RuntimeException(\"Could not add dependencies, `package.json` file do not exists.\");\n }\n\n $packages = json_decode(file_get_contents($this->file), true);\n\n $packages[$field] = $dependencies + $packages[$field];\n\n ksort($packages[$field]);\n\n file_put_contents($this->file, json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL);\n }", "private function setup_dependencies($deps) {\n\t\tif (isset($deps['info'])) {\n\t\t\t$this->info = $deps['info'];\n\t\t}\n\t}", "public static function add_options(){\n\n \t\t$settings = array(\n \t\t\t'foundation' => 0\n \t\t);\n\n \t\tadd_option( 'zip_downloads', $settings ); \n\t}", "public function getComposerRequires(): array;", "function add_extra_debug_information($extra_debug)\n {\n $extra_debug['layouts'] = $this->frameworks_options_manager->get_options();\n return $extra_debug;\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'chat',\n 'mysql',\n ),\n 'recommends' => array(\n ),\n 'conflicts_with' => array()\n );\n }", "public function getComposerDependencies(): array;", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'iotds',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function onPostUpdateInstall(Event $event)\n {\n $extra = $event->getComposer()->getPackage()->getExtra();\n\n $installDev = $event->isDevMode();\n $isWin = $this->isWinOs();\n $packagesList = array();\n $prefix = \"extra-require\";\n foreach (array(\"\", \"-dev\") as $dev) {\n foreach (array(\"\", \"-win\", \"-unix\") as $os) {\n $option = $prefix . $dev . $os;\n if (!isset($extra[$option])\n || ($dev && !$installDev)\n || ($os == \"-win\" && !$isWin)\n ) {\n continue;\n }\n\n $packagesList = array_merge($packagesList, $extra[$option]);\n }\n }\n\n $this->removeUnusedPackages($packagesList, $installDev);\n if (!empty($packagesList)) {\n $this->installPackages($packagesList, $installDev);\n }\n }", "function setDepends($depends) {\n if ($depends !== ($oldDepends = $this->depends)) {\n $this->depends = $depends;\n }\n }", "public function configureDependencies(DependencyBuilder $dependencies)\n {\n }", "protected static function updateComposerPackageArray(array $composer, string $dev): array\n {\n if ($dev == 'require-dev') {\n return array_merge([\n 'barryvdh/laravel-debugbar' => '^3.2',\n 'barryvdh/laravel-ide-helper' => '^2.6',\n 'friendsofphp/php-cs-fixer' => '^2.16',\n 'nunomaduro/larastan' => '^0.5.2',\n ], $composer);\n } else {\n return array_merge([\n 'livewire/livewire' => '^1.0',\n ], $composer);\n }\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'JavaScript enabled',\n 'points',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function mergeDependencies()\n {\n $this->dependencies = array_merge($this->dependencies, $this->commonDependencies);\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}", "function add_option($option, $value = '', $deprecated = '', $autoload = 'yes')\n {\n }", "public function __addRequire($v)\n{\n\tif(!in_array($v,$this->__extrafiles)) $this->__extrafiles[] = $v;\n}", "public function getDependencyConfig(): array\n {\n return [\n 'invokables' => ['DoctrineModule\\Authentication\\Storage\\Session' => LaminasSessionStorage::class],\n 'factories' => ['doctrine.cli' => Service\\CliFactory::class],\n 'abstract_factories' => ['DoctrineModule' => ServiceFactory\\AbstractDoctrineServiceFactory::class],\n ];\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'Conversr',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'MShopAddTypeDataDefault' );\n\t}", "protected function composerAutoloadDev() :void\n {\n $file = app_path('composer.json');\n $contents = Storage::get($file);\n\n $json = json_decode($contents, true);\n $json['autoload-dev'] = [\n 'classmap' => [\n 'tests/'\n ]\n ];\n $json = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n Storage::put($file, $json);\n }", "protected static function updateNodePackages(callable $callback, $dev = true)\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $configurationKey = $dev ? 'devDependencies' : 'dependencies';\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages[$configurationKey] = $callback(\n array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : [],\n $configurationKey\n );\n\n ksort($packages[$configurationKey]);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "protected static function updateNodePackages(callable $callback, $dev = true)\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $configurationKey = $dev ? 'devDependencies' : 'dependencies';\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages[$configurationKey] = $callback(\n array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : [],\n $configurationKey\n );\n\n ksort($packages[$configurationKey]);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function addRequirements($team, array $requirements = []);", "protected static function updateNodePackages(callable $callback, $dev = true)\n {\n if (!file_exists(base_path('package.json'))) {\n return;\n }\n\n $configurationKey = $dev ? 'devDependencies' : 'dependencies';\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages[$configurationKey] = $callback(\n array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : [],\n $configurationKey\n );\n\n ksort($packages[$configurationKey]);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'wiki',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "protected static function updatePackages()\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['devDependencies'] = static::updatePackageArray(\n $packages['devDependencies']\n );\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_PRETTY_PRINT)\n );\n }", "public function needsToBeInstalledWithAllDependencies(): bool\n {\n return false;\n }", "public function getDependencyConfig()\n {\n return [\n 'factories' => [\n ],\n ];\n }", "private function manipulateComposerJsonWithAllowAutoInstall(): void\n {\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n $manipulator->addSubNode('extra', 'automatic.allow-auto-install', true);\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n }", "function addInstallDefs (&$installDef)\n {\n foreach ( $this->installDefs as $name => $def )\n {\n if (! empty ( $def ))\n {\n foreach ( $def as $val )\n {\n $installDef [ $name ] [] = $val ;\n }\n }\n }\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function autoloadDevFilesAreBuildCorrectlyDataProvider()\n {\n return [\n 'Psr-4 sections' => [\n [\n 'autoload' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => 'Classes',\n ],\n ],\n 'autoload-dev' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\Tests\\\\' => 'Tests',\n ],\n ],\n ],\n [\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Classes\\')',\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\Tests\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Tests\\')',\n ],\n [],\n ],\n 'Psr-4 sections with override' => [\n [\n 'autoload' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => 'Classes',\n ],\n ],\n 'autoload-dev' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => 'Tests',\n ],\n ],\n ],\n [\n '!\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Classes\\')',\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Tests\\')',\n ],\n [],\n ],\n 'Classmap section pointing to two files, one in dev and one not' => [\n [\n 'autoload' => [\n 'classmap' => [\n 'Resources/PHP/Test.php',\n ],\n ],\n 'autoload-dev' => [\n 'classmap' => [\n 'Resources/PHP/AnotherTestFile.php',\n ],\n ],\n ],\n [],\n [\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n ],\n ],\n ];\n }", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "public function install(array $module_list, $enable_dependencies = TRUE);", "public function dev($dev=true)\n {\n\n if($dev) {\n\n $this->dev = true;\n\n }\n\n }", "protected function installNpmDependencies()\n {\n $this->runCommand(['npm', 'set', 'progress=false'], $this->viewsPath(), $this->output);\n $this->runCommand(['npm', 'install'], $this->viewsPath(), $this->output);\n }", "protected function setDependencies($package, array $dependencies)\n\t{\n\t\t$db = JFactory::getDbo();\n\n\t\t$query = $db->getQuery(true)\n\t\t\t->delete('#__akeeba_common')\n\t\t\t->where($db->qn('key') . ' = ' . $db->q($package));\n\n\t\ttry\n\t\t{\n\t\t\t$db->setQuery($query)->execute();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Do nothing if the old key wasn't found\n\t\t}\n\n\t\t$object = (object) array(\n\t\t\t'key' => $package,\n\t\t\t'value' => json_encode($dependencies),\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\t$db->insertObject('#__akeeba_common', $object, 'key');\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Do nothing if the old key wasn't found\n\t\t}\n\t}", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "protected static function updatePackageArray(array $packages)\n {\n // packages to add to the package.json\n $packagesToAdd = [\n 'axios' => '^0.18',\n 'history' => '^4.7.2',\n 'localforage' => '^1.7.1',\n 'lodash' => '^4.17.4',\n 'normalizr' => '^3.2.4',\n 'pluralize' => '^7.0.0',\n 'react' => '^16.2.0',\n 'react-dom' => '^16.2.0',\n 'react-redux' => '^5.0.7',\n 'react-router' => '^4.3.1',\n 'react-router-redux' => '^5.0.0-alpha.9',\n 'react-select' => '^2.0.0-beta.6',\n 'redux' => '^4.0.0',\n 'redux-act' => '^1.7.4',\n 'redux-logger' => '^3.0.6',\n 'redux-persist' => '^5.10.0',\n 'redux-thunk' => '^2.3.0'\n ];\n\n // packages to add as dev dependency to the package.json\n $packagesToAddDev = [\n 'babel-eslint' => '^8.2.3',\n 'babel-preset-react' => '^6.23.0',\n 'cross-env' => '^5.1',\n 'eslint' => '^4.19.1',\n 'eslint-plugin-react' => '^7.9.1',\n 'laravel-mix' => '^2.0',\n 'laravel-mix-react-css-modules' => '^1.2.0'\n ];\n\n // packages to remove from the package.json\n $packagesToRemove = ['vue', 'jquery', 'bootstrap', 'popper.js', 'lodash', 'axios'];\n\n return [\n 'dependencies' => $packagesToAdd,\n 'devDependencies' => $packagesToAddDev + Arr::except($packages['devDependencies'], $packagesToRemove),\n ]; \n }", "public function get_additional_packages()\n {\n return array();\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n ],\n ];\n }", "public function deps( string ...$deps ): self {\n\t\t$this->deps = $deps;\n\t\treturn $this;\n\t}", "public function configureDependencies(DependencyBuilder $dependencies): void\n {\n $dependencies\n ->addClassDependency(OverblogGraphQLBundle::class, 'overblog/graphql-bundle');\n }", "public function configureDependencies(DependencyBuilder $dependencies): void\n {\n $dependencies\n ->addClassDependency(OverblogGraphQLBundle::class, 'overblog/graphql-bundle');\n }", "protected function sortAvailablePackagesByDependencies() {}", "private function receiveDependecies()\n {\n $dependencyReceiver = new ConsoleDependencyReceiver($this);\n $dependencyReceiver->buildWithAllDependencies();\n }", "function get_dependencies();", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "public function getDependencies(): array;", "protected static function updatePackageArray(array $packages, string $dev): array\n {\n if ($dev == 'devDependencies') {\n return array_merge([\n 'eslint' => '^6.8.0',\n 'eslint-config-airbnb' => '^18.0.1',\n 'eslint-config-prettier' => '^6.10.0',\n 'eslint-plugin-import' => '^2.20.1',\n 'eslint-plugin-jsx-a11y' => '^6.2.3',\n 'eslint-plugin-react' => '^7.18.3',\n 'eslint-plugin-react-hooks' => '^1.7.0',\n 'prettier' => '^1.19.1',\n ], Arr::except($packages, [\n 'axios',\n 'laravel-mix',\n 'lodash',\n ]));\n } else {\n return array_merge([\n 'axios' => '^0.19',\n 'laravel-mix' => '^5.0.1',\n 'laravel-mix-purgecss' => '^4.1',\n 'laravel-mix-tailwind' => '^0.1.0',\n 'lodash' => '^4.17.13',\n 'tailwindcss' => '^1.2',\n 'alpinejs' => '^2.2',\n 'turbolinks' => '^5.2.0',\n ], $packages);\n }\n }", "public function set_up_dependencies () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\t\tadd_action('admin_enqueue_scripts', array($this, 'enqueue_dependencies'));\n\t}", "public function collectInstalledComposerJson()\r\n {\r\n $this->collectFiles(\r\n $this->site_root.\"/vendor/composer\",\r\n array(\"json\")\r\n );\r\n }", "public function updateDependencies()\n {\n $db = Codeli::getInstance()->getDB();\n $db->query(\"DELETE FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n if (count($this->dependencies) < 1)\n {\n return;\n }\n\n $values = array();\n foreach ($this->dependencies as $dep => $data)\n {\n $values[] = \" ('$this->guid', '$dep') \";\n }\n\n $sql = \"INSERT INTO \" . SystemTables::MODULE_DEPENDENCY . \" (guid, dependencyGuid) VALUES \" . implode(\",\", $values);\n return $db->query($sql);\n }", "public function add_gw214_js_dependencies( $deps ) {\n\t\t\tif ( ! is_array( $deps ) ) {\n\t\t\t\t$deps = array();\n\t\t\t}\n\n\t\t\treturn array_merge( $deps, array(\n\t\t\t\t'ttfmake-sections/js/models/hero-block.js',\n\t\t\t\t'ttfmake-sections/js/views/hero-block.js',\n\t\t\t\t'ttfmake-sections/js/views/hero.js',\n\t\t\t) );\n\t\t}", "public function getDependencies(): array\r\n {\r\n return [\r\n ];\r\n }", "public function dependencies()\n {\n return $this->bundle['dependencies'] ?? [];\n }", "public function __invoke()\n {\n return [\n 'require' => self::getDevRequirements(),\n 'require-dev' => self::getRequirements()\n ];\n }", "static public function depends_on()\n {\n return [\n '\\phpbb\\db\\migration\\data\\v31x\\v314',\n '\\oxcom\\phpbbch\\migrations\\add_module',\n ];\n }", "private function pushDevCommand(): void\n {\n $dev_command = [\n CreateCommandFile::class\n ];\n foreach ($dev_command as $command) {\n array_push($this->commands, $command);\n }\n }", "private function setDependencies()\n {\n $base = 'blocks/' . $this->getId();\n\n $this->dependencies = [\n 'style' => [\n 'public' => file_exists(assetFile($base . '/public.css')) ? assetPath($base . '/public.css') : '',\n 'admin' => file_exists(assetFile($base . '/admin.css')) ? assetPath($base . '/admin.css') : ''\n ],\n 'script' => [\n 'public' => file_exists(assetFile($base . '/public.js')) ? assetPath($base . '/public.js') : '',\n 'admin' => file_exists(assetFile($base . '/admin.js')) ? assetPath($base . '/admin.js') : ''\n ],\n 'images' => [],\n 'svg' => [],\n 'template' => file_exists($this->path . 'template.blade.php') ? templatePath($this->path . 'template.blade.php') : ''\n ];\n\n if (file_exists($this->path . 'images/')) {\n foreach (scandir($this->path . 'images/') as $file) {\n if (preg_match(\"#\\.(jpe?g|png)$# i\", $file)) {\n $this->dependencies['images'][$file] = assetPath($base . '/images/' . $file);\n }\n }\n }\n\n if (file_exists($this->path . 'svg/')) {\n foreach (scandir($this->path . 'svg/') as $file) {\n if (preg_match(\"#\\.(svg)$# i\", $file)) {\n $this->dependencies['svg'][$file] = assetPath($base . '/images/' . $file);\n }\n }\n }\n }", "public function getDependencyConfig()\n {\n return [\n // Legacy Zend Framework aliases\n 'aliases' => [\n \\Zend\\Paginator\\AdapterPluginManager::class => AdapterPluginManager::class,\n \\Zend\\Paginator\\ScrollingStylePluginManager::class => ScrollingStylePluginManager::class,\n ],\n 'factories' => [\n AdapterPluginManager::class => AdapterPluginManagerFactory::class,\n ScrollingStylePluginManager::class => ScrollingStylePluginManagerFactory::class,\n ],\n ];\n }", "protected function requireComposerDevPackages($packages)\n {\n $composer = $this->option('composer');\n\n if ($composer !== 'global') {\n $command = [$this->phpBinary(), $composer, 'require', '--dev'];\n }\n\n $command = array_merge(\n $command ?? ['composer', 'require', '--dev'],\n is_array($packages) ? $packages : func_get_args()\n );\n\n return (new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))\n ->setTimeout(null)\n ->run(function ($type, $output) {\n $this->output->write($output);\n }) === 0;\n }", "public function getDependencies() {}", "public function includeExtraScripts(array $keys = array())\n {\n $this->_extraScripts = empty($keys) ? array_keys($this->_confs['extra']) : $keys;\n }", "function boiler_dependencies() {\n if( ! function_exists('acf_add_options_page') )\n echo '<div class=\"error\"><p> Warning: The theme needs ACF Plugin installed and activated to function </p></div>';\n}", "function addOptions(GetOpt $_options)\n {\n $_options->addOptions(array(\n array(null, \"cmd\", GetOpt::NO_ARGUMENT, \"ConsoleOutput - Wenn die Ausgabe per CMD Fenster oder Terminal erfolgt.\\n\")\n ));\n }", "public function addDependency($dependency)\n {\n $this->dependencies[$dependency] = array(\"dependencyGuid\" => $dependency);\n }", "private function dld_load_dependencies()\n {\n require_once plugin_dir_path(__FILE__) . '../woocommerce-delivery-schedular/admin/settings-data.php';\n require_once plugin_dir_path(__FILE__) . 'class-custom-delivery-date-admin-settings.php';\n }", "public static function mergeDeps($stdDeps = array(), $customDeps = array()) {\n foreach ($customDeps as $index => $dep) $customDeps[$index] = self::$appPrefix . '-' . $dep;\n return array_merge($stdDeps, $customDeps);\n }", "protected function addScriptsToNpmPackage()\n {\n $package = json_decode(file_get_contents(base_path('package.json')), true);\n\n $package['scripts']['build-'.$this->viewsName()] = 'cd '.$this->relativeViewsPath().' && npm run dev';\n $package['scripts']['build-'.$this->viewsName().'-prod'] = 'cd '.$this->relativeViewsPath().' && npm run prod';\n\n file_put_contents(\n base_path('package.json'),\n json_encode($package, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)\n );\n }", "public function getDependencies()\n {\n return [\n 'Chaplean\\Bundle\\CmsBundle\\DataFixtures\\Liip\\DefaultData\\LoadFileExtensionImageData'\n ];\n }", "#[DataProvider('dpCreateToolsFromComposer')]\n public function testCreateToolsFromComposer(callable $setup, bool $locked, bool $installed, bool $noDev): void\n {\n $setupManifest = $setup();\n $composer = (new ComposerFactory())->createComposer(new NullIO(), $setupManifest, cwd: \\dirname($setupManifest));\n\n $tools = [...Builder::createToolsFromComposer($composer, null, false)];\n\n $fTools = array_filter(\n $tools,\n static fn (Models\\Tool $t): bool => 'cyclonedx' === $t->getVendor() && 'cyclonedx-php-composer' === $t->getName()\n );\n self::assertCount(1, $fTools, 'missing self');\n /** @var Models\\Tool $fTool */\n $fTool = reset($fTools);\n if ($installed || $locked) {\n self::assertMatchesRegularExpression('/^v?4\\./', $fTool->getVersion());\n } else {\n self::assertNull($fTool->getVersion());\n }\n\n $fTools = array_filter(\n $tools,\n static fn (Models\\Tool $t): bool => 'cyclonedx' === $t->getVendor() && 'cyclonedx-library' === $t->getName()\n );\n self::assertCount(1, $fTools, 'missing library');\n /** @var Models\\Tool $fTool */\n $fTool = reset($fTools);\n if ($installed || $locked) {\n self::assertMatchesRegularExpression('/^v?2\\./', $fTool->getVersion());\n } else {\n self::assertNull($fTool->getVersion());\n }\n }", "public function getDependencies(): array\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n // third party\n Adapter::class => AdapterServiceFactory::class,\n CorsMiddleware::class => Middleware\\CorsMiddlewareFactory::class,\n // Handler\n Handler\\AuthorizationTokenHandler::class => Handler\\AuthorizationTokenFactory::class,\n Handler\\ObtainCalcResultHandler::class => Handler\\ObtainCalcResultFactory::class,\n Handler\\StoreCalcResultHandler::class => Handler\\StoreCalcResultFactory::class,\n // Service\n Service\\PreserveNumberOfResultsService::class => Service\\PreserveNumberOfResultsFactory::class,\n Service\\CalcResultExtractingService::class => Service\\CalcResultExtractingFactory::class,\n // Repository\n Repository\\CalcResultsRepository::class => Repository\\CalcResultsFactory::class,\n ],\n ];\n }", "function erp_addon_licenses() {\n $licenses = [];\n\n return apply_filters( 'erp_settings_licenses', $licenses );\n}", "public function install( $args, $assoc_args ) {\n\n\t\tlist( $package ) = $args;\n\n\t\t$defaults = array(\n\t\t\t\t'version' => 'dev-master',\n\t\t\t);\n\t\t$assoc_args = array_merge( $defaults, $assoc_args );\n\n\t}", "public function getDependencies(): array\n {\n return ['Dravencms\\Model\\Locale\\Fixtures\\CurrencyFixtures', 'Dravencms\\Model\\Location\\Fixtures\\CountryFixtures'];\n }", "public function customize_preview_enqueue_deps()\n {\n }", "function add_option_whitelist($new_options, $options = '')\n {\n }", "public function getDependencies(): array\n {\n return [\n 'factories' => [\n //Midlewares\n CacheExpirationMiddleware::class => CacheExpirationMiddlewareFactory::class,\n ResponseCacheMiddleware::class => ResponseCacheMiddlewareFactory::class,\n\n // CLI Application\n Application::class => ApplicationFactory::class,\n\n // Logger\n LoggerInterface::class => LoggerFactory::class,\n AccessLogMiddleware::class => AccessLogMiddlewareFactory::class,\n ErrorLoggerMiddleware::class => ErrorLoggerMiddlewareFactory::class,\n\n // Cache\n CacheInterface::class => CacheFactory::class,\n CacheItemPoolInterface::class => CacheItemPoolFactory::class,\n ],\n ];\n }", "function setSyncProdDesc()\n {\n }", "public function get_dependencies()\n\t{\n\t\treturn array();\n\t}", "private function determineMissingDependencies(): array\n {\n $depBuilder = $this->testDetails->getDependencyBuilder();\n file_put_contents($this->path.'/dep_builder', serialize($depBuilder));\n file_put_contents($this->path.'/dep_runner.php', '<?php\n\nrequire __DIR__.\"/vendor/autoload.php\";\n$depBuilder = unserialize(file_get_contents(\"dep_builder\"));\n$missingDependencies = array_merge(\n $depBuilder->getMissingDependencies(),\n $depBuilder->getMissingDevDependencies()\n);\necho json_encode($missingDependencies);\n ');\n\n $process = MakerTestProcess::create('php dep_runner.php', $this->path)->run();\n $data = json_decode($process->getOutput(), true, 512, \\JSON_THROW_ON_ERROR);\n\n unlink($this->path.'/dep_builder');\n unlink($this->path.'/dep_runner.php');\n\n return array_merge($data, $this->testDetails->getExtraDependencies());\n }", "public function getDependencies()\n {\n return [\n 'Elcodi\\Bundle\\StoreBundle\\DataFixtures\\ORM\\StoreData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\PrintSideData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductColorsData',\n ];\n }", "public function getModuleDependencies()\n {\n return [\n 'Core42',\n 'Admin42',\n ];\n }", "protected function addDependency($package, $dependency)\n\t{\n\t\t$dependencies = $this->getDependencies($package);\n\n\t\tif (!in_array($dependency, $dependencies))\n\t\t{\n\t\t\t$dependencies[] = $dependency;\n\n\t\t\t$this->setDependencies($package, $dependencies);\n\t\t}\n\t}", "public function add_extra_headers() {\n\t\t$gu_extra_headers = [\n\t\t\t'RequiresWP' => 'Requires WP',\n\t\t\t'ReleaseAsset' => 'Release Asset',\n\t\t\t'PrimaryBranch' => 'Primary Branch',\n\t\t];\n\n\t\t$uri_types = [\n\t\t\t'PluginURI' => ' Plugin URI',\n\t\t\t'ThemeURI' => ' Theme URI',\n\t\t];\n\n\t\tforeach ( self::$git_servers as $server ) {\n\t\t\tforeach ( $uri_types as $uri_key => $uri_value ) {\n\t\t\t\t$gu_extra_headers[ $server . $uri_key ] = $server . $uri_value;\n\t\t\t}\n\t\t\tforeach ( self::$extra_repo_headers as $header_key => $header_value ) {\n\t\t\t\t$gu_extra_headers[ $server . $header_key ] = $server . ' ' . $header_value;\n\t\t\t}\n\t\t}\n\n\t\tself::$extra_headers = array_unique( array_merge( self::$extra_headers, $gu_extra_headers ) );\n\t\tksort( self::$extra_headers );\n\n\t\treturn self::$extra_headers;\n\t}" ]
[ "0.5920187", "0.58762705", "0.55962074", "0.5414203", "0.5285141", "0.525705", "0.5253719", "0.52028227", "0.5188637", "0.5140187", "0.51334393", "0.5119874", "0.51079035", "0.5081996", "0.50043845", "0.49999052", "0.49728587", "0.49551252", "0.49512973", "0.49407893", "0.4929995", "0.49037644", "0.48915982", "0.48487172", "0.4834943", "0.48157722", "0.47839215", "0.47466692", "0.47334775", "0.47226864", "0.46550712", "0.4649411", "0.46338353", "0.46338353", "0.46316767", "0.46140817", "0.46112528", "0.46053416", "0.45995328", "0.4597135", "0.4594492", "0.45877683", "0.45837235", "0.45837235", "0.45837235", "0.4578515", "0.45755413", "0.45734316", "0.45602152", "0.45570275", "0.45545405", "0.45296243", "0.4524258", "0.45141667", "0.4500496", "0.44939813", "0.448838", "0.448838", "0.44847667", "0.4479581", "0.44776666", "0.44716296", "0.44574898", "0.44549665", "0.44545987", "0.4444023", "0.44434944", "0.44296592", "0.4426753", "0.44231606", "0.44097075", "0.44091222", "0.44064364", "0.44013703", "0.44013384", "0.44013014", "0.44005367", "0.43934953", "0.4392268", "0.43914992", "0.4387229", "0.43857917", "0.43810162", "0.4369728", "0.43692103", "0.43615973", "0.4358836", "0.43455765", "0.4342354", "0.43359575", "0.43329036", "0.43172002", "0.43151352", "0.43143553", "0.43121612", "0.43063414", "0.43057916", "0.43024328", "0.42993557", "0.42940852" ]
0.6786218
0
Adds additional entries to the specifed option field.
public function add($field, array $dependencies) { if (! file_exists($this->file)) { throw new RuntimeException("Could not add dependencies, `package.json` file do not exists."); } $packages = json_decode(file_get_contents($this->file), true); $packages[$field] = $dependencies + $packages[$field]; ksort($packages[$field]); file_put_contents($this->file, json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add_option() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );\n\t\t$opt_type = FrmAppHelper::get_post_param( 'opt_type', '', 'sanitize_text_field' );\n\t\t$opt_key = FrmAppHelper::get_post_param( 'opt_key', 0, 'absint' );\n\n $field = FrmField::getOne($id);\n\n if ( 'other' == $opt_type ) {\n\t\t\t$opt = __( 'Other', 'formidable' );\n $other_val = '';\n $opt_key = 'other_' . $opt_key;\n } else {\n\t\t\t$opt = __( 'New Option', 'formidable' );\n }\n $field_val = $opt;\n\n $field_data = $field;\n\t\t$field = (array) $field;\n\t\t$field['separate_value'] = isset( $field_data->field_options['separate_value'] ) ? $field_data->field_options['separate_value'] : 0;\n\t\tunset( $field_data );\n\n\t\t$field_name = 'item_meta[' . $id . ']';\n\t\t$html_id = FrmFieldsHelper::get_html_id( $field );\n $checked = '';\n\n if ( 'other' == $opt_type ) {\n\t\t\tinclude( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );\n } else {\n\t\t\trequire( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );\n }\n wp_die();\n }", "protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }", "function add_allowed_options($new_options, $options = '')\n {\n }", "function options( $field_name, $options ) {\n// could test to see if this is an array here, warn if not?\n\t\n\t$this->fields[$field_name]['options'] = $options;\n\t\n\t//$this->debug( \"Fieldx Value\", $this->fields[$field_name]['value'] );\n}", "function register_options_field($args) {\r\n\t\tadd_settings_field($args['id'], $args['title'], array(&$this, $args['type']), $this->page , $args['section'],$args\t);\r\n\t}", "public function field_additional_items() {\n\t\t$addtl_items = array(\n\t\t\t\t'log_404s' => __( 'Log 404 errors as events', 'wp-google-analytics' ),\n\t\t\t\t'log_searches' => sprintf( __( 'Log searches as /search/{search}?referrer={referrer} (<a href=\"%s\">deprecated</a>)', 'wp-google-analytics' ), 'http://wordpress.org/extend/plugins/wp-google-analytics/faq/' ),\n\t\t\t\t'log_outgoing' => __( 'Log outgoing links as events', 'wp-google-analytics' ),\n\t\t\t);\n\t\tforeach( $addtl_items as $id => $label ) {\n\t\t\techo '<label for=\"wga_' . $id . '\">';\n\t\t\techo '<input id=\"wga_' . $id . '\" type=\"checkbox\" name=\"wga[' . $id . ']\" value=\"true\" ' . checked( 'true', $this->_get_options( $id ), false ) . ' />';\n\t\t\techo '&nbsp;&nbsp;' . $label;\n\t\t\techo '</label><br />';\n\t\t}\n\t}", "abstract public function addOptions(Getopt $_options);", "private function setAdditionalOptions(): void\n\t{\n\t\tforeach ( $this->configuration->getAdditionalOptions() as $additionalOptionIdentifier => $additionalOptionValue )\n\t\t{\n\t\t\tif ( true === in_array( $additionalOptionIdentifier, static::EXCLUDED_ADDITIONAL_OPTIONS, true ) )\n\t\t\t{\n\t\t\t\tldap_set_option( $this->ldapHandle, $additionalOptionIdentifier, $additionalOptionValue );\n\t\t\t}\n\t\t}\n\t}", "public function addOption()\n {\n try {\n $this->validate();\n DB::beginTransaction();\n if ($this->option !== \"\") {\n $this->assessment->options()->create([\n 'option' => $this->option,\n ]);\n }\n $this->option = \"\";\n } catch (\\Throwable $th) {\n DB::rollback();\n session()->flash('error', $th->getMessage());\n }\n DB::commit();\n $this->emitSelf('render');\n }", "function add(){\n global $wpdb;\n global $DOPBSP;\n \n $field_id = $_POST['field_id'];\n $position = $_POST['position'];\n $language = $_POST['language'];\n \n $wpdb->insert($DOPBSP->tables->forms_fields_options, array('field_id' => $field_id,\n 'position' => $position,\n 'translation' => $DOPBSP->classes->translation->encodeJSON('FORMS_FORM_FIELD_SELECT_ADD_OPTION_LABEL')));\n $id = $wpdb->insert_id;\n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $DOPBSP->views->backend_form_field_select_option->template(array('select_option' => $select_option,\n 'language' => $language));\n \n die();\n }", "public function addOptions(Getopt $_options)\n {\n\n }", "abstract function fields_options();", "function SetupOtherOptions() {\n\t\tglobal $Language, $Security;\n\t\t$options = &$this->OtherOptions;\n\t\t$option = $options[\"addedit\"];\n\n\t\t// Add\n\t\t$item = &$option->Add(\"add\");\n\t\t$addcaption = ew_HtmlTitle($Language->Phrase(\"AddLink\"));\n\t\t$item->Body = \"<a class=\\\"ewAddEdit ewAdd\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . ew_HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->Phrase(\"AddLink\") . \"</a>\";\n\t\t$item->Visible = ($this->AddUrl <> \"\" && $Security->CanAdd());\n\t\t$option = $options[\"detail\"];\n\t\t$DetailTableLink = \"\";\n\t\t$item = &$option->Add(\"detailadd_avaluo\");\n\t\t$url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . \"=avaluo\");\n\t\t$caption = $Language->Phrase(\"Add\") . \"&nbsp;\" . $this->TableCaption() . \"/\" . $GLOBALS[\"avaluo\"]->TableCaption();\n\t\t$item->Body = \"<a class=\\\"ewDetailAddGroup ewDetailAdd\\\" title=\\\"\" . ew_HtmlTitle($caption) . \"\\\" data-caption=\\\"\" . ew_HtmlTitle($caption) . \"\\\" href=\\\"\" . ew_HtmlEncode($url) . \"\\\">\" . $caption . \"</a>\";\n\t\t$item->Visible = ($GLOBALS[\"avaluo\"]->DetailAdd && $Security->AllowAdd(CurrentProjectID() . 'avaluo') && $Security->CanAdd());\n\t\tif ($item->Visible) {\n\t\t\tif ($DetailTableLink <> \"\") $DetailTableLink .= \",\";\n\t\t\t$DetailTableLink .= \"avaluo\";\n\t\t}\n\n\t\t// Add multiple details\n\t\tif ($this->ShowMultipleDetails) {\n\t\t\t$item = &$option->Add(\"detailsadd\");\n\t\t\t$url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . \"=\" . $DetailTableLink);\n\t\t\t$caption = $Language->Phrase(\"AddMasterDetailLink\");\n\t\t\t$item->Body = \"<a class=\\\"ewDetailAddGroup ewDetailAdd\\\" title=\\\"\" . ew_HtmlTitle($caption) . \"\\\" data-caption=\\\"\" . ew_HtmlTitle($caption) . \"\\\" href=\\\"\" . ew_HtmlEncode($url) . \"\\\">\" . $caption . \"</a>\";\n\t\t\t$item->Visible = ($DetailTableLink <> \"\" && $Security->CanAdd());\n\n\t\t\t// Hide single master/detail items\n\t\t\t$ar = explode(\",\", $DetailTableLink);\n\t\t\t$cnt = count($ar);\n\t\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t\tif ($item = &$option->GetItem(\"detailadd_\" . $ar[$i]))\n\t\t\t\t\t$item->Visible = FALSE;\n\t\t\t}\n\t\t}\n\t\t$option = $options[\"action\"];\n\n\t\t// Set up options default\n\t\tforeach ($options as &$option) {\n\t\t\t$option->UseImageAndText = TRUE;\n\t\t\t$option->UseDropDownButton = TRUE;\n\t\t\t$option->UseButtonGroup = TRUE;\n\t\t\t$option->ButtonClass = \"btn-sm\"; // Class for button group\n\t\t\t$item = &$option->Add($option->GroupOptionName);\n\t\t\t$item->Body = \"\";\n\t\t\t$item->Visible = FALSE;\n\t\t}\n\t\t$options[\"addedit\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonAddEdit\");\n\t\t$options[\"detail\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonDetails\");\n\t\t$options[\"action\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonActions\");\n\n\t\t// Filter button\n\t\t$item = &$this->FilterOptions->Add(\"savecurrentfilter\");\n\t\t$item->Body = \"<a class=\\\"ewSaveFilter\\\" data-form=\\\"fsolicitudlistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"SaveCurrentFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$item = &$this->FilterOptions->Add(\"deletefilter\");\n\t\t$item->Body = \"<a class=\\\"ewDeleteFilter\\\" data-form=\\\"fsolicitudlistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"DeleteFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$this->FilterOptions->UseDropDownButton = TRUE;\n\t\t$this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton;\n\t\t$this->FilterOptions->DropDownButtonPhrase = $Language->Phrase(\"Filters\");\n\n\t\t// Add group option item\n\t\t$item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\t}", "function add_extra_field_to_checkout( $fields ) {\n\n\t$depto_args = wp_parse_args( array(\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\t'Seleccione' => 'Seleccione',\n\t\t\t'Francisco Morazan' => 'Francisco Morazan',\n\t\t\t'Olancho' => 'Olancho',\n\t\t\t'Valle' => 'Valle',\n\t\t),\n\t), $fields['shipping']['shipping_depto'] );\n\n\t$fields['shipping']['shipping_depto'] = $depto_args;\n\t$fields['billing']['billing_depto'] = $depto_args; \n\t$fields['billing']['billing_depto']['priority'] = 80;\n\n\treturn $fields;\n\n}", "public function add_option() {\n\t\tadd_option(\n\t\t\t$this->header_text_option, // The header text option\n\t\t\t$this->default_header_text // The default header text\n\t\t);\n\t}", "public function addExtraField($field,$value){\n $this->extraFields[$field] = $value;\n }", "public function insertOption($data);", "function create_options( $field ) {\n\t\t$field = array_merge($this->defaults, $field);\n\t\t$key = $field['name'];\n\t}", "function add_blog_option($id, $option, $value)\n {\n }", "function add_screen_option($option, $args = array())\n {\n }", "public function addOption(string $key, string $value): CustomField\n {\n $this->options[] = [\n 'key' => $key,\n 'value' => $value,\n 'selected' => false\n ];\n\n return $this;\n }", "function get_additional_field_options($val){\n\t \t$OPTIONS = stripslashes($val);\n\t\t\t$OPTIONS = str_replace(', ', ',', $OPTIONS);\n\t\t\t$OPTIONS = explode(',', $OPTIONS);\n\t\t\t$output = false;\n\t\t\tforeach($OPTIONS as $option){\n\t\t\t\t$slug = str_replace(' ', '-', $option);\n\t\t\t\t$output[$slug]= $option;\n\t\t\t}\n\t\t\treturn $output;\n\t }", "function add_option($option, $value = '', $deprecated = '', $autoload = 'yes')\n {\n }", "public function addData($data) {\n foreach ($data as $value) {\n $this->add(new Option($value));\n }\n }", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "public function add_options() {\n\t\t$types = get_option( 'ibx_docs_type' );\n\t\tif ( ! empty( $types ) ) {\n\t\t\t$docs_option = maybe_unserialize( $types );\n\t\t} else {\n\t\t\t$docs_option = array();\n\t\t}\n\n\t\tif (\n\t\t\t! isset( $_POST['docs_generate_nonce'] )\n\t\t\t|| ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['docs_generate_nonce'] ) ), 'docs__form_save' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post_title = '';\n\t\t$post_slug = '';\n\t\t// process form data.\n\t\tif ( isset( $_POST['title'] ) ) {\n\t\t\t$post_title = sanitize_text_field( wp_unslash( $_POST['title'] ) );\n\t\t\tif ( isset( $_POST['slug'] ) && ! empty( $_POST['slug'] ) ) {\n\t\t\t\t$post_slug = sanitize_text_field( wp_unslash( $_POST['slug'] ) );\n\t\t\t} else {\n\t\t\t\t$post_slug = sanitize_title_with_dashes( $post_title );\n\t\t\t}\n\t\t}\n\n\t\t$docs_option[ $post_slug ] = array(\n\t\t\t'title' => $post_title,\n\t\t\t'slug' => $post_slug,\n\t\t);\n\n\t\tupdate_option( 'ibx_docs_type', maybe_serialize( $docs_option ) );\n\t}", "function _options_push($option , $new_data, $group = null) {\n \n // si existe lo pone al dia\n if(_options_exist($option)){\n //echo \"$option \" ;\n _options_update($option , $new_data);\n \n \n }else{ // si no lo crea\n _options_add($option, $new_data, $group);\n\n }\n \n}", "function create_options($key, $field)\n\t{\n\t\t\n\t}", "function addAllOptionToDropDownList (array $fieldData)\n {\n array_unshift ($fieldData['options'], ['id' => '', $fieldData['showNodes'][0] => trans ('HCTranslations::core.all')]);\n\n return $fieldData;\n }", "function add_site_option($option, $value)\n {\n }", "function addOptions(GetOpt $_options)\n {\n $_options->addOptions(array(\n array(null, \"cmd\", GetOpt::NO_ARGUMENT, \"ConsoleOutput - Wenn die Ausgabe per CMD Fenster oder Terminal erfolgt.\\n\")\n ));\n }", "public function\r\n add_option(HTMLTags_Option $option)\r\n {\r\n $attribute = $option->get_attribute('value');\r\n \r\n /*\r\n * What's this line for?\r\n */\r\n $attribute->get_value();\r\n \r\n $this->options[$attribute->get_value()] = $option;\r\n }", "function add_options($option_arr){\n\t\tforeach($option_arr as $option){\n\t\t\tif($option['type']=='bgset'){\n\t\t\t\t$this->add_bgset($option);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->options[]=$option;\n\t\t}\n\t}", "function zenbu_field_extra_settings($table_col, $channel_id, $extra_options)\n\t{\n\t\t// Retrieve previous results if present\n\t\t$rel_option_1 = (isset($extra_options['rel_option_1']) && $extra_options['rel_option_1'] == 'y') ? TRUE : FALSE;\n\t\t\n\t\t// Option: Show related entry ID with related entry title \t\t\t\t\t\t\n\t\t$output['rel_option_1'] = form_label(form_checkbox('settings['.$channel_id.']['.$table_col.'][rel_option_1]', 'y', $rel_option_1) . '&nbsp;' . $this->EE->lang->line('show').'&nbsp;'.$this->EE->lang->line('entry_id'));\n\t\t\t\t\n\t\t// Output\n\t\treturn $output;\n\t\n\t}", "function awm_select_options()\n {\n return array(\n 'options' => array(\n 'label' => __('Options', 'extend-wp'),\n 'case' => 'repeater',\n 'include' => array(\n 'option' => array(\n 'label' => __('Value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'label' => array(\n 'label' => __('Label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n ),\n ),\n );\n }", "public function addOptions(array $options = []): CustomField\n {\n foreach($options as $key => $value) {\n $this->addOption($key, $value);\n }\n\n return $this;\n }", "public function addAdditionalOptionsToQuote($observer)\n {\n $action = Mage::app()->getFrontController()->getAction();\n if ($action->getFullActionName() == 'checkout_cart_add')\n {\n Mage::log(\"checkout_cart_add\", Zend_Log::DEBUG, \"threekit.log\");\n // assuming you are posting your custom form values in an array called extra_options...\n if ($options = $action->getRequest()->getParam('clara_additional_options'))\n {\n $decodePost = json_decode($options, true);\n $product = $observer->getProduct();\n\n // add to the additional options array\n $additionalOptions = array();\n if ($additionalOption = $product->getCustomOption('additional_options'))\n {\n $additionalOptions = (array) unserialize($additionalOption->getValue());\n }\n foreach ($decodePost as $key => $value)\n {\n $additionalOptions[] = array(\n 'label' => $key,\n 'value' => $value,\n );\n }\n // add the additional options array with the option code additional_options\n $observer->getProduct()\n ->addCustomOption('additional_options', serialize($additionalOptions));\n }\n }\n }", "public function add_option($option, $args = array())\n {\n }", "public function addOption(string $_option)\n {\n $this->options[] = $_option;\n }", "public function addDefaultEntriesAndValues() {}", "public function addAdditionalFieldsFields(FormBuilderInterface $builder, array $options = []): void\n {\n \n $builder->add('enableOptionalString1', CheckboxType::class, [\n 'label' => $this->__('Enable optional string 1') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If you need an additional string for each page you can enable an optional field.')\n ],\n 'help' => $this->__('If you need an additional string for each page you can enable an optional field.'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('The enable optional string 1 option')\n ],\n 'required' => false,\n ]);\n \n $builder->add('enableOptionalString2', CheckboxType::class, [\n 'label' => $this->__('Enable optional string 2') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If you need an additional string for each page you can enable an optional field.')\n ],\n 'help' => $this->__('If you need an additional string for each page you can enable an optional field.'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('The enable optional string 2 option')\n ],\n 'required' => false,\n ]);\n \n $builder->add('enableOptionalText', CheckboxType::class, [\n 'label' => $this->__('Enable optional text') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If you need an additional text for each page you can enable an optional field.')\n ],\n 'help' => $this->__('If you need an additional text for each page you can enable an optional field.'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('The enable optional text option')\n ],\n 'required' => false,\n ]);\n }", "function eventspractice_options() {\n\n $options = array (\n 'Option 1' => 'A',\n 'Option 2' => 'B',\n 'Option 3' => 'C'\n );\n\n if ( !get_option( 'eventspractice_options' ) ){\n add_option( 'eventspractice_option', $options );\n }\n update_option( 'eventspractice_option', $options );\n\n\n // add_option( 'eventspractice_option', 'My NEW Plugin Options' );\n // update_option( 'eventspractice_option', 'This is a test with the Options API' );\n // delete_option( 'eventspractice_option' );\n\n}", "function edit_component_tool_inputs_param_options_filter(&$form) {\n // use current time as form_key to enable webform component clone.\n $form['form_key']['#default_value'] = 'form_key_' . time();\n\n unset($form['validation']);\n unset($form['display']);\n\n $form = array_merge($form, get_edit_component_base_form_elements($form, 'filter'));\n\n // form field to edit attributes, available attributes for command includes:\n $form['extra']['attributes']['type'] = [\n '#type' => 'select',\n '#title' => t('Type'),\n '#description' => t('These values are defined in the module ' .\n l('/lib/galaxy/tools/parameters/dynamic_options.py', 'https://github.com/galaxyproject/galaxy/blob/master/lib/galaxy/tools/parameters/dynamic_options.py') .\n ' in the filter_types dictionary'),\n '#options' => drupal_map_assoc([\n 'data_meta',\n 'param_value',\n 'static_value',\n 'unique_value',\n 'multiple_splitter',\n 'attribute_value_splitter',\n 'add_value',\n 'remove_value',\n 'sort_by',\n ]),\n '#required' => TRUE,\n ];\n $form['extra']['attributes']['column'] = [\n '#type' => 'textfield',\n '#title' => t('Column'),\n '#description' => t('Column targeted by this filter - this attribute is \n unused and invalid if <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> or \n <span style=\"color: #FF5666\">remove_value</span>. \n This can be a column index or a column name.'),\n ];\n $form['extra']['attributes']['name'] = [\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('Name displayed for value to add (only used with \n <span style=\"color: #FF5666;\">type</span> of <span style=\"color: #FF5666\">add_value</span>).'),\n ];\n $form['extra']['attributes']['ref'] = [\n '#type' => 'textfield',\n '#title' => t('Reference file'),\n '#description' => t('The attribute name of the reference file (tool data) or \n input dataset. Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> (required), \n <span style=\"color: #FF5666\">param_value</span> (required), or \n <span style=\"color: #FF5666\">remove_value</span> (optional).')\n ];\n $form['extra']['attributes']['key'] = [\n '#type' => 'textfield',\n '#title' => t('Key'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">param_value</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is the name of \n the metadata key to filter by.'),\n ];\n $form['extra']['attributes']['multiple'] = [\n '#type' => 'radios',\n '#title' => t('Multiple'),\n '#description' => t('For types <span style=\"color: #FF5666\">data_meta</span> and \n <span style=\"color: #FF5666\">remove_value</span>, whether option values are multiple. \n Columns will be split by separator. Defaults to <span style=\"color: #FF5666\">false</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ])\n ];\n $form['extra']['attributes']['separator'] = [\n '#type' => 'textfield',\n '#title' => t('Separator'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">multiple_splitter</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is used to split \n one value into multiple parts. When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> or \n <span style=\"color: #FF5666\">remove_value</span> this is only used if \n <span style=\"color: #FF5666\">multiple</span> is set to \n <span style=\"color: #FF5666\">true</span>.')\n ];\n $form['extra']['attributes']['keep'] = [\n '#type' => 'radios',\n '#title' => t('Keep'),\n '#description' => t('If <span style=\"color: #FF5666\">true</span>, keep columns \n matching the value, if <span style=\"color: #FF5666\">false</span> discard \n columns matching the value. Used when <span style=\"color: #FF5666\">type</span> \n is either <span style=\"color: #FF5666\">static_value</span> or \n <span style=\"color: #FF5666\">param_value</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ]),\n '#default_value' => 'true',\n ];\n $form['extra']['attributes']['value'] = [\n '#type' => 'textfield',\n '#title' => t('Value'),\n '#description' => t('Target value of the operations - has slightly different \n meanings depending on type. For instance when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> it is the value to add to the list \n and when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">static_value</span> it is the value compared against.')\n ];\n $form['extra']['attributes']['ref_attribute'] = [\n '#type' => 'textfield',\n '#title' => t('Reference attribute'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">param_value</span>. Period (<span style=\"color: #FF5666\">.</span>) \n separated attribute chain of input (<span style=\"color: #FF5666\">ref</span>) \n attributes to use as value for filter.'),\n ];\n $form['extra']['attributes']['index'] = [\n '#type' => 'textfield',\n '#title' => t('Index'),\n '#description' => t('Used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span>, it is the index into the \n list to add the option to. If not set, the option will be added to \n the end of the list.'),\n ];\n $form['extra']['attributes']['meta_ref'] = [\n '#type' => 'textfield',\n '#title' => t('Meta reference'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">remove_value</span>. Dataset to look for the \n value of metadata <span style=\"color: #FF5666\">key</span> to remove from the list.')\n ];\n // grab populated data from 'extra' column from webform_component table and\n // fill it as default values for edit component form fields.\n edit_component_form_fields_default_value($form);\n}", "public static function add_options(){\n\n \t\t$settings = array(\n \t\t\t'foundation' => 0\n \t\t);\n\n \t\tadd_option( 'zip_downloads', $settings ); \n\t}", "function acf_append_setting($name, $value)\n{\n}", "public function addField();", "public function addOptions(...$options)\n {\n foreach ($options as $option) {\n $this->addOption($option);\n }\n }", "public function addOptions(array $options)\n {\n foreach ($options as $option => $value) {\n if (is_array($value)\n && array_key_exists('key', $value)\n && array_key_exists('value', $value)\n ) {\n $this->addOption($value['key'], $value['value']);\n } else {\n $this->addOption($option, $value);\n }\n }\n }", "public function addCustomFields()\n {\n if (!($enabled_custom_fields = $this->getDataManager()->getOption('custom_fields'))) {\n $enabled_custom_fields = array();\n }\n if (!($enabled_profile_fields = $this->getDataManager()->getOption('custom_fields_additional'))) {\n $enabled_profile_fields = array();\n }\n ?>\n <fieldset data-rm-target=\"#custom-fields .custom-field-select option\" id=\"profile-fields\" class=\"checkbox-list rm-ctrl syncstate\"<?php echo !$this->getDataManager()->getOption('enable_sync') ? ' disabled=\"disabled\"' : '' ?>>\n <?php foreach ($this->custom_fields as $custom_field): ?>\n <div>\n <label>\n <input class=\"profile-field-checkbox\" type=\"checkbox\" name=\"<?php echo $this->getViewKey().'[custom_fields_additional][]' ?>\" value=\"<?php echo $custom_field->getId() ?>\"<?php echo in_array($custom_field->getId(), $enabled_profile_fields) ? ' checked=\"checked\"' : '' ?> />\n <?php echo $custom_field->getName() ?> (<?php _e('customfield.type.'.$custom_field->getFieldType(), 'mgrt-wordpress') ?>)\n </label>\n </div>\n <?php endforeach; ?>\n </fieldset>\n <p class=\"description\"><?php _e('form.sync.field.custom.more.help', 'mgrt-wordpress') ?></p>\n <?php\n }", "function addRowsOptionValue(&$rows, &$rowNumber, $customLabel, $customField) {\n if ($this->_optionGroupId == 0) {\n $apiParams = array(\n 'version' => 3,\n 'custom_group_id' => $this->_customGroupId,\n 'label' => $customLabel\n );\n $apiCustomField = civicrm_api('CustomField', 'Getsingle', $apiParams);\n if (!isset($apiCustomField['is_error']) || $apiCustomField['is_error'] == 0) {\n if (isset($apiCustomField['option_group_id'])) {\n $this->_optionGroupId = $apiCustomField['option_group_id'];\n }\n }\n }\n $apiParams = array(\n 'version' => 3,\n 'option_group_id' => $this->_optionGroupId\n );\n $apiOptionValues = civicrm_api('OptionValue', 'Get', $apiParams);\n if ($apiOptionValues['is_error'] == 0) {\n foreach($apiOptionValues['values'] as $optionValueId => $apiOptionValue) {\n /*\n * Calculate number of contacts in econ_status, only print if any\n */\n $aantalIn = $this->calculateAantalInContacts($apiOptionValue['label'], $customField);\n if ($aantalIn > 0) {\n $rows[$rowNumber]['label'] = ts($apiOptionValue['label']);\n $rows[$rowNumber]['aantal'] = $aantalIn;\n $rows[$rowNumber]['percentage'] = CRM_Utils_HilreportsUtils::calculatePercentage($aantalIn, $this->_aantalContacts).\"%\";\n $rowNumber++;\n $this->_aantalRijen++;\n }\n }\n /*\n * last time for none\n */\n $aantalIn = $this->calculateAantalInContacts('none', $customField);\n if ($aantalIn > 0) {\n $rows[$rowNumber]['label'] = 'Onbekend';\n $rows[$rowNumber]['aantal'] = $aantalIn;\n $rows[$rowNumber]['percentage'] = CRM_Utils_HilreportsUtils::calculatePercentage($aantalIn, $this->_aantalContacts).\"%\";\n $rowNumber++;\n $this->_aantalRijen++;\n }\n }\n }", "public function addOption($hOption)\n {\n $this->hOptionList[] = $hOption;\n }", "function add_option_whitelist($new_options, $options = '')\n {\n }", "public function addOption($attribute, $data)\r\n {\r\n Mage::helper('api')->toArray($data);\r\n return parent::addOption($attribute, $data);\r\n }", "public function addOptions( $options ): void {\n\t\tforeach ( $options as $key => $option ) {\n\t\t\tif ( is_int( $key ) ) {\n\t\t\t\t$this->addOption( $option );\n\t\t\t} else {\n\t\t\t\t$this->addOption( $key, $option );\n\t\t\t}\n\t\t}\n\t}", "function affwp_add_program_field_to_affiliate_registration_form() {\n\n\t$errors = affiliate_wp()->register->get_errors();\n // $options = get_option( 'affwp_program' );\n\n\tif ( ! array_key_exists( 'empty_program', $errors ) ) {\n $program = sanitize_text_field( $_POST['affwp_program'] );\n\t}\n\n\t?>\n\t<p>\n\t\t<label for=\"affwp-program\">Affiliate Program Type</label>\n\t\t \n <select name='affwp_program'>\n <option value=''>Choose the type of program you run</option>\n\t\t\t<option value='Web Affiliate'>Web Affiliate</option>\n\t\t\t<option value='Retailer'>Retailer</option>\n <option value='Team or Facility'>Team or Facility</option>\n </select>\n\t</p>\n\t<?php\n}", "function addToField(\\Foundation\\Form\\Field $field);", "function init_extra_fields() {\n $temp = $this->uc->CallMethod('PickupLocations', array(), 'GET', $this->token);\n $pickups = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $pickups[$t['LocationId']] = $t['Name'];\n }\n }\n\n // obtine lista planurilor tarifare\n $temp = $this->uc->CallMethod('PriceTables', array(), 'GET', $this->token);\n\n $prices = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $prices[$t['PriceTableId']] = empty($t['Name']) ? $t['PriceTableId'] : $t['Name'];\n }\n }\n\n $this->form_fields += array(\n 'pickup' => array(\n 'title' => __('Punct de ridicare', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege punctul de ridicare') + $pickups\n ),\n 'priceplan' => array(\n 'title' => __('Plan tarifar', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege planul tarifar') + $prices\n ),\n 'insurance' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Asigurare', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'saturday' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare sambata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'morning' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare dimineata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'open' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Deschidere colet', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'repayment' => array(\n 'title' => __('Incasare ramburs', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'cash' => 'Numerar',\n 'bank' => 'Transfer bancar'\n )\n ),\n 'payer' => array(\n 'title' => __('Platitor expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'sender' => 'Expeditor',\n 'recipient' => 'Destinatar'\n )\n ),\n 'type' => array(\n 'title' => __('Tip expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'parcel' => 'Colet',\n 'envelope' => 'Plic'\n )\n ),\n 'free' => array(\n 'title' => __('Plafon transport gratuit', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'fixed' => array(\n 'title' => __('Cost fix transport', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'height' => array(\n 'title' => __('Inaltime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'width' => array(\n 'title' => __('Latime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'length' => array(\n 'title' => __('Lungime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'service' => array(\n 'title' => __('Serviciu', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 0 => 'Inactiv',\n 1 => 'Activ'\n )\n ),\n );\n }", "public function addOptions($options)\n {\n foreach ($options as $key => $value) {\n $this->options[$key] = $value;\n }\n }", "function create_options( $field )\n\t{\n\t\t// defaults?\n\t\t/*\n\t\t$field = array_merge($this->defaults, $field);\n\t\t*/\n\t\t\n\t\t\n\t\t$field['character_number'] = isset($field['character_number']) ? $field['character_number'] : '';\n\t\t\n\t\t?>\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Number of characters\",'acf'); ?></label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($field['character_number'] == \"\"){\n\t\t\t\t\t\n\t\t\t\t\t$field['character_number'] = 150;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t\t\t'type'\t=>\t'text',\n\t\t\t\t\t\t\t'name'\t=>\t'fields['.$field['name'].'][character_number]',\n\t\t\t\t\t\t\t'value'\t=>\t$field['character_number']\n\t\t\t\t));\n\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\n<!--\n\t\t<tr class=\"field_option field_option_file\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label>Choice</label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<ul class=\"radio_list radio horizontal\"><li><label><input id=\"acf-field_5_save_format-object\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"object\">File Object</label></li><li><label><input id=\"acf-field_5_save_format-url\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"url\">File URL</label></li><li><label><input id=\"acf-field_5_save_format-id\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"id\" checked=\"checked\" data-checked=\"checked\">File ID</label></li></ul>\t\t\t</td>\n\t\t</tr>\t\n-->\t\n\t\t\n\t\t<?php\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t}", "public function addOption($name, $id, $label, $value){\n if(empty($this->items[$name]))\n return;\n if(!empty($this->items[$name]['options'][$id]))\n return;\n $this->items[$name]['options'][$id]['id']=$id;\n $this->items[$name]['options'][$id]['label']=$label;\n $this->items[$name]['options'][$id]['value']=$value;\n }", "private function addLongOption($name, $value)\n {\n $this->options[$name] = $value;\n }", "public function addIntegrationFields(FormBuilderInterface $builder, array $options = []): void\n {\n \n $listEntries = $this->listHelper->getEntries('appSettings', 'enabledFinderTypes');\n $choices = [];\n $choiceAttributes = [];\n foreach ($listEntries as $entry) {\n $choices[$entry['text']] = $entry['value'];\n $choiceAttributes[$entry['text']] = ['title' => $entry['title']];\n }\n $builder->add('enabledFinderTypes', MultiListType::class, [\n 'label' => $this->__('Enabled finder types') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Which sections are supported in the Finder component (used by Scribite plug-ins).')\n ],\n 'help' => $this->__('Which sections are supported in the Finder component (used by Scribite plug-ins).'),\n 'empty_data' => [],\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('Choose the enabled finder types.')\n ],\n 'required' => false,\n 'placeholder' => $this->__('Choose an option'),\n 'choices' => $choices,\n 'choice_attr' => $choiceAttributes,\n 'multiple' => true,\n 'expanded' => false\n ]);\n }", "public function add_blog_option() {\n global $json_api;\n\n $this->_verify_admin();\n $this->_verify_nonce('add_blog_option');\n\n extract($_REQUEST);\n\n if(!isset($blog_id))\n $json_api->error(__(\"You must send the 'blog_id' parameter.\"));\n\n if(!isset($key))\n $json_api->error(__(\"You must send the 'key' parameter.\"));\n\n if(!isset($value))\n $json_api->error(__(\"You must send the 'value' parameter.\"));\n\n add_blog_option( $blog_id, $key, $value );\n\n return array( \"message\" => __(\"You successfully added a blog option.\") );\n }", "function SetupOtherOptions() {\n\t\tglobal $Language, $Security;\n\t\t$options = &$this->OtherOptions;\n\t\t$option = $options[\"addedit\"];\n\n\t\t// Add\n\t\t$item = &$option->Add(\"add\");\n\t\t$item->Body = \"<a class=\\\"ewAddEdit ewAdd\\\" title=\\\"\" . ew_HtmlTitle($Language->Phrase(\"AddLink\")) . \"\\\" data-caption=\\\"\" . ew_HtmlTitle($Language->Phrase(\"AddLink\")) . \"\\\" href=\\\"\" . ew_HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->Phrase(\"AddLink\") . \"</a>\";\n\t\t$item->Visible = ($this->AddUrl <> \"\" && $Security->CanAdd());\n\t\t$option = $options[\"action\"];\n\n\t\t// Set up options default\n\t\tforeach ($options as &$option) {\n\t\t\t$option->UseImageAndText = TRUE;\n\t\t\t$option->UseDropDownButton = FALSE;\n\t\t\t$option->UseButtonGroup = TRUE;\n\t\t\t$option->ButtonClass = \"btn-sm\"; // Class for button group\n\t\t\t$item = &$option->Add($option->GroupOptionName);\n\t\t\t$item->Body = \"\";\n\t\t\t$item->Visible = FALSE;\n\t\t}\n\t\t$options[\"addedit\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonAddEdit\");\n\t\t$options[\"detail\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonDetails\");\n\t\t$options[\"action\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonActions\");\n\n\t\t// Filter button\n\t\t$item = &$this->FilterOptions->Add(\"savecurrentfilter\");\n\t\t$item->Body = \"<a class=\\\"ewSaveFilter\\\" data-form=\\\"fuserslistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"SaveCurrentFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$item = &$this->FilterOptions->Add(\"deletefilter\");\n\t\t$item->Body = \"<a class=\\\"ewDeleteFilter\\\" data-form=\\\"fuserslistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"DeleteFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$this->FilterOptions->UseDropDownButton = TRUE;\n\t\t$this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton;\n\t\t$this->FilterOptions->DropDownButtonPhrase = $Language->Phrase(\"Filters\");\n\n\t\t// Add group option item\n\t\t$item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\t}", "function add_additional_field($details) {\r\n\t\t$sql = \"INSERT INTO sys_man_additional_fields (field_name, field_type, field_placement, group_id) VALUES (?, ?, ?, ?)\";\r\n\t\t$data=array(\"$details->field_name\", \"$details->field_type\", \"$details->field_placement\", \"$details->group_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\treturn;\r\n\t}", "public function register_option($option){\r\n\t\tif(!is_array($option))\r\n\t\t\t$option = array($option=>'');\r\n\t\t$this->registered_option = array_merge($this->registered_option, $option);\r\n\t}", "public function getAdditionalFields() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t$ro_settings = $this->config->get('related_options');\n\t\t\t$std_fields = array('sku', 'upc', 'ean', 'location');\n\t\t\tforeach ($std_fields as $field) {\n\t\t\t\tif ( isset($ro_settings['spec_'.$field]) && $ro_settings['spec_'.$field] ) {\n\t\t\t\t\t$fields[] = $field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}", "public function create_db_options_field() {\n\n\t\t\tif ( ! $this->is_db_options_exist( $this->options_slug ) ) {\n\t\t\t\t$this->save_options( $this->options_slug, $this->default_options );\n\t\t\t}\n\n\t\t\tif ( ! $this->is_db_options_exist( $this->options_slug . '_default' ) ) {\n\t\t\t\t$this->save_options( $this->options_slug . '_default', $this->default_options );\n\t\t\t}\n\t\t}", "function imbaf_properties_create_add_fields(){\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[imbaf_property_type]\">Typ</label>\n\n <select name=\"term_meta[imbaf_property_type]\">\n\n <?php\n\n foreach($this -> property_types as $property){\n\n ?> <option style=\"width:100%;\" value=\"<?php echo $property['value']; ?>\"><?php echo $property['label']; ?></option> <?php\n\n }\n\n\n ?>\n </select>\n\n <p class=\"description\"><?php _e('Vergleichswert-Typ','imb_affiliate'); ?></p>\n\n\n\n <label for=\"term_meta[imbaf_property_icon]\">Icon</label>\n <input type=\"text\" name=\"term_meta[imbaf_property_icon]\">\n\n <p class=\"description\"><?php _e('Font Awesome Icon','imb_affiliate'); ?></p>\n\n\n <label for=\"term_meta[imbaf_property_prefix]\"><?php _e('Präfix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_prefix]\">\n\n <p class=\"description\"><?php _e('Vorgestellter Wert (ca.)','imb_affiliate'); ?></p>\n\n <label for=\"term_meta[imbaf_property_suffix]\"><?php _e('Suffix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_suffix]\">\n <p class=\"description\"><?php _e('Nachgestellter Wert (z.B. kg, MhZ etc.)','imb_affiliate'); ?></p>\n\n\n\n </div>\n <?php\n\n\n }", "function add_to_context( $context ) {\n\t\t$context['options'] = get_fields('options');\n\t\treturn $context;\n\t}", "function SetupOtherOptions() {\n\t\tglobal $Language, $Security;\n\t\t$options = &$this->OtherOptions;\n\t\t$option = $options[\"addedit\"];\n\n\t\t// Add\n\t\t$item = &$option->Add(\"add\");\n\t\t$addcaption = ew_HtmlTitle($Language->Phrase(\"AddLink\"));\n\t\t$item->Body = \"<a class=\\\"ewAddEdit ewAdd\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . ew_HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->Phrase(\"AddLink\") . \"</a>\";\n\t\t$item->Visible = ($this->AddUrl <> \"\" && $Security->CanAdd());\n\t\t$option = $options[\"action\"];\n\n\t\t// Set up options default\n\t\tforeach ($options as &$option) {\n\t\t\t$option->UseImageAndText = TRUE;\n\t\t\t$option->UseDropDownButton = FALSE;\n\t\t\t$option->UseButtonGroup = TRUE;\n\t\t\t$option->ButtonClass = \"btn-sm\"; // Class for button group\n\t\t\t$item = &$option->Add($option->GroupOptionName);\n\t\t\t$item->Body = \"\";\n\t\t\t$item->Visible = FALSE;\n\t\t}\n\t\t$options[\"addedit\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonAddEdit\");\n\t\t$options[\"detail\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonDetails\");\n\t\t$options[\"action\"]->DropDownButtonPhrase = $Language->Phrase(\"ButtonActions\");\n\n\t\t// Filter button\n\t\t$item = &$this->FilterOptions->Add(\"savecurrentfilter\");\n\t\t$item->Body = \"<a class=\\\"ewSaveFilter\\\" data-form=\\\"fneonatallistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"SaveCurrentFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$item = &$this->FilterOptions->Add(\"deletefilter\");\n\t\t$item->Body = \"<a class=\\\"ewDeleteFilter\\\" data-form=\\\"fneonatallistsrch\\\" href=\\\"#\\\">\" . $Language->Phrase(\"DeleteFilter\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\t\t$this->FilterOptions->UseDropDownButton = TRUE;\n\t\t$this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton;\n\t\t$this->FilterOptions->DropDownButtonPhrase = $Language->Phrase(\"Filters\");\n\n\t\t// Add group option item\n\t\t$item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\t}", "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "function _addMetadataFields()\n {\n $config =& NDB_Config::singleton();\n $this->dateOptions = array(\n 'language' => 'en',\n 'format' => 'YMd',\n 'minYear' => $config->getSetting('startYear'),\n 'maxYear' => $config->getSetting('endYear'),\n 'addEmptyOption' => true,\n 'emptyOptionValue' => null\n );\n\n $this->form->addElement('date', 'Date_taken', 'Date of Administration', $this->dateOptions);\n\n $examiners = $this->_getExaminerNames();\n $this->form->addElement('select', 'Examiner', 'Radiologist', $examiners);\n\n \t$this->form->addGroupRule('Date_taken', 'Date of Administration is required', 'required');\n\n $this->form->registerRule('checkdate', 'callback', '_checkDate');\n $this->form->addRule('Date_taken', 'Date of Administration is invalid', 'checkdate');\n\n $this->form->addRule('Examiner', 'Examiner is required', 'required');\n }", "function on_add_extra()\r\n\t{\r\n\t}", "final protected function addOption($option) {\n $this->selectedOptions[$option] = 1;\n }", "function add_specific_form_fields() {\n\t\treturn false;\n\t}", "private static function _addThreedsOptions()\n {\n global $db;\n\n $challengeIndicators = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getChallengeIndicators()\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable 3DSv2',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'THREEDS_ALLOWED'\n ) . \"',\n 'true', 'Enable 3DSv2 optional parameters.',\n '6', '4', 'emp_zfg_draw_toggle(',\n 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('3DSv2 Challenge',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'THREEDS_CHALLENGE_INDICATOR'\n ) . \"', 'no_preference', \n 'The value has weight and might impact the decision whether a \n challenge will be required for the transaction or not.',\n '6', '4', 'emp_zfg_select_drop_down_single({$challengeIndicators},',\n now())\"\n );\n }", "public function addListingOptions($optionCount)\n\t{\n\t\tself::view('listingOptions/addListingOptions', ['optionCount' => $optionCount]);\n\t}", "public function option_fields() {\n\n // Only need to initiate the array once per page-load\n if ( ! empty( $this->option_metabox ) ) {\n return $this->option_metabox;\n }\n\n $completion_badge_array = EMS_OP_Tool::wpbadger_award_choose_badge ();\n\n $this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Content version number', 'op_tool' ),\n\t\t\t\t'desc' => __( 'increase this version number after any change to the content of this resource', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'content_version',\n\t\t\t\t'type' => 'text_small',\n\t\t\t\t// 'repeatable' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Completion badge', 'op_tool' ),\n\t\t\t\t'desc' => __( 'select the badge to be awarded for the completion of this OP Tool', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'completion_badge_id',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => $completion_badge_array,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge evidence text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'this text will be displayed when someone follows the evidence link of a completion badge', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_evidence_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge admin email text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'the text that will appear in the email to the Administrator the user elected to inform', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_notify_admin_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\t/*array(\n\t\t\t 'id' => $prefix . 'ems_admin_contacts_group',\n\t\t\t 'type' => 'group',\n\t\t\t 'description' => __( 'The EMS admin contacts for each institution (to be sent notifications when their students complete)', 'op_tool' ),\n\t\t\t 'options' => array(\n\t\t\t 'group_title' => __( 'Institution {#}', 'op_tool' ), // since version 1.1.4, {#} gets replaced by row number\n\t\t\t 'add_button' => __( 'Add Another Institution', 'op_tool' ),\n\t\t\t 'remove_button' => __( 'Remove Institution', 'op_tool' ),\n\t\t\t 'sortable' => true, // beta\n\t\t\t ),\n\t\t\t\t'show_names' => true,\n\t\t\t // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.\n\t\t\t 'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'Institution', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the intitution\\'s name', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'EMS admin\\'s email address', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the email address of the person who deals with EMS OPT certificates', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_admin_email',\n\t\t\t\t\t\t'type' => 'text_email',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t ),\n\t\t\t),*/\n );\n\n $this->option_metabox = array(\n 'id' => 'option_metabox',\n 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),\n 'show_names' => true,\n 'fields' => $this->fields,\n );\n\n return $this->option_metabox;\n }", "public function optionsCallback($strField);", "public static function set_options() {\r\n\t\tself::add_option(\"my_option\", \"foo\");\r\n\t}", "protected function adjustOptionsValues()\n {\n $this->init();\n $this->create();\n }", "function brag_add_meta_field($args) {\n \n $args['fields']['referral'] = '';\n $args['fields']['notes'] = '';\n $args['fields']['type'] = '';\n $args['fields']['lead_status'] = '';\n\n return $args;\n}", "function pqurc_display_extra()\n {\n $extra_fi = get_option('pqurcode_extra');\n printf(\"<input type='text' id='%s' name='%s' value='%s' />\", 'pqurcode_extra', 'pqurcode_extra', $extra_fi);\n }", "private function addFieldType($type,$hasOptions){\n $this->hasOptions[$type]=$hasOptions;\n }", "public function register_options() {\n\t\tparent::register_options();\n\n\t}", "function create_options($field)\n\t{\n\t\t// defaults?\n\t\t$field = array_merge($this->defaults, $field);\n\n\t\t// key is needed in the field names to correctly save the data\n\t\t$key = $field['name'];\n\n\n\t\t// Create Field Options HTML\n\t\t?>\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Default Icon\", 'acf'); ?></label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<div class=\"fa-field-wrapper\">\n\t\t\t\t\t<div class=\"fa-live-preview\"></div>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'name' => 'fields[' . $key . '][default_value]',\n\t\t\t\t\t\t'value' => $field['default_value'],\n\t\t\t\t\t\t'class'\t => 'fontawesome',\n\t\t\t\t\t\t'choices' => array_merge( array( 'null' => __(\"Select\",'acf') ), $field['choices'] )\n\t\t\t\t\t));\n\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Return Value\",'acf'); ?></label>\n\t\t\t\t<p class=\"description\"><?php _e(\"Specify the returned value on front end\", 'acf'); ?></p>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t'type'\t=>\t'radio',\n\t\t\t\t\t'name'\t=>\t'fields['.$key.'][save_format]',\n\t\t\t\t\t'value'\t=>\t$field['save_format'],\n\t\t\t\t\t'choices'\t=>\tarray(\n\t\t\t\t\t\t'element'\t=>\t__(\"Icon Element\",'acf'),\n\t\t\t\t\t\t'class'\t\t=>\t__(\"Icon Class\",'acf'),\n\t\t\t\t\t\t'unicode'\t=>\t__(\"Icon Unicode\",'acf'),\n\t\t\t\t\t\t'object'\t=>\t__(\"Icon Object\",'acf'),\n\t\t\t\t\t),\n\t\t\t\t\t'layout'\t=>\t'horizontal',\n\t\t\t\t));\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Allow Null?\",'acf'); ?></label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t'type'\t=>\t'radio',\n\t\t\t\t\t'name'\t=>\t'fields['.$key.'][allow_null]',\n\t\t\t\t\t'value'\t=>\t$field['allow_null'],\n\t\t\t\t\t'choices'\t=>\tarray(\n\t\t\t\t\t\t1\t=>\t__(\"Yes\",'acf'),\n\t\t\t\t\t\t0\t=>\t__(\"No\",'acf'),\n\t\t\t\t\t),\n\t\t\t\t\t'layout'\t=>\t'horizontal',\n\t\t\t\t));\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Enqueue FontAwesome?\",'acf'); ?></label>\n\t\t\t\t<p class=\"description\"><?php _e(\"Set to 'Yes' to enqueue FA in the footer on any pages using this field.\", 'acf'); ?></p>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t'type'\t=>\t'radio',\n\t\t\t\t\t'name'\t=>\t'fields['.$key.'][enqueue_fa]',\n\t\t\t\t\t'value'\t=>\t$field['enqueue_fa'],\n\t\t\t\t\t'choices'\t=>\tarray(\n\t\t\t\t\t\t1\t=>\t__(\"Yes\",'acf'),\n\t\t\t\t\t\t0\t=>\t__(\"No\",'acf'),\n\t\t\t\t\t),\n\t\t\t\t\t'layout'\t=>\t'horizontal',\n\t\t\t\t));\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\n\t}", "public static function add_filters_get_user_option()\n\t\t\t\t{\n\t\t\t\t\tif(!($fields = json_decode($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"], TRUE)))\n\t\t\t\t\t\treturn; // Nothing to do in this case.\n\n\t\t\t\t\tforeach($fields as $_field => $_config)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadd_filter('get_user_option_' . $_field, 'c_ws_plugin__s2member_custom_reg_fields::do_filter_get_user_option', 20, 3);\n\t\t\t\t\t\t\tadd_filter('get_user_option_s2_' . $_field, 'c_ws_plugin__s2member_custom_reg_fields::do_filter_get_user_option', 20, 3);\n\t\t\t\t\t\t}\n\t\t\t\t\tunset($_field, $_config); // Housekeeping.\n\t\t\t\t}", "function my_epl_add_single_bedrooms_search_dropdown_field($fields) {\n\tforeach($fields as $field_key => &$field) {\n\t if( in_array($field['meta_key'], array('property_bedrooms_min','property_bedrooms_max') ) ) {\n\t\t\tunset($fields[$field_key]);\n\t }\n\t}\n\t$fields[] =array(\n\t\t'key'\t\t\t=>\t'search_bed',\n\t\t//'multiple'\t\t=>\ttrue,\n\t\t'meta_key'\t\t=>\t'property_bedrooms',\n\t\t'label'\t\t\t=>\t__('Bedrooms','epl'),\n\t\t'type'\t\t\t=>\t'select',\n\t\t'option_filter'\t\t=>\t'property_bedrooms',\n\t\t'options'\t\t=>\tarray(\n\t\t\t\t\t\t\t'studio'\t=> 'Studio',\n\t\t\t\t\t\t\t'1'\t\t=> '1',\n\t\t\t\t\t\t\t'2'\t\t=> '2',\n\t\t\t\t\t\t\t'3'\t\t=> '3',\n\t\t\t\t\t\t\t'4'\t\t=> '4',\n\t\t\t\t\t\t\t'5'\t\t=> '5',\n\t\t),\n\t\t'option_type' => 'range', // provide range of option instead of option array\n\t\t'query'\t\t\t=>\tarray(\n\t\t\t\t\t\t\t'query'\t\t=>\t'meta',\n\t\t\t\t\t\t\t'compare'\t=>\t'EQUALS',\n\t\t\t\t\t\t\t'type'\t\t=>\t'numeric'\n\t\t),\n\t\t'class'\t\t\t=>\t'epl-search-row-full',\n\t\t'order'\t\t\t=> 160\n\t);\n\treturn $fields;\n}", "private static function AddMembergroupOptions(CheckList $field)\n {\n $sql = Access::SqlBuilder();\n $tbl = Membergroup::Schema()->Table();\n $orderBy = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));\n $groups = Membergroup::Schema()->Fetch(false, null, $orderBy);\n foreach ($groups as $group)\n {\n $field->AddOption($group->GetID(), $group->GetName());\n }\n }", "function civiq_ballots_ajax_add_more_options($form, $form_state) {\r\n return $form['options'];\r\n}", "function addExtraCategoryFields_editForm($tag) {\n\t\t$this->addExtraCategoryFields($tag, true);\n\t}", "public function additional(array $data);", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "protected function addTestOptions()\n {\n foreach (['test' => 'PHPUnit', 'pest' => 'Pest'] as $option => $name) {\n $this->getDefinition()->addOption(new InputOption(\n $option,\n null,\n InputOption::VALUE_NONE,\n \"Generate an accompanying {$name} test for the {$this->type}\"\n ));\n }\n }", "public function options_update() {\n\t\tregister_setting( $this->plugin_name, $this->plugin_name, array($this, 'validate', 'default' => array( \"url_nerd_instance\" => \"\", \"category_weight\" => \"0.04\", \"entity_weight\" => \"0.7\" ) ) );\n\t}", "private function set_end_options(): void {\n Simply_Static\\Options::instance()\n ->set('additional_files', Utils::array_to_option_string($this->files))\n ->set('additional_urls', Utils::array_to_option_string($this->urls))\n ->set('archive_end_time', Simply_Static\\Util::formatted_datetime())\n ->save();\n }", "function top10_install() {\r\n/* Creates new database field */\r\n//add_option('omekafeedpull_omekaroot', '/omeka', '', 'yes');\r\n}", "public function catch_field_options( $field ) {\n\n\t\tif ( isset( $field['choices'] ) ) {\n\t\t\t$this->field_options = $field['choices'];\n\t\t}\n\t}", "public function addField($field, array $data)\n {\n $this->fields[$field] = $this->prepareField($data);\n }", "public function add()\n\t{\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon_display'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_display_empty'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_select_menu'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_text'\n\t\t);\n\t\t\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_text'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_dc_enable'\n\t\t);\n\t}" ]
[ "0.70371526", "0.68228126", "0.61906844", "0.6183079", "0.6150025", "0.6078163", "0.60629195", "0.6051076", "0.59929407", "0.5958412", "0.5910745", "0.5901721", "0.5893534", "0.58824867", "0.58562297", "0.5826155", "0.57709146", "0.5728315", "0.5722235", "0.56976545", "0.5657035", "0.5646724", "0.5642399", "0.5630691", "0.56097466", "0.560775", "0.5604202", "0.56003374", "0.5595141", "0.5563715", "0.5553109", "0.5544732", "0.55399835", "0.5527354", "0.5523149", "0.5519979", "0.55189157", "0.55161756", "0.5447186", "0.54380214", "0.54277694", "0.5426099", "0.5423511", "0.5407046", "0.53945243", "0.53915876", "0.53880036", "0.53842795", "0.5381425", "0.5377349", "0.5377221", "0.5373703", "0.53650856", "0.5354894", "0.5342236", "0.53249836", "0.530659", "0.5303527", "0.5303441", "0.529978", "0.52961886", "0.5284897", "0.5282797", "0.5272619", "0.5271937", "0.5268641", "0.5264856", "0.525681", "0.5255596", "0.52519363", "0.5244954", "0.52433497", "0.5238375", "0.52383566", "0.5232604", "0.5232222", "0.5229303", "0.5206225", "0.52046347", "0.51955223", "0.51917595", "0.5191358", "0.518864", "0.5187353", "0.51639867", "0.5144559", "0.5137345", "0.5132395", "0.5128485", "0.5122785", "0.5122428", "0.51215243", "0.5119313", "0.51168966", "0.5105562", "0.5102241", "0.50980365", "0.5097383", "0.5093852", "0.5087906", "0.5087898" ]
0.0
-1
Ajoute un commentaire dans la base
public function ajouterCommentaire($auteur, $contenu, $idBillet) { $auteur = htmlspecialchars($auteur); $contenu = htmlspecialchars($contenu); $sql = 'insert into T_COMMENTAIRE(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)' . ' values(?, ?, ?, ?)'; $date = date('Y-m-d H:i:s'); // Récupère la date courante $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "abstract protected function add(Comment $comment);", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "public function add(Comment $comments)\n {\n $query = $this->db->pdo->prepare('INSERT INTO comments(idnews, idparent, niveau, moderate, content, membre, addDate) VALUES (:idnews, :idparent, :niveau, :moderate, :content, :membre, NOW())');\n $query->bindValue(':idnews', $comments->idnews(), PDO::PARAM_INT);\n $query->bindValue(':idparent', $comments->idparent(), PDO::PARAM_INT);\n $query->bindValue(':niveau', $comments->niveau(), PDO::PARAM_INT);\n $query->bindValue(':moderate', $comments->moderate(), PDO::PARAM_INT);\n $query->bindValue(':content', $comments->content(), PDO::PARAM_STR);\n $query->bindValue(':membre', $comments->membre(), PDO::PARAM_STR);\n\n $query->execute();\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function ajouterCommentaire($auteur, $contenu, $idBillet) {\r\n $sql = 'insert into t_commentaire(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)'\r\n . ' values(?, ?, ?, ?)';\r\n $date = date('Y-m-d H:i:s'); // Récupère la date courante\r\n $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet));\r\n }", "public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }", "function addComment($id){\n $newComment = $this->commentManager->postComment($id, $_POST['author'], $_POST['comment']);\n if($newComment === false){\n throw new \\Exception(\"Impossible d'ajouter le commentaire\");\n } else {\n header('Location: /episode/'.$id);\n }\n }", "public function create($comment)\n {\n\n }", "public function InsertComment($details)\n {\n $this->comments[] = $details;\n }", "public function AddComment($param){\n $param=$param = $this->_check_param($param,array(SERVICE_PARAM_INT,SERVICE_PARAM_INT,SERVICE_PARAM_STRING));\n $user_id=$param[0];\n $article_id=$param[1];\n $comment_contents=$param[2];\n $time=time();\n $this->comment_model->AddComment($user_id,$article_id,$time,$comment_contents); //把评论加入\n $this->article_model->UpdateCommentCount($article_id); //把article_model中的comment_count+1\n return $this->output(true,1000);\n }", "abstract public function comment();", "public function add_comm()\n {\n $this->comments++;\n }", "public function ajoutCommentaire(SetUpComment $ajout)\n {\n\n $message = $ajout->getMessage();\n $note = $ajout->getNote();\n $login = $_SESSION['login'];\n $film = $ajout->getFilm();\n try\n {\n $bdd= new PDO('mysql:host=localhost;dbname=cinemaphp;charset=utf8','root','');\n }\n catch(Exception $e)\n {\n die('Erreur:'.$e->getMessage());\n }\n\n $req = $bdd->prepare('INSERT INTO comment (message,login,note,film) VALUES (?,?,?,?)');\n $req -> execute(array($message,$login,$note,$film));\n\n\n }", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "public function createCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('INSERT INTO commentaires(id_jeu)VALUE(?)');\n $req->execute(array($id));\n return $req;\n }", "public function addComment($body){\n // Comment::create([\n // 'body' => $body,\n // 'post_id' => $this->id\n // ]);\n\n\t\t$this->comments()->create(compact('body'));\n\t}", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "function addComment($chapterId)\r\n\t{\r\n\t\t$commentManager = new CommentManager();\r\n\t\t\r\n\t\trequire_once('view/insertCommentView.php');\r\n\t}", "public function addComment($author, $content, $idPoem) {\n \n $sql = 'INSERT INTO T_COMMENT( COM_DATE, COM_AUTHOR, ' .\n ' COM_CONTENT, ARTICLE_ID ) ' .\n 'VALUES (?, ?, ?, ?) ';\n \n $dt = date(DATE_W3C); // Get current date\n \n $this->executeQuery($sql, array($dt, $author, \n $content, $idPoem));\n \n }", "Public function addComment(Request $request){\n // return $id;\n\n $this->validate($request,[ \n 'comment' => 'required', \n ],\n\n [\n 'comment.required' => ' اجرات خود را بنویسید ',\n ]);\n\n $user_id = Auth::user()->id;\n $comment = new AhkamComment;\n $comment->comment = $request->comment;\n $comment->ahkam_id = $request->ahkam_id;\n $comment->user_id = $user_id;\n DB::transaction(function() use ($comment) {\n $comment->save();\n });\n //to generate its notifications\n Helper::add_noti('Ahkam', $comment->id, $comment->ahkam_id);\n $request->session()->flash('alert-success', ' اجرات شما افزوده شد ' );\n return redirect()->back();\n \n }", "public function addComment(){\n\t\t try{\n\t\t\t $conn=DBConnection::getConnection();\t\t\t \n\t\t\t \t\t\t \n\t\t\t $insertQuery=\"INSERT INTO comment(comment_description,comment_date,news_id,user_name)VALUES(:des,:com_date,:newsId,:user)\";\n\t\t\t $cmd=$conn->prepare($insertQuery);\n\t\t\t \n\t\t\t $cmd->bindValue(':des',$this->getCommentDescription(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':com_date',$this->getCommentDate(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':newsId',$this->getNewsId(),PDO::PARAM_INT);\n\t\t\t $cmd->bindValue(':user',$this->getUserName(),PDO::PARAM_STR);\n\t\t\t \n\t\t\t $returnedValue=$cmd->execute(); //Returns TRUE on success or FALSE on failure\n\t\t\t return $returnedValue;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "function addComment($franchise_id, $user_id, $comments) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"INSERT INTO \" . $db_table_prefix . \"comments (\n\t\tuser_id,\n\t\tfranchise_id,\n\t\tcomments,\n\t\tdate\n\t\t)\n\t\tVALUES (\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t'\" . time() . \"'\n\t\t)\");\n $stmt->bind_param(\"sss\", $user_id, $franchise_id, $comments);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n}", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "function addComment($user, $message) {\n $this->comments[] = new Comment($user, $message);\n }", "public function add(Comment $comment)\n {\n $sql = \"INSERT INTO comments(idArticle, author, content, publishDate)\n VALUES(:idArticle, :author, :content, NOW())\";\n $query = $this->db->prepare($sql);\n $query->execute([\n 'idArticle' => $comment->idArticle(),\n 'author' => $comment->author(),\n 'content' => $comment->content()\n ]);\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function addCommentAction()\n {\n /** @var Facepalm_Model_Row_Comment $comment */\n\n $this->_helper->assertHasParameter('point_id');\n\n $form = new Facepalm_Form_Comment();\n\n if($this->getRequest()->isPost()) {\n $post = $this->getRequest()->getPost();\n\n if($form->isValid($post)) {\n $comments = new Facepalm_Model_Comments();\n $comment = $comments->createRow($form->getValues());\n\n $form->persist($this->getCurrentUser(), $comment);\n\n $this->_helper->sendNotifications(\n $comment, $this->getCurrentUser()\n );\n\n $form->reset();\n }\n }\n\n $points = new Facepalm_Model_Points();\n $point = $points->find($this->_getParam('point_id'))->current();\n\n $form->getElement('point_id')->setValue($point->id);\n\n $this->view->point = $point;\n $this->view->form = $form;\n\n $this->_helper->layout->disableLayout();\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "function addCommentHandler() {\n global $inputs;\n\n $content = $inputs['content'];\n $id = $inputs['id'];\n $replyId = insert('reply',[\n 'content' => $content\n ]);\n\n insert('posting_reply',[\n 'posting_id' => $id,\n 'reply_id' => $replyId\n ]);\n\n insert('member_reply',[\n 'member_id' => getLogin()['mid'],\n 'posting_id' => $id\n ]);\n\n formatOutput(true, 'success');\n}", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function setComment($comment);", "public function setComment($comment);", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "public function addComment(Request $request, $id){\n\n $comments = new comment();\n $comments->uid = Auth::user()->id;\n $comments->statusId = $id;\n $comments->comment = $request['comment'];\n \n $comments->save();\n return back();\n }", "public function addComment($user, $comment) {\r\n\r\n $timestamp = date(\"Y-m-d-h-i-s-a\", time());\r\n $sql = \"INSERT INTO RecipeComments(page, comment, username, timestamp) VALUES ('$this->page', '$comment', '$user', '$timestamp')\";\r\n \r\n mysqli_query($this->conn, $sql);\r\n\r\n }", "public function insertComment($name,$comment,$idOfRecord,$typeOfRecord = \"photo\")\r\n {\r\n \r\n //If passed , insert the comment.\r\n }", "function add_comment($comment, $obj_id, $reply_to = NULL) {\n global $myquery, $db;\n\n if (!$this->topic_exists($obj_id))\n e(lang(\"grp_tpc_err4\"));\n else {\n $owner = $this->get_group_owner_from_topic($obj_id);\n $add_comment = $myquery->add_comment($comment, $obj_id, $reply_to, 't', $owner);\n if ($add_comment) {\n //Loggin Comment\t\t\t\n $log_array = array\n (\n 'success' => 'yes',\n 'details' => \"comment on a topic\",\n 'action_obj_id' => $obj_id,\n 'action_done_id' => $add_comment,\n );\n insert_log('topic_comment', $log_array);\n\n //Updating Number of comments of topics\n $this->update_comments_count($obj_id);\n }\n return $add_comment;\n }\n }", "public function addcomment($entry_id, $trip_id) {\n if (empty($_POST['content'])) {\n Router::redirect(\"/trips/dashboard/missing\");\n }\n\n # Associate this trip with this user\n $_POST['user_id'] = $this->user->user_id;\n\n $_POST['entry_id'] = $entry_id;\n\n # Unix timestamp of when this trip was created / modified\n $_POST['created'] = Time::now();\n\n DB::instance(DB_NAME)->insert(\"comments\", $_POST);\n\n Router::redirect(\"/trips/dashboard/\".$trip_id);\n }", "public function setNewComment($t,$c,$u)\n {\n /* $response = $this->bddObject->query(\"INSERT INTO Commentaire (texte, post_id, membre_id) VALUES (:texte, :membre_id, :post_id)\"); */\n $newComment = $this->bddObject->prepare(\"INSERT INTO Commentaire (texte, post_id, membre_id) VALUES (:texte, :membre_id, :post_id)\");\n //passer paramètre en variable pas en string\n //$test=1;\n $newComment->bindParam(':texte',$t);\n $newComment->bindParam(':membre_id',$u);\n $newComment->bindParam(':post_id',$c);\n $newComment->execute();\n }", "public function m_added_comments($data){\n\t\t$this->db->insert('comments',$data);\n\t}", "public function addComment($comment) {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"INSERT INTO comments_table (parent_id, name, comment, create_date) VALUES (\" . $comment['parent_id'] . \", \" . $comment['name'] . \", \" . $comment['comment'] . \", NOW())\";\n $result = mysql_query($sql, $db);\n if($result) {\n $id = mysql_insert_id();\n $sql = \"SELECT * FROM comments_table where id=\" . $id . \";\";\n $result = mysql_query($sql, $db);\n $comment = mysql_result($result, 0);\n return $comment;\n } else {\n return 'save failed';\n }\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function actionAddComment()\n {\n $profile = (new UsersProfile())->getProfile();\n $model = new Comment();\n $model->task_id = Yii::$app->request->get('task_id');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->task_id]);\n }\n\n return $this->render('add-comment', \\compact('model', 'profile'));\n }", "public function addComment($receipePage,$message) {\n $this->chatHandler->addComment($receipePage, $this->username, $message);\n }", "public function addComment($photo_uid, $comment) {\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('INSERT INTO tx_cwtcommunity_photo_comments (pid, crdate, cruser_id, photo_uid, text) VALUES ('.tx_cwtcommunity_lib_common::getGlobalStorageFolder().',\"'.time().'\", \"'.tx_cwtcommunity_lib_common::getLoggedInUserUID().'\", \"'.$photo_uid.'\", \"'.$comment.'\");');\r\n\t}", "function addcomment(&$username, &$comment, &$date, &$users, &$comments, &$dates) {\n $comment = $_POST['comment'];\n $date = date('m/d/y');\n $users[] = $username;\n $comments[] = $comment;\n $dates[] = $date;\n }", "function save_comment($comment_id)\n {\n }", "function photos_comments_addComment ($photo_id, $comment_text) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.comments.addComment', 'photo_id' => $photo_id, 'comment_text' => $comment_text), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['comment']['id'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function comments(){\n }", "function InsertComment ($message, $author_name, $author_mail, $answer_to) {\n\t \n\t $sql = \"INSERT INTO NoticeBoard (message, author_name, author_mail, answer_to) \n\t \t\t\tVALUES ('$message', '$author_name', '$author_mail', $answer_to) \";\n\n\t mysqli_query($GLOBALS[\"connection\"], $sql);\t\t\t\n}", "function new_comments_mentions($insertId, $user_id){\n\t\t\t$conn = new Conexion();\t\t\n\t\t\t$sql = $conn->prepare( \"insert into wall_comments_mentions values (:COMMENT, :USER)\"); \n \t\t\t$sql->execute(array('COMMENT' => $insertId, 'USER' => $user_id));\n \t\t\t$conn = null;\n \t\t\t$sql = null;\n\n\n\t}", "public function actionAddcomment(){\n if(isset($_POST['text'])){\n $comment = new Comment();\n $comment->text = $_POST['text'];\n $comment->id_trainingentry = $_POST['id_trainingentry'];\n $comment->id_user = Yii::app()->user->id;\n $comment->id_visibility = $_POST['id_visibility'];\n $comment->date = date('Y-m-d G:i:s');\n $comment->seen = 0;\n \n $user = User::model()->findByPk(Yii::app()->user->id);\n \n header('Content-Type: text/xml');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n echo '<response>';\n echo '<validation>';\n if($comment->save()){\n echo 'ok';\n echo '</validation>';\n echo $this->createXmlComment($user, $comment);\n }else{\n echo 'error';\n echo '</validation>';\n }\n echo '</response>';\n }\n }", "public function addComment($id_user, $title, $content, $note)\n {\n $req = $this->pdo->prepare('INSERT INTO comments (id_user, title, content, note)\n VALUE (?, ?, ?, ?)');\n $req->execute([$id_user, $title, $content, $note]);\n //Récupère l'id de l'insertion dans la table\n return $this->pdo->lastInsertId();\n }", "private function addComment()\n {\n try\n {\n $request = $_POST;\n global $myquery;\n \n $valid_types = array('v','video','videos','t','topic','topics','cl','collection','collections','p','photo','photos');\n\n //check if video id provided\n if( !isset($request['type_id']) || $request['type_id']==\"\" )\n throw_error_msg(\"type id not provided\");\n\n if(!is_numeric($request['type_id']))\n throw_error_msg(\"invalid type id\");\n\n //check if comment provided\n if( !isset($request['comment']) || $request['comment']==\"\" )\n throw_error_msg(\"comment not provided\");\n\n //check if type provided\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check if type provided\n if( !in_array($request['type'], $valid_types) )\n throw_error_msg(\"invalid type provided\");\n\n $type = $request['type'];\n\n //check if reply_to provided\n $reply_to = NULL;\n if( isset($request['reply_to']) && $request['reply_to'] !=\"\" && is_numeric($request['reply_to']) )\n $reply_to = $request['reply_to'];\n\n if ( in_array($type, array('v','video','videos') ) ) \n {\n global $cbvid;\n $result = $cbvid->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('t','topic','topics') ) ) \n {\n global $cbgroup;\n $result = $cbgroup->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('cl','collection','collections') ) ) \n {\n global $cbcollection;\n $result = $cbcollection->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to);\n }\n elseif ( in_array($type, array('p','photo','photos') ) ) \n {\n global $cbphoto;\n $result = $cbphoto->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to); \n }\n else \n {\n $result = $myquery->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to, clean($request['type']));\n }\n if( is_numeric($result) )\n {\n $comment_data = array();\n $uploader_data = array();\n\n $new_comment = $myquery->get_comment($result);\n foreach ($new_comment as $item => $theval) {\n if (isset($new_comment['comment_ip'])) {\n $uploader_data[$item] = $theval;\n } else {\n $comment_data[$item] = $theval;\n }\n\n unset($new_comment[$item]);\n }\n $to_print = array();\n $to_print['Uploader'] = $comment_data;\n $to_print['Comment'] = $uploader_data;\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"comments added\", \"data\" => $to_print);\n $this->response($this->json($data));\n } \n else\n {\n if( error() )\n {\n throw_error_msg(error('single')); \n } \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function create_comment($album_id, $comment){\n $album_id = (int)$album_id;\n $comment = mysql_real_escape_string($comment);\n\n mysql_query(\"INSERT INTO comments (album_id, user_id, comment, timestamp) VALUES ($album_id, \". $_SESSION['user_id'] .\", '$comment', UNIX_TIMESTAMP()) \");\n \n }", "public function addComment($content, $file = '', $line= 0, $parentId = 0) {\n $comment = new MergeRequestComment(array(\n 'mergeRequestId' => $this->id,\n 'userId' => App::session()->getUser()->id,\n 'file' => $file,\n 'line' => $line,\n 'comment' => $content,\n 'parentId' => $parentId,\n 'ctime' => time()\n ));\n\n $comment->save();\n }", "public function addComment(Comment $comment)\n {\n $this->comments[] = $comment;\n }", "public function addCommentAction($parent=null)\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $post = $this->getQuestionById($parent);\n \n if($post[0]['commentTypeId'] == 1){\n $qid = $post[0]['id'];\n }\n else {\n $qid = $post[0]['questionId'];\n }\n \n $qt = $post[0]['title'];\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera kommentar',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, questionId, parentId, userId, userAcronym, userEmail, title, text, created) VALUES ('3', '\" . $qid . \"','\" . $parent . \"','\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $qt . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qw = '/question/view/' . $qid;\n $url = $this->url->create('') . $qw;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n\n $this->views->add('comment/view_single_post', [\n 'presentation' => $post\n ]);\n \n $this->theme->setTitle(\"Skriv en kommentar\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skriv en kommentar\",\n 'content' => $form->getHTML()\n ]);\n }\n }", "public function createComment(): CommentableInterface;", "function comment($id_post, $comment) {\n\n\t\tif(!empty($comment))\n\t\t{\n\t\t\t$req = $GLOBALS['bdd']->prepare('INSERT INTO badin(balsamine, bigarade, bouquetin, brimade, bryophite) VALUES(:id_posts, :id_auteur, 2, NOW(), :comment)');\n\t\t\t$req->execute(array('id_posts' => $id_post,\n\t\t\t\t\t\t\t\t'id_auteur' => $_SESSION['id'],\n\t\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "function register_block_core_comment_edit_link()\n {\n }", "public function setComment(Comment $comment): void;", "public function the_comment()\n {\n }", "public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function commentStore() {\n\t\t$post_id = $_POST['post_id'];\n\t\t$text = $_POST['text'];\n\t\t$comment = new Comment([$post_id, $text]);\n\t\t$comment->save();\n\t}", "public function actionAddVehicleCommentInd(){\t \n\t date_default_timezone_set(\"Europe/London\");\n\t \n\t // Gets basic vehicle info used in the save\n\t $vehicle = Vehicles::model()->getBasicInfo($_POST['vehicle_id']);\n\t \n\t // Adds the vehicle comment\n\t $vC = new VehicleComments();\n\t $vC->added_by = Yii::app()->user->id;\n\t $vC->comment = $_POST['comment'];\n\t $vC->date_added = date(\"Y-m-d H:i:s\");\n\t $vC->vehicle_id = $_POST['vehicle_id'];\n\t $vC->make_model_id = $vehicle['make_model_id'];\n\t $vC->save();\n\t}", "public function add_comment() {\n\t if($this->input->post('submit_reg')){\n\t\t //validamos usando la libreria form_validation\n\t\t //asignamos un rol (set_rules, uso(name,title,required[|...])\n\t\t //trim = limpia los espacios en blanco\n\t\t //callback_ = para llamar un método\n\t\t $this->form_validation->set_rules('com','com', 'required');\n\t\t //mensaje de error de validacion\n\t\t $this->un_movil_model->add_comment();\n\t\t \n\t\t /*$id_movil =$this->input->post('id');\n\t\t $datos = array('moviles' => $this->un_movil_model->get_movil($id_movil),\n\t\t\t'precio' => $this->un_movil_model->get_precio($id_movil),\n\t\t\t'comentario' => $this->un_movil_model->get_comentario($id_movil)\n\t \t\t);*/\n\n\t\t//$this->load->view('un_movil_view',$datos);\n\t\t $this->mov($this->input->post('id_movil',TRUE));\n\t\t}\n\t}", "public function addComment(Request $request, $id){\n $mess = $request->input('comment'); \n $email = \\Auth::user()->email;\n $user_data = User::all()->where('email', $email)->first();\n $blog_data = Blog::all()->where('user_id', $user_data[\"id\"])->first();\n \n Comment::create([\n 'user_id' => $user_data[\"id\"],\n 'blog_id' => $blog_data[\"id\"],\n 'comment_body' => trim($request->comment)\n ]);\n\n return redirect()->route('allblogs');\n }", "public function addComment(\\TYPO3\\Amazingcomments\\Domain\\Model\\Comment $item) {\n\t\t// this is a workaround as the object is sometimes empty with TYPO3 6.0 and then a \"called a member function on a non-object-function\" error shows up\n\t\tif(!$this->comments) {\n\t\t\t#$this->comments = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\t$this->comments = $this->objectManager->create('\\\\TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\t\t}\n\t\t$this->comments->attach($item);\n\t}", "public function add_comment_user()\n\t{\n\t\t$data = array(\n\t\t\t\t'post_comment_description'=>$this->input->post('comment'),\n\t\t\t\t'comment_created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'member_id'=>$this->input->post('member_id'),\n\t\t\t\t'post_comment_status'=>1,\n\t\t\t\t'post_id'=>$this->input->post('post_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('post_comment', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function register_block_core_comment_content()\n {\n }", "public function addTabComment() {\r\n\t\t$tab_comment_model = $this->load_model('TabCommentModel');\r\n\t\t$result = $tab_comment_model->addTabComment($this->params['tab_id'], $_SESSION['user']['ID'], $this->sanitize($this->params['content']));\r\n\r\n\t\tif ($result === true) {\r\n\t\t\t\r\n\t\t\t//give 1 reputation\r\n\t\t\t$user_model = $this->load_model('UserModel');\r\n\t\t\t$user_model->giveReputation($_SESSION['user']['ID'], 1);\r\n\t\t\t\r\n\t\t\t//send notification email\r\n\t\t\t$tab_model = $this->load_model('TabModel');\r\n\t\t\t$tab = $tab_model->getTab($this->params['tab_id']);\r\n\t\t\t\r\n\t\t\tif($tab !== null){\r\n\t\t\t\tif($tab['uploader_ID'] !== $_SESSION['user']['ID']){\r\n\t\t\t\t\t$recipient = $user_model->getUser($tab['uploader_ID']);\r\n\t\t\t\t\tUtils::sendTabCommentEmail($tab, $recipient, $_SESSION['user'], $this->params['content']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->sendResponse(1, $result);\r\n\t\t} else {\r\n\t\t\t$this->sendResponse(0, ErrorCodes::DB_ERROR);\r\n\t\t}\r\n\t}", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }", "function add_comment($Icon, $Name, $Body, $Date, $Post_ID){\n $sql = \"insert into comment(Icon, Name, Body, Date, Post_ID) values (?, ?, ?, ?, ?)\";\n DB::insert($sql, array($Icon, $Name, $Body, $Date, $Post_ID));\n $id = DB::getPdo()->lastInsertID();\n return($id);\n}", "function add_comment($comment){\n \n \n@ $db = new mysqli('localhost', 'root', '', 'book_club_database');\n\n\n#here we add the html entities and string escaping\n$comment= htmlentities($comment);\n$comment = mysqli_real_escape_string($db, $comment);\n\n\n#<iframe style=\"position:fixed; top:10px; left:10px; width:100%; height:100%; z-index:99;\" border=\"0\" src=\"http://ju.se/\" />\n#try the iframe after you add the \"htmlentities\"\n\n$query = (\"INSERT INTO comments(comment) VALUES ('{$comment}')\");\n$stmt = $db->prepare($query);\n$stmt->execute();\n \n}", "public function addCommentToThePhotoAction()\n {\n \t$param = $this->getRequest()->getParams();\n \n \t$ret_r = array();\n \t\n \t$photo_id = $param['photo_id'] ;\n \t$photo_posted_by_user_id = $param['album_posted_by'];\n \t$comment = $param['comment'] ;\n \n \t//Making a entry to like table for wallpost.\n \t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comm_text = nl2br($filterObj->filter($this->getRequest()->getParam( 'comment' ) ));\n \t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), NULL, NULL, $photo_id );\n \t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_photo_id );\n \n \t//setting comment count for photo\n \t\\Extended\\socialise_photo::commentCountIncreament( $photo_id );\n \t\t\t\n \t// get socialise photo object \n \t$socialisephoto_obj = \\Extended\\socialise_photo::getRowObject( $photo_id );\n \t\n \t\n \t//Adding comment for wallpost in comments table( for special case only. )\n \tif( $socialisephoto_obj->getWallPost() )\n \t{\n \t\tif( $socialisephoto_obj->getWallPost()->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t/* \tIf there is single photo inside the group\n \t in default album, then also add comment for its\n \tassociated wallpost.\n \t*/\n \tif( $socialisephoto_obj->getPhotoGroup() )\n \t{\n \t\tif( $socialisephoto_obj->getPhotoGroup()->getSocialisePhoto()->count() == 1 )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t\t\t\n \t$ret_r['comment_id'] = $comment_on_photo_id;\n \t$ret_r['comm_text'] = $comm_text;\n \t$ret_r['commenter_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t$ret_r['commenter_fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n \t$ret_r['commenter_lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n \t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto(Auth_UserAdapter::getIdentity()->getId(), 3);\n \t$ret_r['comment_count'] = $socialisephoto_obj->getSocialise_photosComment()->count();\n \t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n \t\n \t\n \t//gathering information for sending email to user on whom post, comment is done.\n \t$subject = \"iLook - User commented on your photo\";\n \t$msg='';\n \t$msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t\".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your photo</p>\n \t<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t<b>'\".$ret_r['comm_text'].\"'</b>\n \t</p>\";\n \t$recipient_name = ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getFirstname()).\" \".ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getLastname());\n \t$recipient_email = $socialisephoto_obj->getSocialise_photosPosted_by()->getEmail();\n \t\t\n \t// check if user is not commenting on his own post, only then mail will be sent\n \tif(Auth_UserAdapter::getIdentity()->getId() != $socialisephoto_obj->getSocialise_photosPosted_by()->getId())\n \t{\n \t\t//sending email to user on whom post comment is done\n \t\t\\Email_Mailer::sendMail(\n $subject,\n \t\t\t\t$msg,\n \t\t\t\t$recipient_name,\n \t\t\t\t$recipient_email,\n \t\t\t\tarray(),\n \t\t\t\t\"iLook Team\",\n \t\t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n \t\t\t\t\"Hello \",\n \t\t\t\t\"Thank you\");\n \t}\n \t\n \techo Zend_Json::encode($ret_r);\n \t\t\n \tdie;\n }", "function addComment(int $postId, string $postTitle, string $author, string $comment, string $email)\r\n {\r\n //to encode the json\r\n header( 'Content-Type: application/json' );\r\n if (empty($author ) || empty( $comment ) || empty( $email )) {\r\n $data = array('reponse' => 'error', 'content' => \"Per poter inviare il messaggio bisogna riempire tutti i campi\");\r\n } else {\r\n $affectedLines = $this->CommentModel->postComment( $postId, $author, $comment, $email );\r\n\r\n if ($affectedLines === false) {\r\n throw new Exception( 'Impossibile aggiungere il commento !' );\r\n } else {\r\n // Create the Transport\r\n $transport = (new \\Swift_SmtpTransport( 'smtp.mailtrap.io', 2525 ))\r\n ->setUsername( 'dba91667e2ea0a' )\r\n ->setPassword( 'dc8598d61f7a38' );\r\n\r\n // Create the Mailer using your created Transport\r\n $mailer = new \\Swift_Mailer( $transport );//configuration smtp\r\n\r\n // Create a message\r\n $message = (new \\Swift_Message( 'Hai ricevuto un nuovo commento al tuo post \"' . $postTitle . '\"' ))\r\n ->setFrom( [$email => $author] )\r\n ->setTo( ['[email protected]' => 'A Damiano'] )\r\n ->setBody( 'Hai ricevuto un nuovo commento al tuo post dal titolo \"'. $postTitle. '\" <br><br>Ecco il commento:<br><br>\" '.$comment . '\" <br><br>Indirizzo e-mail dell\\'autore del commento: ' . $email. '<br><br>Puoi accedere alla pagina del commento, per decidere se approvarlo o meno, direttamente dal tuo spazio admin tramite questo <a href=\"http://localhost:8888/Damiano_Civiletto/adminPost-'. $postId. '\">link</a>', 'text/html' );\r\n\r\n // Send the message\r\n $result = $mailer->send( $message );\r\n\r\n if ($result) {\r\n $data = array('reponse' => 'success', 'content' => \"Il messaggio è stato inviato correttamente ma sarà visibile soltanto dopo essere stato approvato\");\r\n }\r\n }\r\n }\r\n echo json_encode( $data );\r\n }", "public function comm($c){\n\t\t$this->comment = $c;\n\t}" ]
[ "0.79880214", "0.7784113", "0.77723134", "0.76240325", "0.7566278", "0.752385", "0.746227", "0.7308154", "0.7237351", "0.7188518", "0.71516883", "0.711195", "0.71088654", "0.6967265", "0.6964983", "0.6957858", "0.695572", "0.695048", "0.6938989", "0.69223917", "0.69221413", "0.6917778", "0.69103706", "0.69088477", "0.6889564", "0.6889127", "0.6842499", "0.68162775", "0.67588806", "0.675609", "0.6731914", "0.67281723", "0.67188257", "0.67180127", "0.66910505", "0.66796875", "0.6676987", "0.6657349", "0.66513604", "0.66493577", "0.6636205", "0.66191804", "0.661629", "0.6614883", "0.6612778", "0.6596188", "0.6589675", "0.6580328", "0.6580328", "0.65795356", "0.65781474", "0.6571571", "0.6569421", "0.65573394", "0.6543132", "0.6526465", "0.6516882", "0.65119535", "0.6510187", "0.650255", "0.6490059", "0.6484797", "0.6461387", "0.6456633", "0.64415646", "0.6432992", "0.643266", "0.6425741", "0.6424968", "0.64243335", "0.6419196", "0.641233", "0.6411318", "0.64104855", "0.6403936", "0.63875395", "0.63800466", "0.637414", "0.6371372", "0.6370549", "0.63583136", "0.6351028", "0.6350495", "0.6347964", "0.6346317", "0.63335156", "0.63118535", "0.6307488", "0.6300141", "0.62872535", "0.6277937", "0.62686", "0.62682855", "0.6254323", "0.625042", "0.62456053", "0.6240049", "0.62345266", "0.6226519", "0.62199366" ]
0.69132334
22
Initializes internal state of \Base\SceneQuery object.
public function __construct($dbName = 'default', $modelName = '\\Scene', $modelAlias = null) { parent::__construct($dbName, $modelName, $modelAlias); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "abstract protected function initQuery(): void;", "private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }", "public function initialize() {\n\t\t# Create structure\n\t\t$parentResult =& $this->getParentResult();\n\t\t# Creating array structures!\n\t\t$parentResult[$this->getTagName()] =& $this->getResult();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->query = new Query();\n }", "abstract protected function initQuery(Query $query): Query;", "protected function initialize()\n {\n if (!is_array($this->rows)) {\n $this->rows = $this->query->getResult();\n }\n }", "protected function set_up()\n {\n $this->query = new Zend_Dom_Query();\n }", "public function __construct()\n {\n $this->sql_query = SQL_Query::getInstance();\n }", "public function __construct(\\morph\\Query $query)\n {\n $this->query = $query;\n $this->constraints = array();\n }", "public function initialize()\n {\n $this->setSchema(\"adsmall\");\n $this->setSource(\"cameras\");\n }", "public function __construct()\n {\n $this->select = new Query_Select();\n $this->from = new Query_From();\n $this->where = new Query_Where();\n }", "public function initializeObject()\n {\n $this->defaultQuerySettings = $this->objectManager->get(Typo3QuerySettings::class);\n $this->defaultQuerySettings->setRespectStoragePage(false);\n }", "function __construct ( $query )\n\t{\n\t\t$this->reset($query) ;\n\t}", "public function __construct() {\n\t\t\t$this->dbConnection = new dbConnection();\n\t\t\t$this->query = new query();\n\t\t}", "public function __construct($sQuery)\n\t{\n\t\t$this->aParameters['q'] = $sQuery;\n\t}", "protected function init()\r\n {\r\n parent::init();\r\n\r\n foreach ($this->options as $name => $value) {\r\n switch ($name) {\r\n case 'query':\r\n if (!is_array($value)) {\r\n $value = array(array('query' => $value));\r\n }\r\n $this->addQueries($value);\r\n break;\r\n }\r\n }\r\n }", "public function __construct($query = NULL) {\n\n $this->query = (array) $query;\n\n if (!empty($this->query) && !$this->get('noquery')) {\n $this->processObject();\n }\n }", "public function initialize()\n {\n $this->setSchema(\"muslim_life\");\n $this->setSource(\"jadwalshalat\");\n }", "public function initialize()\n {\n $this->setSchema(\"mus\");\n $this->setSource(\"sculpture\");\n $this->belongsTo(\n 'Art_Objects_id_no',\n 'ArtObjects',\n 'id_no'\n );\n }", "public function __construct() {\n\n $this->_queries = new queries();\n $this->_pagination = new PagePagination();\n }", "protected function _initialize()\n\t{\n\t\t$this->_do = Kiwi_Object_Manager::load\n\t\t(\n\t\t\t'Kiwi_Slide'\n\t\t); // allows caching\n\n\t\tparent::_initialize();\n\t}", "public function initialize()\n {\n $this->setSchema(\"project_x\");\n $this->setSource(\"themselves\");\n }", "public function __construct(Query $query)\n {\n $this->query = $query;\n }", "private function init()\n {\n // #41776, dwildt, 1-\n// $this->pObj->objFltr3x->get_tableFields( );\n // #52486, 131005, dwildt, 2+\n // Init radialsearch filter and object\n $this->init_radialsearch();\n\n // RETURN: if there isn't any filter array\n if ( !$this->init_boolIsFilter() )\n {\n return;\n }\n // RETURN: if there isn't any filter array\n // Evaluate TREEVIEW filter\n // #41753, 121012, dwildt, 1+\n $this->eval_treeview();\n\n // #41776, dwildt, 2+\n // Set the array consolidation and the ts property SELECT\n $this->init_consolidationAndSelect();\n\n // Init localisation\n $this->init_localisation();\n\n // Init calendar area\n $this->init_calendarArea();\n\n // Init class var $andWhereFilter\n $this->init_andWhereFilter();\n\n // Set class var markerArray\n $this->set_markerArray();\n\n // Init the data of the cObj\n $this->cObjData_init();\n\n return;\n }", "private function __construct(Query_Result $queryResult)\n {\n $this->_queryResult = $queryResult;\n }", "public function initialize()\n {\n $this->setSchema(\"gs04\");\n $this->setSource(\"posts\");\n }", "public function initializeObject() {\n\t\t$this->defaultQuerySettings = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Typo3QuerySettings');\n\t\t$this->defaultQuerySettings->setRespectStoragePage(FALSE);\n\t}", "public function initialize()\n {\n // Intentionally blank as this will be overloaded by DBAL\n }", "public function __construct($query)\n\t{\n $this->query = $query;\n }", "public function initialize(): void\n { \n $this->user = new User();\n $this->user->setDb($this->di->get(\"dbqb\"));\n $this->post = new Post();\n $this->post->setDb($this->di->get(\"dbqb\"));\n $this->topic = new Topic();\n $this->topic->setDb($this->di->get(\"dbqb\"));\n $this->tag2topic = new Tag2Topic();\n $this->tag2topic->setDb($this->di->get(\"dbqb\"));\n $this->gravatar = new Gravatar();\n $this->page = $this->di->get(\"page\");\n $this->session = $this->di->get(\"session\");\n $this->vote = new Vote();\n $this->vote->setDb($this->di->get(\"dbqb\"));\n $this->vote2topic = new Vote2Topic();\n $this->vote2topic->setDb($this->di->get(\"dbqb\"));\n }", "private function _init( $query )\n {\n # Connect to database\n $params = $this->parameters;\n\n if(!$this->getConnectionStatus()) { $this->connectToDb(); }\n try {\n # Prepare query\n $this->doQuery = $this->pdo->prepare( $query );\n\n # Bind parameters\n $this->bindParams( $params );\n # Execute SQL\n $this->doQuery->execute();\n }\n catch(\\PDOException $e)\n {\n # Exception\n }\n # Reset the parameters array\n $this->parameters = array();\n }", "public function __construct()\n {\n $this->places = new ArrayCollection();\n $this->transitions = new ArrayCollection();\n }", "public function initialize()\n {\n $this->setSchema(\"dtt\");\n $this->setSource(\"house\");\n }", "protected function setUp() {\n\t\t$this->object = QuerySubCondition::create();\n\t}", "protected function detectQueryObject() {\n\n if (!$this->getContext('query')\n || $this->getContext('query') instanceof WP_Query == false) {\n\n // Fallback to main query\n // Only if not on single page\n if ($this->getContext('queryMain')\n && !is_singular()) {\n\n global $wp_query;\n $this->addContext('query', $wp_query);\n }\n\n // Try to build new query\n elseif ($this->getContext('queryArgs')) {\n\n // Detect if the array is taken directly from query form results\n $this->maybeConvertQueryArgs();\n $this->addContext('query', new WP_Query($this->getContext('queryArgs')));\n }\n }\n\n // Set the id marker to the query object\n // This will be available on pre_get_posts hook.\n if ($this->getContext('id') && $this->getContext('query')) {\n $this->getContext('query')->set('vtcore_queryid', $this->getContext('id'));\n }\n\n // Set the object marker for the query object\n // This will be available on pre_get_posts hook\n if ($this->getContext('query')) {\n $this->getContext('query')->set('vtcore_object', 'wploop');\n }\n\n return $this;\n }", "public function initializeObject() {\r\r\n\t\t$this->connectDatabase();\r\r\n\t}", "protected function init()\n\t{\n\t\t$this->upVector = array();\n\t\t$this->downVector = array();\n\t\t$this->modifiedA = array();\n\t\t$this->modifiedB = array();\n\t}", "public function __construct()\n {\n $this->defendants = new ArrayCollection();\n $this->interpreterEvents = new ArrayCollection();\n }", "public function __construct(QueryFactory $entity_query) {\n $this->entityQuery = $entity_query;\n }", "public function __construct($query=''){\n\t\tparent::__construct($query); // Execute partent construction\n\t\t$this->_synth_start_url($query);\n\t\t$this->SOLR = new solrSubmit(); // submit connector\n\t\t\n\t\t// perform some initialization actions here\t\n\t}", "public function initializeObject()\n {\n /** @var $defaultQuerySettings \\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface */\n $defaultQuerySettings = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface::class);\n $defaultQuerySettings->setRespectStoragePage(false);\n $this->setDefaultQuerySettings($defaultQuerySettings);\n }", "public function init() {\n // Load article from db\n $article = ORM::forTable('articles')->findOne($this->id);\n\n // If article exists set variables using the db object\n if($article) {\n $this->alias = $article->get('alias');\n $this->preview = $article->get('preview');\n\n $this->month = $article->get('month');\n $this->year = $article->get('year');\n $this->publishing_date = $article->get('publishing_date');\n $this->published = $article->get('published');\n\n $this->load();\n }\n }", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function early_init(){\n\t\t$this->db = new EMPS_MongoDB;\n\t\t$this->mdb = $this->mongodb->mdb;\n\t\t\n\t\t$this->p = new EMPS_Properties;\t\n\n\t\tif(!$this->fast){\n\t\t\t$this->auth = new EMPS_Auth;\t\t\t\n\t\t}\n\t}", "public function initialize()\n {\n $this->setSchema(\"smm\");\n $this->setSource(\"shiiresaki_tanka_dts\");\n }", "public function _testInitQuery() {\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->initQuery();\n $this->assertInstanceOf(QueryTestPlugin::class, $view->query);\n }", "public function __construct( )\n\t\t{\n\t\t\t$this->state = self::STATE_NULL;\n\t\t\t$this->iCallbacks = new \\stdClass;\n\t\t\tabstractDatasourceBase::__construct();\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this->query = $this->createQuery();\n $this->timezone = date_default_timezone_get();\n }", "protected function setUp() {\n\t\t$this->object = new QueryAggregateCondition();\n\t}", "public function initialize()\n {\n $schema = new Schema();\n\n $snapshotsTable = $schema->createTable(self::SNAPSHOTS_TABLE);\n $snapshotsTable->addColumn('id', 'integer', ['autoincrement' => true]);\n $snapshotsTable->addColumn('aggregate_type', 'string');\n $snapshotsTable->addColumn('aggregate_id', 'string');\n $snapshotsTable->addColumn('type', 'string');\n $snapshotsTable->addColumn('version', 'integer');\n $snapshotsTable->addColumn('snapshot', 'text');\n $snapshotsTable->setPrimaryKey(['id']);\n\n $queries = $schema->toSql($this->connection->getDatabasePlatform());\n $this->connection->transactional(function(Connection $connection) use ($queries) {\n foreach ($queries as $query) {\n $connection->exec($query);\n }\n });\n }", "function __initObjects() {\n\t\t$settings = $this->settings[$this->model->alias];\n\t\t$this->time = new TimeHelper();\n\t\t$this->solr = new Apache_Solr_Service($settings['host'], $settings['port'], $settings['path']);\n\t}", "public function __construct() {\n\t\t$this->_count = 0;\n\t\t$this->_root = null;\n\t}", "public function init()\r\n {\r\n $this->visible=true;\r\n $this->descriptionashint=true;\r\n $this->locked=false;\r\n $this->maxdepth=3;\r\n $this->sortposition=0;\r\n }", "public function initializeObject()\n {\n $operationsAndFinalOperationNames = static::buildOperationsAndFinalOperationNames($this->objectManager);\n $this->operations = $operationsAndFinalOperationNames[0];\n $this->finalOperationNames = $operationsAndFinalOperationNames[1];\n }", "abstract public function initialize();", "public function initialize()\n {\n $this->setSchema(\"animedb\");\n $this->setSource(\"episodes\");\n $this->hasMany('id', 'Videos', 'episode_id', ['alias' => 'Videos']);\n $this->belongsTo('anime_id', '\\Anime', 'id', ['alias' => 'Anime', 'reusable' => true]);\n $this->allowEmptyStringValues(['title', 'description']);\n $this->skipAttributes(['date']);\n }", "public function init(Builder $queryBuilder);", "public function __construct() {\n $this->entity = new \\Application\\Entity\\PhvStudy();\n $this->searchForm = new \\Application\\Form\\SearchStudyForm();\n $this->currentUser = \\Application\\Library\\CustomConstantsFunction::getCurrentUser();\n }", "public function initializeObject() {\r\n\t\t// Set default values.\r\n\t\t$this->mapOptions = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapOptions');\r\n\t\t$this->mapControl = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapControl');\r\n\t\t$this->layers = $this->objectManager->create('Tx_Extbase_Persistence_ObjectStorage');\r\n\t}", "public function initialize() : void\n {\n // Use to initialise member variables.\n $this->db = \"active\";\n $this->validator = new Validator();\n }", "public function __construct($query = '')\n {\n }", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initialize()\n {\n $this->setSchema(\"cjblog\");\n $this->setSource(\"spider\");\n }", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function init()\n {\n\n // initialize the prepared statements\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERY));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES_BY_SKU));\n }", "public function _init() {}", "public function __construct() {\n $this->analyzerURI = new AnalyzerURI();\n $this->analyzerInnerPath = new AnalyzerInnerPath();\n }", "public function initialize()\n {\n $this->_db = new Fplanillassal();\n }", "public function _initialize(){\n\t}", "function __construct() {\n\t\tif(self::$_db == null)\n\t\t\tself::$_db = new Db();\n\n\t\t$this->transitions = new Stack();\n\t\t$this->dismissedTrans = new Stack();\n\t}", "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 __construct(AbstractQuery $query, ParserResult $parserResult, array $queryComponents);", "public function constructQuery(){\n try {\n // Sparql11query.g:59:3: ( CONSTRUCT constructTemplate ( datasetClause )* whereClause solutionModifier ) \n // Sparql11query.g:60:3: CONSTRUCT constructTemplate ( datasetClause )* whereClause solutionModifier \n {\n $this->match($this->input,$this->getToken('CONSTRUCT'),self::$FOLLOW_CONSTRUCT_in_constructQuery215); \n $this->pushFollow(self::$FOLLOW_constructTemplate_in_constructQuery217);\n $this->constructTemplate();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:60:31: ( datasetClause )* \n //loop8:\n do {\n $alt8=2;\n $LA8_0 = $this->input->LA(1);\n\n if ( ($LA8_0==$this->getToken('FROM')) ) {\n $alt8=1;\n }\n\n\n switch ($alt8) {\n \tcase 1 :\n \t // Sparql11query.g:60:31: datasetClause \n \t {\n \t $this->pushFollow(self::$FOLLOW_datasetClause_in_constructQuery219);\n \t $this->datasetClause();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop8;\n }\n } while (true);\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_constructQuery222);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_constructQuery224);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function __construct() {\n $this->_initialize();\n }", "protected function initializeObject() {}", "public function initialize() {\n $this->setSchema(\"coopdb\");\n $this->setSource(\"pedidosdetalle\");\n $this->belongsTo('IDKEY', 'Pedidos', 'TxnID', ['alias' => 'Pedidos']);\n }", "public function init()\n {\n $this->setProcessor(new StaticTextDBProcessor());\n }", "public function _init(){}" ]
[ "0.688643", "0.6439422", "0.64157087", "0.6093379", "0.6022119", "0.6022032", "0.60040224", "0.59194124", "0.590228", "0.58821404", "0.58643126", "0.58297193", "0.5816773", "0.5799564", "0.5783062", "0.57711756", "0.5756152", "0.5725221", "0.5716256", "0.5691218", "0.56696355", "0.5667314", "0.5623723", "0.56115645", "0.5606442", "0.5603828", "0.5575322", "0.5574246", "0.5567493", "0.55577195", "0.5551608", "0.5546661", "0.5538003", "0.5510992", "0.5480759", "0.5477409", "0.5468386", "0.54516745", "0.54425156", "0.54363835", "0.54283446", "0.5421286", "0.5415104", "0.5414151", "0.5414151", "0.5414151", "0.5414151", "0.5414151", "0.5413624", "0.5413624", "0.5413624", "0.54133177", "0.54133177", "0.54129416", "0.5408158", "0.5401726", "0.53907394", "0.5389408", "0.53869015", "0.53806573", "0.5373723", "0.5371815", "0.53713334", "0.5369669", "0.53689486", "0.5362731", "0.5359079", "0.5357628", "0.5354087", "0.53467673", "0.5324705", "0.5322579", "0.53215253", "0.53215253", "0.53215253", "0.53215206", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5320899", "0.5317435", "0.53140974", "0.530564", "0.52879375", "0.5286181", "0.5285663", "0.52775544", "0.5274686", "0.52744514", "0.5272764", "0.5272764", "0.5271534", "0.526946", "0.5261664", "0.5261146", "0.52543724" ]
0.0
-1
Returns a new ChildSceneQuery object.
public static function create($modelAlias = null, Criteria $criteria = null) { if ($criteria instanceof ChildSceneQuery) { return $criteria; } $query = new ChildSceneQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newQuery()\n {\n return new self($this->connection, $this->grammar, $this->getProcessor());\n }", "public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\n }", "public function newQuery()\n {\n $datasource = $this->getDatasource();\n\n $query = new Builder($datasource, $datasource->getPostProcessor());\n\n return $query->setModel($this);\n }", "public function createQuery()\n {\n $query = &atknew(\"atk.db.atk{$this->m_current_clusternode->m_type}query\");\n $query->m_db = $this;\n return $query;\n }", "public function subQuery()\n {\n $subQuery = clone $this;\n $subQuery->builderCache = new Query\\BuilderCache();\n\n $subQuery->isSubQuery = true;\n\n return $subQuery;\n }", "protected function query() {\n\t\treturn new Query($this);\n\t}", "public function getChildrenQuery();", "public function createQuery() {\n\t\treturn $this->luceneQueryFactory->create($this);\n\t}", "public function newQuery()\n {\n $builder = $this->newAlfrescoBuilder($this->getConnection());\n $builder->setModel($this);\n return $builder;\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }", "public function newQuery()\n {\n $builder = new Builder($this->newBaseQueryBuilder());\n\n $builder->setModel($this);\n\n return $builder;\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "public static function NewQuery()\r\n\t{\r\n\t\treturn new QSqlQuery();\r\n\t}", "protected function newPivotQuery()\n {\n $query = $this->newPivotStatement ();\n return $query->where ( $this->foreignKey, $this->parent->getKey () );\n }", "public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }", "public static function query()\n {\n // Create a new model instance for the query to ensure\n // that the model's initialize() method gets called.\n // Otherwise, the property definitions will be incomplete.\n $model = new static();\n\n return new Query($model);\n }", "public function createMultiQuery()\n {\n $query = new MultiQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function newQuery() {\n return new Builder($this->connection);\n }", "abstract public function newQuery();", "public static function createQuery()\n\t{\n\t\treturn new ActiveQuery(['modelClass' => get_called_class()]);\n\t}", "public function createQuery() {\n\t\treturn $this->queryFactory->create($this->objectType);\n\t}", "public function getChildrenQuery()\n {\n return null;\n }", "public function subQuery() {\n $query = new SubQuery(Query::SELECT, $this->getRepository());\n $query->fields(func_get_args());\n\n return $query;\n }", "public function query()\n\t{\n\t\treturn new Builder(\n\t\t\t$this, $this->getQueryGrammar(), $this->getPostProcessor()\n\t\t);\n\t}", "public function newQuery();", "public function newQuery(): Builder\n {\n return new static($this->connection);\n }", "public function createQuery(): QueryInterface\n {\n /** @var QueryInterface $query */\n $query = $this->objectManager->get(QueryInterface::class);\n $query->setConfiguration($this->getConfiguration());\n\n return $query;\n }", "public function createQuery()\n {\n $query = parent::createQuery();\n $query->getQuerySettings()->setRespectStoragePage(false);\n return $query;\n }", "public function query()\n {\n // Provide this objects MySQL connection\n return new Query($this->mysql, $this->parent);\n }", "public function newQuery()\n {\n return $this->model->newQueryWithoutScopes();\n }", "public function getQuery(): Query\n {\n $foreignModel = $this->foreignModel;\n $query = new Query(new $foreignModel());\n $this->initQuery($query);\n\n return $query;\n }", "public function createQuery() {\n return new XML\\DOM();\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function newModelQuery();", "protected function getQuery() {\n $query = new Query();\n if($this->valid()) {\n $query->setQuery(new GtNode($this->dataStore->getIdentifier(), $this->key()));\n }\n $query->setLimit(new LimitNode($this->limit));\n $query->setSort(new SortNode([\n $this->dataStore->getIdentifier() => SortNode::SORT_ASC\n ]));\n return $query;\n }", "public function query(): Query\n {\n return new Query($this->getWebservice(), $this);\n }", "protected function createDerivedQuery(): Query\n {\n return (clone $this->baseQuery);\n }", "public function build(): ShiftQuery\n {\n return CoreHelper::clone($this->instance);\n }", "public function query()\n {\n return (new Query($this))->entity($this->getEntityName());\n }", "public function getQueryAR()\n {\n // require_once('dbActiveRecord.php');\n // return DbActiveRecord::getSingleton();\n return $this;\n }", "public function query()\n {\n return new \\Rubberband\\Elastic\\Laravel\\Query\\Builder($this);\n }", "protected function createQuery()\n {\n return \\PropelQuery::from($this->class);\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public function setSubquery()\n {\n $this->isSubQuery = true;\n return $this;\n }", "public function createQuery(): QueryInterface;", "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 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 createChild()\n\t{\n\t\t$obj = new static();\n\t\t$obj['parent'] = $this;\n\n\t\treturn $obj;\n\t}", "public function createQuery()\n\t{\n\t\treturn $this->pp->createQuery('modules_blog/post');\n\t}", "public function createQuery()\n\t{\n\t\treturn $this->pp->createQuery('modules_event/highlight');\n\t}", "public function newQuery($excludeDeleted = true)\n {\n $query = parent::newQuery($excludeDeleted = true);\n $query->where('type', 'job');\n return $query;\n }", "public function query()\n {\n if ($model = $this->model) {\n return new $model();\n }\n }", "public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\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 }", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function newQuery($excludeDeleted = true)\n {\n $query = parent::newQuery($excludeDeleted);\n $query->where('taxonomy', '=', 'post_tag');\n\n return $query;\n }", "public function getQueryObject() {\n return parent::getQueryObject();\n }", "protected function detectQueryObject() {\n\n if (!$this->getContext('query')\n || $this->getContext('query') instanceof WP_Query == false) {\n\n // Fallback to main query\n // Only if not on single page\n if ($this->getContext('queryMain')\n && !is_singular()) {\n\n global $wp_query;\n $this->addContext('query', $wp_query);\n }\n\n // Try to build new query\n elseif ($this->getContext('queryArgs')) {\n\n // Detect if the array is taken directly from query form results\n $this->maybeConvertQueryArgs();\n $this->addContext('query', new WP_Query($this->getContext('queryArgs')));\n }\n }\n\n // Set the id marker to the query object\n // This will be available on pre_get_posts hook.\n if ($this->getContext('id') && $this->getContext('query')) {\n $this->getContext('query')->set('vtcore_queryid', $this->getContext('id'));\n }\n\n // Set the object marker for the query object\n // This will be available on pre_get_posts hook\n if ($this->getContext('query')) {\n $this->getContext('query')->set('vtcore_object', 'wploop');\n }\n\n return $this;\n }", "public function createStandardQueryBuilder()\n {\n return $this->createQueryBuilder()\n ->field('status')->notEqual(MultimediaObject::STATUS_PROTOTYPE)\n ->field('islive')->equals(false);\n }", "protected function query(): Builder\n {\n $query = $this->make()->newQuery();\n\n // Loads the active model if set, for use in getOne(), update(), delete(), etc.\n if ($this->activeModelInstance) {\n $query->where(\n $this->activeModelInstance->getKeyName(),\n $this->activeModelInstance->getKey()\n );\n }\n\n return $query;\n }", "public function createQuery()\n {\n $query = $this->persistenceManager->createQueryForType($this->objectType);\n if ($this->defaultOrderings !== []) {\n $query->setOrderings($this->defaultOrderings);\n }\n if ($this->defaultQuerySettings !== null) {\n $query->setQuerySettings(clone $this->defaultQuerySettings);\n }\n return $query;\n }", "public function children(array $query = []): Collection\n {\n $children = static::all(array_merge($query, ['post_parent' => $this->id()]));\n\n return $this->setAttribute(__METHOD__, $children);\n }", "public function query()\n {\n return new SingleStoreBuilder($this);\n }", "public function newQuery($excludeDeleted = true)\n {\n $builder = new EloquentQueryBuilder($this->newBaseQueryBuilder());\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 $builder->setModel($this)->with($this->with);\n\n if ($excludeDeleted and $this->softDelete) {\n $builder->whereNull($this->getQualifiedDeletedAtColumn());\n }\n\n return $builder;\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 createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}", "protected function newInstance($query)\n {\n if ($this->common) {\n $class = \"Aura\\SqlQuery\\Common\";\n } else {\n $class = \"Aura\\SqlQuery\\\\{$this->db}\";\n }\n\n $class .= \"\\\\{$query}\";\n\n return new $class(\n $this->getQuoter(),\n $this->newSeqBindPrefix()\n );\n }", "public function query() {\n /** @var Sql $query */\n $query = $this->query;\n\n $configuration = array(\n 'table' => 'node_field_revision',\n 'field' => 'vid',\n 'left_table' => 'node_field_data',\n 'left_field' => 'vid',\n 'operator' => '=',\n 'type'=>'INNER',\n 'left_query' => 'select max(vid) from node_field_revision where nid = nfr.nid',\n 'extra' => 'node_field_data.nid = nfr.nid',\n );\n\n /** @var Subquery $join */\n $join = Views::pluginManager('join')->createInstance('subquery', $configuration);\n\n $query->addRelationship(\"nfr\", $join ,'node_field_revision' );\n $query->addWhere(0, 'nfr.moderation_state', $this->value, 'IN');\n }", "public function newQuery()\n {\n return parent::newQuery()->orderBy('created_at', 'DESC');\n }", "protected function retrieveOrCreateQueryInstance()\n {\n return $this->queryBuilder ?? $this->queryBuilder = new $this->model();\n }", "public function newQuery()\n {\n $query = parent::newQuery();\n\n if ($this->usesTimestamps()) {\n $table = $this->getTable();\n $columns = ['*'];\n foreach ($this->getDates() as $dateColumn) {\n $columns[] = DB::raw(\"CONCAT($table.$dateColumn) AS $dateColumn\");\n }\n $query->addSelect($columns);\n }\n\n return $query;\n }", "static public function getInstance() {\n return (self::$instance === NULL) ? self::$instance = new Query() : self::$instance;\n }", "public static function create(ContainerInterface $container) {\n return new static($container->get('entity.query'));\n }", "public function newQueryWithoutScopes();", "public function getChildren()\n\t{\n\t\treturn new static($this->getInnerIterator()->getChildren(), $this->excludeMasks);\n\t}", "public function newQuery($query = null)\n {\n if ($query === null) {\n $query = app()->make($this->modelClass)->newQuery();\n }\n\n if ($this->trashed === 'only') {\n $query->onlyTrashed();\n } elseif ($this->trashed === 'with') {\n $query->withTrashed();\n }\n\n if (!empty($this->with)) {\n $query->with($this->with);\n }\n\n if (!empty($this->select)) {\n $query->select($this->select);\n }\n\n return $query;\n }", "public function select()\n {\n return new QueryProxy('select', $this);\n }", "public function getQuery()\n {\n $query = array(\n 'query' => $this->buildQueryTerm(),\n 'bases' => array_unique($this->collections),\n 'offset_start' => $this->offsetStart,\n 'per_page' => $this->recordsPerPage,\n 'search_type' => $this->searchType\n );\n\n $query = $this->appendRecordType($query);\n $query = $this->appendDates($query);\n $query = $this->appendStatuses($query);\n $query = $this->appendFields($query);\n $query = $this->appendSort($query);\n $query = $this->appendTruncature($query);\n\n return new RecordQuery($query, $this->searchType);\n }", "public function newQuery($action,$name=null){\n $name = isset($name) ? $name : count($this->querys);\n $this->querys[$name] = new ECP_DatabaseQuery($action,$this->_conf);\n return $this->querys[$name];\n }", "public function getScenes()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$items = Vr360Database::getInstance()->select(\n\t\t\t'v2_scenes',\n\t\t\tarray(\n\t\t\t\t'id', 'tourId', 'name', 'description', 'file', 'ordering', 'status', 'default', 'params'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'status[!]' => VR360_TOUR_STATUS_UNPUBLISHED,\n\t\t\t\t'tourId' => $this->id,\n\t\t\t\t'ORDER' => array('ordering' => 'ASC')\n\t\t\t)\n\t\t);\n\n\t\tif (empty($items))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($items as $key => $item)\n\t\t{\n\t\t\t$scene = new Vr360Scene;\n\t\t\t$item['params'] = json_decode($item['params']);\n\t\t\t$scene->bind($item);\n\t\t\t$items[$key] = $scene;\n\t\t}\n\n\t\treturn $items;\n\t}", "public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\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 }", "public function newQueryBuilder()\n {\n return new Builder($this->config);\n }", "public function getInstanceQuery()\n {\n return $this->get(self::_INSTANCE_QUERY);\n }", "public function createQueryBuilder()\n {\n return new Query\\QueryBuilder($this);\n }", "public function scenes()\n {\n return $this->hasMany(EntryScene::class);\n }", "public function newQuery($excludeDeleted = true)\n {\n $builder = new PostBuilder($this->newBaseQueryBuilder());\n $builder->setModel($this)->with($this->with);\n $builder->orderBy('post_date', 'desc');\n\n if (isset($this->postType) and $this->postType) {\n $builder->type($this->postType);\n }\n\n if ($excludeDeleted and $this->softDelete) {\n $builder->whereNull($this->getQualifiedDeletedAtColumn());\n }\n\n return $builder;\n }", "public function newInstance($newStack = null) {\n\t\t$class = get_class($this);\n\t\t// support inheritance by passing old object to overloaded constructor\n\t\t$new = $class != 'phpQuery'\n\t\t\t? new $class($this, $this->getDocumentID())\n\t\t\t: new phpQueryObject($this->getDocumentID());\n\t\t$new->previous = $this;\n\t\tif (is_null($newStack)) {\n\t\t\t$new->elements = $this->elements;\n\t\t\tif ($this->elementsBackup)\n\t\t\t\t$this->elements = $this->elementsBackup;\n\t\t} else if (is_string($newStack)) {\n\t\t\t$new->elements = phpQuery::pq($newStack, $this->getDocumentID())->stack();\n\t\t} else {\n\t\t\t$new->elements = $newStack;\n\t\t}\n\t\treturn $new;\n\t}", "public function newInstance($newStack = null) {\n\t\t$class = get_class($this);\n\t\t// support inheritance by passing old object to overloaded constructor\n\t\t$new = $class != 'phpQuery'\n\t\t\t? new $class($this, $this->getDocumentID())\n\t\t\t: new phpQueryObject($this->getDocumentID());\n\t\t$new->previous = $this;\n\t\tif (is_null($newStack)) {\n\t\t\t$new->elements = $this->elements;\n\t\t\tif ($this->elementsBackup)\n\t\t\t\t$this->elements = $this->elementsBackup;\n\t\t} else if (is_string($newStack)) {\n\t\t\t$new->elements = phpQuery::pq($newStack, $this->getDocumentID())->stack();\n\t\t} else {\n\t\t\t$new->elements = $newStack;\n\t\t}\n\t\treturn $new;\n\t}", "public function newQuery()\n\t{\n\t\treturn array(\n\t\t\t'terms' => '',\n\t\t\t'query' => array(\n\t\t\t\t'facets' => '*',\n\t\t\t),\n\t\t);\n\t}", "public function constructQuery(){\n try {\n // Sparql11query.g:59:3: ( CONSTRUCT constructTemplate ( datasetClause )* whereClause solutionModifier ) \n // Sparql11query.g:60:3: CONSTRUCT constructTemplate ( datasetClause )* whereClause solutionModifier \n {\n $this->match($this->input,$this->getToken('CONSTRUCT'),self::$FOLLOW_CONSTRUCT_in_constructQuery215); \n $this->pushFollow(self::$FOLLOW_constructTemplate_in_constructQuery217);\n $this->constructTemplate();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:60:31: ( datasetClause )* \n //loop8:\n do {\n $alt8=2;\n $LA8_0 = $this->input->LA(1);\n\n if ( ($LA8_0==$this->getToken('FROM')) ) {\n $alt8=1;\n }\n\n\n switch ($alt8) {\n \tcase 1 :\n \t // Sparql11query.g:60:31: datasetClause \n \t {\n \t $this->pushFollow(self::$FOLLOW_datasetClause_in_constructQuery219);\n \t $this->datasetClause();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop8;\n }\n } while (true);\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_constructQuery222);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_constructQuery224);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function __construct()\n {\n parent::__construct();\n $this->query = new Query();\n }", "public function buildQuery()\n {\n if (!$this->query) {\n $this->query = $this->getMapper()->buildAssociationQuery($this);\n }\n\n return clone $this->query;\n }" ]
[ "0.6505681", "0.640673", "0.6110617", "0.6085378", "0.6069112", "0.6066955", "0.6052147", "0.5975013", "0.59730196", "0.5951865", "0.5949716", "0.58735996", "0.58502924", "0.58502924", "0.5792401", "0.57857966", "0.5739411", "0.57386684", "0.5725852", "0.570643", "0.567539", "0.5661346", "0.5610907", "0.5595743", "0.559263", "0.5580468", "0.55396014", "0.5515752", "0.5508213", "0.54873574", "0.54689735", "0.54654485", "0.5423244", "0.5384342", "0.5369291", "0.53635645", "0.53388613", "0.5316676", "0.5300826", "0.52897716", "0.52744997", "0.5273297", "0.5259935", "0.5257895", "0.52570975", "0.52570975", "0.52531195", "0.52412814", "0.5229444", "0.52239233", "0.5212109", "0.5183564", "0.51725805", "0.515909", "0.513058", "0.5119292", "0.5118868", "0.5075211", "0.50690675", "0.50589496", "0.5052377", "0.5050293", "0.5018318", "0.5011563", "0.5010632", "0.5001636", "0.4996582", "0.49808267", "0.49680597", "0.49680597", "0.49680597", "0.49665844", "0.49508893", "0.4950076", "0.49495646", "0.49345005", "0.49100652", "0.48962298", "0.48849028", "0.48773175", "0.48737815", "0.48731998", "0.48668212", "0.48596448", "0.48531774", "0.48495036", "0.4845209", "0.4837695", "0.48330003", "0.48198402", "0.4807586", "0.48068547", "0.48011294", "0.47947186", "0.4792694", "0.4792694", "0.47816738", "0.47770378", "0.47752604", "0.47634116" ]
0.60312295
7
Find object by primary key. Propel uses the instance pool to skip the database if the object exists. Go fast if the query is untouched. $obj = $c>findPk(12, $con);
public function findPk($key, ConnectionInterface $con = null) { if ($key === null) { return null; } if ((null !== ($obj = SceneTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) { // the object is already in the instance pool return $obj; } if ($con === null) { $con = Propel::getServiceContainer()->getReadConnection(SceneTableMap::DATABASE_NAME); } $this->basePreSelect($con); if ($this->formatter || $this->modelAlias || $this->with || $this->select || $this->selectColumns || $this->asColumns || $this->selectModifiers || $this->map || $this->having || $this->joins) { return $this->findPkComplex($key, $con); } else { return $this->findPkSimple($key, $con); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_AddressPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_AddressPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AnotacaoCasoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AnotacaoCasoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PeliculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PeliculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AdvogadoAreaAdvocaciaPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AdvogadoAreaAdvocaciaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CastlesPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CastlesPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = BitacoraAccesoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(BitacoraAccesoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ClientPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ClientPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = RemoteAppPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(RemoteAppPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = NegocioPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(NegocioPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = PersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = AnakPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(AnakPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsGpkprkhpkWijzigingenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsGpkprkhpkWijzigingenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ProveedormarcaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ProveedormarcaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = UnitPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(UnitPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DomainCheckPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_ProductPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_ProductPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = LpPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = SearchIndexPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(SearchIndexPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PedidoProductoPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PedidoProductoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DropboxPersonPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = TbalunomatriculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(TbalunomatriculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ZipToCityPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ZipToCityPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PagocontrareciboPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PagocontrareciboPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(ArCust3partyFreightTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = ArCust3partyFreightTableMap::getInstanceFromPool(serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]))))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MonedaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MonedaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(BookTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = BookTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ContactPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ContactPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(MentorTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = MentorTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = afGuardUserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(afGuardUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = DireccionRequerimientoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(DireccionRequerimientoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = ClubMeetingsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(ClubMeetingsPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MigrationPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MigrationPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = TblAdherentPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(TblAdherentPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ExpositorFeriaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = OrdencompradetallePeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(OrdencompradetallePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MantenimientoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MantenimientoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = FreeShippingPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(FreeShippingPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CardPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CardPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ActividadPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Routes2011Peer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Routes2011Peer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(SocioTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = SocioTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ClientPrestationsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ClientPrestationsPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = MesaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = RemoteHistoryContaoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(RemoteHistoryContaoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(LyricTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = LyricTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(ArticlesPropelTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = ArticlesPropelTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ProductoPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(BooksByUserTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = BooksByUserTableMap::getInstanceFromPool(serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]))))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsDoseringenUitzonderingenOpBasisPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsDoseringenUitzonderingenOpBasisPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AutenticacaoTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AutenticacaoTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsRelatieTussenZinummerHibcPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsRelatieTussenZinummerHibcPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(CustomerTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = CustomerTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AccountTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AccountTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(ColaboradorTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = ColaboradorTableMap::getInstanceFromPool(serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]))))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function returnFindByPK($id);", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(TblentbidTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = TblentbidTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(ClientiTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = ClientiTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(CustpermTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = CustpermTableMap::getInstanceFromPool(serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1]), (null === $key[2] || is_scalar($key[2]) || is_callable([$key[2], '__toString']) ? (string) $key[2] : $key[2])]))))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\r\n\t{\r\n\t\tif ((null !== ($obj = PersonaCastingPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\r\n\t\t\t// the object is alredy in the instance pool\r\n\t\t\treturn $obj;\r\n\t\t} else {\r\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\r\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\t\t$stmt = $criteria\r\n\t\t\t\t->filterByPrimaryKey($key)\r\n\t\t\t\t->getSelectStatement($con);\r\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\r\n\t\t}\r\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = sfGuardUserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(sfGuardUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = DocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(DocumentTableMap::DATABASE_NAME);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = SchoolPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(SchoolPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(TrabajosTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = TrabajosTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(DebaucheTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = DebaucheTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsSuperproduktenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsSuperproduktenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(EmployeeTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = EmployeeTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(EmployeeTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = EmployeeTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(TorrentTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = TorrentTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_CustomizationPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_CustomizationPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PdnTugasPeer::getInstanceFromPool((string)$key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PdnTugasPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsMedischeHulpmiddelenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsMedischeHulpmiddelenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(BinrsessionTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = BinrsessionTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = GoodsInSalePeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = MenuPersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PengawasTerdaftarPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PengawasTerdaftarPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = InviteDetailPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(InviteDetailPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = HomeCategoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(HomeCategoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AlunoHasDisciplinaTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AlunoHasDisciplinaTableMap::getInstanceFromPool(serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]))))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(ActividadTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = ActividadTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AliSmbonusTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AliSmbonusTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(RemAanvraagTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = RemAanvraagTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = TemplateUnPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(TemplateUnPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `CASO_ID`, `TITULO`, `DESCRICAO`, `DATA_CRIACAO` FROM `anotacao_caso` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\t\t\t\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new AnotacaoCaso();\n\t\t\t$obj->hydrate($row);\n\t\t\tAnotacaoCasoPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PlanPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PlanPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(GuildTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = GuildTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsGeneriekeNamenPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeNamenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = sfSimpleCMSSlotPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(sfSimpleCMSSlotPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(WarrantyTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = WarrantyTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = RespuestaItemPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AliFmbonusTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AliFmbonusTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null)\n {\n return null;\n }\n if ((null !== ($obj = CollectorProfileArchivePeer::getInstanceFromPool((string) $key))) && !$this->formatter)\n {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null)\n {\n $con = Propel::getConnection(CollectorProfileArchivePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n }\n else\n {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(AliGmbonusTableMap::DATABASE_NAME);\n }\n\n $this->basePreSelect($con);\n\n if (\n $this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n }\n\n if ((null !== ($obj = AliGmbonusTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {\n // the object is already in the instance pool\n return $obj;\n }\n\n return $this->findPkSimple($key, $con);\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = TorneoCategoriaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(TorneoCategoriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}" ]
[ "0.76265174", "0.76265174", "0.75664645", "0.754793", "0.7544529", "0.75244766", "0.75094545", "0.74987614", "0.7489247", "0.7463317", "0.74447244", "0.744311", "0.74354047", "0.7418473", "0.74130696", "0.74127275", "0.7406839", "0.73934567", "0.7375753", "0.73711663", "0.7365799", "0.7365654", "0.73635936", "0.73598856", "0.7356563", "0.7346258", "0.7337359", "0.7334661", "0.73303735", "0.73245996", "0.73220825", "0.73220825", "0.7320641", "0.73176944", "0.73172206", "0.7309428", "0.7303325", "0.7298192", "0.7297526", "0.7297063", "0.7290791", "0.72889173", "0.7288747", "0.72881305", "0.7283288", "0.7282045", "0.727342", "0.7273225", "0.7271386", "0.7261528", "0.72572404", "0.7255349", "0.7254857", "0.72515625", "0.72495455", "0.7249429", "0.7246784", "0.72291076", "0.72282356", "0.7223402", "0.722038", "0.7219468", "0.7203865", "0.7203506", "0.7202362", "0.71931654", "0.718799", "0.71780854", "0.71760046", "0.7173214", "0.71696186", "0.7162338", "0.71562266", "0.71562266", "0.7156028", "0.71559757", "0.71535426", "0.7153153", "0.7151817", "0.71464944", "0.7145888", "0.71457785", "0.714332", "0.7141644", "0.71373934", "0.71313834", "0.7128102", "0.71194816", "0.711074", "0.71057725", "0.71004075", "0.7094706", "0.7087074", "0.7086301", "0.70848805", "0.7079386", "0.70772755", "0.7076267", "0.707471", "0.707369", "0.7071423" ]
0.0
-1
Find object by primary key using raw SQL to go fast. Bypass doSelect() and the object formatter by using generated code.
protected function findPkSimple($key, ConnectionInterface $con) { $sql = 'SELECT scene_id, name, description, update_time, update_user FROM scene WHERE scene_id = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->execute(); } catch (Exception $e) { Propel::log($e->getMessage(), Propel::LOG_ERR); throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); } $obj = null; if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { /** @var ChildScene $obj */ $obj = new ChildScene(); $obj->hydrate($row); SceneTableMap::addInstanceToPool($obj, (string) $key); } $stmt->closeCursor(); return $obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnFindByPK($id);", "public abstract function find($primary_key, $model);", "public function select(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\tif($this->exists ()) {\r\n\t\t\t\r\n\t\t\t\t$sql = \"SELECT * FROM $this->sqlTable WHERE lp_id = ?\";\r\n\t\r\n\t\t\t\t$stmt = $ks_db->query ( $sql, $this->id );\r\n\t\t\t\t\r\n\t\t\t\t//record is found, associate columns to the object properties\r\n\t\t\t\twhile ( true == ($row = $stmt->fetch ()) ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->id = $row ['lp_id'];\r\n\t\t\t\t\t$this->userid = $row ['lp_userid'];\r\n\t\t\t\t\t$this->random = $row ['lp_random'];\r\n\t\t\t\t\t$this->deadline = $row ['lp_deadline'];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\techo \"No record found with id ($this->id) from table ($this->sqlTable).\";\r\n\t\t\t}\t\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function returnDetailFindByPK($id);", "public function select(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\tif($this->exists ()) {\r\n\r\n\t\t\t\t$sql = \"SELECT * FROM $this->sqlTable WHERE dsh_id = ?\";\r\n\r\n\t\t\t\t$stmt = $ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t\t//record is found, associate columns to the object properties\r\n\t\t\t\twhile ( true == ($row = $stmt->fetch ()) ) {\r\n\r\n\t\t\t\t\t$this->id = $row ['dsh_id'];\r\n\t\t\t\t\t$this->title = $row ['dsh_title'];\r\n\t\t\t\t\t$this->desc = $row ['dsh_desc'];\r\n\t\t\t\t\t$this->portlet = $row ['dsh_portlet'];\r\n\t\t\t\t\t$this->hide = $row ['dsh_hide'];\r\n\t\t\t\t\t$this->createdBy = $row ['dsh_created_by'];\r\n\t\t\t\t\t$this->modifiedBy = $row ['dsh_modified_by'];\r\n\t\t\t\t\t$this->createdDate = $row ['dsh_created_date'];\r\n\t\t\t\t\t$this->modifiedDate = $row ['dsh_modified_date'];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\techo \"No record found with primary column ($this->id) from table ($this->sqlTable).\";\r\n\t\t\t}\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function fetch($primaryKey);", "function findFirst($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\t$obj = $statement->fetchObject($this->resultClass, array($this));\n\t\treturn $obj;\n\t}", "public function find($arg) {\n if ($arg instanceof IFilterable) {\n $condition = $arg->resultFilter();\n } else {\n $condition = $this->getPrimaryKeyCondition($arg);\n }\n \n $this->_dataHandler->select('*', $this->_table, $condition);\n return $this->_dataHandler->fetchObject();\n }", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DropboxPersonPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public static function find($primary_key)\n {\n return static::select()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fetchOne();\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AdvogadoAreaAdvocaciaPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AdvogadoAreaAdvocaciaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = MesaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "private function _find($id, $lockForUpdate = false)\n {\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . 'WHERE `id` = ? ';\n \n if ($lockForUpdate) {\n $prepSql .= 'FOR UPDATE ';\n }\n \n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n \n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n $entity = $this->_toEntity($dbRecord);\n \n return $entity;\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ClientPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ClientPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = PersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function returnMoreFindByPK($id);", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CastlesPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CastlesPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = LpPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = UnitPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(UnitPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = GoodsInSalePeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ExpositorFeriaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ProductoPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = AnakPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(AnakPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = SearchIndexPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(SearchIndexPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "abstract public function find($id);", "public function selectById()\n {\n $sql = \"SELECT * FROM \" . self::TABLE_NAME . \" WHERE id=?\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"s\", $this->getId());\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n return $result->fetch_assoc();\n }", "public function findPk($key, $con = null)\r\n\t{\r\n\t\tif ((null !== ($obj = PersonaCastingPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\r\n\t\t\t// the object is alredy in the instance pool\r\n\t\t\treturn $obj;\r\n\t\t} else {\r\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\r\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\t\t$stmt = $criteria\r\n\t\t\t\t->filterByPrimaryKey($key)\r\n\t\t\t\t->getSelectStatement($con);\r\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\r\n\t\t}\r\n\t}", "public function findByPk($id, $typeResult = self::FETCH_OBJ){\n\t$query = \"SELECT * FROM $this->tableName USE INDEX(PRIMARY) WHERE ID=?\";\n\treturn $this->createResult($query, array($id), $typeResult);\n}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = RespuestaItemPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_AddressPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_AddressPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public static function find_by_id($id){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"SELECT * FROM \".$table.\" WHERE \".$keyColumn.\" = \".$id;\n $res = mysqli_query(static::$conn,$sql);\n $row = mysqli_fetch_object($res,get_called_class());\n return $row;\n }", "function unframed_sql_select_object($pdo, $table, $column, $key) {\n\t$sql = \"SELECT * FROM \".$table.\" WHERE \".$column.\" = ?\";\n\t$st = $pdo->prepare($sql);\n\t$st->bindValue(1, $key);\n\tif ($st->execute()) {\n\t\treturn $st->fetch(PDO::FETCH_ASSOC);\n\t}\n\tthrow new Unframed($st->errorInfo()[2]);\n}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = CalendarPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_ProductPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_ProductPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MonedaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MonedaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "function find($id=true,$fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n if(is_string($id) || is_numeric($id)){\n $this->where($this->getPk(),'=',$id);\n }\n return $this->db->find($fetch_type);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = sfSimpleCMSSlotPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(sfSimpleCMSSlotPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DomainCheckPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function find($pk = null) {\n\t\t//Prepare the SELECT SQL Query\n\t\t$sql = $this->prepareSelect($pk);\n\t\t\n\t\t//Clear actual dataSet\n\t\t$this->clearDataSet();\n\t\t\n\t\t$modelName = get_class($this->getModel());\n\t\t\n\t\tif($sql != null) {\n\t\t\t$this->execute($sql);\n\t\t\t$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t\t} else {\n\t\t\tPhpBURN_Message::output(\"[!No query found!] - <b>$modelName</b>\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Set cursor at the first position\n\t\t$this->setPointer(0);\n\t\t\n\t\t//Prepare DataSet\n\t\t//$this->setDataSet($dataSet);\n\t\t\n\t\t//Returns the amount result\n\t\treturn $this->getModel()->getConnection()->affected_rows($this->resultSet);\n\t}", "public function find( int $id, string $className, ? string $table = null) //$className parametre de la function, ? parametre optionnel\r\n{\r\n $sql = \"SELECT * FROM {$this->table} WHERE id =:id\";\r\n\r\n if(!empty($table)){\r\n $sql = \"SELECT * FROM $table WHERE id=:id\";\r\n }\r\n\r\n $maRequete = $this->pdo->prepare($sql);\r\n $maRequete->execute(['id' => $id]);\r\n\r\n $item = $maRequete->fetchObject($className); //deja fait pour l'objet il sait qu'on va lui donner une classe;\r\n\r\n return $item;\r\n}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = MenuPersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = TblAdherentPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(TblAdherentPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public static function find($id, $key = 'id');", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PlanPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PlanPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ActividadPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PengawasTerdaftarPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PengawasTerdaftarPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ZipToCityPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ZipToCityPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `id`, `nombre`, `descripcion`, `precio`, `usuarios`, `moneda_id`, `logo_propio`, `quitar_logo`, `correo_masivo`, `correo_info`, `crear_examenes`, `created_by`, `updated_by`, `created_at`, `updated_at` FROM `plan` WHERE `id` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new Plan();\n $obj->hydrate($row);\n PlanPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT ID, LASTNAME, FIRSTNAME, BIRTHDATE, ADDRESS, CITY, ZIP_CODE, CREATED_AT, UPDATED_AT, CREATED_BY, UPDATED_BY FROM ratp_client WHERE ID = :p0';\n try {\n $stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new Client();\n $obj->hydrate($row);\n ClientPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = QuizPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "function find($id);", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsGpkprkhpkWijzigingenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsGpkprkhpkWijzigingenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = TbalunomatriculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(TbalunomatriculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = DireccionRequerimientoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(DireccionRequerimientoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID_ADDRESS`, `ID_COUNTRY`, `ID_STATE`, `ID_CUSTOMER`, `ID_MANUFACTURER`, `ID_SUPPLIER`, `ALIAS`, `COMPANY`, `LASTNAME`, `FIRSTNAME`, `ADDRESS1`, `ADDRESS2`, `POSTCODE`, `CITY`, `OTHER`, `PHONE`, `PHONE_MOBILE`, `VAT_NUMBER`, `DNI`, `DATE_ADD`, `DATE_UPD`, `ACTIVE`, `DELETED` FROM `' . _DB_PREFIX_ . 'address` WHERE `ID_ADDRESS` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Oops_Db_Address();\n\t\t\t$obj->hydrate($row);\n\t\t\tOops_Db_AddressPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ProveedormarcaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ProveedormarcaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PeliculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PeliculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PedidoProductoPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PedidoProductoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `id`, `page_id`, `path`, `language_id`, `link_text`, `page_title`, `created_at`, `updated_at`, `created_by`, `updated_by` FROM `search_index` WHERE `id` = :p0 AND `language_id` = :p1';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);\n $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new SearchIndex();\n $obj->hydrate($row);\n SearchIndexPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = NegocioPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(NegocioPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsSuperproduktenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsSuperproduktenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = BitacoraAccesoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(BitacoraAccesoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = TemplateUnPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(TemplateUnPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\r\n\t{\r\n\t\tif ((null !== ($obj = ScoutImportPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\r\n\t\t\t// the object is alredy in the instance pool\r\n\t\t\treturn $obj;\r\n\t\t} else {\r\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\r\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\t\t$stmt = $criteria\r\n\t\t\t\t->filterByPrimaryKey($key)\r\n\t\t\t\t->getSelectStatement($con);\r\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\r\n\t\t}\r\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AnotacaoCasoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AnotacaoCasoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null)\n {\n return null;\n }\n if ((null !== ($obj = CollectorProfileArchivePeer::getInstanceFromPool((string) $key))) && !$this->formatter)\n {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null)\n {\n $con = Propel::getConnection(CollectorProfileArchivePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n }\n else\n {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = TranslationContentPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(TranslationContentPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = RegistrationPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function find($id){\n return parent::find($this->table, $id);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = OrdencompradetallePeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(OrdencompradetallePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = GsMedischeHulpmiddelenPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(GsMedischeHulpmiddelenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MantenimientoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MantenimientoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ClientPrestationsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ClientPrestationsPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function find($id, $primary_key = 'id') {\r\n $this->where(array($primary_key => $id));\r\n\r\n if (!is_array($id)) {\r\n return $this->first();\r\n }\r\n\r\n return $this->execute();\r\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `ID`, `DESCRIPCION`, `SIMBOLO`, `CODIGO` FROM `moneda` WHERE `ID` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new Moneda();\n $obj->hydrate($row);\n MonedaPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CardPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CardPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = sfGuardUserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(sfGuardUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = afGuardUserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(afGuardUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ArtistPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ArtistPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = MigrationPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(MigrationPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public\tfunction\tfind($primary = NULL)\n\t\t{\n\t\t\t$this->_relate();\n\t\t\t\n\t\t\t$access\t=\t$this->_database->getAccess();\n\t\t\t$query\t=\t$this->getQuery('find');\n\t\t\treturn\t$query;\n\t\t\t$filter\t=\t$this->getQuery('filter');\n\t\t\tvar_dump($filter);\n\t\t\t$access->query($this->getQuery('find'), array());\n\t\t\t\n\t\t\t$output\t=\tarray();\n\t\t\twhile($row = $access->fetch()) {\n\t\t\t\t$output[]\t=\t$this->_fetch($row);\n\t\t\t}\n\t\t\texit();\n\t\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_CustomizationPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_CustomizationPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function find($primaryValue);", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = PdnTugasPeer::getInstanceFromPool((string)$key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(PdnTugasPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins\n ) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT \"pengawas_terdaftar_id\", \"lembaga_id\", \"ptk_id\", \"tahun_ajaran_id\", \"nomor_surat_tugas\", \"tanggal_surat_tugas\", \"tmt_tugas\", \"mata_pelajaran_id\", \"bidang_studi_id\", \"jenjang_kepengawasan_id\", \"aktif_bulan_01\", \"aktif_bulan_02\", \"aktif_bulan_03\", \"aktif_bulan_04\", \"aktif_bulan_05\", \"aktif_bulan_06\", \"aktif_bulan_07\", \"aktif_bulan_08\", \"aktif_bulan_09\", \"aktif_bulan_10\", \"aktif_bulan_11\", \"aktif_bulan_12\", \"jenis_keluar_id\", \"tgl_pengawas_keluar\", \"create_date\", \"last_update\", \"soft_delete\", \"last_sync\", \"updater_id\" FROM \"pengawas_terdaftar\" WHERE \"pengawas_terdaftar_id\" = :p0';\n try {\n $stmt = $con->prepare($sql);\t\t\t\n $stmt->bindValue(':p0', $key, PDO::PARAM_STR);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new PengawasTerdaftar();\n $obj->hydrate($row);\n PengawasTerdaftarPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function findPk($key, ConnectionInterface $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = DocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getServiceContainer()->getReadConnection(DocumentTableMap::DATABASE_NAME);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }" ]
[ "0.674225", "0.67316544", "0.671312", "0.6686858", "0.6600325", "0.64460266", "0.63715494", "0.63658243", "0.6340358", "0.6323407", "0.6282629", "0.6282629", "0.62683886", "0.625569", "0.6250142", "0.62261707", "0.62005794", "0.61881745", "0.61780864", "0.61757374", "0.6175128", "0.61671925", "0.61668307", "0.61592466", "0.6155317", "0.6137768", "0.6106935", "0.61068404", "0.6103197", "0.60998756", "0.6085027", "0.60850084", "0.60651046", "0.6061539", "0.6055684", "0.60522133", "0.6048764", "0.6048549", "0.6038583", "0.60276943", "0.60235965", "0.60199434", "0.60110253", "0.6008055", "0.6000577", "0.5998613", "0.59953785", "0.5993522", "0.5993365", "0.5987027", "0.598033", "0.5977919", "0.59756726", "0.5970716", "0.5968692", "0.5964509", "0.59592897", "0.5950325", "0.5940849", "0.59399724", "0.59354126", "0.59279066", "0.5925098", "0.5915792", "0.5911744", "0.5904624", "0.59011203", "0.59007704", "0.58997536", "0.58963376", "0.58873373", "0.5887101", "0.5886633", "0.58865017", "0.58841336", "0.5881925", "0.58759516", "0.5874012", "0.587136", "0.58705103", "0.58701825", "0.5863538", "0.58599436", "0.58599406", "0.5855429", "0.58512336", "0.58502245", "0.5845291", "0.5841339", "0.58351535", "0.58348113", "0.58249813", "0.58218247", "0.5814176", "0.580996", "0.580996", "0.5807893", "0.5807893", "0.5807893", "0.5807106", "0.58063865" ]
0.0
-1
Find object by primary key.
protected function findPkComplex($key, ConnectionInterface $con) { // As the query uses a PK condition, no limit(1) is necessary. $criteria = $this->isKeepQuery() ? clone $this : $this; $dataFetcher = $criteria ->filterByPrimaryKey($key) ->doSelect($con); return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnFindByPK($id);", "public abstract function find($primary_key, $model);", "public static function find($primary_key)\n {\n return static::select()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fetchOne();\n }", "public static function find($id, $key = 'id');", "public function returnDetailFindByPK($id);", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public static function findByPrimaryKey($primary_key)\n {\n return self::find($primary_key);\n }", "public function find($primaryValue);", "public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }", "public function find($id, $primary_key = 'id') {\r\n $this->where(array($primary_key => $id));\r\n\r\n if (!is_array($id)) {\r\n return $this->first();\r\n }\r\n\r\n return $this->execute();\r\n }", "function find($id);", "public static function find_by_id($id){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"SELECT * FROM \".$table.\" WHERE \".$keyColumn.\" = \".$id;\n $res = mysqli_query(static::$conn,$sql);\n $row = mysqli_fetch_object($res,get_called_class());\n return $row;\n }", "abstract public function find($id);", "public function fetch($primaryKey);", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "function findById($id);", "public function find(int $key);", "public static function find($id);", "public function returnMoreFindByPK($id);", "public function findById($id)\n {\n $sql = $this->getSelectStatement() . ' WHERE ' . $this->getPrimaryKeyName() . '=:id';\n \n $statement = DatabaseHelper::runQuery($this->connection, $sql, array(':key'=> $key));\n return $statement->fetch();\n }", "public function findByPk($primary)\n {\n $stmt = $this->Adapter->prepare(\"SELECT * FROM $this->table WHERE $this->primaryName=:id\");\n $stmt->execute(['id' => $primary]);\n return $stmt->fetch($this->pdoFetch);\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DropboxPersonPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public static function findById($id);", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "static function retrieveByPK($id) {\n\t\treturn static::retrieveByPKs($id);\n\t}", "public function find( $id );", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function find ($key);", "abstract function getPrimaryKey();", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = PersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function find(int $id) ;", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_AddressPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_AddressPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n if ($rs->EOF) {\n return null;\n }\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findFirstByKey($key);", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ExpositorFeriaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = afGuardUserPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(afGuardUserPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CardPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CardPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PeliculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PeliculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = UserPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = CastlesPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(CastlesPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ProveedormarcaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ProveedormarcaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function find($arg) {\n if ($arg instanceof IFilterable) {\n $condition = $arg->resultFilter();\n } else {\n $condition = $this->getPrimaryKeyCondition($arg);\n }\n \n $this->_dataHandler->select('*', $this->_table, $condition);\n return $this->_dataHandler->fetchObject();\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = RemoteAppPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(RemoteAppPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findById ($id);", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Routes2011Peer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Routes2011Peer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = MenuPersonaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = SearchIndexPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(SearchIndexPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = BitacoraAccesoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(BitacoraAccesoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AdvogadoAreaAdvocaciaPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AdvogadoAreaAdvocaciaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AnotacaoCasoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AnotacaoCasoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = UnitPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(UnitPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function find($id){\n return parent::find($this->table, $id);\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ClientPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ClientPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `ID_API_ID`, `ID_NAME`, `ID_EMAIL`, `ID_FBID`, `CDATE`, `MDATE`, `ID_TWID`, `ID_IMAGE` FROM `invite_detail` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new InviteDetail();\n\t\t\t$obj->hydrate($row);\n\t\t\tInviteDetailPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = ArtistPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(ArtistPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = RespuestaItemPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = LpPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = AnakPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(AnakPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findEntity($id);", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = ClubMeetingsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(ClubMeetingsPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `id`, `page_id`, `path`, `language_id`, `link_text`, `page_title`, `created_at`, `updated_at`, `created_by`, `updated_by` FROM `search_index` WHERE `id` = :p0 AND `language_id` = :p1';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);\n $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new SearchIndex();\n $obj->hydrate($row);\n SearchIndexPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "public function findByPK($id) {\n // prepare SELECT statement\n $statement = $this->pdo->prepare('SELECT id, symbol, company\n FROM stocks\n WHERE id = :id');\n // bind value to the :id parameter\n $stmt->bindValue(':id', $id);\n \n // execute the statement\n $stmt->execute();\n \n // return the result set as an object\n return $stmt->fetchObject();\n }", "public function findByPK($id) {\n // prepare SELECT statement\n $stmt = $this->pdo->prepare('SELECT id, symbol, company\n FROM stocks\n WHERE id = :id');\n // bind value to the :id parameter\n $stmt->bindValue(':id', $id);\n \n // execute the statement\n $stmt->execute();\n \n // return the result set as an object\n return $stmt->fetchObject();\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = DomainCheckPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = InviteDetailPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(InviteDetailPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_ProductPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_ProductPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ((null !== ($obj = ActividadPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t// the object has not been requested yet, or the formatter is not an object formatter\n\t\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t\t$stmt = $criteria\n\t\t\t\t->filterByPrimaryKey($key)\n\t\t\t\t->getSelectStatement($con);\n\t\t\treturn $criteria->getFormatter()->init($criteria)->formatOne($stmt);\n\t\t}\n\t}" ]
[ "0.81539774", "0.7867759", "0.7742976", "0.7725865", "0.7634623", "0.7554392", "0.7401224", "0.7310899", "0.7229907", "0.7208223", "0.7153336", "0.7110828", "0.7093999", "0.707613", "0.70712215", "0.7046294", "0.7036454", "0.70232224", "0.69681656", "0.6949603", "0.69344795", "0.6927912", "0.69063175", "0.68736976", "0.6870698", "0.68536013", "0.68214136", "0.6821119", "0.6817394", "0.6781578", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6778138", "0.6776677", "0.6776677", "0.67640674", "0.67578286", "0.67408067", "0.67408067", "0.6738442", "0.669", "0.6687912", "0.6680633", "0.66550416", "0.6651245", "0.66409177", "0.6625536", "0.66194665", "0.66165847", "0.6615172", "0.6612764", "0.6609358", "0.66090894", "0.6608444", "0.66075665", "0.66075665", "0.66075665", "0.6603161", "0.65901697", "0.65897304", "0.65881985", "0.65873367", "0.658688", "0.6586724", "0.6583685", "0.65821403", "0.65815455", "0.65790266", "0.65765196", "0.65749216", "0.6570416", "0.6569202", "0.65614", "0.6544074", "0.65415436", "0.6541106", "0.6539593", "0.6536723", "0.65362525", "0.6535643", "0.653309" ]
0.0
-1
Find objects by primary key $objs = $c>findPks(array(12, 56, 832), $con);
public function findPks($keys, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); } $this->basePreSelect($con); $criteria = $this->isKeepQuery() ? clone $this : $this; $dataFetcher = $criteria ->filterByPrimaryKeys($keys) ->doSelect($con); return $criteria->getFormatter()->init($criteria)->format($dataFetcher); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\t\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\r\n\t{\t\r\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\treturn $this\r\n\t\t\t->filterByPrimaryKeys($keys)\r\n\t\t\t->find($con);\r\n\t}", "public function findPks($keys, $con = null)\r\n\t{\t\r\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\treturn $this\r\n\t\t\t->filterByPrimaryKeys($keys)\r\n\t\t\t->find($con);\r\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\treturn $this\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->find($con);\n\t}", "public function findPks($keys, $con = null)\r\n\t{\r\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\r\n\t\treturn $this\r\n\t\t\t->filterByPrimaryKeys($keys)\r\n\t\t\t->find($con);\r\n\t}", "public function returnMoreFindByPK($id);", "public function findPks($keys, $con = null)\n {\n if ($con === null)\n {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public function findPks($keys, $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\t$criteria = $this->isKeepQuery() ? clone $this : $this;\n\t\t$stmt = $criteria\n\t\t\t->filterByPrimaryKeys($keys)\n\t\t\t->doSelect($con);\n\t\treturn $criteria->getFormatter()->init($criteria)->format($stmt);\n\t}", "public static function retrieveByPKs($pks, PropelPDO $con = null)\n\t{\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(MissionPhotoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\n\t\t$objs = null;\n\t\tif (empty($pks)) {\n\t\t\t$objs = array();\n\t\t} else {\n\t\t\t$criteria = new Criteria(MissionPhotoPeer::DATABASE_NAME);\n\t\t\t$criteria->add(MissionPhotoPeer::ID, $pks, Criteria::IN);\n\t\t\t$objs = MissionPhotoPeer::doSelect($criteria, $con);\n\t\t}\n\t\treturn $objs;\n\t}", "public function returnFindByPK($id);", "public static function retrieveByPKs($pks, PropelPDO $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection(SertifikasiPdPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $objs = null;\n if (empty($pks)) {\n $objs = array();\n } else {\n $criteria = new Criteria(SertifikasiPdPeer::DATABASE_NAME);\n $criteria->add(SertifikasiPdPeer::ID_SERT_PD, $pks, Criteria::IN);\n $objs = SertifikasiPdPeer::doSelect($criteria, $con);\n }\n\n return $objs;\n }", "public function fetchByPrimaryKey($pk){\n\t\t$sql = \"SELECT * FROM \".$this->_tableName.\" WHERE \".$this->_primaryKeyColumn.\"=?\";\n\n\t\ttry{\n\t\t\t$resultArray = $this->_dbConnection->fetchAssoc($sql, array($pk));\n\t\t} catch (\\Exception $e){\n\t\t\t$resultArray = array();\n\t\t}\n\t\t\n\t\treturn $resultArray;\n\t}", "public function retrieveByPKsTableProxy($pPks) {\n $q = $lInvoker->getQuery()->where('id IN ?', $pPks);\n\n return $q->fetch();\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }", "public function findPks($keys, $con = null)\n {\n if ($con === null) {\n $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n $criteria = $this->isKeepQuery() ? clone $this : $this;\n $stmt = $criteria\n ->filterByPrimaryKeys($keys)\n ->doSelect($con);\n\n return $criteria->getFormatter()->init($criteria)->format($stmt);\n }" ]
[ "0.7208273", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.7026064", "0.70093274", "0.70093274", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.691215", "0.68461555", "0.65883046", "0.6499575", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6490696", "0.6393269", "0.63584495", "0.63123256", "0.6252997", "0.6229539", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996", "0.62237996" ]
0.0
-1
Filter the query by primary key
public function filterByPrimaryKey($key) { return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $key, Criteria::EQUAL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ActividadPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n throw new LogicException('The Egive object has no primary key');\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MantenimientoPeer::ID_AUTO, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(AnotacaoCasoPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(LpPeer::ID, $key, Criteria::EQUAL);\n\t}", "public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ExpositorFeriaPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AlumnoTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MateriaTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SocioTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PeliculaPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ArticlesPropelTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RespuestaItemPeer::ID, $key, Criteria::EQUAL);\n\t}", "protected function sqlKeyFilter()\n\t{\n\t\treturn \"`id` = @id@\";\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(UserPeer::UID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(GoodsInSalePeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(afGuardUserPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AutenticacaoTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(LyricTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ProductoPeer::ID_PRODUCTO, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TrabajosTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AnakPeer::ANAK_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CardPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(TblAdherentPeer::ID_ADHERENT, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_ADDRESS, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ProveedormarcaPeer::IDPROVEEDORMARCA, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UsuarioHorarioPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(DomainCheckPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(BitacoraAccesoPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(CalendarPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MesaPeer::ID_MESA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CastlesPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(ScoutImportPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(EafFormInfoPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(AdvertisementPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientiTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(Oops_Db_ProductPeer::ID_PRODUCT, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MonedaPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ArticleTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n throw new LogicException('The Map object has no primary key');\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(RemAanvraagTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(DireccionRequerimientoPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(NegocioPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UsuarioPerfilPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(PlanPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(InviteDetailPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AbuthInvoicesTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ContactPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliHoldheadTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ProfessorTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(QuizPeer::ID, $key, Criteria::EQUAL);\n\t}", "abstract function getPrimaryKey();", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RegistrationPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(RemoteAppPeer::ID, $key, Criteria::EQUAL);\n }", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(BookTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function fetch($primaryKey);", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(SettingPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(PlansTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliFmbonusTableMap::COL_AID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(QueryParametersTableMap::COL_QRP_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(UnitPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliSmbonusTableMap::COL_AID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FacturesPrestationsPeer::FACT_PREST_ID, $key, Criteria::EQUAL);\n }", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "abstract public function primaryKey(): string;", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(OrdencompradetallePeer::IDORDENCOMPRADETALLE, $key, Criteria::EQUAL);\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TemplateUnPeer::TEMPLATE_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(RemoteHistoryContaoPeer::ID, $key, Criteria::EQUAL);\n }", "function isPrimaryKey(): bool;", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_MENU_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MentorTableMap::COL_MENTOR_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UserTableMap::COL_CODE, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ArticleTableMap::COL_ART_NUM, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(DegressifProductsTableMap::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $key, Criteria::EQUAL);\n\t}", "private function _fetch_primary_key()\n {\n if($this->primaryKey == NULl)\n {\n $this->primaryKey = $this->db->query(\"SHOW KEYS FROM `\".$this->_table.\"` WHERE Key_name = 'PRIMARY'\")->row()->Column_name;\n }\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TranslationContentPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ActividadPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKey($key)\n {\n throw new LogicException('The JaAclUsuariosPerfiles object has no primary key');\n }", "public function returnFindByPK($id);", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FoodTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $keys, Criteria::IN);\n\t}" ]
[ "0.6998814", "0.6998814", "0.6787939", "0.67724454", "0.6746847", "0.67268467", "0.67149204", "0.66994244", "0.6679747", "0.66293436", "0.65891814", "0.65612423", "0.6559797", "0.6545799", "0.64770174", "0.6467542", "0.64436316", "0.6443316", "0.64338726", "0.64306927", "0.64261293", "0.6419176", "0.6418797", "0.6410829", "0.63943064", "0.6388085", "0.6357303", "0.6351007", "0.63425875", "0.63420886", "0.63413364", "0.63338387", "0.63334394", "0.63319856", "0.6321498", "0.6310244", "0.630249", "0.6292617", "0.6292617", "0.62909824", "0.6290904", "0.6289017", "0.62843025", "0.62839323", "0.6254624", "0.6246287", "0.62440604", "0.6234988", "0.62247485", "0.622374", "0.6213237", "0.6213237", "0.62015784", "0.6201304", "0.6199474", "0.61959296", "0.61737394", "0.6170697", "0.61696035", "0.6168534", "0.6163148", "0.61523545", "0.6143065", "0.6135944", "0.6118961", "0.6088655", "0.6081676", "0.6081676", "0.60606694", "0.60445714", "0.60375977", "0.60366344", "0.6032351", "0.6029844", "0.60246396", "0.60243976", "0.601998", "0.6019289", "0.59971315", "0.59932095", "0.59829354", "0.5975115", "0.59647596", "0.59611756", "0.595956", "0.5944171", "0.5937695", "0.59262586", "0.5924869", "0.59217024", "0.5913547", "0.5908013", "0.5907965", "0.59053725", "0.5896462", "0.5890872", "0.5890872", "0.5890872", "0.5881955", "0.5879898", "0.5876306" ]
0.0
-1
Filter the query by a list of primary keys
public function filterByPrimaryKeys($keys) { return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $keys, Criteria::IN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ActividadPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RespuestaItemPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(PeliculaPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(LpPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ExpositorFeriaPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(CastlesPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(GoodsInSalePeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\r\n\t{\r\n\t\treturn $this->addUsingAlias(AdvertisementPeer::ID, $keys, Criteria::IN);\r\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(AnotacaoCasoPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ArticlesPropelTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MateriaTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\r\n\t{\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::ID, $keys, Criteria::IN);\r\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(CalendarPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\r\n\t{\r\n\t\treturn $this->addUsingAlias(ScoutImportPeer::ID, $keys, Criteria::IN);\r\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(FoodTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MantenimientoPeer::ID_AUTO, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AlumnoTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ClientPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_ADDRESS, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(BookTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(InviteDetailPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(LyricTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(SettingPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(QuizPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MonedaPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ArticleTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RegistrationPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(SocioTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ContactPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AutenticacaoTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ClubMeetingsPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ClientiTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(CardPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(PlanPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(afGuardUserPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TrabajosTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(UserPeer::UID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(DomainCheckPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(UnitPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(PlansTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MentorTableMap::COL_MENTOR_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ProductoPeer::ID_PRODUCTO, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(Oops_Db_ProductPeer::ID_PRODUCT, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(RemAanvraagTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(DireccionRequerimientoPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(CustomerTableMap::COL_CUSTOMER_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ProveedormarcaPeer::IDPROVEEDORMARCA, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(TblAdherentPeer::ID_ADHERENT, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AbuthInvoicesTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(DegressifProductsTableMap::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AliHoldheadTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(RemoteAppPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ProfessorTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(UsuarioHorarioPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(QueryParametersTableMap::COL_QRP_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(BitacoraAccesoPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(PhotosPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(UsuarioPerfilPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(DebaucheTableMap::COL_DEBAUCHE_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TeamTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TorrentTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(NegocioPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ZipToCityPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(MesaPeer::ID_MESA, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TranslationContentPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(FacturesPrestationsPeer::FACT_PREST_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AnakPeer::ANAK_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(SuitsTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MigrationPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(GroupTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(EafFormInfoPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(FreeShippingPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(SchoolPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ArticleTableMap::COL_ART_NUM, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AliGmbonusTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AliFmbonusTableMap::COL_AID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(RemoteHistoryContaoPeer::ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AliSmbonusTableMap::COL_AID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(RoleactionPeer::ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ClientStateTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(AccountTableMap::COL_ID_ACCOUNT, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(FPartenaireTableMap::COL_INDX_PART, $keys, Criteria::IN);\n }", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(OrdencompradetallePeer::IDORDENCOMPRADETALLE, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TemplateUnPeer::TEMPLATE_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(GuildTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(TestEvalTableMap::COL_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(DocumentTableMap::COL_DOC_NUM, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(VoipTableMap::COL_VOID_ID, $keys, Criteria::IN);\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(ForumPostPeer::POST_ID, $keys, Criteria::IN);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(StartgroupTableMap::COL_ID, $keys, Criteria::IN);\n }" ]
[ "0.71649146", "0.71554565", "0.71554565", "0.702131", "0.69704026", "0.69640625", "0.6959535", "0.69581085", "0.69568676", "0.6947917", "0.6936726", "0.6933796", "0.6914574", "0.6899884", "0.6896012", "0.6879734", "0.68639565", "0.6853219", "0.68508005", "0.68174595", "0.68081754", "0.680744", "0.6806503", "0.6800654", "0.6797916", "0.67927366", "0.6782404", "0.6782404", "0.6775505", "0.6762161", "0.6757997", "0.67445976", "0.67435807", "0.67405355", "0.67338896", "0.67193913", "0.670764", "0.66913056", "0.66814166", "0.6677276", "0.66698015", "0.6668992", "0.6664544", "0.66562134", "0.6655301", "0.6648861", "0.6648112", "0.6640406", "0.6632106", "0.6628881", "0.6628485", "0.66275823", "0.66275823", "0.66165316", "0.6605781", "0.6583729", "0.65699476", "0.65694934", "0.65603876", "0.655833", "0.6550389", "0.65414953", "0.6540322", "0.6539365", "0.6535006", "0.65317404", "0.6529", "0.65255105", "0.65178597", "0.6510637", "0.65099144", "0.6503917", "0.6495076", "0.6488942", "0.6486777", "0.64746904", "0.6456382", "0.6452263", "0.6449484", "0.6446021", "0.6435819", "0.6428886", "0.64267915", "0.6424545", "0.6422875", "0.6414124", "0.6411265", "0.6401266", "0.63974845", "0.6389209", "0.6377831", "0.6345612", "0.63409", "0.63034856", "0.6300764", "0.62808967", "0.6266333", "0.62652826", "0.6258984", "0.62506914", "0.62488806" ]
0.0
-1
Filter the query on the scene_id column Example usage: $query>filterBySceneId(1234); // WHERE scene_id = 1234 $query>filterBySceneId(array(12, 34)); // WHERE scene_id IN (12, 34) $query>filterBySceneId(array('min' => 12)); // WHERE scene_id > 12
public function filterBySceneId($sceneId = null, $comparison = null) { if (is_array($sceneId)) { $useMinMax = false; if (isset($sceneId['min'])) { $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($sceneId['max'])) { $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $key, Criteria::EQUAL);\n }", "public function filterId(int $id): self;", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $keys, Criteria::IN);\n }", "public function itemsFilterIds($params){\n\t\tif(empty($params['orderby'])){\n\t\t\t$params['orderby']=$this->leftKeyName;\n\t\t\t}\n\t\treturn parent::itemsFilterIds($params);\n\t\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MateriaTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "public function filterUser(int|UniqueId $id): self;", "public function whereId($id);", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SocioTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $key, Criteria::EQUAL);\n\t}", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "public function filterUser(int $id): self;", "public function filterIds(int ...$ids): self;", "public function getFilter($id)\n {\n return parent::getFilter(strtolower($id));\n }", "function PreciosFilter( $Filter )\n {\n $Field = PreciosField( $Filter );\n \n $where = \"\";\n if( !empty($Filter->precMin) ) $where = 'AND '.$Field.'>='.$Filter->precMin.' ';\n if( !empty($Filter->precMax) && $Filter->precMax<150) $where .= 'AND '.$Field.'<='.$Filter->precMax.' ';\n\n if( !empty($where) ) $where .= 'AND '.$Field.'>0 ';\n return $where; \n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MesaPeer::ID_MESA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientStateTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function series_filter_params(string $id)\n {\n return $this->request(\"series/{$id}/filter/params\");\n }", "public function filtering();", "function automap_filter_by_ids(&$obj, $params = null) {\n if(isset($params['filter_by_ids']) && $params['filter_by_ids'] != '') {\n $allowed_ids = array_flip(explode(',', $params['filter_by_ids']));\n automap_filter_tree($allowed_ids, $obj);\n }\n}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(RemAanvraagTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filter()\n\t{\n\t\tif (isset($_GET['cty']) AND (int) $_GET['cty'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$county_id = (int) $_GET['cty'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"county \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $county_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_GET['cst']) AND (int) $_GET['cst'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$constituency_id = (int) $_GET['cst'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"constituency \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $constituency_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AlumnoTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(CalendarPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TrabajosTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(EmployeeTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FacturesPrestationsPeer::FACT_PREST_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(LyricTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(StartgroupTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SuitsTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ArticlesPropelTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ClientiTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filter();", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(GoodsInSalePeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::ID, $id, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(ArticleTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPreId($preId = null, $comparison = null)\n {\n if (is_array($preId)) {\n $useMinMax = false;\n if (isset($preId['min'])) {\n $this->addUsingAlias(ResultadoDetalleTableMap::COL_PRE_ID, $preId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($preId['max'])) {\n $this->addUsingAlias(ResultadoDetalleTableMap::COL_PRE_ID, $preId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ResultadoDetalleTableMap::COL_PRE_ID, $preId, $comparison);\n }", "function createObjectFilter($opt) {\n\textract($opt);\n\n\t//make an array if we only have a singular column value\n\tif (is_array($object_filter)) $str = implode(\",\",$object_filter);\n\telse $str = $object_filter;\n\n\t$sql = \"SELECT id FROM docmgr.dm_object WHERE id IN (\".$str.\")\";\n\n\treturn $sql;\n\n}", "public function getRecordsFiltered(): int;", "public function filterByRouteid($routeid = null, $comparison = null)\n\t{\n\t\tif (is_array($routeid)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($routeid['min'])) {\n\t\t\t\t$this->addUsingAlias(Routes2011Peer::ROUTEID, $routeid['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($routeid['max'])) {\n\t\t\t\t$this->addUsingAlias(Routes2011Peer::ROUTEID, $routeid['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Routes2011Peer::ROUTEID, $routeid, $comparison);\n\t}", "public function filterByPrimaryKey($key)\n {\n throw new LogicException('The Egive object has no primary key');\n }", "public function filter() {\n\t $this->model->filter(array(\"status\"=>array(0,1)));\n\t if(Request::post(\"section\")){\n\t $section = new CmsSection(Request::post(\"section\"));\n\t foreach($section->tree() as $section) $section_ids[] = $section->primval;\n\t $this->model->filter(array(\"cms_section_id\"=>$section_ids));\n }\n\t parent::filter();\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(PlansTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function addFilterById($id)\n {\n $this->addFilter('main_table.entity_id', array('in' => $id), 'public');\n return $this;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MonedaPeer::ID, $key, Criteria::EQUAL);\n }", "public function filter($params)\n {\n try{\n $params = json_decode($params, true);\n if($params['year_from']==\"\"){\n $err_arr = ['sucess'=>0, 'error'=>ERROR_PARAMS];\n return json_encode($err_arr);\n }\n if(count($params)>0){\n $query = \"SELECT cars.id, brands.name as brand, models.name as model, cars.img\"\n . \" FROM brands JOIN\"\n . \" (cars JOIN models ON models.id = cars.id_model)\"\n . \" ON brands.id = cars.id_brand WHERE (year_of_issue BETWEEN :year_from AND :year_to)\";\n if($params['id_model']!=\"\"){\n $query .= \" AND cars.id_model = :id_model\";\n }else{\n unset($params['id_model']);\n }\n if($params['id_brand']!=\"\"){\n $query .= \" AND cars.id_brand = :id_brand\";\n }else{\n unset($params['id_brand']);\n }\n if($params['speed_from']!=\"\" && $params['speed_to']!=\"\"){\n $query .= \" AND (max_speed BETWEEN :speed_from AND :speed_to)\";\n }else{\n unset($params['speed_from']);\n unset($params['speed_to']);\n }\n if($params['engine_capacity_from']!=\"\" && $params['engine_capacity_to']!=\"\")\n {\n $query .= \" AND (engine_capacity BETWEEN :engine_capacity_from\"\n .\" AND :engine_capacity_to)\";\n }else{\n unset($params['engine_capacity_from']);\n unset($params['engine_capacity_to']);\n }\n if($params['price_from']!=\"\" && $params['price_to']!=\"\"){\n $query .= \" AND (price BETWEEN :price_from AND :price_to)\";\n }else{\n unset($params['price_from']);\n unset($params['price_to']);\n }\n $color_id = \"\";\n if($params['id_color']!=\"\"){\n $color_id = $params['id_color']; \n } \n unset($params['id_color']);\n $sth = $this->pdo->prepare($query);\n $sth->execute($params);\n $collection = [];\n $arr_id = []; \n $temp = [];\n while($res = $sth->fetch(\\PDO::FETCH_ASSOC)){\n $temp[] = $res;\n $arr_id[] = $res['id'];\n }\n $collection['cars'] = $temp;\n $str_id = implode(\",\", $arr_id);\n\n if($color_id!=\"\"){\n $query = \"SELECT cars.id, brands.name as brand, models.name as model, cars.img\"\n . \" FROM brands JOIN\"\n . \" (cars JOIN models ON models.id = cars.id_model)\"\n . \" ON brands.id = cars.id_brand \"\n . \" WHERE cars.id IN \"\n . \" (SELECT id_car FROM color_car WHERE id_color = :id_color AND id_car IN ($str_id))\";\n $sth = $this->pdo->prepare($query);\n $sth->execute(['id_color'=>$color_id]);\n $collection['cars'] = $this->getFetchAccoss($sth);\n }else{\n unset($params['id_color']);\n }\n\n $collection ['sucess'] = 1;\n return json_encode($collection);\n\n }else{\n $err_arr = ['sucess'=>0, 'error'=>ERROR_PARAMS];\n return json_encode($err_arr);\n }\n }catch(PDOException $err){\n file_put_contents('errors.txt', $err->getMessage(), FILE_APPEND); \n $err_arr = ['sucess'=>0];\n return json_encode($err_arr);\n }\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MenuTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "public function series_filter(string $id, array $keys)\n {\n $params = array('keys' => implode(',', $keys));\n return $this->request(\"series/{$id}/filter\", $params);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CastlesPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliHoldheadTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "public function filterByPrimaryKey($key)\n {\n throw new LogicException('The Map object has no primary key');\n }", "public function selectByFilter($routerVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($routerVo)) $routerVo = new RouterVo();\n$sql = \"select * from `router` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($routerVo->routerId)){ //If isset Vo->element\n$fieldValue=$routerVo->routerId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `router_id` $key :routerIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `router_id` $key :routerIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':routerIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':routerIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `router_id` = :routerIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `router_id` = :routerIdKey';\n}\n$params[]=array(':routerIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->layoutId)){ //If isset Vo->element\n$fieldValue=$routerVo->layoutId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `layout_id` $key :layoutIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `layout_id` $key :layoutIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `layout_id` = :layoutIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `layout_id` = :layoutIdKey';\n}\n$params[]=array(':layoutIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->pkName)){ //If isset Vo->element\n$fieldValue=$routerVo->pkName;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `pk_name` $key :pkNameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `pk_name` $key :pkNameKey\";\n}\nif($type == 'str') {\n $params[] = array(':pkNameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':pkNameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `pk_name` = :pkNameKey';\n$isFirst=false;\n}else{\n$condition.=' and `pk_name` = :pkNameKey';\n}\n$params[]=array(':pkNameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->prefix)){ //If isset Vo->element\n$fieldValue=$routerVo->prefix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `prefix` $key :prefixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `prefix` $key :prefixKey\";\n}\nif($type == 'str') {\n $params[] = array(':prefixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':prefixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `prefix` = :prefixKey';\n$isFirst=false;\n}else{\n$condition.=' and `prefix` = :prefixKey';\n}\n$params[]=array(':prefixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->suffix)){ //If isset Vo->element\n$fieldValue=$routerVo->suffix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `suffix` $key :suffixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `suffix` $key :suffixKey\";\n}\nif($type == 'str') {\n $params[] = array(':suffixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':suffixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `suffix` = :suffixKey';\n$isFirst=false;\n}else{\n$condition.=' and `suffix` = :suffixKey';\n}\n$params[]=array(':suffixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->alias)){ //If isset Vo->element\n$fieldValue=$routerVo->alias;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias` $key :aliasKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias` $key :aliasKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias` = :aliasKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias` = :aliasKey';\n}\n$params[]=array(':aliasKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasBy)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasBy;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_by` $key :aliasByKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_by` $key :aliasByKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasByKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasByKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_by` = :aliasByKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_by` = :aliasByKey';\n}\n$params[]=array(':aliasByKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasList)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasList;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_list` $key :aliasListKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_list` $key :aliasListKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasListKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasListKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_list` = :aliasListKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_list` = :aliasListKey';\n}\n$params[]=array(':aliasListKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->callback)){ //If isset Vo->element\n$fieldValue=$routerVo->callback;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `callback` $key :callbackKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `callback` $key :callbackKey\";\n}\nif($type == 'str') {\n $params[] = array(':callbackKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':callbackKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `callback` = :callbackKey';\n$isFirst=false;\n}else{\n$condition.=' and `callback` = :callbackKey';\n}\n$params[]=array(':callbackKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('RouterVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "private static function filterParams($params=[])\n { \n $where = '';\n if (!empty($params)) {\n $where = 'WHERE ';\n foreach ($params as $index=>$value) {\n $where .= $index.' = ? AND '; \n }\n $where = trim($where,'AND ');//delete and\n }\n $query = \"SELECT * FROM \".static::tableName().\" $where\";\n return $query;\n }", "public function addEntityIdFilter(string $id): Collection\n {\n return $this->addFilter(Model::ID, $id);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(ClientStateTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(ClientStateTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientStateTableMap::COL_ID, $id, $comparison);\n }", "public function whereId($value)\n {\n if (!is_scalar($value)) {\n throw new \\Exception(\"WHEREID argument must be a scalar\", 100);\n }\n $this->clauses[] = array('whereid', $value);\n return $this;\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(RepositoryPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filter($criteria, $filter, $args=[]);", "public function filterById($id = null, $comparison = null)\n\t{\n\t\tif (is_array($id) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $id, $comparison);\n\t}", "abstract public function filters();", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ActividadPeer::ID, $key, Criteria::EQUAL);\n\t}", "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function createWhere($valueId){\n return $this->createWhereByValue( $this->findValueById($valueId) );\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(UnitPeer::ID, $key, Criteria::EQUAL);\n\t}", "protected function filterIdColumn()\n {\n return 'manufacturercode';\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(PlanPeer::ID, $key, Criteria::EQUAL);\n }", "public function getQueryBy($param, $value)\r\n {\r\n return $this->db\r\n ->select('*')\r\n ->from('semestre s')\r\n ->where($param, $value)\r\n ->get();\r\n }", "private function filterStudent($filters) {\n $query = Student::all();\n\n if (isset($filters['major'])) {\n $query = $query->where('major', $filters['major']);\n }\n\n if (isset($filters['totalCertifiedHoursSSC'])) {\n $query = $query->where('totalCertifiedHoursSSC', $filters['conditionTotalCertifiedHoursSSC'], $filters['totalCertifiedHoursSSC']);\n }\n\n if (isset($filters['totalRegisteredHoursSSC'])) {\n $query = $query->where('totalRegisteredHoursSSC', $filters['conditionTotalRegisteredHoursSSC'], $filters['totalRegisteredHoursSSC']);\n }\n\n if (isset($filters['totalCertifiedHoursSSP'])) {\n $query = $query->where('totalCertifiedHoursSSP', $filters['conditionTotalCertifiedHoursSSP'], $filters['totalCertifiedHoursSSP']);\n }\n\n if (isset($filters['totalRegisteredHoursSSP'])) {\n $query = $query->where('totalRegisteredHoursSSP', $filters['conditionTotalRegisteredHoursSSP'], $filters['totalRegisteredHoursSSP']);\n }\n\n if (isset($filters['totalCertifiedHoursSS'])) {\n $query = $query->where('totalCertifiedHoursSS', $filters['conditionTotalCertifiedHoursSS'], $filters['totalCertifiedHoursSS']);\n }\n\n if (isset($filters['campus'])) {\n $query = $query->where('campus', $filters['campus']);\n }\n\n if (isset($filters['recCourseCertified'])) {\n $query = $query->where('recCourseCertified', $filters['recCourseCertified']);\n }\n\n if (isset($filters['inductionCourseCertified'])) {\n $query = $query->where('inductionCourseCertified', $filters['inductionCourseCertified']);\n }\n\n return $query;\n }", "public function filterByClId($clId = null, $comparison = null)\n {\n if (is_array($clId)) {\n $useMinMax = false;\n if (isset($clId['min'])) {\n $this->addUsingAlias(ClientPrestationsPeer::CL_ID, $clId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($clId['max'])) {\n $this->addUsingAlias(ClientPrestationsPeer::CL_ID, $clId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPrestationsPeer::CL_ID, $clId, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CardPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CardPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CardPeer::ID, $id, $comparison);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(TorneoCategoriaPeer::ID_TORNEO_CATEGORIA, $key, Criteria::EQUAL);\n\t}", "public function filter(Builder $dataSource)\r\n {\r\n $model = $dataSource->getModel();\r\n $filters = [];\r\n\r\n if ($this->_separated) {\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === self::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === self::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n if (null === $this->_value) {\r\n $filter = new \\Elastica\\Query\\Filtered();\r\n $filterMissing = new \\Elastica\\Filter\\Missing($field);\r\n //$filterMissing->addParam(\"existence\", true);\r\n //$filterMissing->addParam(\"null_value\", true);\r\n $filter->setFilter($filterMissing);\r\n\r\n $filters[] = $filter;\r\n } else {\r\n if ($criteria === self::CRITERIA_EQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_NOTEQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LIKE) {\r\n $filter = new \\Elastica\\Query\\Match();\r\n $filter->setField($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_BEGINS) {\r\n //$filter = new \\Elastica\\Query\\Prefix();\r\n //$filter->setPrefix($field, $this->_value);\r\n //$filters[] = $filter;\r\n $filter = new \\Elastica\\Query\\QueryString();\r\n $filter->setQuery($this->_value);\r\n $filter->setDefaultField($field);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_MORE) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gt' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LESS) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lt' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_MORER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gte' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LESSER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lte' => $this->_value]);\r\n $filters[] = $filter;\r\n }\r\n }\r\n }\r\n } else {\r\n $filters = new \\Elastica\\Query\\MultiMatch();\r\n $fields = [];\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === self::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === self::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n $fields[] = $field;\r\n }\r\n\r\n $filters->setFields($fields);\r\n $filters->setTieBreaker(0.3);\r\n $filters->setType($filters::TYPE_BEST_FIELDS);\r\n //$filter->setType($filter::TYPE_MOST_FIELDS);\r\n $filters->setQuery($this->_value);\r\n }\r\n\r\n\r\n return $filters;\r\n }", "abstract protected function foreignIDFilter($id = null);", "function filter_posts( $params ) {\n global $wpdb;\n\n $facet = $params['facet'];\n $selected_values = $params['selected_values'];\n $selected_values = array_pop( $selected_values );\n $selected_values = explode( '-', $selected_values );\n $selected_values = array_map( 'floatval', $selected_values );\n\n $sql = \"\n SELECT DISTINCT post_id FROM {$wpdb->prefix}facetwp_index\n WHERE facet_name = '{$facet['name']}' AND facet_value > $selected_values[0]\";\n\n if ( ! empty( $selected_values[1] ) ) {\n $sql .= \" AND facet_value < $selected_values[1] \";\n }\n\n return facetwp_sql( $sql, $facet );\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::ID, $id, $comparison);\n }", "public function selectByFilter($sliderImageVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($sliderImageVo)) $sliderImageVo = new SliderImageVo();\n$sql = \"select * from `slider_image` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($sliderImageVo->sliderImageId)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->sliderImageId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `slider_image_id` $key :sliderImageIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `slider_image_id` $key :sliderImageIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':sliderImageIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':sliderImageIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `slider_image_id` = :sliderImageIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `slider_image_id` = :sliderImageIdKey';\n}\n$params[]=array(':sliderImageIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($sliderImageVo->sliderId)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->sliderId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `slider_id` $key :sliderIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `slider_id` $key :sliderIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':sliderIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':sliderIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `slider_id` = :sliderIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `slider_id` = :sliderIdKey';\n}\n$params[]=array(':sliderIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($sliderImageVo->image)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->image;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `image` $key :imageKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `image` $key :imageKey\";\n}\nif($type == 'str') {\n $params[] = array(':imageKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':imageKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `image` = :imageKey';\n$isFirst=false;\n}else{\n$condition.=' and `image` = :imageKey';\n}\n$params[]=array(':imageKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->title)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->title;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `title` $key :titleKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `title` $key :titleKey\";\n}\nif($type == 'str') {\n $params[] = array(':titleKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':titleKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `title` = :titleKey';\n$isFirst=false;\n}else{\n$condition.=' and `title` = :titleKey';\n}\n$params[]=array(':titleKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->description)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->description;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `description` $key :descriptionKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `description` $key :descriptionKey\";\n}\nif($type == 'str') {\n $params[] = array(':descriptionKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':descriptionKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `description` = :descriptionKey';\n$isFirst=false;\n}else{\n$condition.=' and `description` = :descriptionKey';\n}\n$params[]=array(':descriptionKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->link)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->link;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `link` $key :linkKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `link` $key :linkKey\";\n}\nif($type == 'str') {\n $params[] = array(':linkKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':linkKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `link` = :linkKey';\n$isFirst=false;\n}else{\n$condition.=' and `link` = :linkKey';\n}\n$params[]=array(':linkKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->order)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->order;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order` $key :orderKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order` $key :orderKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order` = :orderKey';\n$isFirst=false;\n}else{\n$condition.=' and `order` = :orderKey';\n}\n$params[]=array(':orderKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('SliderImageVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "abstract public function filter(Builder $dataSource);", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PeliculaPeer::ID, $key, Criteria::EQUAL);\n\t}", "protected function user_where_clause() {}", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(ScoutImportPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliSmbonusTableMap::COL_AID, $key, Criteria::EQUAL);\n }", "public function filterByClPrestId($clPrestId = null, $comparison = null)\n {\n if (is_array($clPrestId)) {\n $useMinMax = false;\n if (isset($clPrestId['min'])) {\n $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $clPrestId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($clPrestId['max'])) {\n $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $clPrestId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPrestationsPeer::CL_PREST_ID, $clPrestId, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TeamTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(EafFormInfoPeer::ID, $key, Criteria::EQUAL);\n\t}", "abstract public function filterWhere(Builder $dataSource);", "protected function filter(&$query)\n {\n if (!empty($this->filterModel)) {\n if (isset($this->filterModel->status_id)) {\n $query->andWhere(['status' => $this->filterModel->status_id]);\n }\n }\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(ProductoPeer::ID_PRODUCTO, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(AliFmbonusTableMap::COL_AID, $key, Criteria::EQUAL);\n }", "public function filterByResourceId($resourceId = null, $comparison = null)\n\t{\n\t\tif (is_array($resourceId)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($resourceId['min'])) {\n\t\t\t\t$this->addUsingAlias(CalendarPeer::RESOURCE_ID, $resourceId['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($resourceId['max'])) {\n\t\t\t\t$this->addUsingAlias(CalendarPeer::RESOURCE_ID, $resourceId['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(CalendarPeer::RESOURCE_ID, $resourceId, $comparison);\n\t}", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TestEvalTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CustomerTableMap::COL_CUSTOMER_ID, $key, Criteria::EQUAL);\n }", "public function filterByUniqueId(UniqueId $uuid): self;", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FoodTableMap::COL_ID, $key, Criteria::EQUAL);\n }" ]
[ "0.62507355", "0.52833366", "0.5076601", "0.5074339", "0.50417024", "0.49674606", "0.48690894", "0.48471305", "0.482481", "0.4824601", "0.48025548", "0.47710732", "0.47683024", "0.47671998", "0.47402745", "0.47310618", "0.47300684", "0.47291607", "0.47286707", "0.47137916", "0.46792105", "0.46780264", "0.46762764", "0.4672865", "0.46708354", "0.4669641", "0.46635517", "0.46635517", "0.46615046", "0.46149772", "0.46101436", "0.4607945", "0.4578709", "0.45755896", "0.4555767", "0.45538086", "0.4546089", "0.45380074", "0.4534639", "0.45303816", "0.45263728", "0.4521109", "0.45207334", "0.45178595", "0.45150164", "0.45118436", "0.4505767", "0.45032656", "0.4501087", "0.4487287", "0.4472627", "0.44699502", "0.44571733", "0.44544652", "0.4449672", "0.44489792", "0.44400555", "0.44296277", "0.44283012", "0.4415528", "0.44139996", "0.44120166", "0.44094706", "0.44094706", "0.44042188", "0.44018745", "0.43983245", "0.43963286", "0.43954483", "0.43944997", "0.43922767", "0.43888456", "0.43826035", "0.43819702", "0.43793884", "0.43723208", "0.43695644", "0.4368547", "0.43667302", "0.43660933", "0.43658397", "0.43596947", "0.43563983", "0.43525532", "0.43512982", "0.4345089", "0.43370146", "0.43364257", "0.43353721", "0.433192", "0.43306366", "0.43221533", "0.4311611", "0.43064353", "0.43048507", "0.4304172", "0.43015626", "0.4300764", "0.43000656", "0.42994252" ]
0.62240636
1
Filter the query on the name column Example usage: $query>filterByName('fooValue'); // WHERE name = 'fooValue' $query>filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
public function filterByName($name = null, $comparison = null) { if (null === $comparison) { if (is_array($name)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $name)) { $name = str_replace('*', '%', $name); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(SceneTableMap::COL_NAME, $name, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByName($name)\n {\n $name = (string) $name;\n if ($name !== '') {\n $this->query->andWhere($this->query->expr()->like('b.name', $this->query->createNamedParameter('%' . addcslashes($name, '%_\\\\') . '%')));\n }\n }", "public function filterByName($filter) {\n if (strlen($filter) > 0) {\n $this->calcData = array_filter($this->calcData, function($item) use ($filter) {\n if (strpos($item['name'], $filter) !== false) {\n return $item;\n }\n });\n }\n }", "public function getFilter(string $name);", "public function name ($name) {\n return (!$this->requestAllData($name)) ? $this->builder->where('name', 'like', '%'.$name.'%') : null;\n }", "public function searchUserByName($name){\r\n $result = $this->DB->fetchAll('select * from user where name like ?',array(\"%{$name}%\"));\r\n return $this->formatResult($result);\r\n }", "public function filterExists(string $name);", "public function searchName($name = null, $perPage = 5, $columns = array('*')) {\n\n return $this->model\n ->where('name', 'like', '%' . $name . '%')\n ->orderBy('created_at', 'DESC')\n ->paginate($perPage, $columns);\n }", "public function fuzzySearchName($name) {\n $con = mysqli_connect('localhost', 'root', 'root', 'HexDatabase');\n //TODO: Add firstname and surname support\n $query = 'SELECT * FROM User WHERE firstName LIKE \\'%'.$name.'%\\';';\n $results = mysqli_query($con, $query);\n if ($results) {\n return $this->getResultAsJson($results);\n } else {\n return json_encode(null);\n }\n }", "public function byName($name)\n {\n $this->whereClause .= ' AND name LIKE ?';\n $this->parameterList[] = $name;\n\n return $this;\n }", "public function seachByName($query)\n {\n return $this->model->where('name', 'like', \"%\" . $query . \"%\");\n }", "public function filter ( $name ) {\n\t\t$this->opts['filter'] = $name;\n\t\treturn $this;\n\t}", "public function filterName($name)\n {\n $rule = array(\n \"\\r\" => '',\n \"\\n\" => '',\n \"\\t\" => '',\n '\"' => \"'\",\n '<' => '[',\n '>' => ']',\n );\n $filtered = filter_var(\n $name,\n FILTER_SANITIZE_STRING,\n FILTER_FLAG_NO_ENCODE_QUOTES\n );\n return trim(strtr($filtered, $rule));\n }", "public function by_name($name) {\n return parent::_by_fields(\n self::BY_NAME,\n [\n 'name' => (string) $name,\n ]\n );\n }", "public function scopeName($query, $name)\n {\n return $query->orWhere('name', 'LIKE', '%'.$name.'%');\n }", "function xh_fetchFilter($filter_name)\r\n\t{\r\n\t}", "public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n return $query->where('name', 'LIKE', \"%$name%\");\n }", "public function searchByName($query);", "public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n }", "public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n }", "public function scopeName($query, $name)\n {\n if($name)\n return $query->where('IAP_DESC', 'LIKE', \"%$name%\");\n }", "public function removeFilter(string $name);", "public function filterByName($value, $operator = \"=\") \n {\n $this->addFilter(\"Name\", $value, $operator);\n return $this;\n }", "public function filter($name, $callback)\r\n {\r\n // TODO: Implement filter() method.\r\n }", "public function findStudentsWithNameFiltering($name)\n {\n return $this->createQueryBuilder('u')\n ->select('u.lastName')\n ->join('u.group', 'g')\n ->where('g.name = :group_name')\n ->andWhere('u.lastName LIKE :last_name')\n ->setParameters([\n 'group_name' => 'Студент',\n 'last_name' => $name . '%',\n ])\n ->getQuery()\n ;\n }", "public function getFilter($name)\n {\n return $this->jade->getFilter($name);\n }", "public function testSingleName()\n {\n $filter = new Name();\n\n $this->assertSame([\n 'forename' => 'Ian',\n 'surname' => ''\n ], $filter->filter('Ian'));\n\n $this->assertSame([\n 'forename' => 'Dave',\n 'surname' => ''\n ], $filter->filter('dave'));\n }", "function selectEventsWithName($name)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE events.name LIKE :name ;\";\n return executeQuerySelect($query, createBinds([[\":name\", $name]]));\n}", "private function filterInput($name, $value)\n {\n if ($this->filter == null) {\n throw new \\Exception('No filter object defined!');\n }\n\n $val = $this->filter->filter($name, $value);\n return ($val !== false && $val !== null) ? $val : null;\n }", "public function filterByName($name = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($name)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $name)) {\n\t\t\t\t$name = str_replace('*', '%', $name);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(SettingPeer::NAME, $name, $comparison);\n\t}", "public function whereName($value) {\n return $this->addSearchParam('searchFor', $value);\n }", "public function findByName(String $name);", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::NAME, $name, $comparison);\n }", "abstract public function getFilterName();", "public static function search_characters_by_name($name) {\n\t\t$result = DB::table('characters')\n\t\t\t\t->where('deleted', 0)\n\t\t\t\t->where('name','LIKE', '%'.$name.'%')\n\t\t\t\t->get();\n\n\t\treturn $result;\n\t}", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserPeer::NAME, $name, $comparison);\n }", "protected function filter($rows){\n\n if(request()->has('name') && request()->get('name') !=\"\"){\n $rows = $rows->where('name',request()->get('name')) ; \n }\n return $rows;\n }", "public function removeFilter(string $name): void;", "public function search_by_name($query, $limit = null, $offset = 0) {\n $where = '`'.$this->table()->info('name').'`.`displayname` LIKE ?';\n $arg = '%'. $query .'%';\n return $this->_all_where($where, $arg, $limit, $offset);\n }", "public static function filter($name)\n {\n $result = '';\n $tot = strlen($name);\n for ($i = 0; $i < $tot; $i += 1) {\n $ord = ord($name[$i]);\n if ($ord > 32 && $ord < 127 && $ord !== 58) {\n $result .= $name[$i];\n }\n }\n return $result;\n }", "private function filterName($name)\n {\n $name = ucfirst($name);\n $name = str_replace('_', ' ', $name);\n \n return $name;\n }", "public function testDoubleName()\n {\n $filter = new Name();\n\n $this->assertSame([\n 'forename' => 'Ian',\n 'surname' => 'Chadwick'\n ], $filter->filter('Ian Chadwick'));\n\n $this->assertSame([\n 'forename' => 'Dave',\n 'surname' => 'Jones'\n ], $filter->filter('dave jones'));\n }", "public function scopeName($query, $name)\n {\n if($name)\n return $query->where('NOMBRE_COMPLETO', 'LIKE', \"%$name%\");\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(CastlesPeer::NAME, $name, $comparison);\n }", "public function filterByName($name = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($name)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $name)) {\n\t\t\t\t$name = str_replace('*', '%', $name);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::NAME, $name, $comparison);\n\t}", "public function filterByName($name = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($name)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $name)) {\n\t\t\t\t$name = str_replace('*', '%', $name);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::NAME, $name, $comparison);\n\t}", "public function byName($name)\n {\n $pdo = DB::getPdo();\n\n $sql = \"SELECT `clients`.`name`, `clients`.`uid`, `currencys`.`alias` AS `currency`, `clients`.`country`, \n `actions`.`alias` AS `action`, (`logs`.`value` / 100) AS `sum_value`, `logs`.`action_date`,\n IF(`rate`.`date` IS NOT NULL, ((`logs`.`value` / `rate`.`value`)), null) AS `curs`\n FROM `logs` \n LEFT JOIN `clients` ON `logs`.`client_id` = `clients`.`id`\n LEFT JOIN `wallets` ON `logs`.`client_id` = `wallets`.`client_id`\n LEFT JOIN `actions` ON `logs`.`action_id` = `actions`.`id`\n LEFT JOIN `currencys` ON `wallets`.`currency_id` = `currencys`.`id`\n LEFT JOIN `exchange_rates_to_usd` AS `rate` ON `currencys`.`id` IN(`rate`.`currency_id`)\n AND `rate`.`date` = CURDATE()\n WHERE `clients`.`name` LIKE :name\";\n\n $stmt = $pdo->prepare($sql, [PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true]);\n $stmt->bindParam(':name', $name, PDO::PARAM_STR);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if ($result === false) {\n throw new Exception('Error, not execute search client');\n }\n\n return $result;\n }", "private function filterName(string $name): string\n {\n $name = str_replace(['-', '_'], ' ', $name);\n $words = explode(' ', $name);\n $filtered = '';\n foreach ($words as $word) {\n $filtered .= ucfirst($word);\n }\n return $filtered;\n }", "public function hasFilter(string $name): bool;", "private function getFilterName($name) {\n $view = $this->viewsUtility->loadView($this->configuration['view_name'], $this->configuration['display_id']);\n if (!$view) {\n return $name;\n }\n\n // Default identifier.\n $filters = $view->display_handler->getOption('filters');\n if (isset($filters[$name])) {\n return $name;\n }\n\n // Identifier changed in view config.\n foreach ($filters as $key => $info) {\n if (isset($info['expose']) && isset($info['expose']['identifier']) && $info['expose']['identifier'] == $name) {\n return $key;\n }\n }\n\n return $name;\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::NAME, $name, $comparison);\n }", "public function testCategoriesAreFilteredByName()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.name]='.$visibleCategory->name)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function lookupNameFilter($id, $categoryName)\n {\n return Lookup::getInstance()->findById($categoryName, $id)->getName();\n }", "public static function search($name) {\n return DB::table('users AS u')\n ->where('u.fullname', 'LIKE', '%'.$name.'%')\n ->orWhere('u.username', 'LIKE', '%'.$name.'%')\n ->selectRaw('u.id, u.fullname, u.profile_image')\n ->get();\n }", "public function getFilter($name)\n {\n if (isset($this->_filters[$name])) {\n return $this->_filters[$name];\n } else {\n return $this->getRequest()->getParam($name) ? htmlspecialchars($this->getRequest()->getParam($name)) : '';\n }\n }", "public function scopeNombre($query,$name){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",NULL);\n\n // }\n }", "public function getProductsWithName($name){\r\n\t\t$newQuery = \"SELECT * from products \".\r\n\t\t\t\t\" WHERE name LIKE '%\".$name.\"%'\";\r\n\t\t\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($newQuery);\r\n\t}", "public function name($name)\n {\n $this->andWhere('name=:name:', [\n 'name' => $name\n ]);\n return $this;\n }", "public function name($name);", "public function addNameColumnQuery(Doctrine_Query $query, $field, $values) \n { \n\tif ( !empty($values['text']) ) \n\t{\n\t\t$driver = Doctrine_Manager::getInstance()\n\t\t\t->getCurrentConnection()->getDriverName();\n\t \n\t\tif\t($driver=='Mysql')\n\t\t\t$query->andWhere('LOWER(a.name) LIKE ?', strtolower($values['text'])); \n\t\telse\t\n\t\t\t$query->andWhere('a.name LIKE ?', $values['text']); \n\t}\t\n }", "protected function _filterRequestNames($name)\n {\n return '_' !== $name[0];\n }", "public function filterByName($name = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($name)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $name)) {\n\t\t\t\t$name = str_replace('*', '%', $name);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LpPeer::NAME, $name, $comparison);\n\t}", "function filterName($field) {\n // Limpiar el nombre del usuario\n $sanitizeField = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if (filter_var($sanitizeField, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"/^[a-zA-Z\\s]+$/\")))) {\n return $sanitizeField;\n } else {\n return false;\n }\n}", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(RemoteAppPeer::NAME, $name, $comparison);\n }", "public function applyFilter(AbstractQueryBuilder $queryBuilder, $name, $data);", "function filter($param)\r\n\t{\r\n\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t$sql = \"SELECT `\" . $param[1] . \"` FROM `\" . $param[0] . \"` WHERE `\" . $param[1] . \"` LIKE '\" . $_SQL->sql_real_escape_string($_GET['q']) . \"%' \r\n\t\t ORDER BY `\" . $param[1] . \"` LIMIT 0,100\";\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res) )\r\n\t\t{\r\n\t\t\techo $ob->$param[1] . \"\\n\";\r\n\t\t}\r\n\t}", "public function name(string $name): self\r\n {\r\n $this->name = Sanitization::input($name)->sanitize();\r\n return $this;\r\n }", "public function search($name)\n {\n return DB::table('pokemon')\n ->where('name', 'like', '%' . $name . '%')\n ->orderBy('name', $request->dir ?? 'ASC')\n ->paginate(10);\n }", "function filterName($field){\n // Sanitize user name\n $field = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if(filter_var($field, FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z\\s]+/\")))){\n return $field;\n }else{\n return FALSE;\n }\n}", "public function search($name)\n {\n //\n $objects = Object::where('name','LIKE',\"%$name%\")->get(['id','name']);\n return response()->json( $objects );\n }", "public function _search($name)\n {\n $result = $this->like('nama_pelanggan', $name)\n ->select('nama_pelanggan')\n ->limit(10)\n ->get()\n ->getResult();\n return $result;\n }", "public function setNameSearch($name = NULL){\n\t\t$this->nameSearch = $name ? $name : \"Procurar \".$this->name;\n\t}", "public function search($name)\n {\n return Item::where('title', 'like','%' .$name. '%')->orWhere('sku', 'like','%' .$name. '%')->orWhere('ebay_item_id', 'like','%' .$name. '%')->get();\n\n \n }", "function checkName(){\n $name = $_REQUEST[\"name\"];\n if(preg_match(\"/[a-zA-ZåäöÅÄÖ0-9]+/\", $name)){\n $db = new MyDB(\"sqltemptime.db\");\n if(!$db){\n echo $db->lastErrorMsg();\n }\n $sql = <<<EOF\n SELECT name FROM mashschedule WHERE name=\"$name\";\nEOF;\n $ret = $db->query($sql);\n $row = $ret->fetchArray(SQLITE3_ASSOC);\n if($row['name']){\n echo \"fail\";\n } else {\n echo \"success\";\n }\n $db->close();\n }\n else{\n echo \"Name not valid\";\n }\n}", "protected function setFilter($name, $value)\n {\n if (isset($this->filterTypes[$name])) {\n $this->filters[$name] = $value;\n $this->_nested = null;\n return;\n }\n $key = $name;\n $elements = explode(\":\", $name, 2);\n $operator = null;\n if (count($elements) > 1) {\n list($name, $operator) = $elements;\n } else {\n $name = $elements[0];\n }\n if ($name == 'visible' || $name == 'visibility') {\n $this->useVisibility = false;\n if ($name == 'visible') {\n $this->objectFilters[] = array('visibility', $value);\n } else {\n $this->objectFilters[] = array($key, $value);\n }\n } elseif ($name == 'path' || $name == 'section' || $name == 'state' || $name == 'depth' || $name == 'class_identifier' || $name == 'class_name' || $name == 'priority' || $name == 'name') {\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'published' || $name == 'modified' || $name == 'modified_subnode') {\n if ($value instanceof \\DateTime) {\n $value = $value->getTimestamp();\n }\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'node_id') {\n if (is_object($value)) {\n if ($value instanceof \\eZContentObjectTreeNode) {\n $value = $value->attribute('node_id');\n } elseif ($value instanceof \\eZContentObject) {\n $value = $value->attribute('main_node_id');\n }\n }\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'contentobject_id') {\n if (is_object($value)) {\n if ($value instanceof \\eZContentObjectTreeNode) {\n $value = $value->attribute('contentobject_id');\n } elseif ($value instanceof \\eZContentObject) {\n $value = $value->attribute('id');\n }\n }\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'path_element') {\n if (is_object($value)) {\n if ($value instanceof \\eZContentObjectTreeNode) {\n $value = $value->attribute('contentobject_id');\n } elseif ($value instanceof \\eZContentObject) {\n $value = $value->attribute('id');\n }\n }\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'class_identifier') {\n if (is_object($value)) {\n if ($value instanceof \\eZContentClass) {\n $value = $value->attribute('identifier');\n } elseif ($value instanceof \\eZContentObjectTreeNode || $value instanceof \\eZContentObject) {\n $value = $value->attribute('class_identifier');\n }\n }\n $this->objectFilters[] = array($key, $value);\n } elseif ($name == 'class_name') {\n if (is_object($value)) {\n if ($value instanceof \\eZContentClass) {\n $value = $value->attribute('name');\n } elseif ($value instanceof \\eZContentObjectTreeNode || $value instanceof \\eZContentObject) {\n $value = $value->attribute('class_name');\n }\n }\n $this->objectFilters[] = array($key, $value);\n } else {\n // Detect class/attribute strings and use them as filters\n // If not they are placed as object filters\n if (strpos($name, \"/\") !== false) {\n $this->objectFilters[] = array($key, $value);\n } else {\n $this->filters[$name] = $value;\n }\n }\n $this->_nested = null;\n }", "public function filterByName($model = null, $searchedName, $dbColumn)\n {\n //recherche par nom\n if( isset($searchedName) && !empty($searchedName) )\n {\n $array = [];\n $modelFiltered = $model->each(function ($items) use($searchedName, $dbColumn, &$array){\n $array = $items->where($dbColumn, 'LIKE', '%'.$searchedName.'%')->get();\n });\n\n if($array) {\n $currentPage = LengthAwarePaginator::resolveCurrentPage();\n $currentPageItems = $array->slice(($currentPage - 1) * 10, 10);\n $usersPaginate = new LengthAwarePaginator($currentPageItems, count($array), 10);\n $modelsFiltredToReturn = $usersPaginate->setPath($_SERVER['REQUEST_URI']);\n\n return $modelsFiltredToReturn;\n }else{ return $model;}\n }\n return $model;\n }", "static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }", "public function filterCheckCustomerName($name)\n {\n $modelCustomer = new QcCustomer();\n $dataCustomer = $modelCustomer->infoFromSuggestionName($name);\n if (count($dataCustomer) > 0) {\n $result = array(\n 'status' => 'exist',\n 'content' => $dataCustomer\n );\n } else {\n $result = array(\n 'status' => 'notExist',\n 'content' => \"null\"\n );\n }\n die(json_encode($result));\n }", "public function findByName($name);", "public function findByName($name);", "public function findByName($name);", "public function testGetName()\n\t{\n\t\t$this->assertEquals($this->filterName, $this->filter->getName());\n\t}", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(cTableActionsPeer::NAME, $name, $comparison);\n }", "public function search($input)\r\n {\r\n return $this->db->table(self::TABLE)->ilike('name', '%' . $input . '%')->asc('name')->findAll();\r\n }", "static public function getOneByName($name) {\n $name = htmlspecialchars($name);\n $name = mb_strtolower($name);\n\n $query = self::getBaseQuery();\n $query.= \" WHERE LOWER(name) = '{$name}'\";\n\n return PDOManipulator::create()\n ->query($query);\n }", "public function callFilter($filterName, $inputString)\n {\n if ($filterName == 'nospaces') {\n return str_replace(' ', '', $inputString);\n }\n\n throw new JigException(\"callFilter called for unknown filter '$filterName'\");\n }", "public function search($name)\n {\n // Get the authenticated user\n $user = auth()->user();\n\n return Contact::\n where('name', 'like', '%'.$name.'%')->\n where('user_id', $user->id)->\n get();\n }", "public function __construct($name)\n {\n parent::__construct($name, 'SearchByColumn', '~');\n }", "function filter($request) {\n\t\t//$model = singleton($this->modelClass);\n\t\t$context = $this->dataObject->getDefaultSearchContext();\n\t\t$value = $request->getVar('q');\n\t\t$results = $context->getResults(array(\"Name\"=>$value));\n\t\theader(\"Content-Type: text/plain\");\n\t\tforeach($results as $result) {\n\t\t\techo $result->Name . \"\\n\";\n\t\t}\t\t\n\t}", "public function __construct($name)\n {\n parent::__construct($name, 'ApplyFilter', '-1');\n $this->filterExpressions = new IndexedCollection();\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(sfSimpleCMSSlotPeer::NAME, $name, $comparison);\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(RemoteHistoryContaoPeer::NAME, $name, $comparison);\n }", "public function removeFilter($name)\n {\n unset($this->filters[$name]);\n }", "public function getWhere($name = null)\n {\n return $this->_get('_where', $name);\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TeamTableMap::COL_NAME, $name, $comparison);\n }", "public function filter($name, $value=null)\n {\n $clone = $this->makeClone(true);\n if (is_array($name)) {\n $filters = $name;\n foreach ($filters as $name => $value) {\n $clone->setFilter($name, $value);\n }\n } else {\n $clone->setFilter($name, $value);\n }\n return $clone;\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MapTableMap::COL_NAME, $name, $comparison);\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TeamMemberTableMap::COL_NAME, $name, $comparison);\n }", "public function filterByHcName($hcName = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($hcName)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $hcName)) {\n\t\t\t\t$hcName = str_replace('*', '%', $hcName);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(HomeCategoryPeer::HC_NAME, $hcName, $comparison);\n\t}", "protected function applyNameFilter(Builder $instance, array $filters): void\n {\n if ($name = Arr::get($filters, 'name')) {\n $filterString = '%' . $name . '%';\n\n $instance->where(static function (Builder $instance) use ($filterString) {\n $instance->where('sendportal_subscribers.first_name', 'like', $filterString)\n ->orWhere('sendportal_subscribers.last_name', 'like', $filterString)\n ->orWhere('sendportal_subscribers.email', 'like', $filterString);\n });\n }\n }", "public function search($name) {\n return $this->db->query(\"SELECT * FROM `user` WHERE `firstname` ='$name' or `lastname`='$name'\")->result();\n //return $this->db->last_query();\n //return $query->result(); \n }" ]
[ "0.7560682", "0.70978594", "0.67135376", "0.67033", "0.6342645", "0.63185567", "0.6304595", "0.6302433", "0.6166413", "0.61547184", "0.6124989", "0.61144906", "0.6100394", "0.6098749", "0.6090962", "0.6059548", "0.600586", "0.5995159", "0.5995159", "0.5971277", "0.5961557", "0.59505326", "0.5935012", "0.59240806", "0.5921693", "0.5895982", "0.58935696", "0.58902526", "0.5843079", "0.5836281", "0.5818464", "0.5816976", "0.58124083", "0.58079916", "0.5801306", "0.57860035", "0.57824355", "0.57800424", "0.5779746", "0.5736067", "0.5734044", "0.5713196", "0.5692241", "0.5687244", "0.5687244", "0.5682302", "0.5655551", "0.56436765", "0.562354", "0.5614289", "0.5606054", "0.55994254", "0.559222", "0.55784714", "0.5578043", "0.55764645", "0.5553834", "0.55471957", "0.5529695", "0.5526352", "0.5525687", "0.55251515", "0.55151886", "0.5514615", "0.551376", "0.5513515", "0.5488431", "0.54780066", "0.5477972", "0.5476767", "0.54611015", "0.5437304", "0.54221416", "0.54218173", "0.5418369", "0.5416623", "0.5408821", "0.53840905", "0.53840905", "0.53840905", "0.53716826", "0.5370966", "0.53706133", "0.5370477", "0.5369476", "0.536804", "0.5363872", "0.53624445", "0.53609484", "0.5356213", "0.5353877", "0.5350298", "0.5342847", "0.53426874", "0.53409237", "0.53325784", "0.53323936", "0.53085893", "0.5297628", "0.5296004" ]
0.5472418
70
Filter the query on the description column Example usage: $query>filterByDescription('fooValue'); // WHERE description = 'fooValue' $query>filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
public function filterByDescription($description = null, $comparison = null) { if (null === $comparison) { if (is_array($description)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $description)) { $description = str_replace('*', '%', $description); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(SceneTableMap::COL_DESCRIPTION, $description, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFilter($description, $value) {\n $this->callMethod( 'addFilter', array($description, $value) );\n }", "public function filterByDescription($description = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($description)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $description)) {\n\t\t\t\t$description = str_replace('*', '%', $description);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::DESCRIPTION, $description, $comparison);\n\t}", "public function filterByDescription($description = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($description)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $description)) {\n\t\t\t\t$description = str_replace('*', '%', $description);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LpPeer::DESCRIPTION, $description, $comparison);\n\t}", "public function FilterDescription() {\n\t\t$params = $this->parseParams();\n\n\t\t$filters = array();\n\t\tif ($params['tag']) {\n\t\t\t$term = TaxonomyTerm::get_by_id('TaxonomyTerm', $params['tag']);\n\t\t\tif ($term) {\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_WITHIN', 'within') . ' \"' . $term->Name . '\"';\n\t\t\t}\n\t\t}\n\n\t\tif ($params['from'] || $params['to']) {\n\t\t\tif ($params['from']) {\n\t\t\t\t$from = strtotime($params['from']);\n\t\t\t\tif ($params['to']) {\n\t\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '\n\t\t\t\t\t\t. date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);\n\t\t\t\t} else {\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $from);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $to);\n\t\t\t}\n\t\t}\n\n\t\tif ($params['year'] && $params['month']) {\n\t\t\t$timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);\n\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_IN', 'in') . ' ' . date('F', $timestamp) . ' ' . $params['year'];\n\t\t}\n\n\t\tif ($filters) {\n\t\t\treturn $this->getUpdateName() . ' ' . implode(' ', $filters);\n\t\t}\n\t}", "public function getDescriptionAttribute($description)\n {\n return \\Purify::clean($description);\n }", "public function filterByDescription($description = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($description)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $description)) {\n\t\t\t\t$description = str_replace('*', '%', $description);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(QuizPeer::DESCRIPTION, $description, $comparison);\n\t}", "public function search($description)\n {\n return Taske::where('description', 'LIKE', \"%{$description}%\")->paginate(15);\n \n }", "public function filterByDescription($description = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($description)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $description)) {\n $description = str_replace('*', '%', $description);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(PhotosPeer::DESCRIPTION, $description, $comparison);\n }", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "protected function getDescriptionQuery()\n {\n return $this->descriptionQuery;\n }", "public function setDescription($description)\n {\n $this->description = $this->db->real_escape_string($description);\n\n return $this;\n }", "public function filterByDescription($description = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($description)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MapTableMap::COL_DESCRIPTION, $description, $comparison);\n }", "public function setDescription($value)\n {\n return $this->setParameter('description', $value);\n }", "public function description(?string $description): static;", "function setDescription($description) {\n $this->checkChange();\n\n $this->description = $description;\n return $this;\n }", "public function filterByDescription($description = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($description)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserTableMap::COL_DESCRIPTION, $description, $comparison);\n }", "public function setDesciption($description);", "public function setDescription($description)\n {\n parent::setDescription($this->replaceType($description));\n }", "public function setDescription(/*string*/ $description);", "public function filter_coler($params){\n $this->db->select(\"$this->table_product.text_coler\")\n ->from($this->table_product);\n $this->db->distinct();\n if (!empty($params['keyword'])) $this->db->like(\"$this->table_product.text_coler\", $params['keyword']);\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "public function description( string $description ) : self\n {\n $this->description = $description;\n return $this;\n }", "public function setDescriptionAttribute($value)\n {\n $this->attributes['description'] = strtolower($value);\n }", "public function setDescription($description){\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\r\n {\r\n $this->description = $description;\r\n\r\n return $this;\r\n }", "private function cleanDescription($description): string\n {\n $description = filter_var(trim($description), FILTER_SANITIZE_STRING);\n return preg_replace(\"/\\s+/\", ' ', $description);\n }", "public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\t\treturn $this;\n\t}", "public function setDescription($description)\n {\n $this->description = $description;\n \n return $this;\n }", "public function setDescription($description) {\n $this->_description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->_description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n \n $this->__set(self::FIELD_DESCRIPTION,$description);\n \n return $this;\n }", "public function setDescription($description)\r\n {\r\n $this->description = $description;\r\n\r\n return $this;\r\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description) \n\t{\n \n $this->description = empty($description) ? \"\" : $description;\t\n\t}", "public function setDescription($description){\n\t\t$this->description = $description;\n\t}", "public function setDescription($description) {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description) {\n $this->description = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = (string) $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\r\n {\r\n $this->description = $description;\r\n }", "public function filterByDescription($description = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($description)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(QueryParametersTableMap::COL_QRP_DESCRIPTION, $description, $comparison);\n }", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "function searchDescription($description){\n\t\t//Connect to database. Include db_password.php with your MySQL or MariaDB credentials\n\t\n\t\ttry{\n\t\t\tif(!isset($pdo)){\n\t\t\t\t$pdo = new PDO('mysql:host=127.0.0.1;dbname=auction_site_db', $GLOBALS[\"user\"], $GLOBALS[\"pass\"]); //$user, $pass);\n\t\t\t}\n\t\t\t\n\t\t\t$queryString = 'SELECT * FROM AuctionItems WHERE itemDescription LIKE :itemDescription'; //= :itemName'; \n\t\t\t//$queryString = \"SELECT * FROM AuctionItems\"; //for debugging\n\t\t\t\n\t\t\t$query = $pdo->prepare($queryString);\n\t\t\t\n\t\t\t//take name variable, add SQL wildcards to find more results\n\t\t\t//$wildcard = \"%\";\n\t\t\t//$iName = {$wildcard}{$GLOBALS[\"name\"]}{$wildcard};\n\t\t\t//print_r($iName);\n\t\t\t//$name = \"fdfd\";\n\t\t\t\n\t\t\t$query->execute(array(':itemDescription' => $description));//$GLOBALS[\"name\"]));\t//$name));\n\t\t\t$query_result = $query->fetchAll(PDO::FETCH_BOTH);\n\t\t\t\n\t\t\tif($query_result){\n\t\t\t\t//echo json_encode(array_values($query_result));\n\t\t\t\treturn json_encode(array_values($query_result));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//echo \"No match was found\";\n\t\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\t}\n\t\t\t\n\t\t\t//make everything null so it closes the db connection\n\t\t\t$query = null; \n\t\t\t$pdo = null;\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\tdie();\n\t\t}\n\t\n\t}", "public function set_description ($description) {\n $this->description = $description;\n }", "public function setDescription($description): self\r\n {\r\n $this->extras['description'] = $description;\r\n return $this;\r\n }", "public function setDescription($description) {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n\t{\n\t\t$this->_description = $description;\n\t}", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function setDescription($description) {\n $this->description = $description;\n }", "public function setDescription( $description )\r\n\t{\r\n\t\t$this->description = $description;\r\n\t}", "public function set_description(String $_description){\n $this->_description = $_description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->values['Description'] = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->values['Description'] = $description;\n return $this;\n }", "public function setDescription($description)\n {\n $this->values['Description'] = $description;\n return $this;\n }", "protected function setDescription($description) {\r\n $this->description = $description;\r\n }", "public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\n\t\treturn $this;\n\t}", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n\n return $this;\n }" ]
[ "0.6368608", "0.63634586", "0.624017", "0.608958", "0.60247576", "0.5812391", "0.5779115", "0.5748133", "0.5744105", "0.5744105", "0.5744105", "0.5744105", "0.5744105", "0.5744105", "0.5736533", "0.5695035", "0.56949794", "0.5599126", "0.5551501", "0.55424416", "0.5535576", "0.5492903", "0.5448671", "0.5439674", "0.54308975", "0.5413437", "0.5387216", "0.5386606", "0.5385708", "0.5385061", "0.53759557", "0.5373736", "0.5358116", "0.5353955", "0.5351865", "0.5349491", "0.5345882", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.5339243", "0.53337806", "0.53301823", "0.5325727", "0.5325727", "0.53188944", "0.53078485", "0.5307147", "0.52994", "0.5298436", "0.52973694", "0.52973694", "0.5296322", "0.52936846", "0.52932745", "0.52908695", "0.5286095", "0.5284361", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5283269", "0.5277388", "0.52755123", "0.5275221", "0.52687836", "0.5268019", "0.526717", "0.52670825", "0.52670825", "0.52670825", "0.52670574", "0.5263651", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694", "0.52578694" ]
0.5500863
21
Filter the query on the update_time column Example usage: $query>filterByUpdateTime('20110314'); // WHERE update_time = '20110314' $query>filterByUpdateTime('now'); // WHERE update_time = '20110314' $query>filterByUpdateTime(array('max' => 'yesterday')); // WHERE update_time > '20110313'
public function filterByUpdateTime($updateTime = null, $comparison = null) { if (is_array($updateTime)) { $useMinMax = false; if (isset($updateTime['min'])) { $this->addUsingAlias(SceneTableMap::COL_UPDATE_TIME, $updateTime['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($updateTime['max'])) { $this->addUsingAlias(SceneTableMap::COL_UPDATE_TIME, $updateTime['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(SceneTableMap::COL_UPDATE_TIME, $updateTime, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _filter(&$values) {\n\t\tif (is_array($values)) {\n\t\t\tforeach (array_keys($values) as $key) {\n\t\t\t\tif (!isset($values[$key]['TS_UPDATE']) || $values[$key]['TS_UPDATE'] < time()-1800) {\n\t\t\t\t\tunset($values[$key]);\n\t\t\t\t\t$this->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setUpdateTime($update_time)\n\t{\n\t\t$column = self::COL_UPDATE_TIME;\n\t\t$this->$column = $update_time;\n\n\t\treturn $this;\n\t}", "public function setUpdateTime($update_time)\n\t{\n\t\t$column = self::COL_UPDATE_TIME;\n\t\t$this->$column = $update_time;\n\n\t\treturn $this;\n\t}", "public function filterByLastUpdate($lastUpdate = null, $comparison = null)\n {\n if (is_array($lastUpdate)) {\n $useMinMax = false;\n if (isset($lastUpdate['min'])) {\n $this->addUsingAlias(AnakPeer::LAST_UPDATE, $lastUpdate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastUpdate['max'])) {\n $this->addUsingAlias(AnakPeer::LAST_UPDATE, $lastUpdate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AnakPeer::LAST_UPDATE, $lastUpdate, $comparison);\n }", "public function filterByLastUpdate($lastUpdate = null, $comparison = null)\n {\n if (is_array($lastUpdate)) {\n $useMinMax = false;\n if (isset($lastUpdate['min'])) {\n $this->addUsingAlias(TemplateUnPeer::LAST_UPDATE, $lastUpdate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastUpdate['max'])) {\n $this->addUsingAlias(TemplateUnPeer::LAST_UPDATE, $lastUpdate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TemplateUnPeer::LAST_UPDATE, $lastUpdate, $comparison);\n }", "private function filterDay()\n {\n try {\n if(empty($this->day)) {\n return;\n }\n\n $dayDT = new DateTime(DateHelper::parseDateTime($this->day), DateHelper::getSystemTimeZone());\n\n $endDT = clone $dayDT;\n $endDT->setTime(23,59,59);\n $end = $endDT->getTimestamp();\n\n $start = $dayDT->setTime(0,0,0)->getTimestamp();\n\n $this->query->andWhere(['<=', 'log_time', $end]);\n $this->query->andWhere(['>=', 'log_time', $start]);\n\n } catch (\\Exception $e) {\n Yii::error($e, 'admin');\n }\n }", "public function setUpdateTime($update_time)\r\n {\r\n $this->update_time = $update_time;\r\n\r\n return $this;\r\n }", "public function setUpdateTime($update_time)\n {\n $this->update_time = $update_time;\n return $this;\n }", "public function setUpdateTime($update_time)\n {\n $this->update_time = $update_time;\n return $this;\n }", "public function setUpdateTime($update_time)\n {\n $this->update_time = $update_time;\n return $this;\n }", "public function filterByLastUpdate($lastUpdate = null, $comparison = null)\n {\n if (is_array($lastUpdate)) {\n $useMinMax = false;\n if (isset($lastUpdate['min'])) {\n $this->addUsingAlias(PengawasTerdaftarPeer::LAST_UPDATE, $lastUpdate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastUpdate['max'])) {\n $this->addUsingAlias(PengawasTerdaftarPeer::LAST_UPDATE, $lastUpdate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PengawasTerdaftarPeer::LAST_UPDATE, $lastUpdate, $comparison);\n }", "public function applyLatestOnlyCondition(Event $event)\n {\n /** @var \\yii\\db\\BaseActiveRecord|\\zarv1k\\sync\\twoway\\behavior\\model\\SyncableBehavior $model */\n $model = $event->data;\n /** @var \\yii\\db\\ActiveRecordInterface $modelClass */\n $modelClass = $this->owner->modelClass;\n /** @var ActiveQuery $activeQuery */\n $activeQuery = $event->sender;\n\n $updatedAfterDate = \\Yii::$app->request->getQueryParam($model->timestampQueryParam);\n\n $orderBy = [$model->timestampColumn => SORT_ASC];\n foreach ($modelClass::primaryKey() as $column) {\n $orderBy[$column] = SORT_ASC;\n }\n\n $activeQuery\n ->andFilterWhere(['>', $model->timestampColumn, $updatedAfterDate])\n ->addOrderBy($orderBy);\n\n Event::off(ActiveQuery::className(), ActiveQuery::EVENT_INIT, [$this, 'applyLatestOnlyCondition']);\n }", "public function setUpdate_time($update_time)\r\n {\r\n $this->update_time = $update_time;\r\n\r\n return $this;\r\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function setUpdateTime(string $updateTime) {\n $this->update_time = $updateTime;\n\n return $this;\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function setUpdateTime($update_time)\n {\n $this->update_time = $update_time;\n\n return $this;\n }", "public function filter_values()\n {\n $current_time = time();\n $values = $this->storevalues;\n if (!empty($values)) {\n $filter_values = array_filter($values, function ($value) use ($current_time) {\n $difference = ($current_time - $value['created_at']);\n $difference = $difference / 60; //difference in minutes\n return ($difference < $this->expiration_time);\n }, ARRAY_FILTER_USE_BOTH);\n //Save the filtered values\n $this->save($filter_values);\n }\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function setUpdatetime($Updatetime)\n {\n $this->updateTime = $Updatetime;\n\n return $this;\n }", "protected function getFilterForUpdate() \n\t{\n\t\t\n\t\t$inputFilter = new InputFilter();\n\t\t$factory = new InputFactory();\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_login',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_password',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t)\n \t\t)));\n\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_name',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'application_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'server_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'updated_password',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_id',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_ip',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\treturn $inputFilter;\n\t}", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function DateGreater($time) {\n $this->filter->Greater('udate', $time);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n\t{\n\t\tif (is_array($updatedAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($updatedAt['min'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($updatedAt['max'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::UPDATED_AT, $updatedAt, $comparison);\n\t}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n\t{\n\t\tif (is_array($updatedAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($updatedAt['min'])) {\n\t\t\t\t$this->addUsingAlias(UnitPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($updatedAt['max'])) {\n\t\t\t\t$this->addUsingAlias(UnitPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(UnitPeer::UPDATED_AT, $updatedAt, $comparison);\n\t}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n\t{\n\t\tif (is_array($updatedAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($updatedAt['min'])) {\n\t\t\t\t$this->addUsingAlias(TblAdherentPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($updatedAt['max'])) {\n\t\t\t\t$this->addUsingAlias(TblAdherentPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(TblAdherentPeer::UPDATED_AT, $updatedAt, $comparison);\n\t}", "protected function _timeCondition($query) {\n if (!empty($query['conditions']['time']) && array_key_exists($query['conditions']['time'], $this->times)) {\n $this->request['uri']['query']['time'] = $query['conditions']['time'];\n }\n return $query;\n }", "public function filterByLastUpdated($lastUpdated = null, $comparison = null)\n {\n if (is_array($lastUpdated)) {\n $useMinMax = false;\n if (isset($lastUpdated['min'])) {\n $this->addUsingAlias(TorrentTableMap::COL_LAST_UPDATED, $lastUpdated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastUpdated['max'])) {\n $this->addUsingAlias(TorrentTableMap::COL_LAST_UPDATED, $lastUpdated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TorrentTableMap::COL_LAST_UPDATED, $lastUpdated, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(FreeShippingPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(FreeShippingPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(FreeShippingPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "static function retrieveByUpdated($value) {\n\t\treturn static::retrieveByColumn('updated', $value);\n\t}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function getUpdateTime()\n\t{\n\t\t$column = self::COL_UPDATE_TIME;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function getUpdateTime()\n\t{\n\t\t$column = self::COL_UPDATE_TIME;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "public function filterOnUpdate($data, Cond $cond = null)\n {\n return $this->filterData('update', (array)$data, $cond);\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public function alm_filters_updated(){\n\t \tif( isset( $_GET[\"filter_updated\"] ) ) {\n\t\t \t$this->alm_filters_add_admin_notice('<i class=\"fa fa-check-square\" style=\"color: #46b450\";></i>&nbsp; '.__('Filter successfully updated.', 'ajax-load-more-filters'), 'success');\n\t\t }\n\t }", "public function onTimeUpdate(callable $callback);", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(sfSimpleCMSSlotPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(sfSimpleCMSSlotPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfSimpleCMSSlotPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function timeFilter($request)\n {\n return $request->filled(['from','till']) ? $this->filter($request->from, $request->till) : $this;\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(EmployeeTableMap::COL_UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(EmployeeTableMap::COL_UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EmployeeTableMap::COL_UPDATED_AT, $updatedAt, $comparison);\n }", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "public function getQuery($time);", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\r\n\t{\r\n\t\tif (is_array($updatedAt)) {\r\n\t\t\t$useMinMax = false;\r\n\t\t\tif (isset($updatedAt['min'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif (isset($updatedAt['max'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif ($useMinMax) {\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\tif (null === $comparison) {\r\n\t\t\t\t$comparison = Criteria::IN;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::UPDATED_AT, $updatedAt, $comparison);\r\n\t}", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function setUpdateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->update_time = $var;\n\n return $this;\n }", "public function testWriterShouldFilterSelectForUpdate()\n\t{\n\t\tR::nuke();\n\t\t$id = R::store( R::dispense('bean') );\n\t\tR::debug( TRUE, 1 );\n\t\t$bean = R::findForUpdate('bean', 'id > 0');\n\t\t$logs = R::getDatabaseAdapter()->getDatabase()->getLogger()->grep( AQueryWriter::C_SELECT_SNIPPET_FOR_UPDATE );\n\t\tasrt( count($logs), 0 ); //if no cache clear, then would have been 2\n\t\t$bean = R::loadForUpdate('bean', $id);\n\t\t$logs = R::getDatabaseAdapter()->getDatabase()->getLogger()->grep( AQueryWriter::C_SELECT_SNIPPET_FOR_UPDATE );\n\t\tasrt( count($logs), 0 ); //if no cache clear, then would have been 2\n\t\tR::getWriter()->setUseCache( FALSE );\n\t\tR::debug( FALSE );\n\t\tR::nuke();\n\t}", "public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($updatedBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $updatedBy)) {\n $updatedBy = str_replace('*', '%', $updatedBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(PlanPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public static function last_update()\n {\n $gallery_date = Gallery::orderBy('updated_at', 'desc')->value('updated_at');\n $gallery_last_date = (!empty($gallery_date)) ? date(strtotime($gallery_date . '+1 hours')) : '';\n $posts_date = Posts::orderBy('updated_at', 'desc')->value('updated_at');\n $posts_last_date = (!empty($posts_date)) ? date(strtotime($posts_date . '+1 hours')) : '';\n $newsletter_date = Newsletter::orderBy('updated_at', 'desc')->value('updated_at');\n $newsletter_last_date = (!empty($newsletter_date)) ? date(strtotime($newsletter_date . '+1 hours')) : '';\n $properties_date =\n DB::table('apimo_properties')\n ->select('updated_at')\n ->where(function($query) {\n $query->orWhere('reference', 'like', 'HSTP%')\n ->orWhere('reference', 'like', 'HD%');\n })\n ->orderBy('updated_at', 'desc')\n ->value('updated_at');\n $properties_last_date = (!empty($properties_date)) ? date(strtotime($properties_date . '+1 hours')) : '';\n\n $dates = [$posts_last_date, $gallery_last_date, $properties_last_date, $newsletter_last_date];\n\n $last_update = max($dates);\n\n return date('d.m.Y - H:i', (!empty($last_update)) ? $last_update : 0);\n }", "public function FilterDescription() {\n\t\t$params = $this->parseParams();\n\n\t\t$filters = array();\n\t\tif ($params['tag']) {\n\t\t\t$term = TaxonomyTerm::get_by_id('TaxonomyTerm', $params['tag']);\n\t\t\tif ($term) {\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_WITHIN', 'within') . ' \"' . $term->Name . '\"';\n\t\t\t}\n\t\t}\n\n\t\tif ($params['from'] || $params['to']) {\n\t\t\tif ($params['from']) {\n\t\t\t\t$from = strtotime($params['from']);\n\t\t\t\tif ($params['to']) {\n\t\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '\n\t\t\t\t\t\t. date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);\n\t\t\t\t} else {\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $from);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $to);\n\t\t\t}\n\t\t}\n\n\t\tif ($params['year'] && $params['month']) {\n\t\t\t$timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);\n\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_IN', 'in') . ' ' . date('F', $timestamp) . ' ' . $params['year'];\n\t\t}\n\n\t\tif ($filters) {\n\t\t\treturn $this->getUpdateName() . ' ' . implode(' ', $filters);\n\t\t}\n\t}", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "public function findAlarms($Filter=[]) { \n $q = $this->createQueryBuilder('a')\n ->select('a.eoid,a.joid,a.alarm,a.alarmTime,a.state,a.stateTime,a.response,a.theUser,a.eventComment,'\n . 'j.jobName,j.description,j.status,'\n . 'e.runNum,e.ntry,e.machName')\n ->leftjoin('AriiATSBundle:UjoJobst','j',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'a.joid = j.joid')\n ->leftjoin('AriiATSBundle:UjoProcEvent','e',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'a.eoid = e.eoid');\n if (isset($Filter['jobName'])) {\n $q->andWhere('j.jobName = :jobName')\n ->setParameter('jobName',$Filter['jobName']);\n } \n // A la minute\n if (isset($Filter['alarmTime'])) {\n $q->andWhere('a.alarmTime >= :alarmTime')\n ->andWhere('a.alarmTime <= :alarmTime2') \n ->setParameter('alarmTime',$Filter['alarmTime']-> format('U'))\n ->setParameter('alarmTime2',$Filter['alarmTime']-> format('U')+60);\n } \n if (isset($Filter['state']) and ($Filter['state']>0)) {\n $q->andWhere('a.state = :state')\n ->setParameter('state',$Filter['state']);\n } \n return $q->orderBy('a.eoid','desc')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n }", "public function setUpdateTs($update_ts)\n {\n $this->update_ts = $update_ts;\n\n return $this;\n }", "public function getFilterTimeCount() {\n \n $columns = array();\n $params = array();\n\n // TODAY\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n $columns[] = \"\n SUM(\n CASE \n WHEN \n n.start_date >= :todayStart AND n.start_date <= :todayEnd \n OR\n n.end_date >= :todayStart AND n.end_date <= :todayEnd \n OR\n n.start_date < :todayStart AND n.end_date > :todayEnd \n THEN 1 \n ELSE 0 \n END\n ) as today\";\n $params['todayStart'] = $dateStart;\n $params['todayEnd'] = $dateEnd;\n\n // YESTERDAY\n $dateStart = new \\DateTime('yesterday');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime('yesterday');\n $dateEnd->setTime(23, 59, 59);\n $columns[] = \"\n SUM(\n CASE \n WHEN \n n.start_date >= :yesterdayStart AND n.start_date <= :yesterdayEnd \n OR\n n.end_date >= :yesterdayStart AND n.end_date <= :yesterdayEnd \n OR\n n.start_date < :yesterdayStart AND n.end_date > :yesterdayEnd \n THEN 1 \n ELSE 0 \n END\n ) as yesterday\";\n $params['yesterdayStart'] = $dateStart;\n $params['yesterdayEnd'] = $dateEnd;\n\n // THIS WEEK\n $today = new \\DateTime();\n if('Sunday' == $today->format('l')) {\n $dateStart = clone $today;\n $dateStart->modify('Monday last week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = $today;\n $dateEnd->setTime(23, 59, 59);\n } else {\n $dateStart = clone $today;\n $dateStart->modify('Monday this week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = clone $today;\n $dateEnd->modify('Sunday this week');\n $dateEnd->setTime(23, 59, 59);\n }\n $columns[] = \"\n SUM(\n CASE \n WHEN \n n.start_date >= :thisWeekStart AND n.start_date <= :thisWeekEnd \n OR\n n.end_date >= :thisWeekStart AND n.end_date <= :thisWeekEnd \n OR\n n.start_date < :thisWeekStart AND n.end_date > :thisWeekEnd \n THEN 1 \n ELSE 0 \n END\n ) as thisWeek\";\n $params['thisWeekStart'] = $dateStart;\n $params['thisWeekEnd'] = $dateEnd;\n\n // LAST WEEK\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P7D'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n $columns[] = \"\n SUM(\n CASE \n WHEN \n n.start_date >= :lastWeekStart AND n.start_date <= :lastWeekEnd \n OR\n n.end_date >= :lastWeekStart AND n.end_date <= :lastWeekEnd \n OR\n n.start_date < :lastWeekStart AND n.end_date > :lastWeekEnd \n THEN 1 \n ELSE 0 \n END\n ) as lastWeek\";\n $params['lastWeekStart'] = $dateStart;\n $params['lastWeekEnd'] = $dateEnd;\n \n // PAST MONTH\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P1M'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n $columns[] = \"\n SUM(\n CASE \n WHEN \n n.start_date >= :pastMonthStart AND n.start_date <= :pastMonthEnd \n OR\n n.end_date >= :pastMonthStart AND n.end_date <= :pastMonthEnd \n OR\n n.start_date < :pastMonthStart AND n.end_date > :pastMonthEnd \n THEN 1 \n ELSE 0 \n END\n ) as pastMonth\";\n $params['pastMonthStart'] = $dateStart;\n $params['pastMonthEnd'] = $dateEnd;\n\n return $this->createQueryBuilder('n')\n ->select(implode(', ', $columns))\n ->where('n.draft = false')\n ->setParameters($params)\n ->getQuery()\n ->getOneOrNullResult();\n }", "protected function setUpdatedTime($updated_time) {\r\n $this->updated_time = strtotime($updated_time);\r\n }", "function getAppLastUpdated($appId, $eBulkApplication) {\n $commonQuery = \"select DISTINCT ap.ebulkapp,ap.application_id, o.name oname,o.org_id,o.povafirst,o.list99 list99req,c.company_id, c.name cname, sx.app_ref_no, sx.pova pova,sx.id_verified_on, sx.list99 list99,fs.certno, fs.formstatus, fs.`p&sDate` psdt, fs.`s&rDate` srdt, fs.dCrbDate dcrbdt, fs.current_status,fs.rRDate rrdt, fs.povaStart povaStart,fs.povaEnd povaEnd, fs.povaResult povaResult,fs.lpfdate, fs.list99Start list99start,fs.list99End list99End,fs.list99Result list99Result,ap.application_id, ap.cancelled,sx.discType,sx.category_code,sx.remuneration,ap.sectionx_complete_time,ap.submit_time ,fs.last_updated,ap.manual_application as manualApp,fs.recruitment_decision, upper(pnf.name) as UserForename,fs.result, upper(pns.name) as UserSurname\n FROM organisation o,company c, applications ap\n INNER JOIN app_person_name apnf ON ap.application_id = apnf.application_id\n INNER JOIN person_names pnf ON apnf.name_id = pnf.name_id\n AND pnf.name_type_id =4\n INNER JOIN app_person_name apns ON ap.application_id = apns.application_id\n INNER JOIN person_names pns ON apns.name_id = pns.name_id\n AND pns.name_type_id =3\n left outer join sectionx sx on ap.application_id=sx.application_id\n left outer join form_status fs on {JOINEXPR}\n where ap.submit_time IS NOT NULL AND ap.sectionx_complete_time IS NOT NULL and o.activated='Y' and ap.org_id=o.org_id and o.company_id=c.company_id and ap.cancelled <> 'Y' and ap.application_id='$appId'\";\n\n $commonQuery.=\" {EBULKCONDITION}\";\n\n #Query for normal applications - printed\n $joinexpr = \"fs.app_ref_no=sx.app_ref_no\";\n $ebulkconfition = \"and ap.ebulkapp <> 'Y'\";\n $content_var = array(\"{JOINEXPR}\", \"{EBULKCONDITION}\");\n $content_value = array($joinexpr, $ebulkconfition);\n $pquery = str_replace($content_var, $content_value, $commonQuery);\n\n #Query for Ebulk applications - Not printed\n $joinexpr = \"fs.application_id=sx.application_id\";\n $ebulkconfition = \"and ap.ebulkapp = 'Y'\";\n $content_var = array(\"{JOINEXPR}\", \"{EBULKCONDITION}\");\n $content_value = array($joinexpr, $ebulkconfition);\n $equery = str_replace($content_var, $content_value, $commonQuery);\n\n $query = $pquery . \" UNION \" . $equery . \"\";\n\n $res = $this->getDBRecords($query);\n\n $lastUpdated = \"\";\n if ($eBulkApplication <> 'Y') {\n if (!empty($res[0][\"submit_time\"]) && empty($res[0][\"psdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"submit_time\"]);\n $appatstage = \"appsubmited\";\n $current_stage = \"Application Submitted\";\n } elseif (!empty($res[0][\"psdt\"]) && empty($res[0][\"srdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"psdt\"]);\n $appatstage = \"printedandsent\";\n $current_stage = \"Printed & Sent\";\n } elseif (empty($res[0][\"dcrbdt\"]) && !empty($res[0][\"srdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"srdt\"]);\n $appatstage = \"indispatchqueue\";\n $current_stage = \"In Dispatch Queue\";\n } elseif (!empty($res[0][\"dcrbdt\"]) && empty($res[0][\"rrdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"dcrbdt\"]);\n $appatstage = \"dispatchedtocrb\";\n\n #If alreday dispatched to CRB and the application has moved to different stage within CRB\n if (!empty($res[0][\"current_status\"]) && $res[0][\"current_status\"] <> \"\")\n $current_stage = trim($res[0][\"current_status\"]);\n else\n $current_stage=\"Dispatched to \".DBS;\n\n if (!empty($res[0][\"last_updated\"]))\n $lastUpdated = date(\"d/m/Y\", $res[0][\"last_updated\"]);\n }elseif ((!empty($res[0][\"rrdt\"]) && ($res[0][\"rrdt\"] != 'NULL'))) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"rrdt\"]);\n $appatstage = \"resultreceived\";\n $current_stage = \"Result Received\";\n if ($res[0][\"result\"] == 'Invalid Disclosure')\n $current_stage = \"Invalid Disclosure\";\n }\n }else {\n if (!empty($res[0][\"submit_time\"]) && empty($res[0][\"psdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"submit_time\"]);\n $appatstage = \"appsubmited\";\n $current_stage = \"Application Submitted\";\n } elseif (!empty($res[0][\"psdt\"]) && empty($res[0][\"srdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"psdt\"]);\n $appatstage = \"qualitycompleted\";\n $current_stage = \"Quality Check Completed\";\n } elseif (empty($res[0][\"dcrbdt\"]) && !empty($res[0][\"srdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"srdt\"]);\n $appatstage = \"indispatchqueue\";\n $current_stage = \"In Dispatch Queue\";\n } elseif (!empty($res[0][\"dcrbdt\"]) && empty($res[0][\"rrdt\"])) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"dcrbdt\"]);\n $appatstage = \"dispatchedtocrb\";\n\n #If alreday dispatched to CRB and the application has moved to different stage within CRB\n if (!empty($res[0][\"current_status\"]) && $res[0][\"current_status\"] <> \"\")\n $current_stage = trim($res[0][\"current_status\"]);\n else\n $current_stage=\"Dispatched to \".DBS;\n\n if (!empty($res[0][\"last_updated\"]))\n $lastUpdated = date(\"d/m/Y\", $res[0][\"last_updated\"]);\n }elseif ((!empty($res[0][\"rrdt\"]) && ($res[0][\"rrdt\"] != 'NULL'))) {\n $lastUpdated = date(\"d/m/Y\", $res[0][\"rrdt\"]);\n $appatstage = \"resultreceived\";\n $current_stage = \"Result Received\";\n if ($res[0][\"result\"] == 'Invalid Disclosure')\n $current_stage = \"Invalid Disclosure\";\n }\n }\n return $lastUpdated;\n }", "private function updateUpdatedAtField() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof UpdatedAtField) {\n $this->$field_name = time();\n }\n }\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(PlanPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(PlanPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PlanPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "protected static function updated_at(): mixed\n\t{\n\t\treturn self::$query->updated_at;\n\t}", "protected static function updated_at(): mixed\n\t{\n\t\treturn self::$query->updated_at;\n\t}", "public static function FilterByTime() {\n\t\t\t\n\t\t\t$sql = \"SELECT Code,Starting_time,Ending_time FROM employees\";\n\t\t\t$statement = Database::$db->prepare($sql);\n\t\t\t$statement->execute();\n\t\t\t$employees1 = [];\n\t\t\twhile($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$employees1[] = new Employee($row['Code']);\n\t\t\t}\n\t\t\treturn $employees1;\n\t\t}", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function build_time_query($column, $compare, $hour = \\null, $minute = \\null, $second = \\null)\n {\n }", "public function filterByEndTime($endTime = null, $comparison = null)\n\t{\n\t\tif (is_array($endTime)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($endTime['min'])) {\n\t\t\t\t$this->addUsingAlias(QuizPeer::END_TIME, $endTime['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($endTime['max'])) {\n\t\t\t\t$this->addUsingAlias(QuizPeer::END_TIME, $endTime['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(QuizPeer::END_TIME, $endTime, $comparison);\n\t}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(ProfessorTableMap::COL_UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(ProfessorTableMap::COL_UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProfessorTableMap::COL_UPDATED_AT, $updatedAt, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(SocioTableMap::COL_UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(SocioTableMap::COL_UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SocioTableMap::COL_UPDATED_AT, $updatedAt, $comparison);\n }", "public function getLatestTimestamp()\n {\n return DB::table('product_models')->orderBy('updated', 'desc')->value('updated');\n }", "protected function user_where_clause() {}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(TblentbidTableMap::COL_UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(TblentbidTableMap::COL_UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblentbidTableMap::COL_UPDATED_AT, $updatedAt, $comparison);\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(TranslationContentPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(TranslationContentPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TranslationContentPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function getUserLastUpdates($user, $maxCount = null);", "public function lastUpdated()\n {\n $lastAction = $this->actions->sortBy('updated_at')->last();\n\n if ($lastAction && $lastAction->updated_at->gt($this->updated_at))\n return $lastAction->updated_at;\n else\n return $this->updated_at;\n }", "function filterDiffTime($all_meals, $diff_time){\n\n $query_date = date('c', intval($diff_time));\n $meals = [];\n \n\n foreach($all_meals as $meal){\n if($meal->status == 'created' && $meal->created_at > $query_date){\n $meals[] = $meal;\n \n }\n elseif($meal->status == 'updated' && $meal->updated_at > $query_date){\n $meals[] = $meal;\n \n }\n elseif($meal->status == 'deleted' && $meal->deleted_at > $query_date){\n $meals[] = $meal;\n \n }\n }\n\n return $meals;\n }", "public function getPriceMaxForFiltersCategoryProducts($model)\n {\n $query = Product::query();\n\n $query->join('product_prices', function ($join) use($model) {\n $join->on('products.id', '=', 'product_prices.product_id')\n ->where('product_prices.user_type_id', '=', $model->userTypeId);\n })->join('product_category', function ($query) use ($model) {\n $query->on('products.id', '=', 'product_category.product_id')\n ->where('product_category.category_id', '=', \"\". $model->currentCategory->id . \"\");\n })->max('price');\n\n if (count($model->parsedFilters) > 0)\n {\n foreach ($model->parsedFilters as $name => $values) {\n $query->whereHas('properties', function ($query) use ($name, $values) {\n $query->whereHas('property_names', function ($query) use ($name) {\n $query->whereIn('slug', [$name]);\n })->whereHas('property_values', function ($query) use ($values) {\n $query->whereIn('slug', $values);\n });\n });\n }\n }\n\n return $query->whereIsVisible(true)->max('price');\n }", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TbalunomatriculaPeer::UPDATED_AT, $updatedAt, $comparison);\n }", "public function updateTime( Inx_Api_Recipient_Attribute $attr, $sValue );", "function getListFilter($col,$key) {\n\t\t\tif($col == 'unit') {\n\t\t\t\tglobal $conn, $conf;\n\t\t\t\trequire_once($conf['gate_dir'].'model/m_unit.php');\n\t\t\t\t\n\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\n\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t}\n\t\t\tif($col == 'bulan')\n\t\t\t\treturn \"substring(cast(cast(r.tglkpb as date) as varchar),6,2) = '$key'\";\n\t\t\tif($col == 'tahun')\n\t\t\t\treturn \"substring(cast(cast(r.tglkpb as date) as varchar),1,4) = '$key'\";\n\t\t\tif($col == 'bulankgb')\n\t\t\t\treturn \"substring(cast(cast(r.tglkgb as date) as varchar),6,2) = '$key'\";\n\t\t\tif($col == 'tahunkgb')\n\t\t\t\treturn \"substring(cast(cast(r.tglkgb as date) as varchar),1,4) = '$key'\";\n\t\t}", "public function filterByUpdatedAt($updatedAt = null, $comparison = null)\n {\n if (is_array($updatedAt)) {\n $useMinMax = false;\n if (isset($updatedAt['min'])) {\n $this->addUsingAlias(DegressifProductsTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedAt['max'])) {\n $this->addUsingAlias(DegressifProductsTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(DegressifProductsTableMap::UPDATED_AT, $updatedAt, $comparison);\n }", "public function updated(int $from_time, int $to_time = null)\n {\n $params = array('fromTime' => $from_time);\n\n if (null !== $to_time) {\n $params['toTime'] = $to_time;\n }\n\n return $this->request('updated/query', $params);\n }", "function filter_update_keys( $args ) {\n\t\t$updates = $args[0];\n\n\t\tif ( isset( $updates->no_update ) ) {\n\t\t\tunset( $updates->no_update );\n\t\t}\n\n\t\treturn $args;\n\t}" ]
[ "0.56800145", "0.53627783", "0.53627783", "0.5306349", "0.5267168", "0.5168976", "0.51090264", "0.50715184", "0.50715184", "0.50715184", "0.50586724", "0.5045774", "0.50454605", "0.5031505", "0.5024032", "0.50046545", "0.49969956", "0.49418426", "0.49378103", "0.49208996", "0.48857498", "0.48499233", "0.48066396", "0.47625095", "0.47574508", "0.47195068", "0.47151697", "0.4692864", "0.46854925", "0.46721724", "0.4651842", "0.46487156", "0.46384373", "0.4633209", "0.46025273", "0.46025273", "0.45993543", "0.45956844", "0.45790595", "0.45680642", "0.45524272", "0.4545356", "0.4544163", "0.45224783", "0.45085973", "0.4490337", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.4486678", "0.44847187", "0.4480278", "0.44479212", "0.44456798", "0.44261587", "0.44253004", "0.44240284", "0.44205648", "0.4414082", "0.44132653", "0.44108447", "0.44067803", "0.44030374", "0.43952513", "0.43952513", "0.43769822", "0.43737984", "0.4373374", "0.43650386", "0.4357765", "0.43523523", "0.4351484", "0.43395388", "0.43230447", "0.43171808", "0.4312695", "0.430497", "0.43034086", "0.4298575", "0.4294404", "0.42928323", "0.4290254", "0.42889977", "0.42869875", "0.4286747" ]
0.5944986
0
Filter the query on the update_user column Example usage: $query>filterByUpdateUser('fooValue'); // WHERE update_user = 'fooValue' $query>filterByUpdateUser('%fooValue%'); // WHERE update_user LIKE '%fooValue%'
public function filterByUpdateUser($updateUser = null, $comparison = null) { if (null === $comparison) { if (is_array($updateUser)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $updateUser)) { $updateUser = str_replace('*', '%', $updateUser); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(SceneTableMap::COL_UPDATE_USER, $updateUser, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFilterForUpdate() \n\t{\n\t\t\n\t\t$inputFilter = new InputFilter();\n\t\t$factory = new InputFactory();\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_login',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_password',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t)\n \t\t)));\n\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_name',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'application_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'server_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'updated_password',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_id',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_ip',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\treturn $inputFilter;\n\t}", "function filter_search_columns($columns, $search, $WP_User_Query)\n {\n }", "public function _replyToModifyMySQLWhereClauseToSearchUsers( $oWPQuery ) {\n \n global $wpdb;\n if ( $oWPQuery->get( 'q' ) ) {\n $_sSearchTerm = $oWPQuery->get( 'q' );\n $oWPQuery->query_where .= \" AND \" . $wpdb->users . \".display_name LIKE '%\" . esc_sql( $wpdb->esc_like( $_sSearchTerm ) ) . \"%'\";\n } \n \n }", "protected function user_where_clause() {}", "public function getUserAllLimitSortFilter($filter_by, $filter_by_value, $sort_by, $order_by, $offset, $limit, $regex_filter=true)\n {\n $statement = \"SELECT * FROM user\";\n\n // If only the $filter_by_value is set, then search all the columns.\n // If both $filter_by and $filter_by_value are set, then search only in\n // the $filter_by column.\n if (isset($filter_by_value) && !empty($filter_by_value)) {\n if (isset($filter_by) && !empty($filter_by)) {\n // Search in a specific column with regex\n if ($regex_filter) {\n // Search in a specific column with regex\n $statement .= \" WHERE $filter_by REGEXP '$filter_by_value'\";\n } else {\n $statement .= \" WHERE $filter_by = '$filter_by_value'\";\n }\n } else {\n // Search in all columns with exact match\n // TODO Need a better way to get the column names\n $allColumns = \"(UserID, FirstName, LastName, Email, TravelDateStart, TravelDateEnd, TravelReason)\";\n $statement .= \" WHERE '$filter_by_value' IN $allColumns\";\n }\n }\n\n if (isset($sort_by) && !empty($sort_by)) {\n $statement .= \" ORDER BY $sort_by\";\n\n // order type (ASC, DESC) needs ORDER BY\n if (isset($order_by) && !empty($order_by)) {\n $statement .= \" $order_by\";\n }\n }\n\n if (isset($limit) && !empty($limit)) {\n $statement .= \" LIMIT $limit\";\n }\n\n // OFFSET needs LIMIT\n if (isset($offset) && !empty($offset)) {\n $statement .= \" OFFSET $offset\";\n }\n\n try {\n $statement = $this->db->query($statement);\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n return $result;\n } catch (\\PDOException $e) {\n echo \"Error getUserAllLimitSort: \" . $e->getMessage();\n exit();\n }\n }", "function getFieldQuery($filter) {\n\n\t\t$output = \"SELECT id_user \".\n\t\t\t\"FROM \".$this->_getUserEntryTable().\" \".\n\t\t\t\"WHERE id_common = '\".$this->id_common.\"' AND user_entry \";\n\n\t\tswitch ($filter['cond']) {\n\n\t\t\tcase 2: { //equal\n\t\t\t\t$output .= \" = '\".$filter['value'].\"' \";\n\t\t\t} break;\n\n\t\t\tcase 0: { //contains\n\t\t\t\t$output .= \" LIKE '%\".$filter['value'].\"%' \";\n\t\t\t} break;\n\n\t\t\tcase 3: { //not equal\n\t\t\t\t$output .= \" <> '\".$filter['value'].\"' \";\n\t\t\t} break;\n\n\t\t\tcase 1: { //do not contains\n\t\t\t\t$output .= \" NOT LIKE '%\".$filter['value'].\"%' \";\n\t\t\t} break;\n\n\t\t\tcase 4: { //starts with\n\t\t\t\t$output .= \" LIKE '\".$filter['value'].\"%' \";\n\t\t\t} break;\n\n\t\t\tcase 5: { //ends with\n\t\t\t\t$output .= \" LIKE '%\".$filter['value'].\"' \";\n\t\t\t} break;\n\n\t\t\tdefault: { $output = \" NOT LIKE '%' \"; }\n\n\t\t} // end switch\n\t\treturn $output;\n\t}", "private function searchUsers($userCollection, $filter)\t{\n trace('[CMD] '.__METHOD__);\n\n\t\t$filterlist = $filter->getDataArray();\n\t\t$searchlist = array();\n\t\t$exactMatch = false;\n\t\t$specified = false;\n\t\t$result = '';\n\t\tforeach ($filterlist as $key => $value) {\n\t\t\tif ($value == '') {\n\t\t\t\t// ignore empty search fields\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'gsa_kundnr':\n\t\t\t\t\t// special case; find gsauid by gsa_kundnr\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'exactMatch':\n\t\t\t\t\t// switch match mode\n\t\t\t\t\t$exactMatch = $value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// copy field to searchlist\n\t\t\t\t\t$specified = true;\n\t\t\t\t\t$searchlist[$key] = $value;\n\t\t\t}\n\t\t}\n\t\tif (! $specified) {\n\t\t\t$result = $this->pi_getLL('msg_searchreq', '[msg_searchreq]');\n\t\t}\n\t\telse {\n\t\t\t$cnt = $userCollection->loadBySearchlist($searchlist, $exactMatch, self::MAX_SEARCHRESULTS);\n\t\t\tif ($cnt > self::MAX_SEARCHRESULTS) {\n\t\t\t\t// to many hits, complain\n\t\t\t\t$result = $this->pi_getLL('msg_toomany', '[msg_toomany]');\n\t\t\t}\n\t\t\telse if (! $cnt) {\n\t\t\t\t// nothing found, complain\n\t\t\t\t$result = $this->pi_getLL('msg_notfound', '[msg_notfound]');\n\t\t\t}\n\t\t}\n\t\ttrace($result);\n\t\treturn $result;\n\t}", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($updatedBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $updatedBy)) {\n $updatedBy = str_replace('*', '%', $updatedBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbalunomatriculaPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "private function filter($filter) {\n\t\tforeach ($filter as $key => $value) {\n\n\t\t\tif (array_key_exists('userID', $filter)) {\n\t\t\t\t$this -> db -> where('userID', $filter['userID']);\n\t\t\t}\n\t\t\tif (array_key_exists('catID', $filter)) {\n\t\t\t\t$this -> db -> where('catID', $filter['catID']);\n\t\t\t}\n\n\t\t\tif (array_key_exists('search', $filter)) {\n\t\t\t\t$array = explode(' ', $value);\n\t\t\t\tforeach ($array as $key => $value)\n\t\t\t\t\t$this -> db -> like('title', $value);\n\n\t\t\t}\n\t\t}\n\t}", "function getUserString($argArrPost) {\n //echo '<pre>';print_r($argArrPost); die;\n $varSearchWhere = \" AND (AdminType = 'user-moderator' OR AdminType = 'super-admin') \";\n if ($argArrPost['frmSearchUserNameResult'] != '') {\n $varSearchWhere .= ' AND AdminUserName LIKE \\'%' . trim(addslashes($argArrPost['frmSearchUserNameResult'])) . '%\\'';\n }\n\n if ($argArrPost['frmSearchUserMailResult'] != '') {\n $varSearchWhere .= ' AND AdminEmail LIKE \\'%' . trim(addslashes($argArrPost['frmSearchUserMailResult'])) . '%\\'';\n }\n\n if ($argArrPost['frmRoll'] > 0) {\n $varSearchWhere .= ' AND fkAdminRollId = \\'' . $argArrPost['frmRoll'] . '\\'';\n }\n// pre($varSearchWhere);\n return $varSearchWhere;\n }", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function YWR_2020_pre_user_query($user_search)\n{\n\n $user = wp_get_current_user();\n\n if (!current_user_can('manage_options')) {\n\n global $wpdb;\n\n $user_search->query_where =\n str_replace('WHERE 1=1',\n \"WHERE 1=1 AND {$wpdb->users}.ID IN (\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\n WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities'\n AND {$wpdb->usermeta}.meta_value NOT LIKE '%administrator%')\",\n $user_search->query_where\n );\n\n }\n}", "function wc_pre_user_query($user_search) {\n\n\t\t$user = wp_get_current_user();\n\t\tif ($user->ID != 1) {\n\n\t\t\tglobal $wpdb;\n\t\t\t$user_search->query_where = str_replace('WHERE 1=1', \"WHERE 1=1 AND {$wpdb->users}.ID <> 1\", $user_search->query_where);\n\t\t}\n\t}", "function user_search_columns($columns, $search, $WP_User_Query)\n {\n }", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "function dbUpdate_updateUser($data){\n\t$whereClause = \"\";\n\t\n\t$tableName = \"tbl_user\";\n\t$updateVal = \"\";\n\tforeach($data as $fieldData){\n\t\tif ($fieldData[\"type\"] == \"text\") {\t$updateVal .= $fieldData[\"name\"].\" = '\".$fieldData[\"val\"].\"',\";\t}\n\t\telseif(\"num\") {\t$updateVal .= $fieldData[\"name\"].\" = \".$fieldData[\"val\"].\",\";\t};\n\t}\n\t$updateVal = substr($updateVal, 0, -1);\n\t$sql = \"UPDATE $tableName SET $updateVal\";\n\techo $sql;\n}", "protected function bindFilterColumn($column)\n {\n $columns = [\n 'fullname' => 'fullname',\n 'username' => 'username',\n 'user_group_id' => 'user_group_id',\n 'tier' => 'tier'\n ];\n\n return array_get($columns, $column, 'username');\n }", "protected function bindFilterColumn($column)\n {\n $columns = [\n 'fullname' => 'fullname',\n 'username' => 'username',\n 'user_group_id' => 'user_group_id',\n 'tier' => 'tier'\n ];\n\n return array_get($columns, $column, 'username');\n }", "public function actionSearch($s) {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['site/index']);\n }\n $s = trim($s);\n if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $s)) {\n $squery = DvUsers::find()->where(['email' => $s, \"status\" => 1])->all();\n } else {\n $sq = explode(\" \", $s);\n $size = sizeof($sq);\n if ($size > 1) {\n $squery = DvUsers::find()->orWhere(['first_name' => $sq[0]])->orWhere(['first_name' => $sq[1]])->orWhere(['last_name' => $sq[0]])->orWhere(['last_name' => $sq[1]])->andWhere([\"status\" => 1])->all();\n } else {\n $squery = DvUsers::find()->orWhere(['first_name' => $s])->orWhere(['last_name' => $s])->andWhere([\"status\" => 1])->all();\n }\n }\n return $this->render('index', [ 'users' => $squery, 'total_records' => '1']);\n }", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "public function filterByUserRelatedByUpdatedBy($user, $comparison = null)\n {\n if ($user instanceof User) {\n return $this\n ->addUsingAlias(SearchIndexPeer::UPDATED_BY, $user->getId(), $comparison);\n } elseif ($user instanceof PropelObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(SearchIndexPeer::UPDATED_BY, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);\n } else {\n throw new PropelException('filterByUserRelatedByUpdatedBy() only accepts arguments of type User or PropelCollection');\n }\n }", "private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function filterByUserRelatedByUpdatedBy($user, $comparison = null)\n {\n if ($user instanceof User) {\n return $this\n ->addUsingAlias(SchoolPeer::UPDATED_BY, $user->getId(), $comparison);\n } elseif ($user instanceof PropelObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(SchoolPeer::UPDATED_BY, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);\n } else {\n throw new PropelException('filterByUserRelatedByUpdatedBy() only accepts arguments of type User or PropelCollection');\n }\n }", "static function findOnlyUsersFromUserListingTable($external_table, $field_prefix, $filter, $min_state = STATE_ARCHIVED) {\n $users_table = TABLE_PREFIX . 'users';\n $user_id_field = \"{$field_prefix}_id\";\n\n $where_part = DB::prepare(\"($users_table.id = $external_table.$user_id_field AND $users_table.state >= ?)\", $min_state);\n\n if($filter) {\n $where_part .= \" AND ($filter)\";\n } // if\n\n return Users::findBySQL(\"SELECT DISTINCT $users_table.* FROM $users_table, $external_table WHERE $where_part ORDER BY CONCAT($users_table.first_name, $users_table.last_name, $users_table.email)\");\n }", "public static function userFilter(Builder $users, UserRequest $request)\n {\n if($request->get('name')) \n $users->where('name', 'like', '%'.$request->get('name').'%');\n if($request->get('LastName')) \n $users->where('LastName', 'like', '%'.$request->get('LastName').'%');\n if($request->get('mail')) \n $users->where('mail', 'like', '%'.$request->get('mail').'%');\n }", "function where ($where, $userid, $update=1){\n if (!is_valid_id($userid))\n die;\n\n if(empty($where))\n $where = \"Unknown Location...\";\n\n if ($update)\n $stmt = $pdo->run(\"UPDATE users SET page=? WHERE id=?\", [$where, $userid]);\n\n if (!$update){\n return $where;\n }else{\n return;\n }\n}", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "function ApplyUserIDFilters($sFilter) {\n\t\treturn $sFilter;\n\t}", "function ApplyUserIDFilters($sFilter) {\n\t\treturn $sFilter;\n\t}", "function ApplyUserIDFilters($sFilter) {\n\t\treturn $sFilter;\n\t}", "function ApplyUserIDFilters($sFilter) {\n\t\treturn $sFilter;\n\t}", "protected function filter(UpdateIncidentUpdateCommand $command)\n {\n $params = [\n 'status' => $command->status,\n 'message' => $command->message,\n 'user_id' => $command->user->id,\n ];\n\n return array_filter($params, function ($val) {\n return $val !== null;\n });\n }", "public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function filter($criteria, $filter, $args=[]);", "public function filter_user() {\n// ----------------------------------------------\n// SELECT * FROM wp_groups_user_group rt\n// LEFT JOIN wp_user u ON rt.user_id = u.ID\n// LEFT JOIN wp_user u ON rt.user_id = u.ID\n// WHERE rt.group_id = 6\n// \n// \n// SELECT * FROM\n// (SELECT \n// rt.user_id,\n// rt.group_id AS location_id\n// FROM wp_groups_user_group rt\n// LEFT JOIN wp_users u ON rt.user_id = u.ID\n// LEFT JOIN wp_users u2 ON rt.user_id = u2.ID\n// WHERE rt.group_id = 6 ) AS rl\n// INNER JOIN\n// (SELECT \n// rt.user_id,\n// rt.group_id AS agency_id\n// FROM wp_groups_user_group rt\n// LEFT JOIN wp_users u ON rt.user_id = u.ID\n// LEFT JOIN wp_users u2 ON rt.user_id = u2.ID\n// WHERE rt.group_id = 3 ) AS ra\n// ON rl.user_id = ra.user_id\n// LEFT JOIN wp_users wu ON rl.user_id = wu.ID ORDER BY `ID` ASC\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($updatedBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $updatedBy)) {\n $updatedBy = str_replace('*', '%', $updatedBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(PlanPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "static function UpdateColumn(string $field, string $value, int $user_id): int\n\t{\n\t\t$field = preg_replace(\"/[^a-zA-z0-9_]/\",\"\",$field);\n\n\t\t$arr = [\n\t\t\t':id' => $user_id,\n\t\t\t':value' => $value\n\t\t];\n\n\t\t$sql = 'UPDATE user_info SET '.$field.' = :value WHERE rf_user_id = :id';\n\n\t\treturn Db::Query($sql,$arr)->RowCount();\n\t}", "function MWX__where ($where)\n{\n global $wp_query, $wpdb;\n\n if (current_user_can ('edit_users'))\n return $where;\n\n $user_maturity = MWX__get_current_user_maturity ();\n\n return $where . \" AND (meta_value IS NULL OR meta_value <= $user_maturity)\";\n}", "function setQueryFilter($sType, $sContent) {\n // when receive search type and data\n if(!(is_null($sType) || is_null($sContent))) {\n // when search type is all\n if($sType == 'all') {\n $this->queryFilter = \"WHERE title LIKE '%{$sContent}%'\n OR content LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else if($sType == 'writer') {\n $this->queryFilter = \"WHERE writer LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else {\n $this->queryFilter = \"WHERE {$sType} LIKE '%{$sContent}%'\";\n }\n } else {\n $this->queryFilter = '';\n }\n }", "public function statistics_ref_users_where( $where ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$user_id = $this->request->get_param( 'user' );\n\t\t\tif ( $user_id ) {\n\t\t\t\t$where .= $wpdb->prepare( \" AND statref.user_id=%d \", (int) $user_id ); //phpcs:ignore\n\t\t\t} else {\n\n\t\t\t\t$users = $this->users_for_stats();\n\n\t\t\t\tif ( ( $users ) ) {\n\t\t\t\t\t$how_many = count( $users );\n\t\t\t\t\t$placeholders = array_fill( 0, $how_many, '%d' );\n\t\t\t\t\t$format = implode( ', ', $placeholders );\n\t\t\t\t\t$where .= $wpdb->prepare( \" AND statref.user_id IN ($format) \", $users ); //phpcs:ignore\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $where;\n\t\t}", "function _applyFilter($user, $info, $filter) {\n\t\tforeach($filter as $key => $pattern) {\n\t\t\t//sanitize pattern for use as regex\n\t\t\t$pattern = '/'.str_replace('/', '\\/', $pattern).'/i';\n\t\t\t\n\t\t\tif($key == 'user') {\n\t\t\t\tif(!preg_match($pattern, $user)) return false;\n\t\t\t} else if($key == 'grps') {\n\t\t\t\tif(!count(preg_grep($pattern, $info['grps']))) { \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!preg_match($pattern, $info[$key])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function actionFilter()\n {\n $userSelectData = ArrayHelper::map(User::find()->all(), 'id', 'fullname');\n $serviceOptions = Service::getOptions();\n $userFlatOptions = [];\n $params = Yii::$app->request->queryParams;\n $searchUser = $params['CounterDataSearch']['searchUser'];\n if ($searchUser) {\n $user = User::findOne($searchUser);\n if ($user) {\n $userFlatOptions = ArrayHelper::map($user->flats, 'flat', function ($model) {\n return $model->flat . ', ' . $model->house->name;\n });\n }\n }\n if (!isset($userFlatOptions[$params['CounterDataSearch']['searchFlat']])) {\n unset($params['CounterDataSearch']['searchFlat']);\n }\n \n $searchModel = new CounterDataSearch();\n $dataProvider = $searchModel->search($params);\n \n return $this->render('filter', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'userSelectData' => $userSelectData,\n 'userFlatOptions' => $userFlatOptions,\n 'serviceOptions' => $serviceOptions,\n ]);\n }", "function update_user ($user_id, $change_field) {\r\n $flag = false;\r\n \r\n //if (!check_admin()) return false;\r\n if (!is_array($change_field)) {\r\n throw new Exception(\"input is not an array!\");\r\n }\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update users set \";\r\n foreach ($change_field as $row) {\r\n if ($flag) {\r\n $query .= \", \";\r\n }\r\n\r\n $temp = $row['name'].\" = '\".trim($row['new_value']).\"'\";\r\n $query .= $temp;\r\n $flag = true;\r\n }\r\n $query .= \" where user_id = '\".$user_id.\"'\"; \r\n //echo $query;\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }", "protected function getSearchColumnsForFilter()\n {\n return sfConfig::get('app_ull_user_phone_book_search_columns', array(\n 'first_name',\n 'last_name',\n 'UllLocation->name',\n 'UllLocation->short_name',\n 'UllLocation->phone_base_no',\n 'UllDepartment->name',\n 'UllJobTitle->name',\n ));\n }", "public function adminUserConditionMatchesAdminUser() {}", "public function getUserAllTotalRowsFiltered($filter_by, $filter_by_value, $regex_filter=true)\n {\n $statement = \"SELECT COUNT(*) AS TOTAL_COUNT_FILTER FROM user\";\n\n // If only the $filter_by_value is set, then search all the columns.\n // If both $filter_by and $filter_by_value are set, then search only in\n // the $filter_by column.\n if (isset($filter_by_value) && !empty($filter_by_value)) {\n if (isset($filter_by) && !empty($filter_by)) {\n // Search in a specific column with regex\n if ($regex_filter) {\n // Search in a specific column with regex\n $statement .= \" WHERE $filter_by REGEXP '$filter_by_value'\";\n } else {\n $statement .= \" WHERE $filter_by = '$filter_by_value'\";\n }\n } else {\n // Search in all columns with exact match\n // TODO Need a better way to get the column names\n $allColumns = \"(UserID, FirstName, LastName, Email, TravelDateStart, TravelDateEnd, TravelReason)\";\n $statement .= \" WHERE '$filter_by_value' IN $allColumns\";\n }\n }\n\n try {\n $statement = $this->db->query($statement);\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n return $result[0][\"TOTAL_COUNT_FILTER\"];\n } catch (\\PDOException $e) {\n echo \"Error getUserAllTotalRows: \" . $e->getMessage();\n exit();\n }\n }", "public function searchUser()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('descripcion_breve',$this->descripcion_breve,true);\n\t\t$criteria->compare('descripcion_detallada',$this->descripcion_detallada,true);\n\t\t$criteria->compare('id_artefacto',$this->id_artefacto);\n\t\t$criteria->compare('impacto',$this->impacto,true);\n\t\t$criteria->compare('prioridad',$this->prioridad,true);\n\t\t$criteria->compare('temporizacion',$this->temporizacion,true);\n\t\t$criteria->compare('riesgos',$this->riesgos,true);\n\t\t$criteria->compare('nombre_estado',$this->nombre_estado,true);\n\t\t$criteria->compare('id_creador',$this->id_creador);\n\t\t$criteria->compare('id_probador',$this->id_probador);\n\t\t$criteria->compare('id_desarrollador',$this->id_desarrollador);\n\t\t\n\t\t$criteriaUsers = new CDbCriteria;\n\t\t$criteriaUsers->compare('id_creador',Yii::app()->user->id);\n\t\t$criteriaUsers->addCondition('id_probador = '.Yii::app()->user->id, 'OR');\n\t\t$criteriaUsers->addCondition('id_desarrollador = '.Yii::app()->user->id, 'OR');\n\t\t\n\t\t$criteria->mergeWith($criteriaUsers, 'AND');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function actionGetFilteredUsersList()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['lastname'])) {\n $lastname = strtolower(trim($_POST['lastname']));\n\n if ($lastname != '') {\n /*getFilteredUsersByLastName(false)*/\n $criteria=new CDbCriteria;\n if ($lastname != '*') {\n $criteria->compare('Last_Name', $lastname, true);\n }\n $criteria->order = 'Last_Name ASC';\n $all_users = Persons::model()->with('user')->findAll($criteria);\n $find = true;\n } else {\n $all_users = array();\n $find = false;\n }\n //var_dump($all_users); die;\n $this->renderPartial('filtered_users_list' , array(\n 'all_users' => $all_users,\n 'find' => $find,\n ));\n }\n }", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(UserPeer::UID, $key, Criteria::EQUAL);\n\t}", "abstract public function filterWhere(Builder $dataSource);", "private static function _getFilter() {}", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function filterUser(int $id): self;", "public function getUpdatedUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE userid != :userid AND username = :username\";\r\n\r\n return $query_string;\r\n}", "public function onKernelRequest(): void\n {\n $user = $this->em->getRepository(User::class)->findOneBy(['username' => 'jane.doe']);\n $filter = $this->em->getFilters()->enable('user_filter');\n $filter->setParameter('id', $user->getId());\n }", "public function getUpdatedEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE userid != :userid AND email = :email\";\r\n\r\n return $query_string;\r\n}", "protected function filterByUser(Builder $query, Request $request)\n {\n if ($search = $request->get('searchUser')) {\n $query->whereHas('account.user', function (Builder $query) use ($search) {\n $query->where('name', 'like', \"%{$search}%\");\n });\n }\n }", "public function Search($criteria, $userId);", "public function dtPerformGlobalFilter($columns, $search = '');", "public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy, $comparison);\n }", "private function search_user_by($column,$data,$db,$start=0,$limit=10){\n\t\tif (empty($column) || strlen($data)<3){\n\t\t\treturn null;\n\t\t}\n\t\t$data=strtolower($data);\n\t\t$data=Db::escapee($data,true);\n\t\t$sql=Db::create_sql(array(\n\t\t\t\t\"user_id\",\n\t\t\t\t\"first_name\",\n\t\t\t\t\"last_name\"\n\t\t),\n\t\t\t\t'users',\n\t\t\t\t\"$column LIKE '%$data%' AND\n\t\t\t\tstatus=1\",\n\t\t\t\tnull,null,\n\t\t\t\t\"$start,$limit\");\n\t\t\t\treturn empty($db)?$sql:Db::fetch_array($db, $sql);\n\t}", "public function whereLike($table, $column, $value);", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function dtPerformColumnFilter($columns);", "public function UserFilterData($value)\n {\n $em = $this->getEntityManager();\n if ($value == 'Display All') {\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $qb1->innerJoin('u.workProfile', 'uw');\n $qb1->innerJoin('uw.team', 't');\n $result1 = $qb1->getQuery()->getResult();\n return $result1;\n } \n else {\n $qb = $em->createQueryBuilder();\n $qb->select('DISTINCT ur.id');\n $qb->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb->innerJoin('u.reportingPersons', 'ur');\n if ($value == 'Non Jyo')\n $qb->where(\"u.id !='14'\");\n elseif ($value == 'Jyo')\n $qb->where(\"u.id = '14'\");\n $result = $qb->getQuery()->getResult();\n\n for ($i = '0'; $i < sizeof($result); $i++) {\n $id = $result[$i]['id'];\n $q = $em->createQueryBuilder();\n $q->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $q->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $q->leftJoin('u.personalProfile', 'up');\n $q->leftJoin('u.workProfile', 'uw');\n $q->leftJoin('uw.team', 't');\n $q->where(\"u.id='$id'\");\n $finalResult[$i] = $q->getQuery()->getResult();\n }\n \n return $finalResult;\n }\n }", "public function testFilterUserByCurrency()\n {\n $expected = $this->usersFilter->filterByCurrency(\"AED\",\"AED\");\n $this->assertTrue($expected);\n }", "public function updateContribBoOnlyUser($userId,$uarr){\n //echo \"<pre>\";print_r($conarray);exit;\n /* user table update */\n $this->_name = \"User\";\n $where2 = \" identifier='\" . $userId . \"' \";\n $result = $this->updateQuery($uarr, $where2);\n if($result === '1')\n return true;\n else\n return fasle;\n }", "public function scopeSearchByUser($query, $user_id)\n {\n if (isset($user_id) && $user_id !== null) {\n return $query->where('user_id', $user_id);\n }\n }", "public function findWhere(String $column, $value, String $operator = '=');", "private function filter_fields_by_user_status( $all_fields = array(), $filter_attribute = 'none' ) {\n // Filter criteria:\n // 1. If the provided filter_attribute is missing or \"none\", return all fields\n // 2. if the field attribute is \"all\", return that field\n // 3. If the field attribute is \"member\", return if the user is logged in\n return array_filter(\n $all_fields,\n function( $field ) use ( $filter_attribute ) {\n return ( 'none' === $filter_attribute ) ||\n ( 'all' === $field[ $filter_attribute ] ) ||\n ( is_user_logged_in() && ( 'member' === $field[ $filter_attribute ] ) );\n }\n );\n }", "public function TestFilterUserByStatus()\n {\n $expected = $this->usersFilter->filterByCurrency(\"authorized\",\"authorized\");\n $this->assertTrue($expected);\n }", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"sistemkuliah = '$key'\";\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('unit'));\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "public function adminUserConditionMatchesRegularUser() {}", "static public function mdlReadUsers($item, $value){\n $sql = \"SELECT * FROM Usuarios \";\n \n if($item == null){\n $stmt = Conexion::connect() -> prepare($sql);\n $stmt -> execute();\n return $stmt -> fetchALl();\n }else{\n $sql .= \"WHERE $item LIKE :item \";\n $stmt = Conexion::connect() -> prepare($sql);\n $stmt -> bindParam(\":item\", $value);\n $stmt -> execute();\n return $stmt -> fetch();\n }\n }", "public function filtermember() {\n $response = $this->Allusers_model->filtermember();\n return $response;\n }", "public function getUserSearchCondition($userOrUID) {\n\t\tif(is_numeric($userOrUID)) {\n\t\t\t$uID = $userOrUID;\n\t\t} else if(is_object($userOrUID)) {\n\t\t\t$uID = $userOrUID->getUserID();\n\t\t} else {\n\t\t\tthrow new Exception('Value for condition must be a user or user ID (was \"'.Loader::helper('text')->entities($userOrUID).'\").');\n\t\t}\n\t\t\n\t\t// Since this is stored in the search index as string containing a \n\t\t// delimited list of uIDs, we can use searchKeywords() to generate a \n\t\t// usable LIKE condition.\n\t\treturn $this->searchKeywords(self::SEARCH_INDEX_DELIMITER.$uID.self::SEARCH_INDEX_DELIMITER);\n\t}", "function authArrayFilter($columns, $items, $operation)\n{\n return GAuthHelper::operation_filter_array($columns, $items, $operation);\n}", "public function filterUser(int|UniqueId $id): self;", "public function searchByFilter($filter)\n {\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(UserPeer::ID, $key, Criteria::EQUAL);\n }", "public function filter($mValue)\n {\n return \\mysql_escape_string($mValue);\n }", "public function user_search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n\n $criteria->compare('time', '>=' . $this->time_up_from);\n $criteria->compare('time', '<=' . $this->time_up_to);\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('note', $this->note, true);\n $criteria->compare('cat_id', $this->cat_id, true);\n $criteria->compare('sub_cat_id', $this->sub_cat_id, true);\n $criteria->compare('reference', $this->reference, true);\n $criteria->compare('value', $this->value);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function UpdateUserNameWithNumSecu() {\n\n $sql = \"SELECT s.id,u.id as user_id,s.num_secu,u.username,s.nom,s.prenom,s.matricule,s.company_id FROM 3cexternpaie_fulloffice_db.salary s\n\nleft join 3cexternpaie_fulloffice_db.user u on s.user_id = u.id\n\n\n\nwhere u.username LIKE '%a%' or '%b%' or '%c%' or '%d%' or '%e%' or '%f%' or '%g%' or '%h%' or '%i%' or '%j%' \n\nor '%k%' or '%l%' or '%m%' or '%n%' or '%o%' or '%p%' or '%q%' or '%r%' or '%s%' or '%t%' or '%u%' or '%v%'or '%w%' or '%x%' or '%y%' or '%z%' \";\n\n\n\n $em = $this->getContainer()->get('doctrine.orm.entity_manager');\n $stmt = $em->getConnection()->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll();\n }", "abstract protected function filterField(): string;", "function filter_update_keys( $args ) {\n\t\t$updates = $args[0];\n\n\t\tif ( isset( $updates->no_update ) ) {\n\t\t\tunset( $updates->no_update );\n\t\t}\n\n\t\treturn $args;\n\t}", "public function testWriterShouldFilterSelectForUpdate()\n\t{\n\t\tR::nuke();\n\t\t$id = R::store( R::dispense('bean') );\n\t\tR::debug( TRUE, 1 );\n\t\t$bean = R::findForUpdate('bean', 'id > 0');\n\t\t$logs = R::getDatabaseAdapter()->getDatabase()->getLogger()->grep( AQueryWriter::C_SELECT_SNIPPET_FOR_UPDATE );\n\t\tasrt( count($logs), 0 ); //if no cache clear, then would have been 2\n\t\t$bean = R::loadForUpdate('bean', $id);\n\t\t$logs = R::getDatabaseAdapter()->getDatabase()->getLogger()->grep( AQueryWriter::C_SELECT_SNIPPET_FOR_UPDATE );\n\t\tasrt( count($logs), 0 ); //if no cache clear, then would have been 2\n\t\tR::getWriter()->setUseCache( FALSE );\n\t\tR::debug( FALSE );\n\t\tR::nuke();\n\t}", "function filter_users_by_course_section($query)\n{\n global $pagenow;\n if (is_admin() && 'users.php' == $pagenow) {\n if (!empty($_GET[ 'user_status'])) \n {\n $user_status= '';\n if($_GET[ 'user_status'] == 'approved')\n {\n $user_status = 1;\n } \n elseif($_GET[ 'user_status'] == 'unapproved')\n {\n $user_status = 0;\n } \n $meta_query = [['key' => '_user_activation_status','value' => $user_status, 'compare' => 'LIKE']];\n $query->set('meta_key', '_user_activation_status');\n $query->set('meta_query', $meta_query);\n }\n }\n}", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "public static function handleTransactionFilter ($filter, $userId) {\n switch ($filter)\n {\n case Config::get('constant.E_VOUCHER_SENT_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.E_VOUCHER_TRANSACTION_TYPE') . \"' AND user_transactions.from_user_id = '\" . $userId . \"'\";\n break;\n case Config::get('constant.E_VOUCHER_RECEIVED_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.E_VOUCHER_TRANSACTION_TYPE') . \"' AND user_transactions.to_user_id = '\" . $userId . \"'\";\n break;\n case Config::get('constant.MONEY_SENT_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.ONE_TO_ONE_TRANSACTION_TYPE') . \"' AND user_transactions.from_user_id = '\" . $userId . \"'\";\n break;\n case Config::get('constant.MONEY_RECEIVED_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.ONE_TO_ONE_TRANSACTION_TYPE') . \"' AND user_transactions.to_user_id = '\" . $userId . \"'\";\n break;\n case Config::get('constant.ADDED_TO_WALLET_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.ADD_MONEY_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.WITHDRAW_MONEY_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.WITHDRAW_MONEY_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.CASHIN_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.CASH_IN_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.CASHOUT_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.CASH_OUT_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.ADDED_COMMISSION_TO_WALLET_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.ADD_COMMISSION_TO_WALLET_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.WITHDRAWAL_OF_COMMISSION_FROM_WALLET_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.WITHDRAW_MONEY_FROM_COMMISSION_TRANSACTION_TYPE') . \"'\";\n break;\n case Config::get('constant.E_VOUCHER_ADDED_TO_WALLET_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.REDEEMED_TRANSACTION_TYPE') . \"' AND user_transactions.to_user_id = '\" . $userId . \"'\";\n break;\n case Config::get('constant.E_VOUCHER_CASHED_OUT_FILTER'): // code to be executed if $filter = ;\n $whereTransactionTypeClause = \"user_transactions.transaction_type = '\" . Config::get('constant.E_VOUCHER_CASHOUT_TRANSACTION_TYPE') . \"'\";\n break;\n default: // code to be executed if filter doesn't match any cases\n $whereTransactionTypeClause = \"1=1\";\n } \n return $whereTransactionTypeClause;\n }", "public function update($column, $value, Utilisateur $user){\n\t\t$q = $this->pdo->prepare('UPDATE utilisateur SET '.$column.'=:value WHERE id=:id' );\n\t\t$q->bindValue(':value', $value );\n\t\t$q->bindValue(':id', $user->getId(), PDO::PARAM_INT);\n\t\t$q->execute();\n\t}" ]
[ "0.5791718", "0.57721555", "0.5631774", "0.5541098", "0.5477778", "0.54755574", "0.54297024", "0.5384514", "0.528031", "0.52615607", "0.5222948", "0.5222948", "0.5222948", "0.5222948", "0.5222948", "0.5222948", "0.5222948", "0.5212269", "0.5210361", "0.5209833", "0.5164055", "0.5154051", "0.5112919", "0.5112919", "0.50980157", "0.5076582", "0.5062833", "0.5060924", "0.5007411", "0.49948344", "0.49921212", "0.4986721", "0.49845064", "0.49714634", "0.4967947", "0.4967947", "0.4967947", "0.4967947", "0.49585405", "0.49564755", "0.4949239", "0.49290174", "0.49115765", "0.49107963", "0.49082178", "0.48972386", "0.4875386", "0.4870984", "0.48703298", "0.48701844", "0.48687318", "0.4857532", "0.48544478", "0.4854063", "0.48447847", "0.48383442", "0.48313016", "0.48294175", "0.48281604", "0.48185205", "0.47939348", "0.47904873", "0.47856748", "0.47854438", "0.47796267", "0.47780243", "0.47771195", "0.47713128", "0.47630444", "0.4758188", "0.47556794", "0.47500157", "0.4749808", "0.47479793", "0.4747782", "0.4746422", "0.4738388", "0.4736207", "0.4735431", "0.47337157", "0.47312808", "0.47276816", "0.4723557", "0.4723367", "0.47127852", "0.47094232", "0.47041258", "0.470395", "0.46979883", "0.46979883", "0.46953285", "0.4693506", "0.4691196", "0.4690531", "0.46898404", "0.46871936", "0.46819025", "0.46785673", "0.46765295", "0.46724322" ]
0.5861497
0
Filter the query by a related \MapPersonaScene object
public function filterByMapPersonaScene($mapPersonaScene, $comparison = null) { if ($mapPersonaScene instanceof \MapPersonaScene) { return $this ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison); } elseif ($mapPersonaScene instanceof ObjectCollection) { return $this ->useMapPersonaSceneQuery() ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \MapPersonaScene or Collection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useMapPersonaSceneQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapPersonaScene($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapPersonaScene', '\\MapPersonaSceneQuery');\n }", "public function scenes()\n {\n return $this->hasMany(EntryScene::class);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $key, Criteria::EQUAL);\n }", "public function filter()\n\t{\n\t\tif (isset($_GET['cty']) AND (int) $_GET['cty'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$county_id = (int) $_GET['cty'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"county \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $county_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_GET['cst']) AND (int) $_GET['cst'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$constituency_id = (int) $_GET['cst'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"constituency \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $constituency_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\t}", "public function filtering();", "public function getScenesNearby($privacy) {\n\t\t$scenes = array();\n\t\t$pos = $this->getPosition();\n\t\t$minX = $pos->lx-100;\n\t\t$maxX = $pos->lx+100;\n\t\t$minY = $pos->ly-100;\n\t\t$maxY = $pos->ly+100;\n\t\t$sql = \"SELECT `sceneID` FROM `scenes` WHERE `privacy`=$privacy AND `globalX`=$pos->x AND `globalY`=$pos->y AND `localX`>$minX AND `localX`<$maxX AND `localY`>$minY AND `localY`<$maxY AND `indoors`=0 ORDER BY `sceneID` DESC\";\n\t\t$result = $this->mysqli->query($sql);\n\t\tif (mysqli_num_rows($result)) {\n\t\t\twhile ($row = mysqli_fetch_row($result)) {\n\t\t\t\t$scenes[] = $row[0];\n\t\t\t}\n\t\t}\n\t\treturn $scenes;\n\t}", "public function isProjection();", "public function filterShopByMap($params)\n {\n $limit = isset($params['page_size']) ? $params['page_size'] : 10;\n $offset = isset($params['page_index']) && $params['page_index'] > 0 ? $this->pagination->getOffsetNumber($params['page_index'], $limit) : 0;\n\n $distance = new GeoDistance(\n 'location',\n [\n 'lat' => $params['latitude'],\n 'lon' => $params['longitude']\n ],\n '20km'\n );\n $query = new \\Elastica\\Query;\n $all = new Query\\MatchAll();\n $query->setPostFilter(new Missing('deletedAt'));\n $query->setQuery(new Query\\Filtered($all, $distance));\n $pagination = $this->storeFinder->createPaginatorAdapter($query);\n $transformedPartialResults = $pagination->getResults($offset, $limit);\n $results= $transformedPartialResults->toArray();\n $total = $transformedPartialResults->getTotalHits();\n return $this->pagination->response($results, $total, $limit, $offset);\n }", "public function getFilteredDetails();", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterVisible(): self;", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n if (count($data->relatorio_id) == 0)\n { \n TTransaction::open('bedevops');\n $conn = TTransaction::get();\n $result = $conn->query('SELECT * FROM relatorio WHERE user_id = '.TSession::getValue(\"userid\").' ORDER BY id DESC LIMIT 4');\n $objects = $result->fetchAll(PDO::FETCH_CLASS, \"stdClass\");\n foreach ($objects as $value) {\n array_push($data->relatorio_id,$value->id);\n }\n TTransaction::close();\n } \n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->categoria_id) AND ( (is_scalar($data->categoria_id) AND $data->categoria_id !== '') OR (is_array($data->categoria_id) AND (!empty($data->categoria_id)) )) )\n {\n\n $filters[] = new TFilter('categoria_id', '=', $data->categoria_id);// create the filter \n }\n\n if (count($data->relatorio_id) <= 4)\n {\n if (isset($data->relatorio_id) AND ( (is_scalar($data->relatorio_id) AND $data->relatorio_id !== '') OR (is_array($data->relatorio_id) AND (!empty($data->relatorio_id)) )) )\n {\n\n $filters[] = new TFilter('relatorio_id', 'in', $data->relatorio_id);// create the filter \n }\n } else {\n throw new Exception('Selecione no máximo 4 relatórios!');\n }\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n }", "public function filter() {\n\t $this->model->filter(array(\"status\"=>array(0,1)));\n\t if(Request::post(\"section\")){\n\t $section = new CmsSection(Request::post(\"section\"));\n\t foreach($section->tree() as $section) $section_ids[] = $section->primval;\n\t $this->model->filter(array(\"cms_section_id\"=>$section_ids));\n }\n\t parent::filter();\n\t}", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "protected abstract function filter();", "public function filter();", "abstract public function filterFields();", "public function getRepr($id_personnemoral){\n $repr = afa::with('personnephysique')\n ->join('personnephysique','personnephysique.idpersonnephysique','=','afa.idpersonnephysique')\n ->where('afa.idpersonnemorale',$id_personnemoral)->get();\n\n foreach ($repr as $res){\n return $res;\n\n }\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_MENU_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $keys, Criteria::IN);\n }", "public function getScenes()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$items = Vr360Database::getInstance()->select(\n\t\t\t'v2_scenes',\n\t\t\tarray(\n\t\t\t\t'id', 'tourId', 'name', 'description', 'file', 'ordering', 'status', 'default', 'params'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'status[!]' => VR360_TOUR_STATUS_UNPUBLISHED,\n\t\t\t\t'tourId' => $this->id,\n\t\t\t\t'ORDER' => array('ordering' => 'ASC')\n\t\t\t)\n\t\t);\n\n\t\tif (empty($items))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($items as $key => $item)\n\t\t{\n\t\t\t$scene = new Vr360Scene;\n\t\t\t$item['params'] = json_decode($item['params']);\n\t\t\t$scene->bind($item);\n\t\t\t$items[$key] = $scene;\n\t\t}\n\n\t\treturn $items;\n\t}", "public function filtroProvincia($provincia){\n $path = '../python_scraper/ofertas_trabajo.json';\n $json = file_get_contents($path);\n $array = json_decode($json);\n\n $filtrado = array_filter($array, function($val) use ($provincia) { \n return $val -> localidad == $provincia;\n });\n\n return response() -> json($filtrado); \n }", "public function relationshipFilter()\n\t{\n\t\tee()->load->add_package_path(PATH_ADDONS.'relationship');\n\t\tee()->load->library('EntryList');\n\t\tee()->output->send_ajax_response(ee()->entrylist->ajaxFilter());\n\t}", "public function index()\n {\n $result=film::join('pozoristes','predstavas.pozoriste_id','=','pozoristes.id')\n ->get(['predstavas.*','pozoristes.ime','pozoristes.lokacija']);\n \n return $result;\n }", "public function filtrarclientes(){\n\n $this->request->allowMethod(['get']);\n \n $keyword = $this->request->query('keyword');\n $activo = $this->request->query('activo');\n\n $condiciones = array();\n\n $condiciones['name like '] = '%'.$keyword.'%';\n\n if($activo){\n $condiciones['borrado = '] = false;\n }\n \n $query = $this->Clientes->find('all', [\n 'conditions' => $condiciones,\n 'order' => [\n 'Clientes.id' => 'ASC'\n ],\n 'limit' => 100\n ]);\n\n $clientes = $this->paginate($query);\n $this->set(compact('clientes'));\n $this->set('_serialize', 'clientes');\n }", "public function filterByName($name = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($name)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $name)) {\n $name = str_replace('*', '%', $name);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SceneTableMap::COL_NAME, $name, $comparison);\n }", "public function personas()\n {\n $parametros = Input::only('term');\n\n $acompaniantes = Acompaniantes::select('personas_id')->get();\n\n $data = Personas::with('municipios','localidades','derechohabientes', 'estados_embarazos')->whereNotIn('id', $acompaniantes)\n ->where(function($query) use ($parametros) {\n $query->where('id','LIKE',\"%\".$parametros['term'].\"%\");\n });\n\n $data = $data->get();\n return $this->respuestaVerTodo($data);\n }", "public function getRegiones($id){ //id del pais\n return Region::where('codPais','=',$id)->get();\n \n }", "private function filterByPermission(){\n\n }", "public function filterMembers()\n {\n return $this->team->where('id', Auth::user()->getTeam()->id)->with([\n 'members' => function ($query) {\n $query->where('slug', 'like', '%' . $this->request->get('q') . '%');\n },\n ])->first()->members;\n }", "public function Search($objeto);", "public function filterBySceneId($sceneId = null, $comparison = null)\n {\n if (is_array($sceneId)) {\n $useMinMax = false;\n if (isset($sceneId['min'])) {\n $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sceneId['max'])) {\n $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId, $comparison);\n }", "abstract protected function foreignIDFilter($id = null);", "public function show($id_scene)\n {\n $s_scene = SecondaryScene::where('id_scenes', $id_scene)->get();\n return response()->json($s_scene);\n }", "abstract public function filters();", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }", "public function searchPrzydzielanie()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t//$this->relations(array('not_in_hasDomains'=>array(self::HAS_MANY,'KlientHasDomains', 'domains_id', 'condition'=>'not_in_hasDomains.domains_id is not null')));\n\t\t $criteria->together = true;\n\t\t$criteria->with=array('przydzielenies', 'not_in_hasDomains'=>array(\tself::HAS_MANY,'KlientHasDomains', 'domains_id', \n\t\t\t\t'joinType' => 'INNER JOIN',\n\t\t\t\t//'on' => \"(not_in_hasDomains.domains_id is not null)\",\n\t\t\t\t'condition'=>'')\n\t\t );\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('user_id',$this->user_id,true);\n\t\t$criteria->compare('name',$this->name);\n\t\t$criteria->compare('expiry_date',$this->expiry_date,true);\n\t\t$criteria->compare('registrar',$this->registrar,true);\n\t\t$criteria->compare('added_date',$this->added_date,true);\n\t\t$criteria->compare('client',$this->client,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->addBetweenCondition('expiry_date', $this->expiry_date_od, $this->expiry_date_do);\n\t\n\t\tif($this->przydzielone) {\n\t\t$criteria->addCondition('przydzielenies.domains_id is null');\n\t\t}\n\t\t\n\t\t//$criteria->addCondition('klients is null');\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t'criteria'=>$criteria,\n\t\t\t\t'sort'=>array(\n\t\t\t\t\t\t'defaultOrder'=>array(\n\t\t\t\t\t\t\t\t'expiry_date'=>false\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'pagination'=>array(\n\t\t\t\t\t\t'pageSize'=>5,\n\t\t\t\t),\n\t\n\t\t));\n\t}", "public function consultar($filtro, $codigoModalidadAcademica = NULL) {\n $estudiantes = array();\n\n /* Modified Diego Rivera <[email protected]>\n * Se añade filtor 105(Admitido que no Ingreso) en S.codigosituacioncarreraestudiante NOT IN (100, 101, 102, 103, 108, 109, 112, 302, 400 ) \n * Since October 5,2017\n */\n $sql = \"\n SELECT DISTINCT\n P.idplanestudio,\n EG.idestudiantegeneral,\n E.codigoestudiante,\n CONCAT( EG.apellidosestudiantegeneral, ' ', EG.nombresestudiantegeneral ) AS Nombre,\n C.nombrecarrera,\n PR.semestreprematricula,\n PR.codigoestadoprematricula,\n C.codigocarrera,\n FG.FechaMaximaCumplimiento,\n MAX( PR.codigoperiodo ) AS codigoperiodo,\n FG.FechaGradoId,\n EG.EstadoActualizaDato,\n E.codigosituacioncarreraestudiante,\n FG.TipoGradoId \n FROM\n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN facultad F ON ( F.codigofacultad = C.codigofacultad )\n LEFT JOIN prematricula PR ON ( PR.codigoestudiante = E.codigoestudiante )\n LEFT JOIN detalleprematricula DP ON ( DP.idprematricula = PR.idprematricula )\n INNER JOIN planestudio P ON ( P.codigocarrera = C.codigocarrera )\n INNER JOIN planestudioestudiante PE ON ( PE.idplanestudio = P.idplanestudio AND PE.codigoestudiante = E.codigoestudiante AND PE.codigoestadoplanestudioestudiante != 200 )\n INNER JOIN situacioncarreraestudiante S ON ( S.codigosituacioncarreraestudiante = E.codigosituacioncarreraestudiante )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera ) \n WHERE\n S.codigosituacioncarreraestudiante NOT IN ( 100, 101, 102, 103, 108, 109, 112, 302, 400, 105 ) \n AND (\n PR.semestreprematricula BETWEEN ( IF ( C.codigocarrera = 1186, P.cantidadsemestresplanestudio - 9, P.cantidadsemestresplanestudio - 3 ) ) \n AND P.cantidadsemestresplanestudio \n OR E.semestre = P.cantidadsemestresplanestudio \n ) \";\n\n if (empty($codigoModalidadAcademica) || $codigoModalidadAcademica == 200 || $codigoModalidadAcademica == 800) {\n $sql .= \" AND ( DP.codigoestadodetalleprematricula IN (10,30,20) OR DP.codigoestadodetalleprematricula IS NULL )\";\n }\n $sql .= $filtro;\n $sql .= \" AND E.codigoestudiante NOT IN ( \n SELECT\n R.codigoestudiante\n FROM \n registrograduado R\n WHERE\n R.codigoestudiante = E.codigoestudiante AND R.codigoestado = 100\n UNION\n SELECT \n RG.EstudianteId\n FROM \n RegistroGrado RG\n WHERE\n RG.EstudianteId = E.codigoestudiante AND RG.CodigoEstado = 100\";\n \n if (isset($_POST[\"cmbTipoGrado\"]) && $_POST[\"cmbTipoGrado\"] == 1) {\n $sql .= \" UNION\n SELECT\n DC.EstudianteId\n FROM\n DetalleAcuerdoActa DC\n INNER JOIN AcuerdoActa AC ON ( AC.AcuerdoActaId = DC.AcuerdoActaId )\n INNER JOIN FechaGrado FGR ON (FGR.FechaGradoId = AC.FechaGradoId )\n WHERE\n DC.EstudianteId = E.codigoestudiante AND FGR.TipoGradoId = 2 AND DC.CodigoEstado = 100\";\n }\n if (isset($_POST[\"cmbTipoGrado\"]) && $_POST[\"cmbTipoGrado\"] == 2) {\n $sql .= \" UNION\n SELECT\n DC.EstudianteId\n FROM\n DetalleAcuerdoActa DC\n INNER JOIN AcuerdoActa AC ON (\n AC.AcuerdoActaId = DC.AcuerdoActaId\n )\n INNER JOIN FechaGrado FGR ON (FGR.FechaGradoId = AC.FechaGradoId )\n WHERE\n DC.EstudianteId = E.codigoestudiante\n AND FGR.TipoGradoId = 1\n AND DC.CodigoEstado = 100\";\n }\n $sql .= \")\n GROUP BY E.codigoestudiante\n ORDER BY EG.apellidosestudiantegeneral ASC\";\n \n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->ejecutarConsulta();\n while ($this->persistencia->getNext()) {\n \n $estudiante = new Estudiante($this->persistencia);\n $estudiante->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $estudiante->setCodigoEstudiante($this->persistencia->getParametro(\"codigoestudiante\"));\n $estudiante->setNombreEstudiante($this->persistencia->getParametro(\"Nombre\"));\n $estudiante->setEstadoActualizaDato($this->persistencia->getParametro(\"EstadoActualizaDato\"));\n\n $situacionCarreraEstudiante = new SituacionCarreraEstudiante(null);\n $situacionCarreraEstudiante->setCodigoSituacion($this->persistencia->getParametro(\"codigosituacioncarreraestudiante\"));\n\n $fechaGrado = new FechaGrado(null);\n $fechaGrado->setIdFechaGrado($this->persistencia->getParametro(\"FechaGradoId\"));\n $fechaGrado->setFechaMaxima($this->persistencia->getParametro(\"FechaMaximaCumplimiento\"));\n\n $tipoGrado = new TipoGrado(null);\n $tipoGrado->setIdTipoGrado($this->persistencia->getParametro(\"TipoGradoId\"));\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $carrera->setNombreCarrera($this->persistencia->getParametro(\"nombrecarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n $fechaGrado->setTipoGrado($tipoGrado);\n\n $estudiante->setFechaGrado($fechaGrado);\n $estudiante->setSituacionCarreraEstudiante($situacionCarreraEstudiante);\n\n $preMatricula = new PreMatricula(null);\n $preMatricula->setSemestrePreMatricula($this->persistencia->getParametro(\"semestreprematricula\"));\n\n $periodo = new Periodo(null);\n $periodo->setCodigo($this->persistencia->getParametro(\"codigoperiodo\"));\n $preMatricula->setPeriodo($periodo);\n\n $estudiante->setPreMatricula($preMatricula);\n $estudiantes[count($estudiantes)] = $estudiante;\n }\n $this->persistencia->freeResult();\n\n return $estudiantes;\n }", "public function showProjectionsList(){\n $locContro=new LocationController();\n $gencontr=new GenreController();\n try{\n $projectionList=$this->projDao->getAllProjectionsGroup();\n $genres=$gencontr->getAll();\n $provinces=$locContro->getAllProvinces();\n $initCities=$locContro->getCitiesByProvince(1);\n include(VIEWS_PATH.\"movies_list.php\");\n }\n catch(Exception $e){\n $message=\"Projections are not currently available.\";\n include(VIEWS_PATH.\"message_view.php\");\n }\n }", "public function search($params)\n {\n $query = A2Liquidaciones::find();\n\n //$query->joinWith('operacionInmobiliaria',false, 'INNER JOIN');\n\n $query->joinWith(['operacionInmobiliaria' => function ($q) {\n $q->joinWith(['inmueble', 'cliente']);\n //$q->joinWith('cliente');\n }], false, 'INNER JOIN');\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'sin_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<0\");\n }\n\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'por_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(`a2_operaciones_inmobiliarias`.`hasta_anio`,'-',\n `a2_operaciones_inmobiliarias`.`hasta_mes`,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>=-70\");\n }\n\n //VENCIDAS\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND (DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>0 AND \n DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<=30) \");\n }\n\n //VENCIDAS MAS DE UN MES\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas_mas_mes') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>30 \");\n }\n\n // add conditions that should always apply here\n if ($params['A2LiquidacionesSearch']['estado'] == 'ACTIVO') {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'liq_anio' => SORT_DESC,\n 'liq_mes' => SORT_DESC,\n ]\n ],\n ]);\n } else {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'fecha_pago' => SORT_DESC,\n ]\n ],\n ]);\n }\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n if (!empty($this->periodo)) {\n $arreglo_periodo = explode(\"/\", $this->periodo);\n $this->liq_mes = $arreglo_periodo[0];\n $this->liq_anio = $arreglo_periodo[1];\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id_liquidacion' => $this->id_liquidacion,\n 'id_operacion' => $this->id_operacion,\n 'liq_anio' => $this->liq_anio,\n 'liq_mes' => $this->liq_mes,\n 'fecha_pago' => $this->fecha_pago,\n 'monto_pagado' => $this->monto_pagado,\n 'monto_intereses' => $this->monto_intereses,\n 'timestamp' => $this->timestamp,\n ]);\n\n\n $query->andFilterWhere(['like', 'usuario', $this->usuario])\n ->andFilterWhere(['like', 'a2_liquidaciones.estado', $this->estado])\n ->andFilterWhere(['like', 'a2_noticias.direccion', $this->direccion])\n ->andFilterWhere(['like', 'a2_clientes.nombre', $this->cliente]);\n\n\n return $dataProvider;\n }", "public function filterByMapSceneRewcat($mapSceneRewcat, $comparison = null)\n {\n if ($mapSceneRewcat instanceof \\MapSceneRewcat) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneRewcat->getSceneId(), $comparison);\n } elseif ($mapSceneRewcat instanceof ObjectCollection) {\n return $this\n ->useMapSceneRewcatQuery()\n ->filterByPrimaryKeys($mapSceneRewcat->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneRewcat() only accepts arguments of type \\MapSceneRewcat or Collection');\n }\n }", "public function getFilterPatient(Request $request)\n {\n $search='%'.$request->search.'%';\n $patient = Patient::leftJoin('triaje', 'paciente_id_paciente', '=','paciente.id_paciente')\n ->select('paciente.*' ,'triaje.fech_update')\n ->where('paciente.pac_name', 'like', $search)\n ->orderBy('id_paciente', 'desc')\n ->paginate(10);\n return $patient;\n }", "function LocalidadFilter( $Filter )\n {\n if( !empty($Filter->Loc) ) \n {\n $Loc = $Filter->Loc;\n return 'AND pLoc=\"'.$Loc.'\" ';\n }\n \n if( isset( $Filter->Prov ) ) \n return 'AND pProv='.$Filter->Prov.' ';\n\n return ''; \n }", "public function search(){\n $tags = Tag::all();\n\n $experiences = DB::table('experiences')\n ->select('experiences.title','experiences.slug','experiences.experience_thumbnail', 'users.name', 'users.avatar', 'experiences.description','countries.name as country','states.name as state')\n ->join('countries','countries.id','=','experiences.country_id')\n ->join('users','users.id','=','experiences.user_id')\n ->join('states','states.id','=','experiences.state_id')\n ->where('experiences.title','like', '%' . $_REQUEST['query'] .'%' )\n ->orWhere('experiences.country_id','=', $_REQUEST['country_id'])\n ->orWhere('experiences.country_id','=', $_REQUEST['country_id'])\n ->paginate(20);\n \n \n \n return view('frontend.filter')\n ->with('experiences', $experiences )\n ->with('tags', $tags );\n\n\n }", "public function searchByName($name){\n $projections=$this->getAllProjectionsGroup();\n $arrayFinded = array();\n foreach ($projections as $value) {\n $movie=$value->getMovie();\n if (stripos($movie->getTitle(),$name)!==false)\n {\n array_push($arrayFinded,$value);\n }\n }\n return $arrayFinded; \n }", "public function findByFilter($filter) {\n $query = $this->createQuery();\n //$query->getQuerySettings()->setRespectEnableFields(false);\n $query->getQuerySettings()->setEnableFieldsToBeIgnored(array());\n $query->getQuerySettings()->setIncludeDeleted(false);\n $query->getQuerySettings()->setRespectStoragePage(false);\n \n\n $constraints = array();\n if($filter->keyword) {\n $keywordConstraints = array();\n $keywordConstraints[] = $query->like('title', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('abstract', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('bodytext', '%'.$filter->keyword.'%');\n $constraints[] = $query->logicalOr($keywordConstraints);\n }\n if($filter->area) {\n $constraints[] = $query->contains('areas', $filter->area);\n }\n if($filter->industry) {\n $constraints[] = $query->contains('industries', $filter->industry);\n }\n if($filter->technology) {\n $constraints[] = $query->contains('technologies', $filter->technology);\n }\n if($filter->theme) {\n $constraints[] = $query->contains('themes', $filter->theme);\n }\n if($filter->year) {\n $minDate = mktime(0, 0, 0, 1, 1, $filter->year);\n $maxDate = mktime(23, 59, 59, 12, 31, $filter->year);\n $constraints[] = $query->greaterThanOrEqual('article_date', $minDate);\n $constraints[] = $query->lessThanOrEqual('article_date', $maxDate);\n }\n\n if(count($constraints)) {\n \n $query->matching(\n $query->logicalAnd($constraints)\n );\n \n \n \n//$queryParser = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbQueryParser::class);\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());\n//\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters());\n\n\n\n return $query->matching(\n $query->logicalAnd($constraints)\n )\n ->execute();\n \n }\n else {\n return $this->findAll();\n }\n }", "public function ActeurAction($acteurid){\n #Attention, nom entre parenthèses doit etre pareil que dans routing\n \n $em = $this -> getDoctrine() -> getManager();\n\n $acteur = $em -> getRepository('TroiswaPublicBundle:Acteur') -> find($acteurid); //Find pour récupérer un seul élément, et prend en argument l'id\n\n return $this->render('TroiswaPublicBundle:Acteur:acteur.html.twig', array('acteur' => $acteur ));\n #Envoyer des infos dans la vue - tableau associatif\n\n //die(Debug::dump($film));\n\n}", "function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function filterByPersona($persona, $comparison = null)\n\t{\n\t\tif ($persona instanceof Persona) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->getIdPersona(), $comparison);\n\t\t} elseif ($persona instanceof PropelCollection) {\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->toKeyValue('PrimaryKey', 'IdPersona'), $comparison);\n\t\t} else {\n\t\t\tthrow new PropelException('filterByPersona() only accepts arguments of type Persona or PropelCollection');\n\t\t}\n\t}", "public function index(Request $request){\n\n $validator = Validator::make($request->all(),[\n 'lat'=>'required',\n 'lng'=>'required',\n 'maxDist'=>'required|numeric|min:20|max:100',\n 'sponsored' =>'boolean',\n ]);\n\n if($validator->fails()){\n return response()->json($validator->messages());\n }\n\n\n\n //controllo di $request->sponsored per la selezione della query\n if($request->sponsored) {\n \n //se sono richiesti gli sponsorizzati\n $query = Apartment::selectRaw(\"*, ST_Distance_Sphere(point($request->lng,$request->lat),\n point(longitude, latitude)) * .001 as distance\")\n ->having('distance','<=',$request->maxDist)\n ->where('attivo', '=', '1')\n ->whereHas('sponsors',function($q){\n $q->where('end_sponsor','>=', Carbon::now());\n })->inRandomOrder();\n \n } else {\n //se sono richiesti tutti gli appartamenti\n $query = Apartment::selectRaw(\"*, ST_Distance_Sphere(point($request->lng,$request->lat),\n point(longitude, latitude)) * .001 as distance\")\n ->having('distance','<=',$request->maxDist)\n ->where('attivo', '=', '1');\n /// da implementare per ulteriori servizi volendo\n if($request->has(['rooms','beds','bathrooms'])){\n $query->whereRaw(\"rooms >= $request->rooms AND beds >= $request->beds AND bathrooms >= $request->bathrooms\");\n }\n }\n \n // FILTRO per servizi se presenti\n if($request['services']) {\n $serv = $request['services'];\n foreach($serv as $ser) {\n $query->whereHas('services', function (Builder $b) use ($ser) {\n $b->where('services.id', '=', $ser );\n\n });\n }\n }\n\n $query = $query->orderBy('distance','asc')->get();\n\n\n return response()->json($query, 200);\n }", "public function all($id){\n return $this->model->query()->where('persona_id',$id)->get();\n }", "public function filterByMapSceneStoreCategory($mapSceneStoreCategory, $comparison = null)\n {\n if ($mapSceneStoreCategory instanceof \\MapSceneStoreCategory) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneStoreCategory->getSceneId(), $comparison);\n } elseif ($mapSceneStoreCategory instanceof ObjectCollection) {\n return $this\n ->useMapSceneStoreCategoryQuery()\n ->filterByPrimaryKeys($mapSceneStoreCategory->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneStoreCategory() only accepts arguments of type \\MapSceneStoreCategory or Collection');\n }\n }", "public function loadPublications() {\n $this->_publications = DAOFactory::getPublicationDAO()->selectByIdPerson($this->_id);\n }", "public function filter(Record $record);", "public function hasStudyQueryDto() {\n return $this->_has(3);\n }", "public function hasCriteria();", "public function onFilterArticle(\\Enlight_Event_EventArgs $args)\n {\n $subject = $args->getSubject();\n $filterBy = $subject->Request()->getParam('filterBy');\n\n list($sqlParams, $filterSql, $categorySql, $imageSQL, $order) = $args->getReturn();\n\n if ($filterBy === 'connect') {\n $imageSQL = '\n LEFT JOIN s_plugin_connect_items as connect_items\n ON connect_items.article_id = articles.id\n ';\n\n $filterSql .= ' AND connect_items.shop_id > 0 ';\n }\n\n return [$sqlParams, $filterSql, $categorySql, $imageSQL, $order];\n }", "public function getFilterArtworks($request){\n return DB::select('select * from users, personal_account_models where users.id = personal_account_models.user_id AND personal_account_models.published = 1 AND users.name Like \"%'.$request['artist'].'%\"');\n }", "public function filterByPersona($persona, $comparison = null)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $persona->getId(), $comparison);\r\n\t}", "public function isFiltered() : bool;", "public function countryfilterAction()\n {\n $page = $this->params()->fromQuery('page', 1);\n $filter = $this->params()->fromRoute('country', null);\n\n // Filter posts by Country\n $query = $this->entityManager->getRepository(Post::class)->findPostsByCountry($filter);\n\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage(15);\n $paginator->setCurrentPageNumber($page);\n\n /* Change layout */\n $this->layout()->setTemplate('layout/layout-front');\n\n /* Latest 3 posts */\n $latestPosts = $this->entityManager->getRepository(Post::class)->findLatestPosts(2);\n\n /* Countries List */\n $countries = $this->entityManager->getRepository(Post::class)->getCountries();\n\n /* Cuisine Types list */\n $types = $this->entityManager->getRepository(Post::class)->getCuisineTypes();\n\n // Render the view template.\n return new ViewModel([\n 'posts' => $paginator,\n 'postManager' => $this->postManager,\n 'countries' => $countries,\n 'types' => $types,\n 'latestPosts' => $latestPosts\n ]);\n }", "public function objects() {\n \t// return call_user_func_array($this->belongsToMany('Object')->withPivot, static::$pivotColumns);\n return $this->belongsToMany('Object')\n ->withPivot('subdivision', 'time', 'place', 'form');\n }", "public function show(PersonaJuridica $personaJuridica)\n {\n return PersonaJuridica::with(['tipoOrganizacion', 'empresas'])\n ->withTrashed()\n ->where('id', $personaJuridica->id)\n ->first();\n }", "public function show(Serologia $serologia)\n {\n //\n }", "function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "abstract public function reverseQuery(GeoQueryInterface $query): Collection;", "public function search($params,$map=\"\")\n { \n if($map==\"map\"){//echo \"<pre>\"; print_r($params); die;\n if(isset($params['OthersVehicleDetailsSearch']['vehicle_name'])){\n $vehicle = $params['OthersVehicleDetailsSearch']['vehicle_name'];\n $reg_no = $params['OthersVehicleDetailsSearch']['reg_no'];\n if(!empty($vehicle) && empty($reg_no)){\n $query = OthersVehicleDetails::find()->where(['vehicle_master.status'=>'Active'])\n ->andWhere(['LIKE','vehicle_name',$vehicle])->joinWith(['driver','client']); \n //echo $query->createCommand()->getRawSql(); die;\n }else if(!empty($reg_no) && empty($vehicle)){\n $query = OthersVehicleDetails::find()->where(['vehicle_master.status'=>'Active'])\n ->andWhere(['LIKE','reg_no',$reg_no])->joinWith(['driver','client']);\n\n }else if(!empty($reg_no) && !empty($vehicle)){\n $query = OthersVehicleDetails::find()->where(['vehicle_master.status'=>'Active'])\n ->andWhere(['LIKE','reg_no',$reg_no])\n ->andWhere(['LIKE','vehicle_name',$vehicle])->joinWith(['driver','client']);\n }else{\n $query = OthersVehicleDetails::find()->where(['vehicle_master.status'=>'Active'])\n ->joinWith(['driver','client']);\n }\n }else{\n $query = OthersVehicleDetails::find()->where(['vehicle_master.status'=>'Active'])->joinWith(['driver','client']);\n }\n }else{\n $query = OthersVehicleDetails::find()->joinWith(['driver']);\n }\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'fc_expire_date' => $this->fc_expire_date,\n 'created_at' => $this->created_at,\n 'modified_at' => $this->modified_at,\n ]);\n\n $query->andFilterWhere(['like', 'vehicle_name', $this->vehicle_name])\n ->andFilterWhere(['like', 'vehicle_uniqe_name', $this->vehicle_uniqe_name])\n ->andFilterWhere(['like', 'reg_no', $this->reg_no])\n ->andFilterWhere(['like', 'vehicle_master.status', $this->status])\n ->andFilterWhere(['like', 'user_id', $this->user_id])\n ->andFilterWhere(['like', 'updated_ipaddress', $this->updated_ipaddress])\n ->andFilterWhere(['like', 'engine_number', $this->engine_number])\n ->andFilterWhere(['like', 'driver_profile.name', $this->driver_name])\n ->andFilterWhere(['like', 'client_master.company_name', $this->client_name])\n ->andFilterWhere(['like', 'frame_number', $this->frame_number]);\n\n return $dataProvider;\n }", "public function within($geometry);", "public function getFilterData($objectId)\n\t{\n\t\t//Get all word of set for filter\n\t\t$wordlist = Object::find($objectId)->word;\n\n\t\t$data = array();\n\n\t\tforeach ($wordlist as $word) \n\t\t{\n\n\t\t\t$layer = array();\n\n\t\t\t$layer[\"type\"] \t\t= \"filter\";\n\t\t\t$layer[\"wordId\"] \t= $word[\"id\"];\n\t\t\t$layer[\"key\"] \t\t= $word[\"key\"];\n\t\t\t$layer[\"value\"] \t= $word[\"value\"];\n\t\t\t$layer[\"image\"] = 'img/object/'.$objectId.'/'.$word[\"id\"].'.jpg';\n\t\t\t//Push thís word to array of Course\n\t\t\tarray_push($data,$layer);\n\t\t}\n\t\t//Return type as json Ajax.\n\t\treturn Response::json($data);\n\t}", "function filter($param)\r\n\t{\r\n\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t$sql = \"SELECT `\" . $param[1] . \"` FROM `\" . $param[0] . \"` WHERE `\" . $param[1] . \"` LIKE '\" . $_SQL->sql_real_escape_string($_GET['q']) . \"%' \r\n\t\t ORDER BY `\" . $param[1] . \"` LIMIT 0,100\";\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res) )\r\n\t\t{\r\n\t\t\techo $ob->$param[1] . \"\\n\";\r\n\t\t}\r\n\t}", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "public function filtreparcoursAction(Request $request){\n $em = $this->getDoctrine()->getManager();\n $mentionId = $request->get('idMention');\n $parcours = $em->getRepository('AppBundle:Parcours')\n ->findParcoursByMention($mentionId)\n ;\n return $this->render('etats/filtre_parcours.html.twig', [\n 'parcours' => $parcours,\n \n ]);\n }", "public function directors($limit = null)\n {\n return $this->belongsToMany('App\\Models\\Cast', 'cast_of_movies')->where('job_id', 2)->limit($limit);\n }", "public function joinMapPersonaScene($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapPersonaScene');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapPersonaScene');\n }\n\n return $this;\n }", "public function searchPrint()\n {\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\t\t$criteria->compare('rekening3_id',$this->rekening3_id);\n//\t\t$criteria->compare('rekening1_id',$this->rekening1_id);\n\t\t$criteria->compare('rekening2_id',$this->rekening2_id);\n\t\t$criteria->compare('LOWER(kdrekening3)',strtolower($this->kdrekening3),true);\n\t\t$criteria->compare('LOWER(nmrekening3)',strtolower($this->nmrekening3),true);\n\t\t$criteria->compare('LOWER(nmrekeninglain3)',strtolower($this->nmrekeninglain3),true);\n\t\t$criteria->compare('rekening3_aktif',$this->rekening3_aktif);\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 filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $keys, Criteria::IN);\n\t}", "public function perspective()\n {\n return $this->belongsTo(\\App\\Perspective::class);\n }", "private function _generateQuery() {\n\t\t// vyhodnoceni odeslanych filtracnich dat\n\t\t$filterObj = $this->getRequest()->getParam(\"_filter\", null);\n\t\t$uuid = $this->getRequest()->getParam(\"id\", null);\n\t\t$uuids = $this->getRequest()->getParam(\"_uuids\", null);\n\t\t\n\t\t// vyhodnoceni stavu\n\t\tif ($uuid) {\n\t\t\t// uuid byl odeslan primo v requestu\n\t\t\t$this->_queryObject = array($uuid);\n\t\t\t\n\t\t\treturn;\n\t\t} elseif ($uuids) {\n\t\t\t// byl odeslan seznam uuid\n\t\t\t$this->_queryObject = (array) $uuids;\n\t\t\t\n\t\t\treturn;\n\t\t} elseif (!$filterObj) {\n\t\t\t// zadna z moznosti nebyla vyuzita\n\t\t\t$this->_queryObject = array();\n\t\t}\n\t\t\n\t\t/**\n\t\t * pokud program dosel az sem, byl odeslan plnohodnotny filtracni objekt\n\t\t */ \n\t\t\n\t\t// reset referenci\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vytvoreni filtracniho objektu a ziskani seznamu tabulek\n\t\t$queryObj = BB_Db_Query_Factory::factory($filterObj);\n\t\t$tableNames = BB_Db_Query_Reference::getTables();\n\t\t\n\t\t// vygenerovani seznamu pouzitych sloupcu z index\n\t\t$usedColumns = $this->getRequest()->getParam(\"_uuidColumns\", array());\n\t\t$usedColumns = (array) $usedColumns;\n\t\t\n\t\tif (!$usedColumns) {\n\t\t\t// seznam pouzitych sloupci je prazdny - toto neni pripustne\n\t\t\tthrow new Zend_Exception(\"UUID_COLUMNS_NOT_SET\", 400);\n\t\t}\n\t\t\n\t\t$usedReferences = array();\n\t\t\n\t\tforeach ($usedColumns as $column) {\n\t\t\t$reference = new BB_Db_Query_Reference($column);\n\t\t\t\n\t\t\t// kontrola jestli je tabulka v seznamu\n\t\t\tif (!in_array($reference->getTable(), $tableNames)) {\n\t\t\t\t// tabulka neni v seznamu, vyhodi se chyba\n\t\t\t\tthrow new Zend_Exception(\"UNKNOWN_INDEX_UUID_COLUMN\", 400);\n\t\t\t}\n\t\t\t\n\t\t\t$usedReferences[] = new BB_Db_Query_Reference($column);\n\t\t}\n\t\t\n\t\t// anulace statickych vlastnosti reference\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vygenerovani infomraci pro filtraci dat\n\t\t$filterData = new stdClass;\n\t\t\n\t\t$filterData->columns = $usedReferences;\n\t\t$filterData->query = $queryObj;\n\t\t$filterData->tables = $tableNames;\n\t\t\n\t\t// nastaveni objektu\n\t\t$this->_queryObject = $filterData;\n\t\t\n\t\treturn $this;\n\t}", "public function getFilterByAmenity($collection, $amenitySearchArray, $copycollection) {\n /**\n * Get the collection for amenity\n */\n $collection->addFieldToFilter ( array (\n array (\n 'attribute' => 'amenity',\n $amenitySearchArray \n ) \n ) );\n /**\n * Copy collection for amenity\n */\n $copycollection->addFieldToFilter ( array (\n array (\n 'attribute' => 'amenity',\n $amenitySearchArray \n ) \n ) );\n /**\n * Return collection the amenity collection\n */\n return $collection;\n }", "public function onBeforePublish() {\n if (false == $this->owner->ShowInSearch)\n {\n if ($this->owner->isPublished())\n {\n $liveRecord = \\Versioned::get_by_stage(get_class($this->owner), 'Live')->byID($this->owner->ID);\n if ($liveRecord->ShowInSearch != $this->owner->ShowInSearch)\n {\n $this->doDeleteDocument();\n }\n }\n }\n }", "function filterByS_A_F($SEDE, $AREA, $FACULTAD,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ?\");\n $parametros = array(\"iii\", &$SEDE, &$AREA, &$FACULTAD);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function filterByIdPersona($idPersona = null, $comparison = null)\n\t{\n\t\tif (is_array($idPersona)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idPersona['min'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idPersona['max'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona, $comparison);\n\t}", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public static function transportistas()\n {\n\t\t\t\t $estado = [\"TAB_TABLAS.ESTADO\"=> Constante::ESTADO_ACTIVO];\n\t return (new Persona())->hasMany(new Empresa(),\"IDCATALOGOTABLAS\",\"IDCATALOGOTABLAS\")->where($estado);\n\t\t //return Catalogotablas::hasMany(Catalogotablas::class);\n\t\t}", "public function filter($fields)\n {\n }", "function filter(){\r\n\t$images = new ImageCollection();\r\n\t\r\n\tif( isset($_GET['city']) || isset($_GET['country']) ) {\r\n\t\t$city = 0;\t\t\r\n\t\tif( isset($_GET['city']) && !empty($_GET['city']) ) {\r\n\t\t\t$city = $_GET['city'];\r\n\t\t}\r\n\t\t$country = \"ZZZ\";\r\n\t\tif( isset($_GET['country']) && !empty($_GET['country']) ) {\r\n\t\t\t$country = $_GET['country'];\r\n\t\t}\r\n\t\t\r\n\t\t$images->loadCollection();\r\n\t\t\t\t\r\n\t\tif($city > 0 && $country == \"ZZZ\") { //if city set\r\n\t\t\t$images->loadCollectionByCity($city);\r\n\t\t}\r\n\t\telseif($city == 0 && $country != \"ZZZ\") { //if country set\r\n\t\t\t$images->loadCollectionByCountry($country);\r\n\t\t}\r\n\t\telseif($city > 0 && $country != \"ZZZ\") { //if country and city set\r\n\t\t\t$images->loadCollectionByCityAndCountry($city, $country);\r\n\t\t}\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telseif( isset($_GET['search']) ) {\r\n\t\t$search = $_GET['search'];\r\n\t\t$images->loadCollectionBySearch($search);\r\n\t\t\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telse {\r\n\t\t$images->loadCollection();\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n}", "public function actasPorSae(){\n return $this->hasMany('Ceidin\\Models\\Acta', 'id_sae');\n }", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "public function show($id)\n {\n $proceso = Proceso::select(\n 'proceso.*',\n 'ciudadproceso.nombre AS ciudadproceso', \n 'corporacion.nombre AS corporacion', \n 'ponente.nombrecompleto AS ponente', \n 'estado.descripcion AS estado')\n ->join('ciudadproceso', 'proceso.ciudadproceso_id', '=', 'ciudadproceso.id')\n ->join('corporacion','proceso.corporacion_id', '=', 'corporacion.id')\n ->join('ponente', 'proceso.ponente_id', '=', 'ponente.id')\n ->join('estado', 'proceso.estado_id', '=', 'estado.id')\n ->findOrFail($id);\n\n $Clientesproceso = Clienteproceso::select('clienteproceso.id', 'clienteproceso.personanatural_id',\n 'clienteproceso.proceso_id', 'personanatural.id', 'personanatural.nombres',\n 'personanatural.nombres', 'personanatural.apellidopaterno',\n 'personanatural.apellidomaterno', 'tipodemanda.abreviatura AS tipodemanda')\n ->selectRaw('CONCAT_WS(\" \", personanatural.nombres, personanatural.apellidopaterno, personanatural.apellidomaterno) AS nombrecompleto')\n ->join('tipodemanda', 'tipodemanda_id', '=', 'tipodemanda.id')\n ->join('personanatural', 'clienteproceso.personanatural_id', '=','personanatural.id')\n ->where('clienteproceso.proceso_id', '=', $id)\n ->orderBy('clienteproceso.created_at', 'DESC')\n ->get();\n\n $Documentosproceso = Documentoproceso::select('documentoproceso.*',\n 'tipodocumento.abreviatura AS tipodocumento',\n 'tipodocumento.descripcion AS tipodocumento_descripcion')\n ->join('tipodocumento', 'tipodocumento_id', '=', 'tipodocumento.id')\n ->where('documentoproceso.proceso_id', '=', $id)\n ->get();\n \n $Recordatoriosproceso = Recordatorioproceso::where('proceso_id', '=', $id)->get();\n\n $Actuacionesproceso = Actuacionproceso::orderBy( 'fechaactuacion', 'DESC')->where('proceso_id', '=', $id)->get();\n\n $auditoria = User::findOrFail($proceso->users_id);\n\n return view('proceso.show', compact('proceso', 'auditoria', 'Documentosproceso', 'Recordatoriosproceso', \n 'Actuacionesproceso', 'Clientesproceso'));\n }", "function show_project_filters($person_id){\n\techo \"<div class='project_filter_display'>\";\t\n\tif ($person_id) {\n\t\techo \"<span class='project_search_filter'>Proyectos de \".getStaffName($person_id).\"</span>\";\n\t}\n echo \"</div>\";\n}", "public function toArray(BitrixORMMap $map){\r\n\r\n $filter = array();\r\n\r\n if($this->data->count() === 1) return $this->data->pop()->toArray($map);\r\n\r\n while(!$this->data->isEmpty()){\r\n\r\n $el = $this->data->pop();\r\n\r\n if(($map->type === BitrixORMMapType::CUSTOM) || (get_class($el) === 'ru\\\\teachbase\\\\BFilterGroup' && $map->type !== BitrixORMMapType::USER)) array_push($filter,$el->toArray($map));\r\n else $filter = array_merge($filter,$el->toArray($map));\r\n }\r\n\r\n return $filter;\r\n }", "function search_authors($publication_id) { \n $sql = \"SELECT * FROM people_publications INNER JOIN people ON people_publications.person_id=people.person_id WHERE people_publications.publication_id = '$publication_id' \"; \n $authors = $this->fetch($sql);\n return($authors);\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id',$this->id);\n\t\t$criteria->compare('t.region_id',$this->region_id);\n\t\t$criteria->compare('t.title',$this->title,true);\n\t\t$criteria->compare('t.sort',$this->sort);\n\t\t$criteria->compare('t.status',$this->status);\n\n\t\t$criteria->with = array('region');\n\n return parent::searchInit($criteria);\n }", "protected function _createFilters(array $params){\n if(is_array($params)){\n if(array_key_exists('d', $params) && array_key_exists('lon', $params) && array_key_exists('lat', $params)){\n $helper = $this->_query->getHelper();\n $this->_query->createFilterQuery('geo')->setQuery(\n $helper->geofilt(\n $params['lat'],\n $params['lon'],\n 'coordinates',\n $params['d'])\n );\n }\n\n\n\tif(($this->_map === true) && !in_array($this->_getRole(), $this->_allowed) && ($this->_core === 'beowulf')){\n\t\t$this->_query->createFilterQuery('knownas')->setQuery('-knownas:[\"\" TO *]');\n\t\t$this->_query->createFilterQuery('hascoords')->setQuery('gridref:[\"\" TO *]');\n\t} elseif($this->_map === true && ($this->_core === 'beowulf')) {\n\t\t$this->_query->createFilterQuery('hascoords')->setQuery('gridref:[\"\" TO *]');\n\t}\n\n if(array_key_exists('bbox',$params)){\n \t$coords = new Pas_Solr_BoundingBoxCheck($params['bbox']);\n $bbox = $coords->checkCoordinates();\n \t$this->_query->createFilterQuery('bbox')->setQuery($bbox);\n\n }\n\n foreach($params as $key => $value){\n if(!in_array($key, $this->_schemaFields)) {\n unset($params[$key]);\n }\n }\n if(isset($params['thumbnail'])){\n $this->_query->createFilterQuery('thumbnails')->setQuery('thumbnail:[1 TO *]');\n unset($params['thumbnail']);\n }\n $this->_checkFieldList($this->_core, array_keys($params));\n foreach($params as $key => $value){\n $this->_query->createFilterQuery($key . $value)->setQuery($key . ':\"'\n . $value . '\"');\n }\n } else {\n throw new Pas_Solr_Exception('The search params must be an array');\n }\n }", "abstract public function findRelatedRecordsBySubject(): array;", "public function filterByPrimaryKey($key)\r\n\t{\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::ID, $key, Criteria::EQUAL);\r\n\t}", "public function personas(): Personas\n {\n return Personas::findById($this->persona_id);\n }" ]
[ "0.54730433", "0.5197914", "0.5097243", "0.50766087", "0.48317218", "0.48317087", "0.47960627", "0.4783737", "0.4753286", "0.46761486", "0.46754092", "0.46463284", "0.46200293", "0.4574407", "0.4574407", "0.45592752", "0.45568585", "0.4549957", "0.45219433", "0.45147", "0.44496533", "0.44483215", "0.4443969", "0.44204608", "0.44163206", "0.43631616", "0.4336697", "0.4323078", "0.43072993", "0.4304902", "0.4304196", "0.4303709", "0.42977673", "0.42961648", "0.42945108", "0.42848787", "0.42735195", "0.42721638", "0.42613828", "0.42604923", "0.4251124", "0.42371133", "0.423652", "0.42340696", "0.4224391", "0.41943333", "0.41875693", "0.4178444", "0.41675574", "0.41610909", "0.41593567", "0.41505536", "0.41463873", "0.41428697", "0.41413048", "0.41337657", "0.41247022", "0.411567", "0.41144693", "0.41114423", "0.41100684", "0.41091362", "0.41090423", "0.41042855", "0.41037503", "0.41005743", "0.40971062", "0.4092789", "0.40916017", "0.40910828", "0.4086494", "0.40847722", "0.40830344", "0.4078143", "0.4076073", "0.40734327", "0.40718994", "0.40656868", "0.40644526", "0.40541416", "0.40443558", "0.40431932", "0.40382418", "0.40356913", "0.40356132", "0.4026077", "0.4024797", "0.40233204", "0.40224776", "0.4020387", "0.40189677", "0.401804", "0.40150872", "0.4014255", "0.40140918", "0.4012737", "0.40113294", "0.40093663", "0.40084082", "0.400799" ]
0.6585563
0
Adds a JOIN clause to the query using the MapPersonaScene relation
public function joinMapPersonaScene($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('MapPersonaScene'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'MapPersonaScene'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useMapPersonaSceneQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapPersonaScene($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapPersonaScene', '\\MapPersonaSceneQuery');\n }", "function joinQuery()\n {\n }", "abstract public function join($alias_from, $rel_name, $alias_to);", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "function map_joins($join){\n //\n //return field to str\n return $join->to_str();\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }", "public function joinPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Persona');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Persona');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function getarchives_join( $join, $r ) {\n\t\tglobal $wpdb;\n\t\t$this->get_archives_where_r = $r;\n\t\tif(isset($r['taxonomy']) && is_array($r['taxonomy']) )\n\t\t$join = $join . \" INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\";\n\n\t\treturn $join;\n\t}", "public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "public function joinPersonaLocalizacion($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('PersonaLocalizacion');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'PersonaLocalizacion');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('oggetto_news/category_news')),\n 'related.news_id = main_table.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "function joinon_Contact_and_Vehicle_singlerecord($rID, $where = NULL) {\r\n if ($where != NULL) { $this->db->where($where); } \r\n $this->db->join(\r\n 'contact', \r\n 'contact.Id = ' . $this->table_name. '.' . $this->contactId_fieldname, \r\n 'left outer'\r\n ); \r\n $this->db->join(\r\n '__vehicles', \r\n '__vehicles.__Id = ' . $this->table_name. '._VehicleId', \r\n 'left outer'\r\n ); \r\n return $this->get($rID);\r\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function getScriptJoin(PersistenceMapper $oAtual, $sTypeJoin = self::LEFT_JOIN) {\n $this->persistenceKey = $this->instantiatePersistence();\n $this->persistenceReference = $oAtual;\n $oJoin = new JoinBuilder($this->persistenceKey->getTableName(false), $this->persistenceReference->getTableName(false), $this->aliasJoin, $sTypeJoin);\n \n if (!count($this->fields)) {\n foreach ($this->persistenceKey->getMapping() as $oMap) {\n if ($oMap->getTableKey()) {\n $oJoin->addKeyColumns($oMap->getNameDb(), $oMap->getNameDb());\n }\n }\n } else {\n foreach ($this->fields as $sKey => $sColumn) {\n $oJoin->addKeyColumns($sKey, $sColumn);\n }\n }\n \n if (count($this->aAdditionalConditions)) {\n foreach ($this->aAdditionalConditions as $oCondiction) {\n if ($this->persistenceReference->getColumnByNameDb($oCondiction->field)) {\n $oJoin->addFixedValues($oCondiction->field, $oCondiction->value, $oCondiction->operator);\n }\n }\n }\n \n return $oJoin->dump();\n }", "public function usePersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Persona', 'PersonaQuery');\n\t}", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "public function naturalJoin($table);", "protected function genSelectsJoins ($map)\n\t{\n\t\t$joins = array_reverse($map[GlobalSystem::ExpJoin]);\n\t\t$from = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpModel];\n\t\t$matcher = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatcher];\n\t\t$matchValue = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatchValue];\n\t\n\t\t$target = $joins[0][GlobalSystem::ExpModel];\n\t\t$sqlBase = \"SELECT {$target}.* FROM {$target} {join} WHERE {$from}.{$matcher} = {$matchValue}\";\n\n\t\t$joinBase = '';\n\t\tforeach($joins as $join) {\n\t\t\t$joinBase .= \"INNER JOIN {$join[GlobalSystem::ExpForeignKey][0]} ON {$join[GlobalSystem::ExpForeignKey][0]}.{$join[GlobalSystem::ExpForeignKey][1]} = {$join[GlobalSystem::ExpModel]}.`{$join[GlobalSystem::ExpProperty]}` \";\n\t\t}\n\n\t\treturn str_replace('{join}', $joinBase, $sqlBase);\n\t}", "public function joinMenuPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('MenuPersona');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'MenuPersona');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinPersona($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\r\n\t{\r\n\t\t$tableMap = $this->getTableMap();\r\n\t\t$relationMap = $tableMap->getRelation('Persona');\r\n\t\t\r\n\t\t// create a ModelJoin object for this join\r\n\t\t$join = new ModelJoin();\r\n\t\t$join->setJoinType($joinType);\r\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\r\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\r\n\t\t\t$join->setPreviousJoin($previousJoin);\r\n\t\t}\r\n\t\t\r\n\t\t// add the ModelJoin to the current object\r\n\t\tif($relationAlias) {\r\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\r\n\t\t\t$this->addJoinObject($join, $relationAlias);\r\n\t\t} else {\r\n\t\t\t$this->addJoinObject($join, 'Persona');\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function custom_search_join($join) {\r\n if ( is_search() && isset($_GET['s'])) {\r\n global $wpdb;\r\n $join = \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id \";\r\n }\r\n return($join);\r\n}", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function joinPagoEfectivoRelatedByIdPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('PagoEfectivoRelatedByIdPersona');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'PagoEfectivoRelatedByIdPersona');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function leftOuterJoin($table);", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "public function custom_attachments_join( $join, $query ){\n\t\tglobal $wpdb;\n\n\t\t//if we are not on admin or the current search is not on attachment return\n\t\tif(!is_admin() || (!isset($query->query['post_type']) || $query->query['post_type'] != 'attachment')){\n\t\t\treturn $join;\n\t\t}\n\n\t\t// if current query is the main query and a search...\n\t\tif( is_main_query() && is_search() ){\n\t\t\t$join .= \"\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function join($table, $on, $field = null, $comparitor = null);", "public function joinMapSceneRewcat($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapSceneRewcat');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapSceneRewcat');\n }\n\n return $this;\n }", "public function joinFields()\r\n {\r\n if (!$this->_joinedFields) {\r\n $this->getSelect()->join(\r\n array('related' => $this->getTable('mageplaza_betterblog/tag_post')),\r\n 'related.post_id = e.entity_id',\r\n array('position')\r\n );\r\n $this->_joinedFields = true;\r\n }\r\n return $this;\r\n }", "public function usePersonaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->joinPersona($relationAlias, $joinType)\r\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Persona', 'PersonaQuery');\r\n\t}", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public static function doSelectJoinMission(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\n foreach (sfMixer::getCallables('BaseMissionPhotoPeer:doSelectJoin:doSelectJoin') as $callable)\n {\n call_user_func($callable, 'BaseMissionPhotoPeer', $c, $con);\n }\n\n\n\t\t$c = clone $c;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\tif ($c->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$c->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tMissionPhotoPeer::addSelectColumns($c);\n\t\t$startcol = (MissionPhotoPeer::NUM_COLUMNS - MissionPhotoPeer::NUM_LAZY_LOAD_COLUMNS);\n\t\tMissionPeer::addSelectColumns($c);\n\n\t\t$c->addJoin(array(MissionPhotoPeer::MISSION_ID,), array(MissionPeer::ID,), $join_behavior);\n\t\t$stmt = BasePeer::doSelect($c, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = MissionPhotoPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = MissionPhotoPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\n\t\t\t\t$omClass = MissionPhotoPeer::getOMClass();\n\n\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tMissionPhotoPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if $obj1 already loaded\n\n\t\t\t$key2 = MissionPeer::getPrimaryKeyHashFromRow($row, $startcol);\n\t\t\tif ($key2 !== null) {\n\t\t\t\t$obj2 = MissionPeer::getInstanceFromPool($key2);\n\t\t\t\tif (!$obj2) {\n\n\t\t\t\t\t$omClass = MissionPeer::getOMClass();\n\n\t\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol);\n\t\t\t\t\tMissionPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (MissionPhoto) to $obj2 (Mission)\n\t\t\t\t$obj2->addMissionPhoto($obj1);\n\n\t\t\t} // if joined row was not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('bs_administrativedoc/administrativedocument_product')),\n 'related.product_id = e.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "public function visitJoinClause(\n /*IJoinClause*/ $node) /*: mixed*/ {\n $id = $node->getIdentifier();\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $left = null;\n $left_value = $node->getLeft();\n if ($left_value != null) {\n $left = /*(string)*/$left_value->accept($this);\n }\n $right = null;\n $right_value = $node->getRight();\n if ($right_value != null) {\n $right = /*(string)*/$right_value->accept($this);\n }\n $group = $node->getGroup();\n\n $result = 'join ';\n if ($id !== null) {\n $result .= '$'.$id.' in ';\n }\n $result .= $collection;\n if ($left !== null && $right !== null) {\n $result .= \" on $left equals $right\";\n if ($group !== null) {\n $result .= ' into '.$group;\n }\n }\n return $result;\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "public function joinStudentToGroups(&$q, $from_table, $student_column, $join_group_info = false) {\n\t\t$q->join($from_table, \"StudentGroup\", array($student_column=>\"people\"));\n\t\tif ($join_group_info)\n\t\t\t$q->join(\"StudentGroup\", \"StudentsGroup\", array(\"group\"=>\"id\"));\n\t}", "protected function _joinPageData($select, $joinType, $joinConditions)\n\t{\n\t\t$select->$joinType(array($this->_pageTableAlias => $this->_pageTable),$joinConditions, array('title'));\n\t\treturn $select;\n\t}", "function joins() {\n //\n //begin with an empty array of joins \n $joins=[];\n //\n //Clean the array to remove any dublicates\n //\n //Sort the array in order of dependency\n $unsorted_entities=[];\n foreach ($this->join_entities as $enames){\n //\n //Get the entities\n $entty= $this->entity->dbase->entities[$enames];\n array_push($unsorted_entities, $entty);\n }\n \n //loop through the sorted array creating a join from each \n foreach ($unsorted_entities as $entity){\n //\n //get the ands columns\n $foreigns= $this->get_foreigners($entity, $joins);\n //\n //Create a new join \n array_push($joins, new join($entity, $foreigns, 'INNER JOIN'));\n }\n //\n //Return the collection of the joins in an array \n return $joins;\n }", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "public function join($id);", "public function useMenuPersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinMenuPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'MenuPersona', 'MenuPersonaQuery');\n\t}", "public function posts_join_request( $join ) {\n global $wpdb;\n\n $join .= \" inner join {$wpdb->postmeta} as metalat on {$wpdb->posts}.ID = metalat.post_id and metalat.meta_key = 'dokan_geo_latitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metalong on {$wpdb->posts}.ID = metalong.post_id and metalong.meta_key = 'dokan_geo_longitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metaaddr on {$wpdb->posts}.ID = metaaddr.post_id and metaaddr.meta_key = 'dokan_geo_address'\";\n\n remove_filter( 'posts_join_request', array( $this, 'posts_join_request' ) );\n\n return $join;\n }", "protected abstract function getJoinClause(array $joins);", "public function fullOuterJoin($table);", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function joinAssociations()\n {\n return array_slice($this->_joins, 1);\n }", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "public function leftJoin($table, $conditions = []);", "public function usePersonaLocalizacionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinPersonaLocalizacion($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'PersonaLocalizacion', 'PersonaLocalizacionQuery');\n\t}", "public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }", "function wc_tab_manager_tabs_posts_join( $join, $query ) {\n\tglobal $wpdb, $typenow;\n\n\tif ( 'wc_product_tab' === $typenow ) {\n\t\t$join .= \" JOIN {$wpdb->posts} AS product_parents ON ( {$wpdb->posts}.post_parent = 0 OR ( {$wpdb->posts}.post_parent = product_parents.ID AND product_parents.post_status != 'trash' ) )\";\n\t}\n\n\treturn $join;\n}", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "public function getJoinSql($data, $link) {\n $str = ' ';\n if ($data->joins) {\n foreach ($data->joins as $join) {\n $join['type'] = strtoupper($join['type']);\n if (strncmp('NATURAL', $join['type'], 7) === 0) {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']);\n } else {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']) . ($join['cond'] ? ' ON ' . $this->parseWhere($join['cond'], '', $link) : '');\n }\n }\n }\n\n return $str;\n }", "function getJoinCondition() ;", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "public function fillNavs(){\n return $this->select('results.eventId','results.resultId', 'results.pilotId', 'results.position', 'results.notes', 'pilots.name', 'pilots.username', 'pilots.country')\n ->join('pilots', 'pilots.pilotId', '=', 'results.pilotId')\n ->get();\n }", "function ydgdict_include_ideas_in_search( $join, $wp_query ) \n{\n if ( ! $wp_query->is_archive( 'entry' ) || ! $wp_query->is_search() || is_admin() ) return $join; // unchanged\n\n global $wpdb;\n\n $join .= \" INNER JOIN {$wpdb->prefix}ydgdict_ideas ideas ON ( {$wpdb->posts}.ID = ideas.entry_id ) \";\n \n return $join;\n}", "public function joinPrestamo($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Prestamo');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Prestamo');\n }\n\n return $this;\n }", "function contentjoiner($what, $from, $contenttojoin, $rid){\n\t$sql='SELECT ids.*';\n\t//everything is connected to a story\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql=<<<SQL\n\t\t\t$sql, stories.CreationTime AS SCreation, stories.LastActionTime AS SAction, stories.URL,\n\t\t\tstories.Title, stories.InternalLink,\tstories.TheText AS SText, stories.Extra,\n\t\t\tstories.Privacy AS SPrivacy, stories.NSFW AS SNSFW, sauth.DisplayName AS SDName, sauth.UserName AS SUName\nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', svotes.Sig AS SSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', sfollow.following AS SF';\n\t\t}//end rid\n\t}//end all stories tags....\n\t//do the comments if we need to \n\tif($what=='all' || $what=='comments'){\n\t\t$sql=<<<SQL\n\t\t\t$sql, comments.CreationTime AS CCreation, comments.LastActionTime AS CAction, commenttext.TheText AS CText,\n\t\t\tcomments.Privacy AS CPrivacy, comments.NSFW AS CNSFW, cauth.DisplayName AS CDName, cauth.UserName AS CUName \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', cvotes.Sig AS CSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', cfollow.Following AS CF';\n\t\t}//end rid\n\t}//end all comments\n\n\t//We've got the initial select statememt now lets get the from information\n\t$sql.=\" FROM ($contenttojoin) AS ids \";\n\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN stories ON stories.ID = ids.SID\n\t\t\tLEFT JOIN users AS sauth ON sauth.ID = stories.UserID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (SELECT *\n\t\t\t\tFROM votes\n\t\t\t\tWHERE votes.UserID = $rid AND ContentType=0) AS svotes ON svotes.ContentID = stories.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid\n\t\t\t\t\t) AS sfollow ON sfollow.FollowedID = stories.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all stories\n\tif($what=='all' || $what=='comments'){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN comments ON comments.ID = ids.CID\n\t\t\tLEFT JOIN users AS cauth on cauth.ID = comments.UserID\n\t\t\tLEFT JOIN commenttext ON commenttext.ID = comments.ID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM votes\n\t\t\t\t\tWHERE votes.UserID = $rid AND ContentType=1) AS cvotes ON cvotes.ContentID = comments.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid) AS cfollow ON cfollow.FollowedID = comments.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all comments\n\n\treturn $sql;\n}", "function MWX__join ($join)\n{\n global $wpdb;\n\n if (current_user_can ('edit_users'))\n return $join;\n\n return $join .= \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'maturity'\";\n}", "function project_project_modifier(&$node)\n {\n userelation(\"atkonetomanyrelation\");\n $node->add(new atkOneToManyRelation(\"user_stories\", \"xp.story\", \"project\", AF_HIDE_LIST), \"user_stories\");\n }", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "public function joinReservas($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Reservas');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Reservas');\n\t\t}\n\n\t\treturn $this;\n\t}", "public function join()\n {\n $this->defaultjoinsetted = true;\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->defaultjoin .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n return $this;\n }", "function getJoinOnLocalProvinceID()\n { \n return $this->getJoinOnFieldX('person_local_province_id');\n }" ]
[ "0.64306664", "0.61106324", "0.54919666", "0.5321662", "0.5220364", "0.5171112", "0.5169157", "0.5107228", "0.50678325", "0.5047034", "0.50247025", "0.49837273", "0.49828842", "0.49648666", "0.4959554", "0.49576846", "0.49555716", "0.49517184", "0.4924939", "0.49187684", "0.49187684", "0.49187684", "0.4909794", "0.48893267", "0.48685575", "0.4867366", "0.48668164", "0.4856171", "0.48354664", "0.48288077", "0.48273057", "0.48259348", "0.48227873", "0.4791503", "0.47875977", "0.478188", "0.47706148", "0.47702625", "0.47693944", "0.4765019", "0.47552", "0.4747526", "0.47414064", "0.4738894", "0.47248808", "0.47245634", "0.47182602", "0.4714707", "0.4706455", "0.47057045", "0.46934754", "0.46838963", "0.4656835", "0.46526432", "0.46419308", "0.46404234", "0.46346122", "0.46314946", "0.46310118", "0.46307543", "0.46257213", "0.46143815", "0.4611497", "0.46103522", "0.4608247", "0.45897654", "0.45826167", "0.4573296", "0.4569411", "0.45625192", "0.4557346", "0.4554282", "0.45457515", "0.45452455", "0.45422903", "0.4538044", "0.45366412", "0.45358327", "0.45144656", "0.4513733", "0.44910124", "0.4488359", "0.44860145", "0.4478049", "0.44755355", "0.4472644", "0.44722608", "0.4469421", "0.44693786", "0.44681832", "0.44678947", "0.4460813", "0.44588363", "0.44583878", "0.4449307", "0.44476524", "0.44471022", "0.4442657", "0.44371763", "0.44278282" ]
0.6444587
0
Use the MapPersonaScene relation MapPersonaScene object
public function useMapPersonaSceneQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinMapPersonaScene($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'MapPersonaScene', '\MapPersonaSceneQuery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function joinMapPersonaScene($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapPersonaScene');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapPersonaScene');\n }\n\n return $this;\n }", "function createPersona()\n {\n return isset($this->source['persona']) && $this->source['persona'] ? $this->source['persona'] : null;\n }", "public function persona()\n {\n\t\treturn $this -> belongsTo(Persona::class,'id_persona','id_persona');\n }", "public function show(Persona $persona)\n {\n $persona->load(['inscripciones', 'inscripciones.rol', 'inscripciones.carrera']);\n return $persona;\n }", "public function getPersona()\n {\n return $this->hasOne(Personas::className(), ['id' => 'persona_id']);\n }", "function iems_StageMap()\n {\n self::__construct();\n }", "public function scenes()\n {\n return $this->hasMany(EntryScene::class);\n }", "public function alejarCamaraPresidencia() {\n\n self::$presidencia->alejarZoom();\n\n }", "function scene($view = null, $data = [], $mergeData = [])\n {\n /** @var \\Phanda\\Contracts\\Scene\\Factory $factory */\n $factory = phanda()->create(\\Phanda\\Contracts\\Scene\\Factory::class);\n\n if (func_num_args() === 0) {\n return $factory;\n }\n\n return $factory->create($view, $data, $mergeData);\n }", "public function loadPublications() {\n $this->_publications = DAOFactory::getPublicationDAO()->selectByIdPerson($this->_id);\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function perspective()\n {\n return $this->belongsTo(\\App\\Perspective::class);\n }", "function project_project_modifier(&$node)\n {\n userelation(\"atkonetomanyrelation\");\n $node->add(new atkOneToManyRelation(\"user_stories\", \"xp.story\", \"project\", AF_HIDE_LIST), \"user_stories\");\n }", "public function show(RelacionMatPerson $relacionMatPerson)\n {\n //\n }", "public function person () {\n\t\treturn $this->belongsTo(\n\t\t\t'App\\Models\\Person',\n\t\t\t'person_id',\n\t\t\t'person_id'\n\t\t);\n\t}", "public function mapFor()\n {\n // Here we tell Doctrine that this mapping is for the Scientist object.\n return Article::class;\n }", "public function scene(string $scene = null)\n {\n if (is_null($scene)) {\n return $this->scene;\n }\n $this->scene = $scene;\n return $this;\n }", "abstract protected function defineMapping();", "public function person()\n {\n return $this->belongsTo(PersonProxy::modelClass());\n }", "public function person()\n {\n return $this->belongsTo(PersonProxy::modelClass());\n }", "public function setPersona_id($persona_id){\n $this->persona_id = $persona_id;\n }", "public function setPersona_id($persona_id){\n $this->persona_id = $persona_id;\n }", "function getScenes() {\n return $this->scenes;\n}", "function getOGActor();", "function getOGActor();", "public function personas(): Personas\n {\n return Personas::findById($this->persona_id);\n }", "public function Person()\n\t{\n\t\treturn $this->belongsTo('ThunderID\\Person\\Models\\Person');\n\t}", "public function isProjection();", "private function createCreatureFront()\n {\n\n }", "function firstentity_person( $person ) {\n $content[] = array(\n '#markup' => l( $person->name , 'person/' . $person->person_id )\n );\n $content[] = field_attach_view( 'person' , $person , 'full' );\n return $content;\n}", "public function show($persona)\n {\n return view('show', [\n 'persona' => Persona::find($persona)\n ]);\n }", "private function loadMapa()\n {\n \n $this->evento->id = $this->id;\n $this->evento->pegaInfo();\n \n echo \"<div class='evento-info2-title'>\".$this->evento->nome.\"</div>\";\n echo \"<div class='evento-list-introduction'>Visualize o mapa para chegar ao local do seu evento.</div>\";\n echo \"<input type='hidden' id='adress' value='\".$this->evento->logradouro.\" \".$this->evento->bairro.\", \".$this->evento->cidade.\" ,\" . $this->evento->escolherEstado() . \"' />\";\n echo \"<script type=\\\"text/javascript\\\" src=\\\"http://maps.google.com/maps/api/js?sensor=false\\\"></script>\";\n echo \"<div id=\\\"mapevento\\\"></div>\";\n \n }", "public function aerolinea(){\n \t$this->belongsTo('App\\Aerolinea');\n }", "public function personas(){\n\n return $this->morphedByMany(Persona::class, 'cargoable'); //relacion muchos a muchos \"una persona tiene muchos cargos y un cargo tiene muchas personas\"\n }", "public function initialize()\n {\n\n $this->setSource(\"area\");\n $this->hasMany('id', 'Pole', 'place_id', ['alias' => 'Pole']);\n }", "public function sanpham()\n {\n return $this->belongsTo('App\\Sanpham', 'sp_ma', 'sp_ma');\n }", "public function show(PersonaJuridica $personaJuridica)\n {\n return PersonaJuridica::with(['tipoOrganizacion', 'empresas'])\n ->withTrashed()\n ->where('id', $personaJuridica->id)\n ->first();\n }", "function warquest_show_map() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\t\r\n\t/* output */\r\n\tglobal $page;\r\n\t\r\n\t$page .= '<div class=\"subparagraph\">'.t('GENERAL_PLANET_'.$player->planet).' '.t('HOME_MAP_TITLE').'</div>';\r\n\r\n\t$page .= '<div class=\"box\">';\r\n\t$page .= warquest_ui_map($player, $player->planet);\r\n\t\r\n\t$page .= '<div class=\"note\"><center>';\r\n\t$page .= t('HOME_MAP_NOTE');\r\n\t$page .= '</center></div>';\t\r\n\t\t\r\n\t$page .= '</div>';\r\n}", "public function insert(Persona $persona);", "public function persona($request, $persona)\n {\n $persona->identificacion = $request->identificacion;\n $persona->nombre = $request->nombres;\n $persona->apellido = $request->apellidos;\n\n return $persona;\n }", "abstract protected function getMapping();", "abstract protected function getMapping();", "public function show(peserta $peserta)\n {\n //\n }", "function map(string $docuri) {\n $map = [\n 'title'=> 'carte '.$this->title,\n 'view'=> ['latlon'=> [47, 3], 'zoom'=> 6],\n ];\n $map['bases'] = [\n 'cartes'=> [\n 'title'=> \"Cartes IGN\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/cartes/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'orthos'=> [\n 'title'=> \"Ortho-images\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/orthos/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'whiteimg'=> [\n 'title'=> \"Fond blanc\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://visu.gexplor.fr/utilityserver.php/whiteimg/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 21 ],\n ],\n ];\n $map['defaultLayers'] = ['whiteimg'];\n \n $request_scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME']\n : ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']=='on')) ? 'https' : 'http');\n foreach ($this->layers as $lyrid => $layer) {\n $overlay = [\n 'title'=> $layer['title'],\n 'type'=> 'UGeoJSONLayer',\n 'endpoint'=> \"$request_scheme://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]/$docuri/$lyrid\",\n ];\n foreach (['pointToLayer','style','minZoom','maxZoom'] as $key)\n if (isset($layer[$key]))\n $overlay[$key] = $layer[$key];\n elseif ($this->$key !== null)\n $overlay[$key] = $this->$key;\n\n $map['overlays'][$lyrid] = $overlay;\n if (isset($layer['displayedByDefault']))\n $map['defaultLayers'][] = $lyrid;\n }\n \n return new Map($map, \"$docuri/map\");\n }", "public function setPersonaIdPers($personaIdPers) {\n $this->personaIdPers = $personaIdPers;\n }", "public function initialize()\n {\n $this->setSchema(\"mus\");\n $this->setSource(\"sculpture\");\n $this->belongsTo(\n 'Art_Objects_id_no',\n 'ArtObjects',\n 'id_no'\n );\n }", "public function people (){\n\n \treturn $this->belongsTo(People::class);\n }", "public function __construct($person)\n {\n $this->person = $person;\n }", "public function crearPersona () \n\t{\n\t\t$persona = null;\n\t\n\t\t// 1 - FK Buscar Lugar\n\t\t$lugar = LugarPeer::buscar( $this->getLugarScout() );\n\t\t\n\t\t// 2 - FK Buscar codigo\n\t\t$codigo = CodigosScoutingPeer::buscar ( $this->getCodigoAgrupador() );\n\t\t\n\t\t// 3 - FK Nacionalidad\n\t\t$nacionalidad = NacionalidadPeer::buscar ($this->getNacionalidad() );\n\t\n\t\t// 4 - Fecha de Nacimiento\n\t\t$fechaNacimiento = GlobalFunctions::parsearFecha( $this->getFechaNacimiento());\n\t\t\n\t\tif ( $fechaNacimiento == null )\n\t\t{\n\t\t\t$fechaNacimiento = GlobalFunctions::calcularFechaNacimiento( $this->getEdad() , $this->getAnio() );\n\t\t}\n\t\t// 5 - Fecha de Scouting\n\t\t$fechaScouting = GlobalFunctions::parsearFecha( $this->getFechaScout() , $this->getAnio() );\n\t\t\n\t\tif ( $fechaScouting == null)\n\t\t{\n\t\t\t// TODO: Si no tengo fecha de scouting, la armo a partir de anio, mes y dia de scouting\n\t\t\t// atributos de como encontre el xls.\t\n\t\t}\n\t\t\n\t\t// 6 - Personas con igual nombre e igual anio de nacimiento.\n\t\t$personas = PersonaPeer::buscarPersonasPorNombreyAnioNacimiento( $this->getNombre(), $fechaNacimiento );\n\t\t\n\t\tif ( $personas != null )\n\t\t{\n\t\t\tfor ( $i = 0 ; $i < count($personas) ; $i++ )\n\t\t\t{\n\t\t\t\t$persona = $personas[$i];\n\t\t\t\t\n\t\t\t\t// Quizas no sea la misma persona.\n\t\t\t\n\t\t\t\t$mes1 = $persona->getFechaNacimiento('m');\n\t\t\t\t$dia1 = $persona->getFechaNacimiento('d');\n\t\t\t\n\t\t\t\t$mes2 = $fechaNacimiento->format('m');\n\t\t\t\t$dia2 = $fechaNacimiento->format('d');\n\t\t\t\t\n\t\t\t\tif ( !(( $mes1 == 1 && $dia1 == 1) || ($mes2 == 1 && $dia2 == 1)) )\n\t\t\t\t{\n\t\t\t\t\tif ( $mes1 != $mes2 || $dia1 != $dia2 )\n\t\t\t\t\t{\n\t\t\t\t\t\tunset ( $personas[$i] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$matchCount = 0;\n\t\t\tfor ( $i = 0 ; $i < count($personas) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( isset($personas[$i]))\n\t\t\t\t{\n\t\t\t\t\t$persona = $personas[$i];\n\t\t\t\t\t$matchCount++; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($matchCount > 1)\n\t\t\t\t$persona = null;\n\t\t\t\n\t\t}\n\t\t\n\t\t$f_new = false; \n\t\t\n\t\tif ( $persona == null )\n\t\t{\n\t\t\t// por ahora creo la nueva persona\n\t\t\t$persona = new Persona();\n\t\t\t$persona->setNombre (trim(strtoupper($this->getNombre())));\n\t\t\t$persona->setPeso ( $this->getPeso() );\n\t\t\t$persona->setAltura ( $this->getAltura() );\t\n\t\t\t$persona->setFechaNacimiento($fechaNacimiento);\n\t\t\t$persona->setTelefono($this->getTelefono());\n\t\t\t$persona->setCelular ($this->getCelular() );\n\t\t\t$persona->setEmail($this->getEmail());\n\t\t\t$persona->setFechaActualizacion ( $fechaScouting );\n\t\t\t$persona->setObservaciones( $this->getObservaciones() );\n\t\t\t$persona->setNacionalidad($nacionalidad);\n\t\t\t$persona->save();\n\t\t\t\n\t\t\t$f_new = true;\n\t\t}\n\t\telse if ( $fechaScouting != null \n && is_object( $fechaScouting ) && \n\t\t\t\t$fechaScouting->format('U') > $persona->getFechaActualizacion('U') ) \n\t\t{\n\t\t\t// HUBO match y estos son datos mas nuevos\n\t\t\t// Actualizo los datos de la persona.\n\t\t\t\n\t\t\tif ( $this->getTelefono() != '' )\n\t\t\t\t$persona->setTelefono($this->getTelefono());\n\t\t\t\n\t\t\tif ( $this->getCelular() != '' )\n\t\t\t\t$persona->setCelular ($this->getCelular() );\n\t\t\t\n\t\t\tif ( $this->getEmail() != '' )\n\t\t\t\t$persona->setEmail($this->getEmail());\n\t\t\n\t\t\tif ( $this->getPeso() != -1 )\n\t\t\t\t$persona->setPeso ( $this->getPeso() );\n\t\t\t\n\t\t\tif ( $this->getAltura() != 0 )\n\t\t\t\t$persona->setAltura ( $this->getAltura() );\n\n\t\t\t$persona->save();\n\t\t}\n\t\t\n\t\t$scout = new PersonaScouting();\n\t\t$scout->setPersona ( $persona );\n\t\t$scout->setLugar( $lugar );\n\t\t$scout->setIdCodigo( $codigo->getId() );\n\t\t$scout->setFecha($fechaScouting);\n\t\t$scout->setTelefono($this->getTelefono());\n\t\t$scout->setCelular ($this->getCelular() );\n\t\t$scout->setEmail($this->getEmail());\n\t\t$scout->setPeso ( $this->getPeso() );\n\t\t$scout->setAltura ( $this->getAltura() );\n\t\t$scout->setActividades($this->getActividades());\n\t\t$scout->setObservaciones($this->getObservaciones());\n\t\t$scout->setDiaContador($this->getDia());\n\t\t$scout->setMes($this->getMes());\n\t\t$scout->setAnio($this->getAnio());\n\t\t\n\t\t$scout->save();\n\t\t\n\t\t// Cargamos la media.\n\t\tMediaPeer::doMediaScout( $scout , $this , $f_new );\n\t\n\t}", "function imdb_person ($id) {\n $this->imdb_base($id);\n }", "public function paris() {\n $relation = $this->hasMany(\"Paris\");\n return $relation;\n }", "public function show(Person $person)\n {\n //\n }", "public function show(Person $person)\n {\n //\n }", "public function initialize()\n {\n $this->setSchema(\"adsmall\");\n $this->setSource(\"cameras\");\n }", "public function getPersonaPivots()\n {\n return $this->Personas_->merge($this->Parents_);\n }", "public function initialize()\n {\n $this->belongsTo('posicao_id', 'Ecommerce\\Admin\\Models\\Posicao', 'id', array('alias' => 'Posicao'));\n }", "public function peserta()\n {\n \t$this->belongsTo('App\\Siswa','id_peserta');\n }", "protected function loadObjects() {\n\tiHRIS_AcademicYear::ensureAcademicYear();\n\tif(!$this->hasPermission(\"task(person_can_edit)\" or $this->getUser()->role==\"admin\")) {\n\t\t//$this->setRedirect(\"noaccess\");\n\t\t}\n\t\tif($this->isPost() ) {\n\t\t\t$id_num=$this->request(\"identification_number\");\n\t\t\tif($id_num==\"\")\n\t\t\treturn;\n\t\t\t$where=array(\t\"operator\"=>\"FIELD_LIMIT\",\n\t\t\t\t\t\t\t\t\"field\"=>\"identification_number\",\n\t\t\t\t\t\t\t\t\"style\"=>\"equals\",\n\t\t\t\t\t\t\t\t\"data\"=>array(\"value\"=>$id_num));\n\t\t\t$registration=I2CE_FormStorage::listFields(\"registration\",array(\"parent\"),false,$where);\n\t\t\tforeach($registration as $reg) {\n\t\t\t\t$this->pers_id = $reg[\"parent\"];\n\t\t\t\t}\n\t\t\tif(!($persObj=$this->factory->createContainer($this->pers_id)) instanceof iHRIS_Person)\n\t\t\treturn;\n\t\t\t$persObj->populate();\n\t\t\t$this->template->setForm($persObj);\n\t\t\t}\n\t\t}", "function __construct()\n { parent::__construct('maps', 'animals');\n }", "public function prestamos()\n {\n return $this->belongsToMany(Prestamo::class);\n }", "public function showGeoAd()\n {\n }", "function document_map_function(&$data, $maps) {\n $stype = $data['subsystem'];\n $sid = $data['subsystem_id'];\n if ($stype > 0) {\n if (isset($maps[$stype][$sid])) {\n $data['subsystem_id'] = $maps[$stype][$sid];\n } else {\n return false;\n }\n }\n if (!isset($data['extra_path'])) {\n $data['extra_path'] = '';\n }\n if (!$data['author']) {\n $data['author'] = '';\n }\n return true;\n}", "public function dictaphoneAction() {\n\t\t$this->initInstance(); \t\t\t\t\n\t\t\n\t}", "public function aObjeto() {\t}", "public function getElasticaMapping() {\n\t\t$mapping = new Mapping();\n\n $fields = $this->getElasticaFields();\n\n\t\t$mapping->setProperties($fields);\n\n $callable = get_class($this->owner).'::updateElasticsearchMapping';\n if(is_callable($callable))\n {\n $mapping = call_user_func($callable, $mapping);\n }\n\n\t\treturn $mapping;\n\t}", "protected function _getParcela(){\n if (!is_object($this->_parcela)){\n $this->_parcela = new Vendas_Model_Parcela_Mapper();\n }\n return $this->_parcela;\n }", "public function getPersonaIdPers() {\n return $this->personaIdPers;\n }", "public function programa()\n {\n return $this->belongsTo(Programa::class);\n }", "public function primaryMembers() {\n return $this->belongsToMany('App\\Member', 'family_maps', 'member_sub_id', 'member_pri_id');\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ScenePictureURL\",$param) and $param[\"ScenePictureURL\"] !== null) {\n $this->ScenePictureURL = $param[\"ScenePictureURL\"];\n }\n\n if (array_key_exists(\"HeadX\",$param) and $param[\"HeadX\"] !== null) {\n $this->HeadX = $param[\"HeadX\"];\n }\n\n if (array_key_exists(\"HeadY\",$param) and $param[\"HeadY\"] !== null) {\n $this->HeadY = $param[\"HeadY\"];\n }\n\n if (array_key_exists(\"HeadWidth\",$param) and $param[\"HeadWidth\"] !== null) {\n $this->HeadWidth = $param[\"HeadWidth\"];\n }\n\n if (array_key_exists(\"HeadHeight\",$param) and $param[\"HeadHeight\"] !== null) {\n $this->HeadHeight = $param[\"HeadHeight\"];\n }\n }", "public function plaza()\n {\n return $this->belongsTo(App\\Models\\Plaza::class);\n }", "public function getShowPersonInfor()\n {\n\n }", "public function aggiungiPartecipante($persona) {\n\t$this->partecipanti[]=$persona;\n $this->numVisite++;\n}", "public function getScenesNearby($privacy) {\n\t\t$scenes = array();\n\t\t$pos = $this->getPosition();\n\t\t$minX = $pos->lx-100;\n\t\t$maxX = $pos->lx+100;\n\t\t$minY = $pos->ly-100;\n\t\t$maxY = $pos->ly+100;\n\t\t$sql = \"SELECT `sceneID` FROM `scenes` WHERE `privacy`=$privacy AND `globalX`=$pos->x AND `globalY`=$pos->y AND `localX`>$minX AND `localX`<$maxX AND `localY`>$minY AND `localY`<$maxY AND `indoors`=0 ORDER BY `sceneID` DESC\";\n\t\t$result = $this->mysqli->query($sql);\n\t\tif (mysqli_num_rows($result)) {\n\t\t\twhile ($row = mysqli_fetch_row($result)) {\n\t\t\t\t$scenes[] = $row[0];\n\t\t\t}\n\t\t}\n\t\treturn $scenes;\n\t}", "protected\tfunction\tsetRelations() {}", "protected\tfunction\tsetRelations() {}", "function site_map() {\n\t\t$this->layout = \"frontend\";\n\t\t/* $reviews=$this->Review->find('all',array('order'=>array('Review.created DESC'),'limit'=>'5'));\n\t\t$this->set('reviews',$reviews);\n\t\t\n\t\tif($this->Session->read('Member.group_id') == '3'){\n\t\t\n\t\t$savedSearches=$this->saveSearch->find('all',array('conditions'=>array('parent_id'=>$this->Session->read('Member.id')),'limit'=>'10'));\n\t\t$this->set('savedSearches',$savedSearches);\n\t\t\n\t\t} */\n\t\t$statdatas = $this->Page->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Page.id' => '4'\n\t\t\t)\n\t\t));\n\t\t$this->set(\"statdatas\", $statdatas);\n\t\t\n\t}", "public function show(CompradorPersona $compradorAgricultor)\n {\n //\n }", "public function setupAssociations() \n {\n \n }", "public function show($id_scene)\n {\n $s_scene = SecondaryScene::where('id_scenes', $id_scene)->get();\n return response()->json($s_scene);\n }", "public function use()\n\t{\n\t\tglUseProgram($this->id);\n\t}", "public function setIdpersona($idpersona)\n {\n $this->idpersona = $idpersona;\n\n return $this;\n }", "public function initialize()\n {\n $this->hasMany('id', 'MapsScore', 'map_id', array('alias' => 'MapsScore'));\n $this->hasMany('id', 'Matchs', 'current_map', array('alias' => 'Matchs'));\n $this->hasMany('id', 'PlayerKill', 'map_id', array('alias' => 'PlayerKill'));\n $this->hasMany('id', 'Players', 'map_id', array('alias' => 'Players'));\n $this->hasMany('id', 'PlayersHeatmap', 'map_id', array('alias' => 'PlayersHeatmap'));\n $this->hasMany('id', 'Round', 'map_id', array('alias' => 'Round'));\n $this->hasMany('id', 'RoundSummary', 'map_id', array('alias' => 'RoundSummary'));\n $this->belongsTo('match_id', 'Matchs', 'id', array('alias' => 'Matchs'));\n }", "public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }", "public function showScene($id)\n {\n $s_scene = SecondaryScene::find($id);\n return response()->json($s_scene);\n }", "public function initialize()\r\n {\r\n\t\t$this->belongsTo(\"Mikro\", \"Pobjeda\\Models\\Mikro\", \"idMikro\");\r\n }", "public function show($id) {\n $scene = Scene::find($id);\n return response()->json($scene);\n }", "public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }", "public function turista()\n {\n return $this->belongsTo(\\App\\Turista::class);\n }", "function load(){\n $sql = 'SELECT * FROM worlds where id=?';\n $w = $this->app['db']->fetchAssoc($sql, array($this->id));\n if(!$w){ \n return false;\n }\n $this->name = $w['name'];\n $this->world = $w['world_json'];\n return true;\n }", "public function getPage(\\SetaPDF_Core_Document $document) {}", "public function show(Plataforma $plataforma)\n {\n //\n }", "public function get_saida()\n {\n // loads the associated object\n if (empty($this->saida))\n $this->saida = new Saida($this->ref_saida);\n \n // returns the associated object\n return $this->saida;\n }", "public static function workflowRelations();", "function setVako($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n //$manager->flush();\n $region = new Region();\n $region->setCountry(\"FR\");\n $region->setName(\"Ile de France\");\n $region->setPresentation(\"La région française capitale\");\n $manager->persist($region);\n \n $manager->flush();\n // Une fois l'instance de Region sauvée en base de données,\n // elle dispose d'un identifiant généré par Doctrine, et peut\n // donc être sauvegardée comme future référence.\n $this->addReference(self::IDF_REGION_REFERENCE, $region);\n $owner=new Owner();\n $owner->setFirstName(\"nermine\");\n $owner->setFamilyName(\"khaled\");\n $owner->setAddress(\"14 Rue Charles fourier\");\n $owner->setcountry(\"Fr\");\n \n $manager->persist($owner);\n $manager->flush();\n $this->addReference(self::IDF_ROOM_REFERENCE, $owner);\n $room = new Room();\n $room->setSummary(\"Beau poulailler ancien à Évry\");\n $room->setDescription(\"très joli espace sur paille\");\n $room->setCapacity(2);\n $room->setSuperficy(100.2);\n $room->setPrice(200);\n $room->setAddress('5 rue charles fourier TSP à vendre');\n //$room->addRegion($region);\n // On peut plutôt faire une référence explicite à la référence\n // enregistrée précédamment, ce qui permet d'éviter de se\n // tromper d'instance de Region :\n $room->addRegion($this->getReference(self::IDF_REGION_REFERENCE)); \n $room->setOwner($this->getReference(self::IDF_ROOM_REFERENCE)); \n $manager->persist($room);\n \n $manager->flush();\n \n \n }", "function Person($name,$position,$bio,$img,$email){\n $this->name = $name;\n $this->position = $position;\n $this->bio = $bio;\n $this->img = $img;\n $this->email = $email;\n }" ]
[ "0.56253654", "0.536894", "0.5115428", "0.50961757", "0.49142268", "0.48397383", "0.47591463", "0.47172597", "0.4675194", "0.4632635", "0.4595656", "0.4592078", "0.4592078", "0.45777825", "0.45762852", "0.45491594", "0.45052046", "0.44714245", "0.4466808", "0.44501486", "0.44397822", "0.44397822", "0.44360375", "0.44360375", "0.44199488", "0.43865198", "0.43865198", "0.43738785", "0.4372009", "0.4364452", "0.4315672", "0.42713162", "0.42668977", "0.42621595", "0.42534536", "0.4251507", "0.42495257", "0.42399588", "0.42203745", "0.4215681", "0.420783", "0.42064333", "0.4198719", "0.4198719", "0.41961986", "0.41821206", "0.41641635", "0.41571906", "0.41444173", "0.41268185", "0.41207534", "0.41181263", "0.4116838", "0.41154677", "0.41154677", "0.4110201", "0.4102556", "0.4099443", "0.4094878", "0.40931132", "0.4090653", "0.40835133", "0.40774965", "0.4077393", "0.40746653", "0.4059415", "0.40561587", "0.4049229", "0.40455735", "0.4038786", "0.40356705", "0.40312532", "0.40304708", "0.4029859", "0.4029785", "0.40291557", "0.40265763", "0.40265763", "0.40252322", "0.40233672", "0.4023323", "0.4021361", "0.40067458", "0.40039167", "0.40018848", "0.40015653", "0.39988455", "0.39978743", "0.3997777", "0.39962676", "0.39961445", "0.39953667", "0.3988206", "0.39880753", "0.39865837", "0.398318", "0.39771557", "0.3977057", "0.3976704", "0.39753768" ]
0.6763629
0
Filter the query by a related \MapSceneRewcat object
public function filterByMapSceneRewcat($mapSceneRewcat, $comparison = null) { if ($mapSceneRewcat instanceof \MapSceneRewcat) { return $this ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneRewcat->getSceneId(), $comparison); } elseif ($mapSceneRewcat instanceof ObjectCollection) { return $this ->useMapSceneRewcatQuery() ->filterByPrimaryKeys($mapSceneRewcat->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByMapSceneRewcat() only accepts arguments of type \MapSceneRewcat or Collection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filter()\n\t{\n\t\tif (isset($_GET['cty']) AND (int) $_GET['cty'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$county_id = (int) $_GET['cty'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"county \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $county_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_GET['cst']) AND (int) $_GET['cst'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$constituency_id = (int) $_GET['cst'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"constituency \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $constituency_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\t}", "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $key, Criteria::EQUAL);\n }", "public function useMapSceneRewcatQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapSceneRewcat($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapSceneRewcat', '\\MapSceneRewcatQuery');\n }", "public function filtering();", "public function scenes()\n {\n return $this->hasMany(EntryScene::class);\n }", "public function getFilteredDetails();", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n if (count($data->relatorio_id) == 0)\n { \n TTransaction::open('bedevops');\n $conn = TTransaction::get();\n $result = $conn->query('SELECT * FROM relatorio WHERE user_id = '.TSession::getValue(\"userid\").' ORDER BY id DESC LIMIT 4');\n $objects = $result->fetchAll(PDO::FETCH_CLASS, \"stdClass\");\n foreach ($objects as $value) {\n array_push($data->relatorio_id,$value->id);\n }\n TTransaction::close();\n } \n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->categoria_id) AND ( (is_scalar($data->categoria_id) AND $data->categoria_id !== '') OR (is_array($data->categoria_id) AND (!empty($data->categoria_id)) )) )\n {\n\n $filters[] = new TFilter('categoria_id', '=', $data->categoria_id);// create the filter \n }\n\n if (count($data->relatorio_id) <= 4)\n {\n if (isset($data->relatorio_id) AND ( (is_scalar($data->relatorio_id) AND $data->relatorio_id !== '') OR (is_array($data->relatorio_id) AND (!empty($data->relatorio_id)) )) )\n {\n\n $filters[] = new TFilter('relatorio_id', 'in', $data->relatorio_id);// create the filter \n }\n } else {\n throw new Exception('Selecione no máximo 4 relatórios!');\n }\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n }", "public function filterVisible(): self;", "function mySearchPostsFilter($query) {\n\tif ($query->is_search) {\n\t\t$query->set('cat','2'); // your category IDs\n\t}\n\treturn $query;\n}", "public function filtrarclientes(){\n\n $this->request->allowMethod(['get']);\n \n $keyword = $this->request->query('keyword');\n $activo = $this->request->query('activo');\n\n $condiciones = array();\n\n $condiciones['name like '] = '%'.$keyword.'%';\n\n if($activo){\n $condiciones['borrado = '] = false;\n }\n \n $query = $this->Clientes->find('all', [\n 'conditions' => $condiciones,\n 'order' => [\n 'Clientes.id' => 'ASC'\n ],\n 'limit' => 100\n ]);\n\n $clientes = $this->paginate($query);\n $this->set(compact('clientes'));\n $this->set('_serialize', 'clientes');\n }", "public function filterShopByMap($params)\n {\n $limit = isset($params['page_size']) ? $params['page_size'] : 10;\n $offset = isset($params['page_index']) && $params['page_index'] > 0 ? $this->pagination->getOffsetNumber($params['page_index'], $limit) : 0;\n\n $distance = new GeoDistance(\n 'location',\n [\n 'lat' => $params['latitude'],\n 'lon' => $params['longitude']\n ],\n '20km'\n );\n $query = new \\Elastica\\Query;\n $all = new Query\\MatchAll();\n $query->setPostFilter(new Missing('deletedAt'));\n $query->setQuery(new Query\\Filtered($all, $distance));\n $pagination = $this->storeFinder->createPaginatorAdapter($query);\n $transformedPartialResults = $pagination->getResults($offset, $limit);\n $results= $transformedPartialResults->toArray();\n $total = $transformedPartialResults->getTotalHits();\n return $this->pagination->response($results, $total, $limit, $offset);\n }", "protected abstract function filter();", "public function filter();", "public function filter() {\n\t $this->model->filter(array(\"status\"=>array(0,1)));\n\t if(Request::post(\"section\")){\n\t $section = new CmsSection(Request::post(\"section\"));\n\t foreach($section->tree() as $section) $section_ids[] = $section->primval;\n\t $this->model->filter(array(\"cms_section_id\"=>$section_ids));\n }\n\t parent::filter();\n\t}", "public function ajoutPost(Request $request){\n // $profile = Profile::find($id);\n //$categories=Categorie::all();\n \n $user = User::findOrFail(auth()->user()->id);\n $docdads=Docdad::where([\n ['visibility_id',\"<=\",$user->visibility_id],\n ['title', '!=', null],\n [function ($query) use ($request){\n if(($term =$request->term)){\n $query->orWhere('title', 'ilike',\"{$term}%\")->orWhere('title', 'ilike',\"%{$term}%\")->orWhere('references', 'ilike',\"%{$term}%\")->get();\n\n } \n }]\n ])\n ->orderBy(\"created_at\", \"desc\")\n ->paginate(35);\n return view('post.addpost',compact('user','docdads'));\n }", "public function filterByMapSceneStoreCategory($mapSceneStoreCategory, $comparison = null)\n {\n if ($mapSceneStoreCategory instanceof \\MapSceneStoreCategory) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneStoreCategory->getSceneId(), $comparison);\n } elseif ($mapSceneStoreCategory instanceof ObjectCollection) {\n return $this\n ->useMapSceneStoreCategoryQuery()\n ->filterByPrimaryKeys($mapSceneStoreCategory->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneStoreCategory() only accepts arguments of type \\MapSceneStoreCategory or Collection');\n }\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(TorneoCategoriaPeer::ID_TORNEO_CATEGORIA, $key, Criteria::EQUAL);\n\t}", "abstract public function reverseQuery(GeoQueryInterface $query): Collection;", "abstract public function filters();", "function filter(){\r\n\t$images = new ImageCollection();\r\n\t\r\n\tif( isset($_GET['city']) || isset($_GET['country']) ) {\r\n\t\t$city = 0;\t\t\r\n\t\tif( isset($_GET['city']) && !empty($_GET['city']) ) {\r\n\t\t\t$city = $_GET['city'];\r\n\t\t}\r\n\t\t$country = \"ZZZ\";\r\n\t\tif( isset($_GET['country']) && !empty($_GET['country']) ) {\r\n\t\t\t$country = $_GET['country'];\r\n\t\t}\r\n\t\t\r\n\t\t$images->loadCollection();\r\n\t\t\t\t\r\n\t\tif($city > 0 && $country == \"ZZZ\") { //if city set\r\n\t\t\t$images->loadCollectionByCity($city);\r\n\t\t}\r\n\t\telseif($city == 0 && $country != \"ZZZ\") { //if country set\r\n\t\t\t$images->loadCollectionByCountry($country);\r\n\t\t}\r\n\t\telseif($city > 0 && $country != \"ZZZ\") { //if country and city set\r\n\t\t\t$images->loadCollectionByCityAndCountry($city, $country);\r\n\t\t}\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telseif( isset($_GET['search']) ) {\r\n\t\t$search = $_GET['search'];\r\n\t\t$images->loadCollectionBySearch($search);\r\n\t\t\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telse {\r\n\t\t$images->loadCollection();\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n}", "public function getFilterArtworks($request){\n return DB::select('select * from users, personal_account_models where users.id = personal_account_models.user_id AND personal_account_models.published = 1 AND users.name Like \"%'.$request['artist'].'%\"');\n }", "public function searchPrint()\n {\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\t\t$criteria->compare('rekening3_id',$this->rekening3_id);\n//\t\t$criteria->compare('rekening1_id',$this->rekening1_id);\n\t\t$criteria->compare('rekening2_id',$this->rekening2_id);\n\t\t$criteria->compare('LOWER(kdrekening3)',strtolower($this->kdrekening3),true);\n\t\t$criteria->compare('LOWER(nmrekening3)',strtolower($this->nmrekening3),true);\n\t\t$criteria->compare('LOWER(nmrekeninglain3)',strtolower($this->nmrekeninglain3),true);\n\t\t$criteria->compare('rekening3_aktif',$this->rekening3_aktif);\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(){\n $tags = Tag::all();\n\n $experiences = DB::table('experiences')\n ->select('experiences.title','experiences.slug','experiences.experience_thumbnail', 'users.name', 'users.avatar', 'experiences.description','countries.name as country','states.name as state')\n ->join('countries','countries.id','=','experiences.country_id')\n ->join('users','users.id','=','experiences.user_id')\n ->join('states','states.id','=','experiences.state_id')\n ->where('experiences.title','like', '%' . $_REQUEST['query'] .'%' )\n ->orWhere('experiences.country_id','=', $_REQUEST['country_id'])\n ->orWhere('experiences.country_id','=', $_REQUEST['country_id'])\n ->paginate(20);\n \n \n \n return view('frontend.filter')\n ->with('experiences', $experiences )\n ->with('tags', $tags );\n\n\n }", "public function filter() {\n\n $GigOutline = $_POST['GigOutline'];\n $CompanyCity = $_POST['CompanyCity'];\n\n $result = $this->gig_model->filter_search($GigOutline, $CompanyCity);\n\n if (!empty($result)){\n //if we have results, then post them here\n $data['title'] = 'Success!';\n $data['gigs'] = $result;\n $this->load->view('gigs/search', $data);\n } else {\n $data['title'] = 'Success!';\n $data['gigs'] = null;\n $this->load->view('gigs/search', $data);\n }\n }", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "function LocalidadFilter( $Filter )\n {\n if( !empty($Filter->Loc) ) \n {\n $Loc = $Filter->Loc;\n return 'AND pLoc=\"'.$Loc.'\" ';\n }\n \n if( isset( $Filter->Prov ) ) \n return 'AND pProv='.$Filter->Prov.' ';\n\n return ''; \n }", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public function filters()\n\t{\n\t\treturn $this->belongsToMany('App\\Filters');\n\t}", "public function isFiltered() : bool;", "public function queryRelatedSearch($query){\n\t\t\treturn $this->query('RelatedSearch',$query);\n\t\t}", "abstract public function filterFields();", "public function getHighlightActionMovie(){\n $movies = Film::with('image')\n ->whereHas('categories',function($q) {\n $q->where('slug','phim-le');\n })\n ->whereHas('genres', function($q){\n $q->where('slug','phim-hanh-dong');\n })\n ->orderByDesc('view')\n ->get();\n\n return response_success([\n 'movies' => $movies\n ],'get highlight action movie');\n }", "public function bySubcategoria($id){\n return Material::where('idsubcategoria','=',$id)->get();\n //Este de aqui nos dara una coleccion una respuesta, para probar ello se creara un ruta\n }", "public function getFilterByAmenity($collection, $amenitySearchArray, $copycollection) {\n /**\n * Get the collection for amenity\n */\n $collection->addFieldToFilter ( array (\n array (\n 'attribute' => 'amenity',\n $amenitySearchArray \n ) \n ) );\n /**\n * Copy collection for amenity\n */\n $copycollection->addFieldToFilter ( array (\n array (\n 'attribute' => 'amenity',\n $amenitySearchArray \n ) \n ) );\n /**\n * Return collection the amenity collection\n */\n return $collection;\n }", "public function directors($limit = null)\n {\n return $this->belongsToMany('App\\Models\\Cast', 'cast_of_movies')->where('job_id', 2)->limit($limit);\n }", "function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function relationshipFilter()\n\t{\n\t\tee()->load->add_package_path(PATH_ADDONS.'relationship');\n\t\tee()->load->library('EntryList');\n\t\tee()->output->send_ajax_response(ee()->entrylist->ajaxFilter());\n\t}", "public function getFilterPatient(Request $request)\n {\n $search='%'.$request->search.'%';\n $patient = Patient::leftJoin('triaje', 'paciente_id_paciente', '=','paciente.id_paciente')\n ->select('paciente.*' ,'triaje.fech_update')\n ->where('paciente.pac_name', 'like', $search)\n ->orderBy('id_paciente', 'desc')\n ->paginate(10);\n return $patient;\n }", "public function defineFilters() {\n\t\treturn array(\n 'join' => array(\n 'car' => array(\n 'on' => array(\n '[car].id = [this].car_id'\n )\n )\n ),\n 'where' => array(\n 'id' => array(\n '[this].id = :id'\n )\n ),\n 'orderby' => array(\n 'date' => array(\n '[this].date :dir'\n )\n )\n );\n\t}", "public function filterAndShow(Request $request)\n { \n \n $filter=$request['busqueda'];\n $sedes=Sede::where('nombre','LIKE','%'. $filter .'%')\n ->orwhere('telefono','LIKE','%'. $filter .'%')\n ->orwhere('departamento','LIKE','%'. $filter .'%')\n ->orwhere('provincia','LIKE','%'. $filter .'%')\n ->orwhere('distrito','LIKE','%'. $filter .'%')\n ->orwhere('direccion','LIKE','%'. $filter .'%')\n ->orwhere('referencia','LIKE','%'. $filter .'%')\n ->orwhere('nombre_contacto','LIKE','%'. $filter .'%')\n ->orwhere('capacidad_maxima','LIKE','%'. $filter .'%')\n ->orwhere('capacidad_socio','LIKE','%'. $filter .'%')\n ->orwhere('estado','LIKE','%'. $filter .'%')->get();\n \n return view('admin-general.sede.index', compact('sedes'));\n \n }", "public function consultar($filtro, $codigoModalidadAcademica = NULL) {\n $estudiantes = array();\n\n /* Modified Diego Rivera <[email protected]>\n * Se añade filtor 105(Admitido que no Ingreso) en S.codigosituacioncarreraestudiante NOT IN (100, 101, 102, 103, 108, 109, 112, 302, 400 ) \n * Since October 5,2017\n */\n $sql = \"\n SELECT DISTINCT\n P.idplanestudio,\n EG.idestudiantegeneral,\n E.codigoestudiante,\n CONCAT( EG.apellidosestudiantegeneral, ' ', EG.nombresestudiantegeneral ) AS Nombre,\n C.nombrecarrera,\n PR.semestreprematricula,\n PR.codigoestadoprematricula,\n C.codigocarrera,\n FG.FechaMaximaCumplimiento,\n MAX( PR.codigoperiodo ) AS codigoperiodo,\n FG.FechaGradoId,\n EG.EstadoActualizaDato,\n E.codigosituacioncarreraestudiante,\n FG.TipoGradoId \n FROM\n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN facultad F ON ( F.codigofacultad = C.codigofacultad )\n LEFT JOIN prematricula PR ON ( PR.codigoestudiante = E.codigoestudiante )\n LEFT JOIN detalleprematricula DP ON ( DP.idprematricula = PR.idprematricula )\n INNER JOIN planestudio P ON ( P.codigocarrera = C.codigocarrera )\n INNER JOIN planestudioestudiante PE ON ( PE.idplanestudio = P.idplanestudio AND PE.codigoestudiante = E.codigoestudiante AND PE.codigoestadoplanestudioestudiante != 200 )\n INNER JOIN situacioncarreraestudiante S ON ( S.codigosituacioncarreraestudiante = E.codigosituacioncarreraestudiante )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera ) \n WHERE\n S.codigosituacioncarreraestudiante NOT IN ( 100, 101, 102, 103, 108, 109, 112, 302, 400, 105 ) \n AND (\n PR.semestreprematricula BETWEEN ( IF ( C.codigocarrera = 1186, P.cantidadsemestresplanestudio - 9, P.cantidadsemestresplanestudio - 3 ) ) \n AND P.cantidadsemestresplanestudio \n OR E.semestre = P.cantidadsemestresplanestudio \n ) \";\n\n if (empty($codigoModalidadAcademica) || $codigoModalidadAcademica == 200 || $codigoModalidadAcademica == 800) {\n $sql .= \" AND ( DP.codigoestadodetalleprematricula IN (10,30,20) OR DP.codigoestadodetalleprematricula IS NULL )\";\n }\n $sql .= $filtro;\n $sql .= \" AND E.codigoestudiante NOT IN ( \n SELECT\n R.codigoestudiante\n FROM \n registrograduado R\n WHERE\n R.codigoestudiante = E.codigoestudiante AND R.codigoestado = 100\n UNION\n SELECT \n RG.EstudianteId\n FROM \n RegistroGrado RG\n WHERE\n RG.EstudianteId = E.codigoestudiante AND RG.CodigoEstado = 100\";\n \n if (isset($_POST[\"cmbTipoGrado\"]) && $_POST[\"cmbTipoGrado\"] == 1) {\n $sql .= \" UNION\n SELECT\n DC.EstudianteId\n FROM\n DetalleAcuerdoActa DC\n INNER JOIN AcuerdoActa AC ON ( AC.AcuerdoActaId = DC.AcuerdoActaId )\n INNER JOIN FechaGrado FGR ON (FGR.FechaGradoId = AC.FechaGradoId )\n WHERE\n DC.EstudianteId = E.codigoestudiante AND FGR.TipoGradoId = 2 AND DC.CodigoEstado = 100\";\n }\n if (isset($_POST[\"cmbTipoGrado\"]) && $_POST[\"cmbTipoGrado\"] == 2) {\n $sql .= \" UNION\n SELECT\n DC.EstudianteId\n FROM\n DetalleAcuerdoActa DC\n INNER JOIN AcuerdoActa AC ON (\n AC.AcuerdoActaId = DC.AcuerdoActaId\n )\n INNER JOIN FechaGrado FGR ON (FGR.FechaGradoId = AC.FechaGradoId )\n WHERE\n DC.EstudianteId = E.codigoestudiante\n AND FGR.TipoGradoId = 1\n AND DC.CodigoEstado = 100\";\n }\n $sql .= \")\n GROUP BY E.codigoestudiante\n ORDER BY EG.apellidosestudiantegeneral ASC\";\n \n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->ejecutarConsulta();\n while ($this->persistencia->getNext()) {\n \n $estudiante = new Estudiante($this->persistencia);\n $estudiante->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $estudiante->setCodigoEstudiante($this->persistencia->getParametro(\"codigoestudiante\"));\n $estudiante->setNombreEstudiante($this->persistencia->getParametro(\"Nombre\"));\n $estudiante->setEstadoActualizaDato($this->persistencia->getParametro(\"EstadoActualizaDato\"));\n\n $situacionCarreraEstudiante = new SituacionCarreraEstudiante(null);\n $situacionCarreraEstudiante->setCodigoSituacion($this->persistencia->getParametro(\"codigosituacioncarreraestudiante\"));\n\n $fechaGrado = new FechaGrado(null);\n $fechaGrado->setIdFechaGrado($this->persistencia->getParametro(\"FechaGradoId\"));\n $fechaGrado->setFechaMaxima($this->persistencia->getParametro(\"FechaMaximaCumplimiento\"));\n\n $tipoGrado = new TipoGrado(null);\n $tipoGrado->setIdTipoGrado($this->persistencia->getParametro(\"TipoGradoId\"));\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $carrera->setNombreCarrera($this->persistencia->getParametro(\"nombrecarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n $fechaGrado->setTipoGrado($tipoGrado);\n\n $estudiante->setFechaGrado($fechaGrado);\n $estudiante->setSituacionCarreraEstudiante($situacionCarreraEstudiante);\n\n $preMatricula = new PreMatricula(null);\n $preMatricula->setSemestrePreMatricula($this->persistencia->getParametro(\"semestreprematricula\"));\n\n $periodo = new Periodo(null);\n $periodo->setCodigo($this->persistencia->getParametro(\"codigoperiodo\"));\n $preMatricula->setPeriodo($periodo);\n\n $estudiante->setPreMatricula($preMatricula);\n $estudiantes[count($estudiantes)] = $estudiante;\n }\n $this->persistencia->freeResult();\n\n return $estudiantes;\n }", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "function SearchFilter($query) {\n if ($query->is_search) {\n \t$query->set('post_type', 'post');\n }\n return $query;\n }", "function filter($param)\r\n\t{\r\n\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t$sql = \"SELECT `\" . $param[1] . \"` FROM `\" . $param[0] . \"` WHERE `\" . $param[1] . \"` LIKE '\" . $_SQL->sql_real_escape_string($_GET['q']) . \"%' \r\n\t\t ORDER BY `\" . $param[1] . \"` LIMIT 0,100\";\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res) )\r\n\t\t{\r\n\t\t\techo $ob->$param[1] . \"\\n\";\r\n\t\t}\r\n\t}", "abstract protected function foreignIDFilter($id = null);", "public function searchByFilterPrint() {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n if (!empty($this->rekening1_id)) {\n $criteria->addCondition(\"rekening1_id = \" . $this->rekening1_id);\n }\n $criteria->compare('LOWER(kdrekening1)', strtolower($this->kdrekening1), true);\n $criteria->compare('LOWER(nmrekening1)', strtolower($this->nmrekening1), true);\n $criteria->compare('LOWER(nmrekeninglain1)', strtolower($this->nmrekeninglain1), true);\n// $criteria->compare('LOWER(rekening1_nb)', strtolower($this->rekening1_nb), true);\n $criteria->compare('rekening1_aktif', $this->rekening1_aktif);\n if (!empty($this->rekening2_id)) {\n $criteria->addCondition(\"rekening2_id = \" . $this->rekening2_id);\n }\n $criteria->compare('LOWER(kdrekening2)', strtolower($this->kdrekening2), true);\n $criteria->compare('LOWER(nmrekening2)', strtolower($this->nmrekening2), true);\n $criteria->compare('LOWER(nmrekeninglain2)', strtolower($this->nmrekeninglain2), true);\n// $criteria->compare('LOWER(rekening2_nb)', strtolower($this->rekening2_nb), true);\n $criteria->compare('rekening2_aktif', $this->rekening2_aktif);\n if (!empty($this->rekening3_id)) {\n $criteria->addCondition(\"rekening3_id = \" . $this->rekening3_id);\n }\n $criteria->compare('LOWER(kdrekening3)', strtolower($this->kdrekening3), true);\n $criteria->compare('LOWER(nmrekening3)', strtolower($this->nmrekening3), true);\n $criteria->compare('LOWER(nmrekeninglain3)', strtolower($this->nmrekeninglain3), true);\n// $criteria->compare('LOWER(rekening3_nb)', strtolower($this->rekening3_nb), true);\n $criteria->compare('rekening3_aktif', $this->rekening3_aktif);\n if (!empty($this->rekening4_id)) {\n $criteria->addCondition(\"rekening4_id = \" . $this->rekening4_id);\n }\n $criteria->compare('LOWER(kdrekening4)', strtolower($this->kdrekening4), true);\n $criteria->compare('LOWER(nmrekening4)', strtolower($this->nmrekening4), true);\n $criteria->compare('LOWER(nmrekeninglain4)', strtolower($this->nmrekeninglain4), true);\n// $criteria->compare('LOWER(rekening4_nb)', strtolower($this->rekening4_nb), true);\n $criteria->compare('rekening4_aktif', $this->rekening4_aktif);\n if (!empty($this->rekening5_id)) {\n $criteria->addCondition(\"rekening5_id = \" . $this->rekening5_id);\n }\n $criteria->compare('LOWER(kdrekening5)', strtolower($this->kdrekening5), true);\n $criteria->compare('LOWER(nmrekening5)', strtolower($this->nmrekening5), true);\n $criteria->compare('LOWER(nmrekeninglain5)', strtolower($this->nmrekeninglain5), true);\n// $criteria->compare('LOWER(rekening5_nb)', strtolower($this->rekening5_nb), true);\n $criteria->compare('LOWER(keterangan)', strtolower($this->keterangan), true);\n $criteria->compare('nourutrek', $this->nourutrek);\n $criteria->compare('rekening5_aktif', $this->rekening5_aktif);\n $criteria->compare('LOWER(kelompokrek)', strtolower($this->kelompokrek), true);\n $criteria->compare('sak', $this->sak);\n $criteria->compare('LOWER(create_time)', strtolower($this->create_time), true);\n $criteria->compare('LOWER(update_time)', strtolower($this->update_time), true);\n $criteria->compare('LOWER(create_loginpemakai_id)', strtolower($this->create_loginpemakai_id), true);\n $criteria->compare('LOWER(update_loginpemakai_id)', strtolower($this->update_loginpemakai_id), true);\n $criteria->compare('LOWER(create_ruangan)', strtolower($this->create_ruangan), true);\n// $condition = 'rincianobyek_id IS NOT NULL';\n// $criteria->addCondition($condition);\n $criteria->limit = -1;\n $criteria->order = 'rekening1_id, rekening2_id, rekening3_id, rekening4_id, nourutrek';\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "private function filters() {\n\n\n\t}", "public function searchMedicineByCategory(Request $req, $categoryId)\n {\n \n // setting variables\n // checking if customer used the find medicine form first \n // if yes then we will the distance and geolocation from that form\n // if session already has latitude use it\n if (Session::has('latitude')){\n $latitude = session('latitude');\n $longitude = session('longitude');\n }\n else{\n $latitude = $req->latitude;\n $longitude = $req->longitude;\n }\n // if session already has distance use it\n if (Session::has('distance'))\n $distance = session('distance');\n // else use default value of 15 kilometer\n else\n $distance = '15';\n\n // set session values\n session(['latitude' => $latitude, 'longitude'=> $longitude, 'distance'=> $distance]);\n\n // query to fetch pharmacies within the specified distance\n $nearByPharmacies = DB::select(DB::raw('SELECT *, ( 3959 * acos( cos( radians('.$latitude.') ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians('.$longitude.') ) + sin( radians('.$latitude.') ) * sin( radians(latitude) ) ) ) AS distance FROM pharmacists HAVING distance < '.$distance.' ORDER BY distance'));\n\n \n \n // if no pharmacies found nearby redirect with message\n if (empty($nearByPharmacies)) {\n return redirect()->back()->with('error', 'oops no pharmacies in the defined radius');\n }\n \n // if pharmacies found nearby then find the searched product in them\n if (!empty($nearByPharmacies)) {\n \n \n// ----------------------- get products from local website storage ----------------------- \n foreach ($nearByPharmacies as $nearByPharmacy) {\n $websiteProducts[] = Pharmacistproduct::where([\n ['pharmacistId', '=', $nearByPharmacy->id],\n ['category', $categoryId],\n ['status', '=', '1']\n ])->get();\n }\n\n // ********** critical step **********\n // $websiteProducts is an array of collections\n // in the code below we combine the collections into 1 collection\n $productsCollection = new Collection();\n foreach ($websiteProducts as $collection) {\n foreach ($collection as $item) {\n $productsCollection->push($item);\n }\n }\n \n // if product not found return with error\n if ($productsCollection->isEmpty()) {\n return redirect('/')->with('error', \"Oops no products found in this category.\");\n }\n\n return view('siteView.searchResultPage', compact('productsCollection', 'nearByPharmacies'));\n } // end of if(!empty($nearByPharmacies)) condition\n }", "function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function search($params)\n {\n $query = A2Liquidaciones::find();\n\n //$query->joinWith('operacionInmobiliaria',false, 'INNER JOIN');\n\n $query->joinWith(['operacionInmobiliaria' => function ($q) {\n $q->joinWith(['inmueble', 'cliente']);\n //$q->joinWith('cliente');\n }], false, 'INNER JOIN');\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'sin_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<0\");\n }\n\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'por_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(`a2_operaciones_inmobiliarias`.`hasta_anio`,'-',\n `a2_operaciones_inmobiliarias`.`hasta_mes`,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>=-70\");\n }\n\n //VENCIDAS\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND (DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>0 AND \n DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<=30) \");\n }\n\n //VENCIDAS MAS DE UN MES\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas_mas_mes') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>30 \");\n }\n\n // add conditions that should always apply here\n if ($params['A2LiquidacionesSearch']['estado'] == 'ACTIVO') {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'liq_anio' => SORT_DESC,\n 'liq_mes' => SORT_DESC,\n ]\n ],\n ]);\n } else {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'fecha_pago' => SORT_DESC,\n ]\n ],\n ]);\n }\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n if (!empty($this->periodo)) {\n $arreglo_periodo = explode(\"/\", $this->periodo);\n $this->liq_mes = $arreglo_periodo[0];\n $this->liq_anio = $arreglo_periodo[1];\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id_liquidacion' => $this->id_liquidacion,\n 'id_operacion' => $this->id_operacion,\n 'liq_anio' => $this->liq_anio,\n 'liq_mes' => $this->liq_mes,\n 'fecha_pago' => $this->fecha_pago,\n 'monto_pagado' => $this->monto_pagado,\n 'monto_intereses' => $this->monto_intereses,\n 'timestamp' => $this->timestamp,\n ]);\n\n\n $query->andFilterWhere(['like', 'usuario', $this->usuario])\n ->andFilterWhere(['like', 'a2_liquidaciones.estado', $this->estado])\n ->andFilterWhere(['like', 'a2_noticias.direccion', $this->direccion])\n ->andFilterWhere(['like', 'a2_clientes.nombre', $this->cliente]);\n\n\n return $dataProvider;\n }", "public function getFiltroStars()\n {\n return Query::fetch('Busca/Filtros/QryBuscarQtdProdutosPorAvaliacao');\n }", "public function index()\n {\n $result=film::join('pozoristes','predstavas.pozoriste_id','=','pozoristes.id')\n ->get(['predstavas.*','pozoristes.ime','pozoristes.lokacija']);\n \n return $result;\n }", "public function filter(){\n try {\n // Sparql11query.g:220:3: ( FILTER constraint ) \n // Sparql11query.g:221:3: FILTER constraint \n {\n $this->match($this->input,$this->getToken('FILTER'),self::$FOLLOW_FILTER_in_filter760); \n $this->pushFollow(self::$FOLLOW_constraint_in_filter762);\n $this->constraint();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function search()\n {\n \n //if(!auth()->user()->active) return Redirect('/');\n\n $medics = [];\n \n if(request()->all())\n {\n if(trim(request('q')) != '' || request('province') != '' || request('canton') != '' || request('district') != '' || request('lat') != '' || request('lon') != '' || request('speciality') != ''){\n $search['q'] = trim(request('q'));\n $search['speciality'] = request('speciality');\n $search['province'] = request('province');\n $search['canton'] = request('canton');\n $search['district'] = request('district');\n $search['lat'] = request('lat');\n $search['lon'] = request('lon');\n $search['general'] = request('general');\n $search['active'] = 1;\n $selectedSpeciality = $search['speciality'];\n \n \n $medics = $this->medicRepo->findAll($search);\n //$count = $medics->count();\n\n //flash('Se '. (($count > 1) ? \"encontraron\" : \"encontró \") . $count.' Médico(s)','success');\n \n if(request('speciality'))\n {\n $specialist = 1;\n return view('user.search.medics.index',compact('medics','search','selectedSpeciality','specialist')); \n }\n if(request('general'))\n {\n $general = 1;\n return view('user.search.medics.index',compact('medics','search','selectedSpeciality','general')); \n }\n \n \n \n \n\n return view('user.search.medics.index',compact('medics','search','selectedSpeciality'));\n }\n }\n\n return view('user.search.medics.index',compact('medics','specialist'));\n\n }", "public function filterBySceneId($sceneId = null, $comparison = null)\n {\n if (is_array($sceneId)) {\n $useMinMax = false;\n if (isset($sceneId['min'])) {\n $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sceneId['max'])) {\n $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $sceneId, $comparison);\n }", "public function getFilterData($objectId)\n\t{\n\t\t//Get all word of set for filter\n\t\t$wordlist = Object::find($objectId)->word;\n\n\t\t$data = array();\n\n\t\tforeach ($wordlist as $word) \n\t\t{\n\n\t\t\t$layer = array();\n\n\t\t\t$layer[\"type\"] \t\t= \"filter\";\n\t\t\t$layer[\"wordId\"] \t= $word[\"id\"];\n\t\t\t$layer[\"key\"] \t\t= $word[\"key\"];\n\t\t\t$layer[\"value\"] \t= $word[\"value\"];\n\t\t\t$layer[\"image\"] = 'img/object/'.$objectId.'/'.$word[\"id\"].'.jpg';\n\t\t\t//Push thís word to array of Course\n\t\t\tarray_push($data,$layer);\n\t\t}\n\t\t//Return type as json Ajax.\n\t\treturn Response::json($data);\n\t}", "function testQueryset() {\n $comments = new Dormio_Queryset('Comment');\n $blogs = new Dormio_Queryset('Blog');\n \n $set = $blogs->filter('author__profile_set__fav_colour', 'IN', array('red', 'green'));\n \n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "function searchfilter($query) {\n \n if ($query->is_search && !is_admin() ) {\n $query->set('post_type',array('post', 'product'));\n }\n \n return $query;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(FacturesPrestationsPeer::FACT_PREST_ID, $key, Criteria::EQUAL);\n }", "private static function showProdotti($id_magazzino, $categoria, $nome, $prezzo_min, $prezzo_max){\n if(!isset($id_magazzino)) $sql_id_magazzino=\"id_magazzino LIKE '%'\";\n else $sql_id_magazzino=\"id_magazzino=$id_magazzino\"; //possiible che devo trasformare il id in un nnumero??? con intval? Oppure i singoli apici....\n\n if(!isset($categoria)) $sql_nome_categoria=\"categorie.nome LIKE '%'\";\n else $sql_nome_categoria=\"categorie.nome='$categoria'\";\n\n if(!isset($nome)) $sql_nome_prodotto=\"prodotti.nome LIKE '%'\";\n else $sql_nome_prodotto= \"prodotti.nome LIKE '%$nome%'\";\n\n if(!isset($prezzo_min)) $sql_prezzo_min=\"prodotti.prezzo > -1\";\n else $sql_prezzo_min = \"prodotti.prezzo > $prezzo_min\";\n\n if(!isset($prezzo_max)) $sql_prezzo_max=\"prodotti.prezzo < 999999999\";\n else $sql_prezzo_max=\"prodotti.prezzo < $prezzo_max\";\n\n\n $items=\\Singleton::DB()->query(\"SELECT DISTINCT prodotti.id as id_prodotto , prodotti.nome as nome_prodotto, prodotti.descrizione as descrizione_prodotto, prodotti.info as info_prodotto, prodotti.prezzo as prezzo_prodotto, prodotti.valuta as valuta_prodotto, items_magazzino.quantita as quantita_prodotto , categorie.id as id_categoria, categorie.nome as nome_categoria, items_magazzino.id_magazzino as id_magazzino, comuni.nome as comune_magazzino, comuni.provincia as provincia_magazzino, comuni.CAP as cap_magazzino, indirizzi.via as via_magazzino, indirizzi.civico as civico_magazzino FROM prodotti,categorie,items_magazzino,magazzini, indirizzi, comuni WHERE $sql_id_magazzino AND items_magazzino.id_prodotto=prodotti.id AND prodotti.id_categoria=categorie.id AND $sql_nome_categoria AND $sql_nome_prodotto AND $sql_prezzo_min AND $sql_prezzo_max AND id_magazzino=magazzini.id AND magazzini.id_indirizzo=indirizzi.id AND indirizzi.id_comune=comuni.id ;\");\n while($r = mysqli_fetch_assoc($items)) {$rows[] = $r; }\n if(isset($rows)) echo json_encode($rows);\n else self::setSuccess(\"empty\");\n }", "private function addFilterByParent(ProductCollection $productCollection, $parentId)\n {\n $tableProductRelation = $productCollection->getTable('catalog_product_relation');\n $productCollection\n ->getSelect()\n ->join(\n ['pr' => $tableProductRelation],\n 'e.entity_id = pr.child_id'\n )\n ->where('pr.parent_id = ?', $parentId);\n }", "public function filterMovie($condition) {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->movieFilter($condition);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}", "public function moviesAndSeriesByCountry() {\n $model = $this->model;\n $request = $this->request;\n $country = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_country_{$this->request->country}\",\n function() use($model, $request) {\n return $model->getByCountry($request->country);\n }\n );\n\n if (count($country[\"movie\"]) + count($country[\"serie\"]) > 0) {\n $this->view->addParameter(\"movies\", $country[\"movie\"]);\n $this->view->addParameter(\"series\", $country[\"serie\"]);\n } else {\n $this->view->addParameter(\"error\", \"Nothing found :/\");\n }\n }", "function applyFilterOcjena( & $polje_polja_hotela, $ocjena)\n\t{\n\t\tforeach($polje_polja_hotela as $kljuc => $polje)\n\t\t\tforeach($polje as $key => $hotel)\n\t\t\t\tif($hotel->ocjena < $ocjena)\n\t\t\t\t\tunset($polje_polja_hotela[$kljuc][$key]);\n\t}", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function actors($limit = null)\n {\n return $this->belongsToMany('App\\Models\\Cast', 'cast_of_movies')->where('job_id', 1)->limit($limit);\n }", "public function search($params,$filtros)\n {\n $query = FdTanquesAlmacenaApscom::find()->alias('a');\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n $query->leftJoin('fd_opcion_select b', 'medicion_entrada = b.id_opcion_select');\n $query->leftJoin('fd_opcion_select c', 'material = c.id_opcion_select');\n $query->leftJoin('fd_opcion_select d', 'frecuencia_mantenimiento = d.id_opcion_select');\n $query->leftJoin('fd_opcion_select e', 'estado_tanque = e.id_opcion_select');\n $query->leftJoin('fd_opcion_select f', 'problemas = f.id_opcion_select');\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id_tanquesalmacena' => $this->id_tanquesalmacena,\n 'capacidad_tanque' => $this->capacidad_tanque,\n 'medicion_entrada' => $this->medicion_entrada,\n //'material' => $this->material,\n //'frecuencia_mantenimiento' => $this->frecuencia_mantenimiento,\n //'estado_tanque' => $this->estado_tanque,\n //'problemas' => $this->problemas,\n 'id_conjunto_respuesta' => $this->id_conjunto_respuesta,\n 'id_junta' => $this->id_junta,\n 'id_pregunta' => $this->id_pregunta,\n 'id_respuesta' => $this->id_respuesta,\n 'id_capitulo' => $this->id_capitulo,\n ]);\n $query->andFilterWhere(['like', 'a.especifique', $this->especifique]) \n ->andFilterWhere(['like', 'b.nom_opcion_select', $this->medicion_entrada])\n ->andFilterWhere(['like', 'c.nom_opcion_select', $this->material])\n ->andFilterWhere(['like', 'd.nom_opcion_select', $this->frecuencia_mantenimiento])\n ->andFilterWhere(['like', 'e.nom_opcion_select', $this->estado_tanque])\n ->andFilterWhere(['like', 'f.nom_opcion_select', $this->problemas]);\n \n $query->andFilterWhere([ \n 'id_conjunto_respuesta' => $filtros['FdTanquesAlmacenaApscomSearch']['id_conjunto_respuesta'],\n 'id_pregunta' => $filtros['FdTanquesAlmacenaApscomSearch']['id_pregunta'],\n 'id_respuesta' => $filtros['FdTanquesAlmacenaApscomSearch']['id_respuesta'], \n 'id_junta' => $filtros['FdTanquesAlmacenaApscomSearch']['id_junta'], \n ]);\n\n\n return $dataProvider;\n }", "public function search($pagesize = 10) {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n // TODO: Step 2, relation filter\n $criteria->with = array('artist' => array('select' => 'name, name_pinyin'), 'category' => array('select' => 'name'));\n $criteria->compare('artist.name', $this->artist_name, true);\n $criteria->compare('artist.name_pinyin', $this->artist_pinyin, true);\n $criteria->compare('category.name', $this->category_name, true);\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('songid', $this->songid, true);\n $criteria->compare('t.name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('lyrics', $this->lyrics, true);\n $criteria->compare('artist_id', $this->artist_id);\n $criteria->compare('category_id', $this->category_id);\n $criteria->compare('albumn_id', $this->albumn_id);\n $criteria->compare('duration', $this->duration);\n $criteria->compare('bpic_filename', $this->bpic_filename, true);\n $criteria->compare('bpic_url', $this->bpic_url, true);\n $criteria->compare('spic_filename', $this->spic_filename, true);\n $criteria->compare('spic_url', $this->spic_url, true);\n $criteria->compare('light_tag', $this->light_tag, true);\n $criteria->compare('led_tag', $this->led_tag, true);\n $criteria->compare('video_filename', $this->video_filename, true);\n $criteria->compare('video_url', $this->video_url, true);\n $criteria->compare('audio_filename', $this->audio_filename, true);\n $criteria->compare('audio_url', $this->audio_url, true);\n $criteria->compare('audio_filename1', $this->audio_filename1, true);\n $criteria->compare('audio_url1', $this->audio_url1, true);\n $criteria->compare('audio_filename2', $this->audio_filename2, true);\n $criteria->compare('audio_url2', $this->audio_url2, true);\n $criteria->compare('status', $this->status);\n $criteria->compare('create_time', $this->create_time, true);\n $criteria->compare('create_user_id', $this->create_user_id);\n $criteria->compare('update_time', $this->update_time, true);\n $criteria->compare('update_user_id', $this->update_user_id);\n $criteria->compare('t.name_chinese', $this->name_chinese, true);\n $criteria->compare('t.name_pinyin', $this->name_pinyin, true);\n $criteria->compare('lyrics_chinese', $this->lyrics_chinese, true);\n $criteria->compare('lyrics_pinyin', $this->lyrics_pinyin, true);\n $criteria->compare('video_dir_name', $this->video_dir_name, true);\n $criteria->compare('video_real_url', $this->video_real_url, true);\n $criteria->compare('video_codec', $this->video_codec, true);\n $criteria->compare('video_res', $this->video_res, true);\n $criteria->compare('video_style', $this->video_style, true);\n $criteria->compare('song_style', $this->song_style, true);\n $criteria->compare('song_lang', $this->song_lang, true);\n $criteria->compare('video_version', $this->video_version, true);\n $criteria->compare('hot_grade', $this->hot_grade);\n $criteria->compare('play_count', $this->play_count);\n $criteria->compare('is_new', $this->is_new);\n $criteria->compare('origin_audio', $this->origin_audio);\n $criteria->compare('qc_grade', $this->qc_grade);\n $criteria->compare('video_comment', $this->video_comment, true);\n $criteria->compare('audio_volume1', $this->audio_volume1);\n $criteria->compare('audio_volume2', $this->audio_volume2);\n $criteria->compare('audio_count', $this->audio_count);\n $criteria->compare('name_count', $this->name_count);\n\n // TODO: Step 2, relation sort\n $sort = new CSort();\n $sort->attributes = array(\n //'defaultOrder'=>'t.create_time',\n 'artist_name' => array(\n 'asc' => 'artist.name',\n 'desc' => 'artist.name desc',\n ),\n 'artist_pinyin' => array(\n 'asc' => 'artist.name_pinyin',\n 'desc' => 'artist.name_pinyin desc',\n ),\n 'category_name' => array(\n 'asc' => 'category.name',\n 'desc' => 'category.name desc',\n ),\n 'id',\n 'name',\n 'name_pinyin',\n 'name_chinese',\n 'duration',\n 'artist_id',\n );\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => $pagesize),\n 'sort' => $sort,\n ));\n }", "public function filter(Request $request)\n {\n if($request->ajax())\n {\n $robotIds = DB::table('robots')->select('id')->get()->pluck('id')->toArray();\n $joinDb = DB::table('robots') ->join('robot_infos', 'robots.id', '=', 'robot_infos.robot_id')\n ->join('properties', 'robot_infos.property_id', '=', 'properties.id');\n $page = 1;\n if($request->has('page') && $request->input('page') != '') \n {\n $page = (int)$request->input('page');\n }\n foreach ($request->all() as $key => $value) {\n if($value != null && $key != 'page') { \n $key = explode(\"*\", $key)[0];\n $query1 = clone $joinDb;\n $robotIds = $query1 ->select('robots.id')\n ->whereIn('robots.id', $robotIds)\n ->where('properties.name', 'LIKE', $key)\n ->where('robot_infos.content', 'LIKE', '%'.$value.'%')\n ->groupBy('id')\n ->get()->pluck('id')->toArray();\n } \n } \n $total = Robot::whereIn('id', $robotIds)->where('state', 1)->get()->count();\n $robots = Robot::whereIn('id', $robotIds)->where('state', 1)->paginate(12, ['*'], 'page', $page); \n $output = \"\";\n if($robots->count() == 0) {\n $output = '<div class=\"col-lg-12\"><h2 style=\"display: inline;\"><br>There are 0 results !!!</h2><a \"javascript:void(0)\" onclick=\"openNav()\" class=\"btn btn-primary\" style=\"float:right;\">Filter</a></div>';\n } else {\n $output = '<div class=\"col-lg-12\"><h2 style=\"display: inline;\"><br>There are ' . $total. ' results !!!</h2><a \"javascript:void(0)\" onclick=\"openNav()\" class=\"btn btn-primary\" style=\"float:right;\">Filter</a></div>';\n foreach($robots as $robot) \n {\n $output .= \"<div class='col-lg-4 col-md-6 mb-4'>\".\n \"<div class='card h-100'>\".\n \"<div class='card-body'>\";\n \n $collection = collect();\n foreach($robot->robotInfos as $robotInfo) \n {\n $collection->push(['property' => $robotInfo->Property->name, 'content' => $robotInfo->content, 'order' => $robotInfo->Property->order]);\n }\n $sorted = $collection->sortBy('order')->where('order' , '>', 0);\n \n foreach($sorted as $robotInfo)\n {\n if($robotInfo['property'] == \"Image\")\n { \n $output .= \"<a href='\" . route('robotDetail', $robot->id) . \"'>\".\n \"<img alt='' src='\" .$robotInfo['content'] . \"' width='800' height='600' style='max-width:100%; max-height:200px; border: 1px solid DarkGreen; border-radius: 50px;' onerror='unavailableImage(this);'>\" .\n \"</a>\";\n }\n elseif($robotInfo['property'] == \"Name\")\n {\n $output .= \"<h5 class='card-title'>\".\n \"<a href='\" .route('robotDetail', $robot->id). \"'>\" .$robotInfo['content'] . \"</a>\".\n \"</h5>\";\n }\n else {\n $output = $output . \"<p class='card-text'><strong>\" .$robotInfo['property']. \" </strong>\" .$robotInfo['content'] . \"</p>\";\n }\n }\n $output .= \"</div>\".\n \"<div class='card-footer'>\".\n \"<small class='text-muted'>&#9733; &#9733; &#9733; &#9733; &#9734;</small>\".\n \"</div>\".\n \"</div>\".\n \"</div>\";\n }\n $output .= \"<div class='col-lg-12' style='text-align: center;'>\" .$robots->links() .\"</div>\";\n }\n return Response($output);\n }\n }", "private function _generateQuery() {\n\t\t// vyhodnoceni odeslanych filtracnich dat\n\t\t$filterObj = $this->getRequest()->getParam(\"_filter\", null);\n\t\t$uuid = $this->getRequest()->getParam(\"id\", null);\n\t\t$uuids = $this->getRequest()->getParam(\"_uuids\", null);\n\t\t\n\t\t// vyhodnoceni stavu\n\t\tif ($uuid) {\n\t\t\t// uuid byl odeslan primo v requestu\n\t\t\t$this->_queryObject = array($uuid);\n\t\t\t\n\t\t\treturn;\n\t\t} elseif ($uuids) {\n\t\t\t// byl odeslan seznam uuid\n\t\t\t$this->_queryObject = (array) $uuids;\n\t\t\t\n\t\t\treturn;\n\t\t} elseif (!$filterObj) {\n\t\t\t// zadna z moznosti nebyla vyuzita\n\t\t\t$this->_queryObject = array();\n\t\t}\n\t\t\n\t\t/**\n\t\t * pokud program dosel az sem, byl odeslan plnohodnotny filtracni objekt\n\t\t */ \n\t\t\n\t\t// reset referenci\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vytvoreni filtracniho objektu a ziskani seznamu tabulek\n\t\t$queryObj = BB_Db_Query_Factory::factory($filterObj);\n\t\t$tableNames = BB_Db_Query_Reference::getTables();\n\t\t\n\t\t// vygenerovani seznamu pouzitych sloupcu z index\n\t\t$usedColumns = $this->getRequest()->getParam(\"_uuidColumns\", array());\n\t\t$usedColumns = (array) $usedColumns;\n\t\t\n\t\tif (!$usedColumns) {\n\t\t\t// seznam pouzitych sloupci je prazdny - toto neni pripustne\n\t\t\tthrow new Zend_Exception(\"UUID_COLUMNS_NOT_SET\", 400);\n\t\t}\n\t\t\n\t\t$usedReferences = array();\n\t\t\n\t\tforeach ($usedColumns as $column) {\n\t\t\t$reference = new BB_Db_Query_Reference($column);\n\t\t\t\n\t\t\t// kontrola jestli je tabulka v seznamu\n\t\t\tif (!in_array($reference->getTable(), $tableNames)) {\n\t\t\t\t// tabulka neni v seznamu, vyhodi se chyba\n\t\t\t\tthrow new Zend_Exception(\"UNKNOWN_INDEX_UUID_COLUMN\", 400);\n\t\t\t}\n\t\t\t\n\t\t\t$usedReferences[] = new BB_Db_Query_Reference($column);\n\t\t}\n\t\t\n\t\t// anulace statickych vlastnosti reference\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vygenerovani infomraci pro filtraci dat\n\t\t$filterData = new stdClass;\n\t\t\n\t\t$filterData->columns = $usedReferences;\n\t\t$filterData->query = $queryObj;\n\t\t$filterData->tables = $tableNames;\n\t\t\n\t\t// nastaveni objektu\n\t\t$this->_queryObject = $filterData;\n\t\t\n\t\treturn $this;\n\t}", "public function searchCar()\n {\n $query = $this->createQueryBuilder('car')\n ->leftJoin('car.imageLogo', 'image_logo')\n ->select('car.name', 'car.id', 'car.slug')\n ->addSelect('image_logo.id as imageId', 'image_logo.providerReference')\n ->getQuery();\n\n return $query->getResult();\n }", "public function filterMedia($zone)\n {\n return $this->media()->wherePivot('zone', $zone);\n }", "public function filter(Record $record);", "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 }", "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 }", "public function search()\n {\n $post = post::where('title','like','%'.request('search').'%')->get();\n return view('resultes')\n ->with('tags' , tag::all() ) \n \n \n \n ->with('posts' , $post)\n\n ->with('title' , 'Result : '. request('search'))\n \n ->with('categories' , Category::take(5)->get() ) \n ->with('query' , request('search') ) ;\n }", "public function applyFilter(Query $query);", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CastlesPeer::ID, $key, Criteria::EQUAL);\n }", "public function relatedReservation($id)\n\t{\n\t\t$dat = $this->database->table(self::TABLE_NAME)->get($id);\n\n\t\t$pole = array();\n\t\tforeach ($dat->related('rezervace_leku_lek.ID_leku') as $med)\n\t\t\t$pole[] = $med->ID_rezervace;\n\t\treturn $this->database->table('rezervace_leku')->where('ID_rezervace', $pole);\n\t}", "public function actionSearch($id) {\n\n if (isset($_GET['Qircomentario']) && !empty($_GET['Qircomentario'])) {\n $modelQir = Qir::model()->findByPk($id);\n $model = new Qircomentario;\n $modelV = new Qircomentario;\n $model->attributes = $_GET['Qircomentario'];\n $modelV->attributes = $_GET['Qircomentario'];\n\n\n $criteria = new CDbCriteria;\n $params = array();\n\n\n $criteria->addCondition('estado like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('fecha like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('para like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('de like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('asunto like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('num_reporte like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('modelo like \"%' . $model->estado . '%\"', 'OR');\n $criteria->addCondition('comentario like \"%' . $model->estado . '%\"', 'OR');\n\n $criteria->addCondition('qirId = :id', 'AND');\n $params[':id'] = $id;\n\n $criteria->params = $params;\n\n // Count total records\n $pages = new CPagination(Qircomentario::model()->count($criteria));\n\n // Set Page Limit\n $pages->pageSize = 10;\n\n // Apply page criteria to CDbCriteria\n $pages->applyLimit($criteria);\n\n // Grab the records\n $posts = Qircomentario::model()->findAll($criteria);\n\n\n /* Verificamos que tenga parametros de busqueda caso contrario redirect al admin */\n\n if (!$posts) {\n Yii::app()->user->setFlash('error', \"No se encontraron datos con la busqueda realizada.\");\n $this->redirect(array('pvQircomentario/admin/id/' . $id));\n }\n\n $this->render('admin', array(\n 'model' => $posts,\n 'pages' => $pages,\n 'busqueda' => '',\n 'modelPost' => $modelV,\n 'id' => $id,\n 'modelQir' => $modelQir,\n ));\n } else {\n Yii::app()->user->setFlash('error', \"Ingrese un valor para realizar la busqueda.\");\n $this->redirect(array('pvQircomentario/admin/id/' . $id));\n }\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 filterByCustomRelation($collection, $filter)\n\t{\n\t\tif(isset($filter->relation))\n\t\t{\n\t\t\t$relation = $filter->relation;\n\t\t\t$relationTable = (isset($this->$relation) && $this->$relation()->getRelated()) ? $this->$relation()->getRelated()->table : '';\n $key = $filter->key;\n $value = $filter->value;\n $shownEmpty = false;\n\n if(Schema::hasTable($relationTable) && Schema::hasColumn($relationTable, $key))\n {\n if(!isset($filter->hideEmpty) || !$filter->hideEmpty)\n {\n $shownEmpty = true;\n $collection->whereDoesntHave($filter->relation);\n }\n\n if(isset($filter->key) && isset($filter->value) && $relationTable)\n {\n if($shownEmpty)\n {\n $collection->orWhereHas($filter->relation, function($query) use ($key, $value, $relationTable)\n {\n if(is_array($value))\n {\n $query->whereIn($relationTable.'.'.$key, $value);\n }\n else\n {\n $query->where($relationTable.'.'.$key, $value);\n }\n });\n }\n else\n {\n $collection->whereHas($filter->relation, function($query) use ($key, $value, $relationTable)\n {\n if(is_array($value))\n {\n $query->whereIn($relationTable.'.'.$key, $value);\n }\n else\n {\n $query->where($relationTable.'.'.$key, $value);\n }\n });\n }\n }\n }\n\t\t}\n\n\t\treturn $collection;\n\t}", "public function getCitiesOfMovies()\n {\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT p\n FROM CinheticPublicBundle:Cinema p\n GROUP BY p.ville\n ORDER BY p.ville ASC'\n );\n return $query->getResult();\n }", "public function search($params)\n {\n $query=Treasure::find()->joinWith(['target']);\n $query->select('treasure.*,(SELECT COUNT(treasure_id) FROM player_treasure WHERE treasure.id=player_treasure.treasure_id) as discovered');\n\n // add conditions that should always apply here\n\n $dataProvider=new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if(!$this->validate())\n {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'treasure.id' => $this->id,\n 'treasure.points' => $this->points,\n 'treasure.appears' => $this->appears,\n 'treasure.weight' => $this->weight,\n 'treasure.category' => $this->category,\n 'treasure.target_id' => $this->target_id,\n '(SELECT COUNT(DISTINCT treasure_id)>0 FROM player_treasure WHERE treasure.id=player_treasure.treasure_id)' => $this->discovered,\n ]);\n\n $query->andFilterWhere(['like', 'treasure.name', $this->name])\n ->andFilterWhere(['like', 'treasure.pubname', $this->pubname])\n ->andFilterWhere(['like', 'treasure.description', $this->description])\n ->andFilterWhere(['like', 'treasure.pubdescription', $this->pubdescription])\n ->andFilterWhere(['like', 'treasure.player_type', $this->player_type])\n ->andFilterWhere(['like', 'treasure.csum', $this->csum])\n ->andFilterWhere(['like', 'treasure.effects', $this->effects])\n ->andFilterWhere(['like', 'treasure.code', $this->code]);\n\n $query->andFilterWhere(['OR',\n ['like', 'INET_NTOA(target.ip)', $this->ipoctet],\n ['like', 'target.name', $this->ipoctet],\n ['=', 'target.id', $this->ipoctet]\n ]);\n $dataProvider->setSort([\n 'attributes' => array_merge(\n $dataProvider->getSort()->attributes,\n [\n 'ipoctet' => [\n 'asc' => ['ip' => SORT_ASC],\n 'desc' => ['ip' => SORT_DESC],\n ],\n 'discovered' => [\n 'asc' => ['discovered' => SORT_ASC],\n 'desc' => ['discovered' => SORT_DESC],\n ],\n ]\n ),\n ]);\n\n return $dataProvider;\n }", "public function filter_get()\n {\n //obteniendo parametros filtro\n $ciudades = $this->input->get(\"cities\", true);\n $categorias = $this->input->get(\"categories\", true);\n $distance = $this->input->get(\"distance\", true);\n $current_position = $this->input->get(\"current\", true);\n\n $services = [];\n $filtered = false;\n if ($categorias) {\n $filtered = true;\n $services = $this->filterBySubcategories($categorias);\n $services = $this->filterByCitiesFiltered($ciudades, $filtered, $services);\n } else {\n if ($ciudades) {\n $services = $this->filterByCitiesFiltered($ciudades, false, null);\n $filtered = true;\n }\n }\n if ($current_position && $distance) {\n $services = $this->filterByDistance($distance, $current_position, $filtered, $services);\n }\n $result[\"data\"] = $services;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function SearchFilter($query) {\nif ($query->is_search) {\n$query->set('post_type', 'post');\n}\nreturn $query;\n}", "function SearchFilter($query) {\nif ($query->is_search) {\n$query->set('post_type', 'post');\n}\nreturn $query;\n}", "abstract public function filter(Builder $dataSource);", "function project_filtering_method(){\n\n \n $sdg_category = $_POST['sdg_category'] != 0 ? $_POST['sdg_category'] : -1;\n $location = $_POST['kommune'];\n $company_type = str_replace(' ', '', $_POST['company_type']);\n $search_term = $_POST['search'];\n $post_amount = $_POST['post_amount'];\n \n\n if ($_POST['sdg_category'] != 0) {\n $tax_query = [\n [\n 'taxonomy' => 'category',\n 'terms' => $sdg_category,\n 'include_children' => true // Remove if you need posts from term 7 child terms\n ],\n ];\n }else{\n $tax_query = [];\n }\n\n if ($_POST['kommune'] != 0) {\n if (strpos($location, 'region') !== false) {\n $location = str_replace('region_', '', $location );\n $query = array(\n 'relation'\t\t=> 'AND',\n array(\n 'key'\t \t=> 'regions',\n 'value'\t \t=> $location,\n 'compare' \t=> '===',\n ),\n );\n \n }elseif (strpos($location, 'commune') !== false) {\n $location = str_replace('commune_', '', $location );\n $query = array(\n 'relation'\t\t=> 'AND',\n array(\n 'key'\t \t=> 'commune',\n 'value'\t \t=> $location,\n 'compare' \t=> '===',\n ),\n );\n \n }\n }else{\n $query = [];\n }\n \n \n if ($post_amount == 2) {\n $startfrom = 0;\n }else{\n $startfrom = $post_amount;\n }\n\n $get_all_posts = get_posts(array(\n 'posts_per_page' => $post_amount,\n 'offset' => $startfrom, \n 'post_status' => 'publish', // Show only the published posts\n 'post_type' => 'projects',\n 'orderby' => 'date',\n 's' => $search_term,\n 'order' => 'DESC',\n 'meta_query'\t=> $query,\n 'tax_query' => $tax_query,\n \n ));\n $results = [];\n\n if ($get_all_posts && !empty($get_all_posts)) : \n $formatted_posts['posts'] = [];\n foreach($get_all_posts as $post):\n\n if ( isset($post->ID) ) {\n \n $author = get_userdata($post->post_author);\n $user_company = get_field('company_type', 'user_'. $author->ID);\n $user_label = str_replace(' ', '', $user_company['label']);\n $project_location = get_field('project_location', $post->ID);\n $company_validate = urlencode($user_label) === urlencode($company_type) ? true : false;\n $image = get_the_post_thumbnail_url($post->ID, 'medium');\n $sdg_logo = get_field('logo', 'user_' . $post->post_author);\n $title = wp_html_excerpt( $post->post_title, 75, '&#8230;' );\n $category_id = get_field('main_goal', $post->ID);\n $sdg_id = get_field('sdg_id', 'category_'.$category_id);\n if($company_type == '0'){\n \n $results['post_items'][$post->ID] = [\n 'post_title' => $title,\n 'post_excerpt' => $post->post_excerpt,\n 'post_date' => $post->post_date,\n 'post_url' => get_permalink($post->ID),\n 'post_id' => $post->ID,\n 'post_image' => $image,\n 'post_type' => $post->post_type,\n 'post_company' => $user_company['label'],\n 'post_company_logo' => $sdg_logo['url'],\n 'post_company_name' => get_field('name', 'user_'. $author->ID),\n 'post_category' => get_the_category($post->ID),\n 'post_category_id' => $sdg_id,\n 'post_location' => $project_location,\n ];\n \n }else{\n if ($company_validate == true) {\n\n $results['post_items'][$post->ID] = [\n 'post_title' => $title,\n 'post_excerpt' => $post->post_excerpt,\n 'post_date' => $post->post_date,\n 'post_url' => get_permalink($post->ID),\n 'post_id' => $post->ID,\n 'post_image' => $image,\n 'post_type' => $post->post_type,\n 'post_company' => $user_company['label'],\n 'post_company_logo' => $sdg_logo['url'],\n 'post_company_name' => get_field('name', 'user_'. $author->ID),\n 'post_category' => get_the_category($post->ID),\n 'post_location' => $project_location,\n ];\n }\n \n }\n \n }else{\n $results['post_items'] = false;\n }\n \n endforeach;\n\n $results['post_items'] = $results['post_items'] == [] ? false : $results['post_items'];\n echo json_encode($results);\n \n\n else: \n $results['post_items'] = 'undefined';\n echo json_encode($results);\n endif;\n //send back the responseBodyJson to frontend\n //it will be send tot the call_back function\n \n die();\n}", "public function movies()\n {\n return $this->morphedByMany('App\\Movie', 'source_genre');\n }", "public function getScenes()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$items = Vr360Database::getInstance()->select(\n\t\t\t'v2_scenes',\n\t\t\tarray(\n\t\t\t\t'id', 'tourId', 'name', 'description', 'file', 'ordering', 'status', 'default', 'params'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'status[!]' => VR360_TOUR_STATUS_UNPUBLISHED,\n\t\t\t\t'tourId' => $this->id,\n\t\t\t\t'ORDER' => array('ordering' => 'ASC')\n\t\t\t)\n\t\t);\n\n\t\tif (empty($items))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($items as $key => $item)\n\t\t{\n\t\t\t$scene = new Vr360Scene;\n\t\t\t$item['params'] = json_decode($item['params']);\n\t\t\t$scene->bind($item);\n\t\t\t$items[$key] = $scene;\n\t\t}\n\n\t\treturn $items;\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 }", "function searchMoviesFromCinema($sCinema, array $aCinemas, array $aMovies)\n{\n $aSearchMovies = array();\n foreach ($aCinemas[$sCinema]['rooms'] as $iMovieId) {\n $aSearchMovies[] = $aMovies[$iMovieId];\n }\n\n return $aSearchMovies;\n}", "public function query()\n {\n $tujuan_id = $this->tujuan_id;\n $query = tDisposisiDokumen::with('tujuan','tujuan.direksi')->whereIn('dest_doc_id',$tujuan_id);\n \n return $this->applyScopes($query);\n }" ]
[ "0.53861344", "0.5253743", "0.50893176", "0.5079959", "0.50666136", "0.504972", "0.49897018", "0.4985952", "0.48427886", "0.48067364", "0.4753822", "0.4690143", "0.46598023", "0.46537682", "0.46460527", "0.45941943", "0.45790404", "0.45775345", "0.4555746", "0.45546597", "0.45246503", "0.44910488", "0.44385794", "0.44205606", "0.44147903", "0.4405518", "0.4399308", "0.4391298", "0.43903595", "0.43903595", "0.43870258", "0.43826136", "0.43764204", "0.43736714", "0.43706864", "0.4369612", "0.43643197", "0.4362106", "0.43543205", "0.43538955", "0.43497363", "0.4344953", "0.43389523", "0.43309918", "0.4326398", "0.43208367", "0.43196318", "0.4313659", "0.43056685", "0.42917278", "0.42875093", "0.42869312", "0.42781234", "0.4277625", "0.42756858", "0.42695603", "0.4268377", "0.42675236", "0.4253246", "0.4248422", "0.42472124", "0.42459014", "0.42452225", "0.42435563", "0.42398822", "0.4237737", "0.42337182", "0.4231283", "0.4230827", "0.422986", "0.42298338", "0.4228203", "0.42275187", "0.4226451", "0.42256504", "0.42184806", "0.42140564", "0.42118013", "0.421001", "0.420445", "0.42043975", "0.41907918", "0.41905716", "0.41893977", "0.41862786", "0.41754547", "0.4172087", "0.41701946", "0.41692185", "0.41680175", "0.4163084", "0.41628945", "0.41628945", "0.41618025", "0.4161263", "0.41580862", "0.4155548", "0.4154901", "0.41542083", "0.4150633" ]
0.59226996
0
Adds a JOIN clause to the query using the MapSceneRewcat relation
public function joinMapSceneRewcat($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('MapSceneRewcat'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'MapSceneRewcat'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinQuery()\n {\n }", "public function useMapSceneRewcatQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapSceneRewcat($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapSceneRewcat', '\\MapSceneRewcatQuery');\n }", "public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "abstract public function join($alias_from, $rel_name, $alias_to);", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function basic_join_setup()\r\n {\r\n \r\n }", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "public function getarchives_join( $join, $r ) {\n\t\tglobal $wpdb;\n\t\t$this->get_archives_where_r = $r;\n\t\tif(isset($r['taxonomy']) && is_array($r['taxonomy']) )\n\t\t$join = $join . \" INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\";\n\n\t\treturn $join;\n\t}", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "public function joinMapPersonaScene($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapPersonaScene');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapPersonaScene');\n }\n\n return $this;\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "function map_joins($join){\n //\n //return field to str\n return $join->to_str();\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "function custom_search_join($join) {\r\n if ( is_search() && isset($_GET['s'])) {\r\n global $wpdb;\r\n $join = \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id \";\r\n }\r\n return($join);\r\n}", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('oggetto_news/category_news')),\n 'related.news_id = main_table.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "public function posts_join_request( $join ) {\n global $wpdb;\n\n $join .= \" inner join {$wpdb->postmeta} as metalat on {$wpdb->posts}.ID = metalat.post_id and metalat.meta_key = 'dokan_geo_latitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metalong on {$wpdb->posts}.ID = metalong.post_id and metalong.meta_key = 'dokan_geo_longitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metaaddr on {$wpdb->posts}.ID = metaaddr.post_id and metaaddr.meta_key = 'dokan_geo_address'\";\n\n remove_filter( 'posts_join_request', array( $this, 'posts_join_request' ) );\n\n return $join;\n }", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "protected function genSelectsJoins ($map)\n\t{\n\t\t$joins = array_reverse($map[GlobalSystem::ExpJoin]);\n\t\t$from = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpModel];\n\t\t$matcher = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatcher];\n\t\t$matchValue = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatchValue];\n\t\n\t\t$target = $joins[0][GlobalSystem::ExpModel];\n\t\t$sqlBase = \"SELECT {$target}.* FROM {$target} {join} WHERE {$from}.{$matcher} = {$matchValue}\";\n\n\t\t$joinBase = '';\n\t\tforeach($joins as $join) {\n\t\t\t$joinBase .= \"INNER JOIN {$join[GlobalSystem::ExpForeignKey][0]} ON {$join[GlobalSystem::ExpForeignKey][0]}.{$join[GlobalSystem::ExpForeignKey][1]} = {$join[GlobalSystem::ExpModel]}.`{$join[GlobalSystem::ExpProperty]}` \";\n\t\t}\n\n\t\treturn str_replace('{join}', $joinBase, $sqlBase);\n\t}", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }", "public function rightOuterJoin($table);", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "function MWX__join ($join)\n{\n global $wpdb;\n\n if (current_user_can ('edit_users'))\n return $join;\n\n return $join .= \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'maturity'\";\n}", "public function SQOfrag_AddJoins_forCatNum(fcSQL_Query $qo) {\n\t$sroDept = $this->SourceDepartments();\n\t$sroSupp = $this->SourceSuppliers();\n\t$qo->Select()->Source()->AddElements(\n\t array(\n\t new fcSQL_JoinElement($sroDept,'t.ID_Dept=d.ID'),\n\t new fcSQL_JoinElement($sroSupp,'t.ID_Supp=s.ID')\n\t )\n\t );\n\t$qo->Select()->Fields()->SetFields($this->Fields_all_forCompile_array());\n }", "function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "final public function addJoin(YMKM_SQL_Entity_Join $s)\n {\n $this->doAddJoin($s);\n return $this;\n }", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "public function getJoins() {\n\t\t$sql = \"\";\n\t\tif (count($this->join) > 0) {\n\t\t\tforeach ($this->join as $j) {\n\t\t\t\t$sj = $j[2];\n\t\t\t\t$sql .= \" \".$j[0].\" JOIN \".$sj->getFrom().\" ON \".$sj->getTable().\".`\".$j[3].\"`=\".$this->getTable().\".`\".$j[1].\"`\";\n\t\t\t\t$sql .= $sj->getJoins();\n\t\t\t}\n\n\n\t\t}\n\t\treturn $sql;\n\t}", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }", "public function custom_attachments_join( $join, $query ){\n\t\tglobal $wpdb;\n\n\t\t//if we are not on admin or the current search is not on attachment return\n\t\tif(!is_admin() || (!isset($query->query['post_type']) || $query->query['post_type'] != 'attachment')){\n\t\t\treturn $join;\n\t\t}\n\n\t\t// if current query is the main query and a search...\n\t\tif( is_main_query() && is_search() ){\n\t\t\t$join .= \"\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "function getJoinCondition() ;", "public function rightJoin($table, $conditions = []);", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "function contentjoiner($what, $from, $contenttojoin, $rid){\n\t$sql='SELECT ids.*';\n\t//everything is connected to a story\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql=<<<SQL\n\t\t\t$sql, stories.CreationTime AS SCreation, stories.LastActionTime AS SAction, stories.URL,\n\t\t\tstories.Title, stories.InternalLink,\tstories.TheText AS SText, stories.Extra,\n\t\t\tstories.Privacy AS SPrivacy, stories.NSFW AS SNSFW, sauth.DisplayName AS SDName, sauth.UserName AS SUName\nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', svotes.Sig AS SSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', sfollow.following AS SF';\n\t\t}//end rid\n\t}//end all stories tags....\n\t//do the comments if we need to \n\tif($what=='all' || $what=='comments'){\n\t\t$sql=<<<SQL\n\t\t\t$sql, comments.CreationTime AS CCreation, comments.LastActionTime AS CAction, commenttext.TheText AS CText,\n\t\t\tcomments.Privacy AS CPrivacy, comments.NSFW AS CNSFW, cauth.DisplayName AS CDName, cauth.UserName AS CUName \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', cvotes.Sig AS CSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', cfollow.Following AS CF';\n\t\t}//end rid\n\t}//end all comments\n\n\t//We've got the initial select statememt now lets get the from information\n\t$sql.=\" FROM ($contenttojoin) AS ids \";\n\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN stories ON stories.ID = ids.SID\n\t\t\tLEFT JOIN users AS sauth ON sauth.ID = stories.UserID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (SELECT *\n\t\t\t\tFROM votes\n\t\t\t\tWHERE votes.UserID = $rid AND ContentType=0) AS svotes ON svotes.ContentID = stories.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid\n\t\t\t\t\t) AS sfollow ON sfollow.FollowedID = stories.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all stories\n\tif($what=='all' || $what=='comments'){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN comments ON comments.ID = ids.CID\n\t\t\tLEFT JOIN users AS cauth on cauth.ID = comments.UserID\n\t\t\tLEFT JOIN commenttext ON commenttext.ID = comments.ID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM votes\n\t\t\t\t\tWHERE votes.UserID = $rid AND ContentType=1) AS cvotes ON cvotes.ContentID = comments.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid) AS cfollow ON cfollow.FollowedID = comments.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all comments\n\n\treturn $sql;\n}", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "public function visitJoinClause(\n /*IJoinClause*/ $node) /*: mixed*/ {\n $id = $node->getIdentifier();\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $left = null;\n $left_value = $node->getLeft();\n if ($left_value != null) {\n $left = /*(string)*/$left_value->accept($this);\n }\n $right = null;\n $right_value = $node->getRight();\n if ($right_value != null) {\n $right = /*(string)*/$right_value->accept($this);\n }\n $group = $node->getGroup();\n\n $result = 'join ';\n if ($id !== null) {\n $result .= '$'.$id.' in ';\n }\n $result .= $collection;\n if ($left !== null && $right !== null) {\n $result .= \" on $left equals $right\";\n if ($group !== null) {\n $result .= ' into '.$group;\n }\n }\n return $result;\n }", "function joinon_Contact_and_Vehicle_singlerecord($rID, $where = NULL) {\r\n if ($where != NULL) { $this->db->where($where); } \r\n $this->db->join(\r\n 'contact', \r\n 'contact.Id = ' . $this->table_name. '.' . $this->contactId_fieldname, \r\n 'left outer'\r\n ); \r\n $this->db->join(\r\n '__vehicles', \r\n '__vehicles.__Id = ' . $this->table_name. '._VehicleId', \r\n 'left outer'\r\n ); \r\n return $this->get($rID);\r\n }", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "public function useMapPersonaSceneQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapPersonaScene($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapPersonaScene', '\\MapPersonaSceneQuery');\n }", "function wc_tab_manager_tabs_posts_join( $join, $query ) {\n\tglobal $wpdb, $typenow;\n\n\tif ( 'wc_product_tab' === $typenow ) {\n\t\t$join .= \" JOIN {$wpdb->posts} AS product_parents ON ( {$wpdb->posts}.post_parent = 0 OR ( {$wpdb->posts}.post_parent = product_parents.ID AND product_parents.post_status != 'trash' ) )\";\n\t}\n\n\treturn $join;\n}", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "private function getJoin() {\n return $this->join;\n }", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "public function joinBills()\n {\n $this->builder->join('bills', 'bil_id', 'rc_bill');\n }", "public function join($id);", "public function getJoinCondition() {}", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "public function fullOuterJoin($table);", "function GetJoins() { return array(); }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public static function adjacent_post_link_join( $join) {\n $post = get_post();\n // only make changes if we are talking about event posts\n if ( self::$o->core_post_type == $post->post_type ) {\n $wpdb='';\n // using start date as the sorter not the post_date\n $join .= $wpdb->prepare( ' inner join ' . $wpdb->postmeta . ' as qspm on qspm.post_id = p.ID AND qspm.meta_key = %s', '_start' );\n }\n\n return $join;\n }", "protected abstract function getJoinClause(array $joins);", "public function joinMapSceneStoreCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapSceneStoreCategory');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapSceneStoreCategory');\n }\n\n return $this;\n }", "public function joinFields()\r\n {\r\n if (!$this->_joinedFields) {\r\n $this->getSelect()->join(\r\n array('related' => $this->getTable('mageplaza_betterblog/tag_post')),\r\n 'related.post_id = e.entity_id',\r\n array('position')\r\n );\r\n $this->_joinedFields = true;\r\n }\r\n return $this;\r\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function leftOuterJoin($table);", "public static function rightJoin($source, $on, $alias = null, array $bindings = []);", "protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }", "function carton_exclude_order_comments_from_feed_join( $join ) {\n\tglobal $wpdb;\n\n if ( ! $join )\n \t$join = \" LEFT JOIN $wpdb->posts ON $wpdb->comments.\\\"comment_post_ID\\\" = $wpdb->posts.\\\"ID\\\" \";\n\n return $join;\n}", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "protected function setJoin($query = null)\n {\n $query = $query ? : $this->query;\n $baseTable = $this->related->getTable ();\n $key = $baseTable . '.' . $this->related->getKeyName ();\n $query->join ( $this->table, $key, '=', $this->getOtherKey () );\n return $this;\n }", "public function getJoinExpression();", "public function prev_next_join( $join ) {\n\t\tglobal $wpdb;\n\t\t$join .= \" LEFT JOIN $wpdb->postmeta AS m ON ( p.ID = m.post_id AND m.meta_key = 'wpex_post_link' )\";\n\t\treturn $join;\n\t}", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function getJoinSql($data, $link) {\n $str = ' ';\n if ($data->joins) {\n foreach ($data->joins as $join) {\n $join['type'] = strtoupper($join['type']);\n if (strncmp('NATURAL', $join['type'], 7) === 0) {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']);\n } else {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']) . ($join['cond'] ? ' ON ' . $this->parseWhere($join['cond'], '', $link) : '');\n }\n }\n }\n\n return $str;\n }", "public function joins()\n {\n return $this->_joins;\n }", "public function joinAssociations()\n {\n return array_slice($this->_joins, 1);\n }", "function ydgdict_include_ideas_in_search( $join, $wp_query ) \n{\n if ( ! $wp_query->is_archive( 'entry' ) || ! $wp_query->is_search() || is_admin() ) return $join; // unchanged\n\n global $wpdb;\n\n $join .= \" INNER JOIN {$wpdb->prefix}ydgdict_ideas ideas ON ( {$wpdb->posts}.ID = ideas.entry_id ) \";\n \n return $join;\n}", "function getJoinType() ;", "function joins() {\n //\n //begin with an empty array of joins \n $joins=[];\n //\n //Clean the array to remove any dublicates\n //\n //Sort the array in order of dependency\n $unsorted_entities=[];\n foreach ($this->join_entities as $enames){\n //\n //Get the entities\n $entty= $this->entity->dbase->entities[$enames];\n array_push($unsorted_entities, $entty);\n }\n \n //loop through the sorted array creating a join from each \n foreach ($unsorted_entities as $entity){\n //\n //get the ands columns\n $foreigns= $this->get_foreigners($entity, $joins);\n //\n //Create a new join \n array_push($joins, new join($entity, $foreigns, 'INNER JOIN'));\n }\n //\n //Return the collection of the joins in an array \n return $joins;\n }" ]
[ "0.65160954", "0.61171395", "0.5994133", "0.5908363", "0.5817801", "0.5733183", "0.5717281", "0.5608988", "0.55758846", "0.5525305", "0.5525228", "0.55057734", "0.54906815", "0.5464042", "0.54604936", "0.5443119", "0.5433904", "0.5425987", "0.5371865", "0.5321493", "0.5303664", "0.52902234", "0.5261721", "0.5252313", "0.5245956", "0.52213246", "0.520796", "0.51953375", "0.5184767", "0.5178049", "0.5159814", "0.5158076", "0.51440865", "0.51312226", "0.51297116", "0.5120968", "0.51115453", "0.5100798", "0.50949806", "0.5093202", "0.5060734", "0.50431544", "0.50211126", "0.5006807", "0.49931434", "0.49903566", "0.49865276", "0.4972863", "0.49644125", "0.49618754", "0.4957984", "0.49533924", "0.49414316", "0.49365512", "0.49363792", "0.4926141", "0.49250472", "0.49214897", "0.49120316", "0.49079904", "0.49052602", "0.49034968", "0.4891216", "0.48835558", "0.48823765", "0.48737118", "0.48678198", "0.48600248", "0.48519126", "0.4848455", "0.48478943", "0.4842242", "0.4818966", "0.48163044", "0.4815038", "0.48134416", "0.48117238", "0.4810327", "0.48091796", "0.47967526", "0.47961742", "0.47950587", "0.47879195", "0.47823486", "0.47766706", "0.47617817", "0.47556257", "0.47493345", "0.47295502", "0.4727818", "0.4725959", "0.47247365", "0.4721712", "0.47194204", "0.4701257", "0.4700446", "0.46991387", "0.46948695", "0.468998", "0.46876192" ]
0.63426995
1
Use the MapSceneRewcat relation MapSceneRewcat object
public function useMapSceneRewcatQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinMapSceneRewcat($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'MapSceneRewcat', '\MapSceneRewcatQuery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByMapSceneRewcat($mapSceneRewcat, $comparison = null)\n {\n if ($mapSceneRewcat instanceof \\MapSceneRewcat) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneRewcat->getSceneId(), $comparison);\n } elseif ($mapSceneRewcat instanceof ObjectCollection) {\n return $this\n ->useMapSceneRewcatQuery()\n ->filterByPrimaryKeys($mapSceneRewcat->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneRewcat() only accepts arguments of type \\MapSceneRewcat or Collection');\n }\n }", "public function joinMapSceneRewcat($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapSceneRewcat');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapSceneRewcat');\n }\n\n return $this;\n }", "function getScenes() {\n return $this->scenes;\n}", "public function scenes()\n {\n return $this->hasMany(EntryScene::class);\n }", "function iems_StageMap()\n {\n self::__construct();\n }", "public function useMapPersonaSceneQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapPersonaScene($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapPersonaScene', '\\MapPersonaSceneQuery');\n }", "function OBJM_AddLayerReference(&$respdata)\r\n{\r\n\r\n\t$retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']);\r\n\tif(!isset($_SESSION['sceneCompXMLDOM']))\r\n\t\treturn false;\r\n\tif(!isset($_SESSION['sceneCompXMLFilePath']))\r\n\t\treturn false;\r\n\t\r\n\t$retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']);\r\n\tif($retval != true)\r\n\t{\r\n\t\t$respdata =\"FAIL\"; \r\n\t\treturn false; \r\n\t}\t\r\n\tparse_str($respdata) ;\t\r\n\t$objID = \t$OBJECTID; \r\n\t$refID = \t$REFERENCEID; \r\n\t$parentID = $SCENEID; \r\n\t\r\n\t//get the source node\r\n\t$refNode = $_SESSION['sceneCompXMLDOM']->getElementById($refID); \r\n\tif(!$refNode)\r\n\t\treturn false;\t\r\n\t\r\n\t$nodeTitle = $refNode->getAttribute('name'); \r\n\t\r\n\t$parentNode = $_SESSION['sceneCompXMLDOM']->getElementById($parentID);\r\n\tif(!$parentNode) \r\n\t\treturn false; \r\n\t\t\t\r\n\t$dataID = $refNode->getAttribute(\"dataid\"); \r\n\t\r\n\t$nodeType = $refNode->getAttribute(\"type\"); \r\n\tif($nodeType != \"LAYER\")\r\n\t{\r\n\t\t$respdata = \"FAIL\"; \r\n\t\treturn false; \r\n\t}\r\n\t\r\n\t//$TMparentIDVal = \"TM_\".$parentID;\r\n\t$retval = OBJM_AddNewObjectToSCXML($objID,$nodeType,\"treemenu\",\"3\", $nodeTitle, $parentID, $dataID, $nodeType, 'reference');\r\n\tif($retval == false)\r\n\t{\r\n\t\t$respData = \"\";\r\n\t\treturn false;\r\n\t}\r\n\t//$retval = $_SESSION['sceneCompXMLDOM']->save($_SESSION['sceneCompXMLFilePath']);\r\n\t//send OK back to client \r\n\t$respdata = $retval; \r\n\treturn true; \t\r\n}", "protected\tfunction\tsetRelations() {}", "protected\tfunction\tsetRelations() {}", "function map(string $docuri) {\n $map = [\n 'title'=> 'carte '.$this->title,\n 'view'=> ['latlon'=> [47, 3], 'zoom'=> 6],\n ];\n $map['bases'] = [\n 'cartes'=> [\n 'title'=> \"Cartes IGN\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/cartes/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'orthos'=> [\n 'title'=> \"Ortho-images\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/orthos/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'whiteimg'=> [\n 'title'=> \"Fond blanc\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://visu.gexplor.fr/utilityserver.php/whiteimg/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 21 ],\n ],\n ];\n $map['defaultLayers'] = ['whiteimg'];\n \n $request_scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME']\n : ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']=='on')) ? 'https' : 'http');\n foreach ($this->layers as $lyrid => $layer) {\n $overlay = [\n 'title'=> $layer['title'],\n 'type'=> 'UGeoJSONLayer',\n 'endpoint'=> \"$request_scheme://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]/$docuri/$lyrid\",\n ];\n foreach (['pointToLayer','style','minZoom','maxZoom'] as $key)\n if (isset($layer[$key]))\n $overlay[$key] = $layer[$key];\n elseif ($this->$key !== null)\n $overlay[$key] = $this->$key;\n\n $map['overlays'][$lyrid] = $overlay;\n if (isset($layer['displayedByDefault']))\n $map['defaultLayers'][] = $lyrid;\n }\n \n return new Map($map, \"$docuri/map\");\n }", "public function initialize()\n {\n $this->setSchema(\"mus\");\n $this->setSource(\"sculpture\");\n $this->belongsTo(\n 'Art_Objects_id_no',\n 'ArtObjects',\n 'id_no'\n );\n }", "public function train(){\n\t\t\n\t\treturn $this->belongsTo('Alsaudi\\\\Eloquent\\\\TrainRelation');\n\t}", "private function initRestorableRelations() {\n\n\t\t$configs = $this->cascadable();\n\n\t\t$this->runCascadeRestore = $configs['restore']['enable'] ?? true;\n\n\t\t$this->relationships = Arr::wrap($configs['restore']['relations'] ?? $configs);\n\t}", "protected static function _relations() {\n\n\t}", "function __construct()\n { parent::__construct('maps', 'animals');\n }", "public function Aremplacer()\n {\n return $this->belongsToMany('App\\Professeur','remplacants_prof','remplacant_id','prof_id');\n }", "function updateObjectReference()\n\t{\n\t\tif (is_object($this->mob_node))\n\t\t{\n\t\t\t$this->mal_node =& $this->mob_node->first_child();\n\t\t\tif (is_object($this->mal_node) && $this->mal_node->node_name() == \"MediaAlias\")\n\t\t\t{\n\t\t\t\t$this->mal_node->set_attribute(\"OriginId\", \"il__mob_\".$this->getMediaObject()->getId());\n\t\t\t}\n\t\t}\n\t}", "public function resources() {\n return $this->belongsToMany(AdResource::class, 'ad_role_resources', 'ro_id', 're_id');\n }", "abstract protected function map_reford_to_object( $record );", "protected function renderReferences() {}", "public function setRelations() {}", "private function metaLoad()\n {\n $this->meta ??= $this?->relations['meta'] ?? $this->meta()->get();\n }", "public function initialize()\n {\n $this->setSchema(\"adsmall\");\n $this->setSource(\"cameras\");\n }", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "function __construct( KeyFrameRelation $kfrel ) // KFRecord and KFRecordCursor constructors have to do the same thing\r\n /**********************************************\r\n */\r\n {\r\n $this->kfrel = $kfrel;\r\n $this->Clear();\r\n }", "public function reverseMap(): MappingInterface;", "public function setResaca($resaca){\n $this->resaca=$resaca;\n }", "public function get_scenes() {\n\t\t//Returns true or false. Values are set in $scenes.\n\t\treturn $this->_get_scenes();\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('Track', 'Track', RelationMap::MANY_TO_ONE, array('track_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Featurevectortype', 'Featurevectortype', RelationMap::MANY_TO_ONE, array('featurevectortype_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('File', 'File', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('DistanceRelatedByTrackAId', 'Distance', RelationMap::ONE_TO_MANY, array('track_id' => 'track_a_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('DistanceRelatedByTrackBId', 'Distance', RelationMap::ONE_TO_MANY, array('track_id' => 'track_b_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Distancejob', 'Distancejob', RelationMap::ONE_TO_MANY, array('track_id' => 'track_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Featurevectorsegment', 'Featurevectorsegment', RelationMap::ONE_TO_MANY, array('track_id' => 'track_id', ), 'RESTRICT', 'CASCADE');\n\t}", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n $this->addRelation('GsArtikelen', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsArtikelen', RelationMap::MANY_TO_ONE, array('zinummer' => 'zinummer', ), null, null);\n $this->addRelation('GsArtikelEigenschappen', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsArtikelEigenschappen', RelationMap::MANY_TO_ONE, array('zinummer' => 'zindex_nummer', ), null, null);\n $this->addRelation('RzvVerstrekkingOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('thesaurus_rzv_verstrekking' => 'thesaurusnummer', 'rzvverstrekking' => 'thesaurus_itemnummer', ), null, null);\n $this->addRelation('RzvHulpmiddelenOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('thesaurus_rzv_hulpmiddelen' => 'thesaurusnummer', 'hulpmiddelen_zorg' => 'thesaurus_itemnummer', ), null, null);\n $this->addRelation('RzvVoorwaardenOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('rzv_thesaurus_120' => 'thesaurusnummer', 'rzvvoorwaarden_bijlage_2' => 'thesaurus_itemnummer', ), null, null);\n }", "private function mapSqlToObject($rs) {\n $cata_category = new cata_category();\n $cata_category->_id = $rs[\"id\"];\n $cata_category->_libelle = $rs[\"libelle\"];;\n $cata_category->_active = $rs[\"active\"];;\n return $cata_category;\n }", "public function acessarRelatorios(){\n\n }", "public function zone(){\n return $this->belongsTo('UserFrosting\\Sprinkle\\IntelliSense\\Database\\Models\\Zone');\n }", "private function renderMapRouteTableWiCat( $tableLocal, $tableCat, $rowsRelation )\n {\n // $rowsLocal: rows without categories\n // tx_route_marker is the local table in the sample below\n //\n //array (\n // 3 =>\n // array (\n // 'tx_route_marker.title' => 'Reichstag',\n // 'tx_route_marker.lat' => '13.376210',\n // 'tx_route_marker.lon' => '52.518572',\n // 'tx_route_marker.image' => 'Reichstag_Berlin.jpg',\n // 'tx_route_marker.uid' => '3',\n // ),\n // Get rows (they don't have any category currently)\n $rowsLocal = $this->renderMapRouteMarkerGetRowsByTable( $tableLocal );\n // Get category rows\n $rowsCat = $this->renderMapRouteMarkerGetRowsByTable( $tableCat );\n\n // LOOP relations\n foreach ( $rowsRelation as $localUid => $catUids )\n {\n // LOOP categories\n foreach ( $catUids as $catUid )\n {\n // LOOP category fields\n foreach ( $rowsCat[ $catUid ] as $catTableField => $catValue )\n {\n // SWITCH: local with or without category field\n switch ( true )\n {\n // CASE: with category field\n case( isset( $rowsLocal[ $localUid ][ $catTableField ] ) ):\n $rowsLocal[ $localUid ][ $catTableField ] = $rowsLocal[ $localUid ][ $catTableField ]\n . $this->catDevider\n . $catValue\n ;\n break;\n // CASE: with category field\n // CASE: without category field\n case(!isset( $rowsLocal[ $localUid ][ $catTableField ] ) ):\n default:\n $rowsLocal[ $localUid ][ $catTableField ] = $catValue;\n break;\n // CASE: without category field\n }\n // SWITCH: local with or without category field\n }\n // LOOP category fields\n }\n // LOOP categories\n }\n // LOOP relations\n // $rowsLocal: rows with categories\n // tx_route_marker is the local table in the sample below\n // tx_route_marker_cat is the category table in the sample below\n //\n //array (\n // 3 =>\n // array (\n // 'tx_route_marker.title' => 'Reichstag',\n // 'tx_route_marker.lat' => '13.376210',\n // ...\n // 'tx_route_marker_cat.title' => 'Geschichte, ;|;Politik, ;|;Politik-Pfad',\n // 'tx_route_marker_cat.icons' => 'history.png, ;|;badge.png, ;|;badge_01.png',\n // 'tx_route_marker_cat.icon_offset_x' => '2, ;|;4, ;|;6',\n // 'tx_route_marker_cat.icon_offset_y' => '2, ;|;4, ;|;6',\n // 'tx_route_marker_cat.uid' => '10, ;|;9, ;|;8',\n // ),\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Rows of ' . $tableLocal . ': ' . var_export( $rowsLocal, true );\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n//$this->pObj->dev_var_dump( $rowsLocal );\n return $rowsLocal;\n }", "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function scene(string $scene = null)\n {\n if (is_null($scene)) {\n return $this->scene;\n }\n $this->scene = $scene;\n return $this;\n }", "public function initRightss()\n {\n $this->collRightss = new ObjectCollection();\n $this->collRightssPartial = true;\n\n $this->collRightss->setModel('\\Rights');\n }", "public function initialize()\n {\n $this->hasMany('id', 'Aulas', 'id_materia', array('alias' => 'Aulas'));\n $this->hasMany('id', 'Aulas', 'id_materia', NULL);\n }", "abstract protected function defineMapping();", "function getGenreCategoryMapping() {\n\t\tassert(false);\n\t}", "function __construct() {\n $this->map = array();\n }", "function &getScreens()\n{\n if(count($this->_screens) > 0){\n return $this->_screens;\n } else {\n $debug_prefix = debug_indent(\"Module-getScreens() {$this->ModuleID}:\");\n $screens_element = $this->_map->selectFirstElement('Screens', NULL, NULL);\n\n if(!empty($screens_element) && count($screens_element->c) > 0){\n foreach($screens_element->c as $screen_element){\n $screen = $screen_element->createObject($this->ModuleID);\n $this->_screens[$screen_element->name] =& $screen;\n\n switch(strtolower(get_class($screen))){\n case 'viewscreen':\n $this->viewScreen =& $screen;\n break;\n case 'searchscreen':\n $this->searchScreen =& $screen;\n break;\n case 'listscreen':\n $this->listScreen =& $screen;\n break;\n default:\n //do nothing\n }\n unset($screen);\n }\n }\n\n debug_unindent();\n return $this->_screens;\n }\n//print_r($this->_screens);\n}", "public function murotal_reciter_surah()\n {\n return $this->hasMany(MRS::class, 'id', 'surah_id');\n }", "protected function _mapDCRelation(Item $item)\n {\n // have to be set to \"original\"\n\n $dcRelation = metadata($item, array('Dublin Core', 'Relation'), array('all' => true));\n\n foreach ($dcRelation as $relation) {\n\n if (strpos($relation,'http://') === 0) {\n\t$modsLocation = $this->_node->appendChild(new Mods_Location());\n\t$modsUrl = $modsLocation->addUrl($relation);\n } else {\n\t$modsRelatedItem = $this->_node->appendChild(new Mods_RelatedItem());\n\t$modsRelatedItem->addTitleInfo($relation);\n }\n \n }\n\n }", "public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }", "function setVako($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "function setVakoImage($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the vako with $object->reference->ShopId */ \n}", "private function mapSqlToObject($rs) {\n if(!$rs){\n return \"false\";\n }\n $sous_prix = new souscategory_prix();\n $sous_prix->_id = $rs[\"id\"];\n $sous_prix->_id_modelmetier_category = $rs[\"id_modelmetier_category\"];\n $sous_prix->_id_coeff_prix = $rs[\"id_coeff_prix\"];\n $sous_prix->_id_support = $rs[\"id_support\"];\n return $sous_prix;\n }", "public function directors($limit = null)\n {\n return $this->belongsToMany('App\\Models\\Cast', 'cast_of_movies')->where('job_id', 2)->limit($limit);\n }", "public function alejarCamaraPresidencia() {\n\n self::$presidencia->alejarZoom();\n\n }", "function unit_map_function(&$data, $maps) {\n // idia symbash/paradoxh me to attendance_gradebook_activities_map_function()\n // des to ekei comment gia ta spasmena FKs\n list($document_map, $link_category_map, $link_map, $ebook_map, $section_map, $subsection_map, $video_map, $videolink_map, $video_category_map, $lp_learnPath_map, $wiki_map, $assignments_map, $exercise_map, $forum_map, $forum_topic_map, $poll_map) = $maps;\n if ($data['type'] == 'videolinks') {\n $data['type'] == 'videolink';\n }\n if (isset($data['course_weekly_view_id'])) {\n $data['unit_id'] = $data['course_weekly_view_id'];\n unset($data['unit_id']);\n }\n $type = $data['type'];\n if ($type == 'doc') {\n $data['res_id'] = @$document_map[$data['res_id']];\n } elseif ($type == 'linkcategory') {\n $data['res_id'] = @$link_category_map[$data['res_id']];\n } elseif ($type == 'link') {\n $data['res_id'] = @$link_map[$data['res_id']];\n } elseif ($type == 'ebook') {\n $data['res_id'] = @$ebook_map[$data['res_id']];\n } elseif ($type == 'section') {\n $data['res_id'] = @$section_map[$data['res_id']];\n } elseif ($type == 'subsection') {\n $data['res_id'] = @$subsection_map[$data['res_id']];\n } elseif ($type == 'description') {\n $data['res_id'] = intval($data['res_id']);\n } elseif ($type == 'video') {\n $data['res_id'] = @$video_map[$data['res_id']];\n } elseif ($type == 'videolink') {\n $data['res_id'] = @$videolink_map[$data['res_id']];\n } elseif ($type == 'videolinkcategory') {\n $data['res_id'] = @$video_category_map[$data['res_id']];\n } elseif ($type == 'lp') {\n $data['res_id'] = @$lp_learnPath_map[$data['res_id']];\n } elseif ($type == 'wiki') {\n $data['res_id'] = @$wiki_map[$data['res_id']];\n } elseif ($type == 'work') {\n if (isset($assignments_map[$data['res_id']])) {\n $data['res_id'] = @$assignments_map[$data['res_id']];\n } else {\n $data['res_id'] = $assignments_map[0];\n }\n } elseif ($type == 'exercise') {\n if (isset($exercise_map[$data['res_id']])) {\n $data['res_id'] = @$exercise_map[$data['res_id']];\n } else {\n $data['res_id'] = $exercise_map[0];\n }\n } elseif ($type == 'forum') {\n $data['res_id'] = @$forum_map[$data['res_id']];\n } elseif ($type == 'topic') {\n $data['res_id'] = @$forum_topic_map[$data['res_id']];\n } elseif ($type == 'poll') {\n $data['res_id'] = @$poll_map[$data['res_id']];\n }\n return true;\n}", "public function load($relation);", "abstract function relations();", "public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }", "public function initialize()\r\n {\r\n\t\t$this->belongsTo(\"Mikro\", \"Pobjeda\\Models\\Mikro\", \"idMikro\");\r\n }", "public function buildRelations()\n\t{\n $this->addRelation('CuadreCaja', 'CuadreCaja', RelationMap::MANY_TO_ONE, array('id_cuadre_caja' => 'id_cuadre_caja', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdPersona', 'Persona', RelationMap::MANY_TO_ONE, array('id_persona' => 'id_persona', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdAutoriza', 'Persona', RelationMap::MANY_TO_ONE, array('id_autoriza' => 'id_persona', ), 'RESTRICT', null);\n\t}", "public function getMapReducers(): array;", "public function initialize(){\n $this->setSource('location');\n }", "function notes_map_function(&$data, $maps) {\n // idia symbash/paradoxh me to attendance_gradebook_activities_map_function()\n // des to ekei comment gia ta spasmena FKs\n list($course_id, $agenda_map, $document_map, $link_map, $video_map,\n $videolink_map, $assignments_map, $exercise_map, $ebook_map,\n $lp_learnPath_map) = $maps;\n $type = $data['reference_obj_type'];\n switch ($type) {\n case 'course':\n $data['reference_obj_id'] = $course_id;\n break;\n case 'course_event':\n if (isset($agenda_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $agenda_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $agenda_map[0];\n }\n break;\n case 'course_document':\n $data['reference_obj_id'] = $document_map[$data['reference_obj_id']];\n break;\n case 'course_link':\n $data['reference_obj_id'] = $link_map[$data['reference_obj_id']];\n break;\n case 'course_video':\n $data['reference_obj_id'] = $video_map[$data['reference_obj_id']];\n break;\n case 'course_videolink':\n $data['reference_obj_id'] = $videolink_map[$data['reference_obj_id']];\n break;\n case 'course_assignment':\n if (isset($assignments_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $assignments_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $assignments_map[0];\n }\n break;\n case 'course_exercise':\n if (isset($exercise_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $exercise_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $exercise_map[0];\n }\n break;\n case 'course_ebook':\n $data['reference_obj_id'] = $ebook_map[$data['reference_obj_id']];\n break;\n case 'course_learningpath':\n $data['reference_obj_id'] = $lp_learnPath_map[$data['reference_obj_id']];\n break;\n case 'course_learningpath':\n $data['reference_obj_id'] = $lp_learnPath_map[$data['reference_obj_id']];\n break;\n default:\n break;\n }\n return true;\n}", "public static function customCollection()\n\t{\n // recupera as features encontradas\n $features = Arr::flatten(parent::$collection);\n // limpa a collection\n parent::$collection = [];\n // realimenta a collection\n foreach ($features as $feature) {\n parent::$collection[$feature] = true;\n }\n\t}", "public function initialize()\n {\n\n $this->setSource(\"area\");\n $this->hasMany('id', 'Pole', 'place_id', ['alias' => 'Pole']);\n }", "function __construct( KeyFrameRelation $kfrel ) // KFRecord and KFRecordCursor constructors have to do the same thing\r\n /**********************************************\r\n */\r\n {\r\n parent::__construct( $kfrel );\r\n }", "public function supplyMov()\n {\n return $this->belongsTo('App\\WMS\\SMovement', 'mvt_reference_id');\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "public function mobiteli()\n {\n return $this->belongsToMany('App\\Mobitel', 'mobitel_trgovina'); //m:n\n }", "public function buildRelations()\n\t{\n $this->addRelation('Tbnecesespecial', 'Tbnecesespecial', RelationMap::MANY_TO_ONE, array('id_neces_especial' => 'id_neces_especial', ), null, null);\n $this->addRelation('Tbcidade', 'Tbcidade', RelationMap::MANY_TO_ONE, array('naturalidade' => 'id_cidade', ), null, null);\n $this->addRelation('Tbpais', 'Tbpais', RelationMap::MANY_TO_ONE, array('nacionalidade' => 'id_pais', ), null, null);\n $this->addRelation('TblogradouroRelatedByCep', 'Tblogradouro', RelationMap::MANY_TO_ONE, array('cep' => 'cep', ), null, null);\n $this->addRelation('Tbcursoversao', 'Tbcursoversao', RelationMap::MANY_TO_ONE, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbtipoingresso', 'Tbtipoingresso', RelationMap::MANY_TO_ONE, array('id_tipo_ingresso' => 'id_tipo_ingresso', ), null, null);\n $this->addRelation('Tbalunosituacao', 'Tbalunosituacao', RelationMap::MANY_TO_ONE, array('id_situacao' => 'id_situacao', ), null, null);\n $this->addRelation('TbinstexternaRelatedByIdDestino', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_destino' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedById2grau', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_2grau' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedById3grau', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_3grau' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedByIdTrabalho', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_trabalho' => 'id_inst_externa', ), null, null);\n $this->addRelation('TblogradouroRelatedByCepTrabalho', 'Tblogradouro', RelationMap::MANY_TO_ONE, array('cep_trabalho' => 'cep', ), null, null);\n $this->addRelation('Tbpolos', 'Tbpolos', RelationMap::MANY_TO_ONE, array('id_polo' => 'id_polo', ), null, null);\n $this->addRelation('Tbalunoracacor', 'Tbalunoracacor', RelationMap::MANY_TO_ONE, array('id_raca' => 'id_raca', ), null, null);\n $this->addRelation('Tbpendencia', 'Tbpendencia', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunodiploma', 'Tbalunodiploma', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunosenha', 'Tbalunosenha', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunosolicitacao', 'Tbalunosolicitacao', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbbanca', 'Tbbanca', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbfila', 'Tbfila', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbhistorico', 'Tbhistorico', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('TbturmaAluno', 'TbturmaAluno', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n\t}", "public function initMap()\n\t{\n\t\t$params =array();\n\t\t$this->add_VcMap($params);\n\t}", "public function magazine()\n {\n return $this->belongsTo('App\\Magazine');\n }", "function userelation($relation) { atkuse(\"relation\" , $relation); }", "function __construct() {\n\t\t$this->map_data = array();\n\t}", "function load(){\n $sql = 'SELECT * FROM worlds where id=?';\n $w = $this->app['db']->fetchAssoc($sql, array($this->id));\n if(!$w){ \n return false;\n }\n $this->name = $w['name'];\n $this->world = $w['world_json'];\n return true;\n }", "public function initialize()\n {\n $this->hasMany('id', 'MapsScore', 'map_id', array('alias' => 'MapsScore'));\n $this->hasMany('id', 'Matchs', 'current_map', array('alias' => 'Matchs'));\n $this->hasMany('id', 'PlayerKill', 'map_id', array('alias' => 'PlayerKill'));\n $this->hasMany('id', 'Players', 'map_id', array('alias' => 'Players'));\n $this->hasMany('id', 'PlayersHeatmap', 'map_id', array('alias' => 'PlayersHeatmap'));\n $this->hasMany('id', 'Round', 'map_id', array('alias' => 'Round'));\n $this->hasMany('id', 'RoundSummary', 'map_id', array('alias' => 'RoundSummary'));\n $this->belongsTo('match_id', 'Matchs', 'id', array('alias' => 'Matchs'));\n }", "public function screen()\n {\n return $this->belongsTo(Screen::class);\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->__resTraitConstruct();\n\t}", "public function refits2()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'refit_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }", "public function loadResources(): void {\n\t\t$sql = \"SELECT * FROM `npc_resource` WHERE `id_npc` = ?\";\n\t\t$this->db->query($sql, [$this->get('id')]);\n\t\t$resources = [];\n\t\twhile ($res = $this->db->next()) {\n\t\t\t$npc_resource = new NPCResource();\n\t\t\t$npc_resource->update($res);\n\t\t\t$npc_resource->loadResource($this->get('margin'));\n\n\t\t\tarray_push($resources, $npc_resource);\n\t\t}\n\t\t$this->setResources($resources);\n\t}", "public function setMap($map) {\n\t\t$maps = $this->static->maps();\n\t\t$this->map = $maps[$map];\n\t}", "public function location_name(){\n return $this->belongsTo('App\\Room', 'location');\n }", "function setArticleAttribut($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "public function initMaterials()\n\t{\n\t\tif ($this->collMaterials === null) {\n\t\t\t$this->collMaterials = array();\n\t\t}\n\t}", "function document_map_function(&$data, $maps) {\n $stype = $data['subsystem'];\n $sid = $data['subsystem_id'];\n if ($stype > 0) {\n if (isset($maps[$stype][$sid])) {\n $data['subsystem_id'] = $maps[$stype][$sid];\n } else {\n return false;\n }\n }\n if (!isset($data['extra_path'])) {\n $data['extra_path'] = '';\n }\n if (!$data['author']) {\n $data['author'] = '';\n }\n return true;\n}", "function onBeginMap($map, $warmUp, $matchContinuation) {\n\n\t\tforeach ($this->storage->players as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t\tforeach ($this->storage->spectators as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t}", "function project_project_modifier(&$node)\n {\n userelation(\"atkonetomanyrelation\");\n $node->add(new atkOneToManyRelation(\"user_stories\", \"xp.story\", \"project\", AF_HIDE_LIST), \"user_stories\");\n }", "abstract protected function getMapping();" ]
[ "0.57635933", "0.52916193", "0.49042577", "0.4808193", "0.45632565", "0.4550605", "0.45142904", "0.45066425", "0.45066425", "0.43429726", "0.43370283", "0.43021974", "0.42954674", "0.42588568", "0.42198515", "0.4217469", "0.41875795", "0.41775414", "0.41770405", "0.41746423", "0.4132744", "0.41111523", "0.41014302", "0.40982136", "0.40982136", "0.40982136", "0.40982136", "0.40982136", "0.40982136", "0.40982136", "0.40982136", "0.40945834", "0.40840283", "0.4080709", "0.40794298", "0.4069389", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40693486", "0.40647596", "0.40574706", "0.40553275", "0.40515047", "0.40510717", "0.40370443", "0.40368047", "0.4033525", "0.4031083", "0.40069848", "0.4005618", "0.40037045", "0.4002958", "0.39860094", "0.39808005", "0.3969981", "0.39599898", "0.39590976", "0.39534333", "0.3948319", "0.39466837", "0.3938086", "0.39353323", "0.39339358", "0.39323992", "0.39303482", "0.39292127", "0.39254496", "0.39230958", "0.3920716", "0.39199015", "0.39170602", "0.39160693", "0.39143074", "0.39117357", "0.39063272", "0.39001614", "0.38992777", "0.38990936", "0.38989875", "0.38981998", "0.38942495", "0.38922235", "0.38910002", "0.38891938", "0.38881853", "0.38741106", "0.38644117", "0.38589928", "0.38539413", "0.38534722", "0.38495004", "0.38469067", "0.38464552", "0.38433" ]
0.6374434
0
Filter the query by a related \MapSceneStoreCategory object
public function filterByMapSceneStoreCategory($mapSceneStoreCategory, $comparison = null) { if ($mapSceneStoreCategory instanceof \MapSceneStoreCategory) { return $this ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneStoreCategory->getSceneId(), $comparison); } elseif ($mapSceneStoreCategory instanceof ObjectCollection) { return $this ->useMapSceneStoreCategoryQuery() ->filterByPrimaryKeys($mapSceneStoreCategory->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByMapSceneStoreCategory() only accepts arguments of type \MapSceneStoreCategory or Collection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function filterCategory()\n {\n if(empty($this->category) || $this->category === static::FILTER_CATEGORY_NONE) {\n return;\n }\n\n if($this->category === static::FILTER_CATEGORY_OTHER) {\n $this->query->andWhere(['LIKE', 'category', 'yii\\\\']);\n return;\n }\n\n $this->query->andWhere(['category' => $this->category]);\n }", "public function filterCategories ($storeId = Store::DEFAULT_STORE_ID)\n {\n $this->categoryCollection->setStoreId($storeId);\n /** @var Category $category */\n foreach ($this->categoryCollection as $key => $category) {\n $rule = $this->rules->loadByCategory($category);\n if (!$rule->getId() || !$rule->getIsActive()) {\n $this->categoryCollection->removeItemByKey($key);\n }\n }\n }", "function mySearchPostsFilter($query) {\n\tif ($query->is_search) {\n\t\t$query->set('cat','2'); // your category IDs\n\t}\n\treturn $query;\n}", "public function findCategories();", "public function getServerCategories($filter=\"\"){\n $category = new Category;\n return $category->get();\n }", "public function useMapSceneStoreCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapSceneStoreCategory($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapSceneStoreCategory', '\\MapSceneStoreCategoryQuery');\n }", "function only_news_cat($query) {\n\n\t$query->set('category_name', 'News');\n\n\treturn $query;\n\n}", "public function addCategoryFilter($category)\n {\n if ($category instanceof Mage_Catalog_Model_Category) {\n $category = $category->getId();\n }\n if (!isset($this->_joinedFields['category'])) {\n $this->getSelect()->join(\n array('related_category' => $this->getTable('fvets_salesrep/category')),\n 'related_category.salesrep_id = main_table.id',\n array('position')\n );\n\n\t\t\tif (is_array($category)) {\n\t\t\t\t$this->getSelect()->where('related_category.category_id IN (?)', $category);\n\t\t\t} else {\n\t\t\t\t$this->getSelect()->where('related_category.category_id = ?', $category);\n\t\t\t}\n\n $this->_joinedFields['category'] = true;\n }\n return $this;\n }", "public function filteredByCategory(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->where('category_id', $request->category)\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }", "public function addStoreFilter($store)\r\n {\r\n if ($store instanceof Mage_Core_Model_Store) {\r\n $store = array (\r\n $store->getId()\r\n );\r\n }\r\n\r\n $this->getSelect()->join(\r\n array('store_table' => $this->getTable('slider_store')),\r\n 'main_table.slider_id = store_table.slider_id',\r\n array ()\r\n )->where('store_table.store_id in (?)', array (\r\n 0,\r\n $store\r\n ))->group('main_table.slider_id');\r\n\r\n return $this;\r\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(TorneoCategoriaPeer::ID_TORNEO_CATEGORIA, $key, Criteria::EQUAL);\n\t}", "public function getCategoryStores(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n\n $category = Category::find($request->category_id);\n if( !$category ){\n return $this->errorResponse(trans('messages.category.notfound'),null,404);\n }\n \n $city = City::find($request->city_id);\n\n if( !$city ){\n return $this->errorResponse('This City Not Found!',null,404);\n }\n // it is a client ask to search with city only or city and region\n if( !$request->region_id ){\n $city = City::with('stores')->where('id',$request->city_id)->first();\n $stores = $city->stores()->where('category_id',$request->category_id)\n ->where('discount', '!=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false); \n return $this->dataResponse($stores,null,200);\n\n }\n\n $region = Region::where('id',$request->region_id)->where('city_id',$request->city_id)->first();\n if( !$region ){\n return $this->errorResponse(trans('messages.region.notfound'),null,404);\n }\n $branches = Branch::where('region_id',$request->region_id)->get();\n\n $storeResult = [];\n foreach( $branches as $key => $branch ){\n $stores = $branch->store()->where('category_id',$request->category_id)\n ->where('discount', '!=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false);\n foreach ($stores as $singleStore) {\n $storeResult[$key] = $singleStore;\n\n }\n }\n // To ensure that no repeated stores and return these only values in array\n $uiquedStores = array_values(array_unique($storeResult));\n \n return $this->dataResponse($uiquedStores,null,200);\n }", "public function getProductCollectionFromCategoryLeft() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $not_in_array = array_merge($not_in_array_left, $not_in_array_parent);\n\t $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(10)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \t}", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "public function getStoreCategoryFilter($rootcatId)\n {\n $catColl = Mage::getModel('catalog/category')->getCollection()\n ->addFieldToFilter('path', array('like'=>'%/'.$rootcatId.'/%'))\n ->addAttributeToFilter('is_active', 1)\n //->addStoreFilter()\n ;\n\n if ($catColl->getSize()) {\n return implode(',', $catColl->getAllIds());\n } else {\n return '';\n }\n }", "public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }", "public function addStoreToFilter($store)\n\t{\n\t\t$this->getSelect()\n\t\t\t->where('SELECT FIND_IN_SET((?),main_table.store_id)', $store);\n\n\t\treturn $this;\n\t}", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "public function getAllWithCategory();", "public function getCollection($storeId)\n {\n\n if (trim($storeId) == '') {\n return false;\n }\n\n $conditions = array(\n 'r.review_id =detail.review_id',\n $this->_getWriteAdapter()->quoteInto('detail.store_id=?', $storeId)\n );\n\n $this->_select = $this->_getWriteAdapter()->select()\n ->from(array('r' => $this->getMainTable()), array('prod_id' => 'r.entity_pk_value'))\n ->join(\n array('detail' => $this->getTable('review/review_detail')), join(' AND ', $conditions), array())\n ->where('r.status_id =?', 1)\n ->distinct(true);\n\n $this->_addFilter($storeId, 'visibility', Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds(), 'in');\n\n// die((string) ($this->_select));\n\n $query = $this->_getWriteAdapter()->query($this->_select);\n\n return $query;\n }", "public function test_products_can_be_filtered_by_category()\n {\n $products = factory(Product::class, 2)->create();\n \n // and the first proudct has a category\n $products->first()->categories()->save($category = factory(Category::class)->create());\n\n // if we hit our endpoint querying for that category, the product with that category will be returned\n // but the other product will not be present\n $this->json('get', route('products.index', ['category' => $category->slug]))\n ->assertJsonFragment(['slug' => $products->first()->slug])\n ->assertJsonMissing(['name' => $products->last()->name]);\n }", "public function addStoreFilter($storeId)\n {\n $entityInfo = $this->_getAssociatedEntityInfo('store');\n if (!$this->getFlag('is_store_table_joined')) {\n $this->setFlag('is_store_table_joined', true);\n if ($storeId instanceof Mage_Core_Model_Store) {\n $storeId = $storeId->getId();\n }\n\n $subSelect = $this->getConnection()->select()\n ->from(array('store' => $this->getTable($entityInfo['associations_table'])), '')\n ->where('store.' . $entityInfo['entity_id_field'] . ' IN (?)', $storeId);\n $this->getSelect()->exists(\n $subSelect,\n 'main_table.entity_id = store.' . $entityInfo['id_field']\n );\n }\n return $this;\n }", "public function getCategoriesStall(){\n\t\t$this->db->query('SELECT * FROM categories_tbl WHERE type=1');\n\t\treturn $this->db->resultSet();\n\t}", "public function getCategoriesStall(){\n\t\t$this->db->query('SELECT * FROM categories_tbl WHERE type=1');\n\t\treturn $this->db->resultSet();\n\t}", "public function productsBasedOnCategory($category_id){\n $now=Carbon::now();\n $date=$now->toDateString();\n $products=Product::where([['status',1],['sell_by_date','>',$date],['category_id',$category_id]])->get();\n\n /*to be populated in dashboard*/\n $categories=Category::all();\n\n $category=Category::find($category_id);\n return view('products.filter.byCategory',compact('products','categories','category'));\n }", "public function filter()\n\t{\n\t\tif (isset($_GET['cty']) AND (int) $_GET['cty'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$county_id = (int) $_GET['cty'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"county \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $county_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_GET['cst']) AND (int) $_GET['cst'])\n\t\t{\n\t\t\t$db = new Database();\n\n\t\t\t$constituency_id = (int) $_GET['cst'];\n\t\t\t$sql = \"SELECT AsText(geometry) as geometry\n\t\t\t\t\tFROM \".Kohana::config('database.default.table_prefix').\"constituency \n\t\t\t\t\tWHERE id = ?\";\n\t\t\t$query = $db->query($sql, $constituency_id);\n\t\t\t$geometry = FALSE;\n\t\t\tforeach ( $query as $item )\n\t\t\t{\n\t\t\t\t$geometry = $item->geometry;\n\t\t\t}\n\n\t\t\tif ($geometry)\n\t\t\t{\n\t\t\t\t$filter = \" MBRContains(GeomFromText('\".$geometry.\"'), GeomFromText(CONCAT_WS(' ','Point(',l.longitude, l.latitude,')')))\";\n\n\t\t\t\t// Finally add to filters params\n\t\t\t\tarray_push(Event::$data, $filter);\n\t\t\t}\n\t\t}\n\t}", "public function findAllWithLocations()\n {\n $query = $this->createQuery();\n $fieldName = ((bool)ConfigurationUtility::getExtensionConfiguration()['enableFilterCategories']) ? 'filter_categories' : 'categories';\n $query->statement('\n SELECT DISTINCT\n sys_category.*\n FROM\n sys_category\n JOIN\n sys_category_record_mm\n ON sys_category_record_mm.uid_local = sys_category.uid\n WHERE\n sys_category_record_mm.tablenames = \"tx_locationmanager_domain_model_location\" AND\n sys_category_record_mm.fieldname = \"' . $fieldName . '\"\n GROUP BY\n sys_category.uid\n ');\n return $query->execute();\n }", "public function getCategories():ActiveQuery\n {\n return $this\n ->hasMany(Category::class, ['id' => 'categoryId'])\n ->viaTable(CategoryBloc::tableName(), ['blocId' => 'id']);\n }", "function custom_post_type_cat_filter($query) {\n if ( !is_admin() && $query->is_main_query() ) {\n if ($query->is_category()) {\n $query->set( 'post_type', array( 'articles', 'guides', 'conseils' ) );\n }\n }\n}", "public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }", "public function categories() {\n\t\t// sukuria sasaja su Category modeliu:\n\t\treturn $this->hasOne('App\\Category', 'id', 'category');\n\t}", "public function addStoreFilter($store)\n {\n // if (!$this->context->getStoreManager()->isSingleStoreMode()) {\n if ($store instanceof \\Magento\\Store\\Model\\Store) {\n $store = [$store->getId()];\n }\n\n $this->getSelect()\n ->join(\n ['store_table' => $this->getTable('mst_seo_rewrite_store')],\n 'main_table.rewrite_id = store_table.rewrite_id',\n []\n )\n ->where('store_table.store_id in (?)', [0, $store]);\n\n return $this;\n }", "public function getSelectedCategoriesCollection($filter_active = true, $storeId = null)\n {\n $collection = $this->getCategoryInstance()->getCategoryCollection($this, $filter_active);\n\n\t\tif (isset($storeId)) {\n\t\t\t$store = Mage::getModel('core/store')->load($storeId);\n\t\t\t$rootCategoryId = $store->getRootCategoryId();\n\t\t\t$rootpath = Mage::getModel('catalog/category')\n\t\t\t\t->setStoreId($storeId)\n\t\t\t\t->load($rootCategoryId)\n\t\t\t\t->getPath();\n\t\t\t$collection->addAttributeToFilter('path', array(\"like\" => $rootpath . \"/\" . \"%\"));\n\t\t}\n\n return $collection;\n }", "public function filterShopByMap($params)\n {\n $limit = isset($params['page_size']) ? $params['page_size'] : 10;\n $offset = isset($params['page_index']) && $params['page_index'] > 0 ? $this->pagination->getOffsetNumber($params['page_index'], $limit) : 0;\n\n $distance = new GeoDistance(\n 'location',\n [\n 'lat' => $params['latitude'],\n 'lon' => $params['longitude']\n ],\n '20km'\n );\n $query = new \\Elastica\\Query;\n $all = new Query\\MatchAll();\n $query->setPostFilter(new Missing('deletedAt'));\n $query->setQuery(new Query\\Filtered($all, $distance));\n $pagination = $this->storeFinder->createPaginatorAdapter($query);\n $transformedPartialResults = $pagination->getResults($offset, $limit);\n $results= $transformedPartialResults->toArray();\n $total = $transformedPartialResults->getTotalHits();\n return $this->pagination->response($results, $total, $limit, $offset);\n }", "public function filter() {\n if(!empty(request()->category)){\n\n session()->put('filter', $_POST['category']);\n\n }else {\n\n session()->put('filter');\n\n }\n\n return Redirect::to('/producten');\n\n }", "public function categoriesSon()\n {\n return $this->hasMany(self::class);\n }", "public function query(Request $request)\n {\n $results = [];\n\n if (session('storefront_store')) {\n $results = Category::queryWithRequest($request, function (&$query) use ($request) {\n $query->select([DB::raw('public_id as id'), 'public_id', 'uuid', 'parent_uuid', 'icon_file_uuid', 'name', 'description', 'tags', 'translations', 'icon', 'slug', 'created_at'])->where(['owner_uuid' => session('storefront_store'), 'for' => 'storefront_product']);\n\n // only parent categories\n if ($request->has('parents_only')) {\n $query->whereNull('parent_uuid');\n }\n\n // get categories with parent\n if ($request->has('parent')) {\n $query->whereHas('parentCategory', function ($q) use ($request) {\n $q->where('public_id', $request->input('parent'));\n });\n }\n });\n\n // if we want to get categories with products\n if ($request->has('with_products')) {\n // get all category ids\n $categoryIds = $results->map(function ($category) {\n return $category->uuid;\n })->toArray();\n\n // get all products in these categories\n $products = Product::whereIn('category_uuid', $categoryIds)->where('is_available', 1)->with(['addonCategories', 'variants', 'files'])->get();\n\n $results = $results->map(function ($category) use ($products) {\n $category->products = $products->where('category_uuid', $category->uuid)->mapInto(ProductResource::class)->values();\n\n return $category;\n });\n }\n }\n\n if (session('storefront_network')) {\n if ($request->filled('store')) {\n $store = Store::where([\n 'company_uuid' => session('company'),\n 'public_id' => $request->input('store')\n ])->whereHas('networks', function ($q) {\n $q->where('network_uuid', session('storefront_network'));\n })->first();\n\n if ($store) {\n $results = Category::queryWithRequest($request, function (&$query) use ($store, $request) {\n $query->select([DB::raw('public_id as id'), 'public_id', 'uuid', 'parent_uuid', 'icon_file_uuid', 'name', 'icon', 'description', 'tags', 'translations', 'slug', 'created_at'])->where(['owner_uuid' => $store->uuid, 'for' => 'storefront_product']);\n\n // only parent categories\n if ($request->has('parents_only')) {\n $query->whereNull('parent_uuid');\n }\n\n // get categories with parent\n if ($request->has('parent')) {\n $query->whereHas('parentCategory', function ($q) use ($request) {\n $q->where('public_id', $request->input('parent'));\n });\n }\n });\n\n // if we want to get categories with products\n if ($request->has('with_products')) {\n // get all category ids\n $categoryIds = $results->map(function ($category) {\n return $category->uuid;\n })->toArray();\n\n // get all products in these categories\n $products = Product::whereIn('category_uuid', $categoryIds)->where('is_available', 1)->with(['addonCategories', 'variants', 'files'])->get();\n\n $results = $results->map(function ($category) use ($products) {\n // $category->products = Product::where('category_uuid', $category->uuid)->get()->mapInto(ProductResource::class);\n $category->products = $products->where('category_uuid', $category->uuid)->mapInto(ProductResource::class)->values();\n\n return $category;\n });\n }\n }\n } else {\n $results = Category::queryWithRequest($request, function (&$query) use ($request) {\n $query->select([DB::raw('public_id as id'), 'public_id', 'uuid', 'parent_uuid', 'name', 'icon', 'description', 'tags', 'translations', 'slug', 'created_at'])->where(['owner_uuid' => session('storefront_network'), 'for' => 'storefront_network']);\n\n // only parent categories\n if ($request->has('parents_only')) {\n $query->whereNull('parent_uuid');\n }\n\n // get categories with parent\n if ($request->has('parent')) {\n $query->whereHas('parentCategory', function ($q) use ($request) {\n $q->where('public_id', $request->input('parent'));\n });\n }\n });\n\n // if we want to get categories with stores\n if ($request->has('with_stores')) {\n $results = $results->map(function ($category) {\n $category->stores = Store::whereHas('networks', function ($q) use ($category) {\n $q->where('network_uuid', session('storefront_network'));\n $q->where('category_uuid', $category->uuid);\n })->get();\n\n return $category;\n });\n }\n }\n }\n\n return StorefrontCategory::collection($results);\n }", "public function get_product_categories($store_id = \"\",$search=\"\")\n\t{\n\t\t$conditions = \"purchase_count < user_limit_quantity and category.category_status = 1 and store_status = 1 and shop_id = $store_id\";\n\t\tif($search){\n\t\t\t$conditions .= \" and (deal_title like '%\".mysql_real_escape_string($search).\"%'\";\n\t\t\t$conditions .= \" or deal_description like '%\".mysql_real_escape_string($search).\"%')\";\n\t\t}\n\t\tif(CITY_SETTING){ \n\t\t\t$conditions .= \" and stores.city_id = $this->city_id \";\n\t\t}\n\t\t$query = \"select deal_id, deal_key, url_title, deal_title, deal_description, deal_value,category_url from product join stores on stores.store_id=product.shop_id join category on category.category_id=product.category_id where $conditions and product.deal_status = 1 \".$this->club_condition.\" group by product.deal_id order by product.deal_id DESC\"; \n\t\t$result = $this->db->query($query);\n\t \n\t return $result;\n\t}", "public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }", "public function get_deals_categories($store_id = \"\",$search=\"\")\n\t{\n\t\t\n\t\t$conditions = \"deals.shop_id = $store_id and deals.deal_status = 1 \".$this->club_condition.\" and enddate > \".time().\"\";\n\t\t if($search){\n\t\t\t$conditions .= \" and (deal_title like '%\".mysql_real_escape_string($search).\"%'\";\n\t\t\t$conditions .= \" or deal_description like '%\".mysql_real_escape_string($search).\"%')\";\n\t\t}\n\t\tif(CITY_SETTING){ \n\t\t\t$conditions .= \" and stores.city_id = $this->city_id \";\n\t\t\t\n\t $result = $this->db->from(\"deals\")\n\t ->where($conditions)\n ->join(\"stores\",\"stores.store_id\",\"deals.shop_id\")\n ->join(\"city\",\"city.city_id\",\"stores.city_id\")\n ->join(\"country\",\"country.country_id\",\"stores.country_id\")\n ->join(\"users\",\"users.user_id\",\"deals.merchant_id\")\n ->join(\"category\",\"category.category_id\",\"deals.category_id\")\n ->get();\n \n return $result;\n\t\t}else {\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t $n_condition = array(\"shop_id\" => $store_id,\"enddate >\" => time(),\"deal_status\"=>1);\n\t\t\t\t \n\t\t\t\t if($this->club_condition_arr)\n\t\t\t\t \t $n_condition = array(\"shop_id\" => $store_id,\"enddate >\" => time(),\"deal_status\"=>1, \"for_store_cred\" => 0);\n\t\t\t\t \n\t\t\t $result = $this->db->from(\"deals\")\t \n\t ->where($n_condition)//@Live\n ->join(\"stores\",\"stores.store_id\",\"deals.shop_id\")\n ->join(\"users\",\"users.user_id\",\"deals.merchant_id\")\n ->join(\"category\",\"category.category_id\",\"deals.category_id\")\n ->get();\n return $result;\n\t\t}\n\t}", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function findCategotyList($storeId=null,$merchantId=null){\n \n //echo $storeId.\" \".$merchantId;\n $categoryList =$this->find('all',array('fields'=>array('id','name','store_id','start_time','end_time','imgcat','is_meal','has_topping','is_sizeonly'),'conditions'=>array('Category.store_id'=>$storeId,'Category.is_active'=>1,'Category.is_deleted'=>0),'order' => array('name' => 'asc')));\n //echo \"<pre>\";print_r($categoryList);die;\n if($categoryList){\n return $categoryList;\n \n }\n }", "public function scopeFilterCategories($query, $categories)\n {\n return $query->whereHas('categories', function($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }", "protected function _getAllCategoriesForStore()\n {\n $read = Mage::getModel('core/resource')->getConnection('core_read');\n $table = $this->getTableName(\"catalog_category_entity\");\n $sql2 = $read->select()->from($table, array('entity_id', 'path'));\n \n $results = $read->fetchPairs($sql2);\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $categories = array();\n foreach ($results as $entity_id => $path) {\n $path = explode('/', $path);\n if (count($path) > 1) {\n if ($path[1] == $rootCategoryId) {\n $categories[] = $entity_id;\n }\n } else {\n $categories[] = $entity_id;\n }\n }\n \n return $categories;\n }", "public function scopeFilterCategories($query, $categories)\n {\n return $query->whereHas('categories', function ($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }", "public function filter() {\n\t $this->model->filter(array(\"status\"=>array(0,1)));\n\t if(Request::post(\"section\")){\n\t $section = new CmsSection(Request::post(\"section\"));\n\t foreach($section->tree() as $section) $section_ids[] = $section->primval;\n\t $this->model->filter(array(\"cms_section_id\"=>$section_ids));\n }\n\t parent::filter();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t//$collection->getSelect()->joinLeft(array('st' => 'core_store'),'main_table.SiteID = st.store_id',array('storename' => 'st.name'));\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "public function category($categoryname)\n {\n $categories = Category::has('subcategories', '>=','0')->get();\n\n\n $products = Product::whereHas('categories', function($query) use($categoryname){\n $query->where('name', $categoryname);\n })->paginate(6);\n\n\n $categorys = Category::has('subcategories', '>=','0')->where('name','=',$categoryname)->get();\n \n\n $cart = Cart::content();\n\n\n return view('category', ['categorys'=>$categorys, 'categories'=>$categories,'products'=>$products, 'cart'=>$cart]);\n}", "public function get_auction_categories($store_id = \"\",$search=\"\")\n\t{\n\t\t$conditions = \"auction.shop_id = $store_id and auction.deal_status = 1 \".$this->club_condition.\" and enddate > \".time().\"\";\n\t\t if($search){\n\t\t\t$conditions .= \" and (deal_title like '%\".mysql_real_escape_string($search).\"%'\";\n\t\t\t$conditions .= \" or deal_description like '%\".mysql_real_escape_string($search).\"%')\";\n\t\t}\n\t\tif(CITY_SETTING){ \n\t\t\t$conditions .= \" and stores.city_id = $this->city_id \"; \t\t\n\t $result = $this->db->from(\"auction\")\n\t ->where($conditions)\n ->join(\"stores\",\"stores.store_id\",\"auction.shop_id\")\n ->join(\"city\",\"city.city_id\",\"stores.city_id\")\n ->join(\"country\",\"country.country_id\",\"stores.country_id\")\n ->join(\"users\",\"users.user_id\",\"auction.merchant_id\")\n ->join(\"category\",\"category.category_id\",\"auction.category_id\")\n ->get();\n return $result;\n\t\t}else {\n\t\t\t$n_condition = array(\"shop_id\" => $store_id,\"enddate >\" => time(),\"deal_status\"=>1);\n\t\t\t\n\t\t\tif($this->club_condition_arr)\n\t\t\t\t$n_condition = array(\"shop_id\" => $store_id,\"enddate >\" => time(),\"deal_status\"=>1, \"auction.for_store_cred\" => 0);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t $result = $this->db->from(\"auction\")\n\t\t\t->where($n_condition)//@Live\n\t\t\t->join(\"stores\",\"stores.store_id\",\"auction.shop_id\")\n\t\t\t->join(\"users\",\"users.user_id\",\"auction.merchant_id\")\n\t\t\t->join(\"category\",\"category.category_id\",\"auction.category_id\")\n\t\t\t->get();\n\t\t\treturn $result;\n\t\t}\n\t}", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "public function categories() {\n return $this->belongsToMany('App\\PodcastMetaData', 'podcast_metas', 'podcast_id', 'meta_id')->where('meta_type', 'podcast_category');\n }", "public function addFacetCondition()\n {\n $category = $this->getCategory();\n\n Mage::dispatchEvent('category_filter_add_facet_to_collection_before', array('filter' => $this, 'category' => $category));\n\n if (!$this->getProductCollectionFacetSet()) {\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $options = array('script_field' => 'doc.categories.values + doc.show_in_categories.values');\n $query->addFacet('categories', 'terms', $options);\n }\n\n return $this;\n }", "protected function getCategoryFilter($categories = [])\n {\n $filter = new BoolQuery;\n\n foreach ($categories as $value) {\n $cat = new NestedQuery();\n $cat->setPath('departments');\n\n $term = new Term;\n $term->setTerm('departments.id', $value);\n\n $cat->setQuery($term);\n\n $filter->addMust($cat);\n $this->categories[] = $value;\n }\n\n return $filter;\n }", "public function getCategories()\n {\n return Category::all();\n }", "public function getProductCollectionFromCategoryBottom() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromFourRow();\n $not_in_array_right = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $custom_array = array(2202,2354,2161);\n $not_in_array = array_merge($not_in_array_left, $not_in_array_right,$not_in_array_parent,$custom_array);\n $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(20)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \n \t}", "public function getVisibleProductCollection($category){\n $layer = $this->getLayer();\n $layer->setCurrentCategory($category);\n return $layer->getProductCollection();\n }", "public function getFilteredSubCategoriesForListing(ProductCategory $product_category);", "public function autocomplete()\n {\n $items = Category::orderBy('parent_id', 'ASC');\n\n $items->whereHas('translation', function ($query) {\n if (Request::filled('keyword')) {\n $query->where('title', 'LIKE', '%' . Request::input('keyword') . '%');\n } else {\n $query->where('parent_id', 0);\n }\n });\n\n\n /**\n * Content type filter\n */\n if (Request::filled('content_type_id')) {\n $items->where('content_type_id', (int) Request::input('content_type_id'));\n }\n\n\n /**\n * Query\n */\n $items = $items->paginate(5);\n\n\n /**\n * Response structure\n */\n return CategoryAutocompleteResource::collection($items);\n }", "public function findAllCategories(): iterable;", "public function getCategories();", "public function getCategories();", "public function categories() {\n return $this->belongsTo(\"Category\", \"category_id\", \"id\");\n }", "public function testCategoriesAreFilteredByParent()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $visibleCategory->parent()->associate(factory(Category::class)->create());\n $visibleCategory->save();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.parent_id]='.$visibleCategory->parent->id)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function findBySlugWithCategory($slug);", "public function categories()\n {\n $categories = Category::all();\n $supermarket_categories = [];\n\n foreach($categories as $category) {\n if($category->products->where('supermarket_id', $this->id)->count()) {\n $supermarket_categories[] = $category;\n } \n }\n \n return collect($supermarket_categories);\n }", "protected function _renderFiltersBefore()\r\n {\r\n if ($this->getFilter('stores')) {\r\n $this->getSelect()->join(\r\n array('store_table' => $this->getTable('imaginato_contacts/enquerytypestoreview')),\r\n 'main_table.entity_id = store_table.enquery_type_id',\r\n array()\r\n );\r\n\r\n /*\r\n * Allow analytic functions usage because of one field grouping\r\n */\r\n $this->_useAnalyticFunction = true;\r\n }\r\n return parent::_renderFiltersBefore();\r\n }", "public static function getCMSCategoriesByLocation($location, $id_shop = false)\n\t{\n\t}", "public function findAllCategotyList($storeId = null, $merchantId = null) {\n\n //echo $storeId.\" \".$merchantId;\n $categoryList = $this->find('all', array('fields' => array('is_active', 'position', 'id', 'name', 'store_id', 'start_time', 'end_time', 'imgcat', 'is_meal', 'has_topping', 'is_sizeonly'), 'conditions' => array('Category.store_id' => $storeId, 'Category.is_deleted' => 0), 'order' => array('position' => 'asc')));\n //echo \"<pre>\";print_r($categoryList);die;\n if ($categoryList) {\n return $categoryList;\n }\n }", "public function search($params)\r\n {\r\n $query = Property::find();\r\n $query->joinWith(['propertyCategory' => function($q) {\r\n $q->from(Yii::$app->db->tablePrefix . 'property_category c');\r\n }]);\r\n $query\t->from(Yii::$app->db->tablePrefix . 'property p')\r\n ->join('LEFT OUTER JOIN', 'mls_user u', 'p.user_id =u.id')\r\n ->join('LEFT OUTER JOIN', 'mls_profile pr','u.profile_id = pr.id'); \r\n \r\n //$query->joinWith('propertyCategory');\r\n // add conditions that should always apply here\r\n// $query = $query->createCommand();\r\n// $query = $query->queryAll();\t\r\n //\\yii\\helpers\\VarDumper::dump($data,4,12); exit;\r\n $dataProvider = new ActiveDataProvider([\r\n 'query' => $query,\r\n 'sort'=> ['defaultOrder' => ['id' => SORT_DESC]]\r\n \r\n ]);\r\n\r\n \r\n $this->load($params);\r\n\r\n \r\n if(!\\frontend\\helpers\\AuthHelper::is('admin')){\r\n $query->andWhere(['OR',\r\n ['is_multi_units_apt' => 0],\r\n ['AND', ['is_multi_units_apt'=> 1], ['is not', 'parent_id', new Expression('NULL')]]\r\n ]);\r\n }\r\n \r\n \r\n \r\n// \\yii\\helpers\\VarDumper::dump($this->categoryName); exit;\r\n // grid filtering conditions\r\n $query->andFilterWhere([\r\n 'id' => $this->id,\r\n //'property_category_id' => $this->categoryName,\r\n 'is_condo' => $this->is_condo,\r\n 'user_id' => $this->user_id,\r\n 'lat' => $this->lat,\r\n 'lng' => $this->lng,\r\n 'metric_type_id' => $this->metric_type_id,\r\n 'lot_size' => $this->lot_size,\r\n 'no_of_room' => $this->no_of_room,\r\n 'no_of_toilet' => $this->no_of_toilet,\r\n 'no_of_bathroom' => $this->no_of_bathroom,\r\n 'price' => $this->price,\r\n 'property_category_id' => $this->property_category_id,\r\n 'is_seller_information_show' => $this->is_seller_information_show,\r\n 'created_by' => $this->created_by,\r\n 'updated_by' => $this->updated_by,\r\n 'created_at' => $this->created_at,\r\n 'updated_at' => $this->updated_at,\r\n 'market_status' => $this->market_status,\r\n 'profile_id' => $this->profile_id,\r\n ]);\r\n\r\n $query->andFilterWhere(['like', 'title', $this->title])\r\n ->andFilterWhere(['like', 'reference_id', $this->reference_id]) \r\n ->andFilterWhere(['like', 'description', $this->description])\r\n ->andFilterWhere(['like', 'country', $this->country])\r\n ->andFilterWhere(['like', 'state', $this->state])\r\n ->andFilterWhere(['like', 'town', $this->town])\r\n ->andFilterWhere(['like', 'currency', $this->currency])\r\n ->andFilterWhere(['like', 'currency_symbol', $this->currency_symbol])\r\n ->andFilterWhere(['or', ['like', 'c.title', $this->categoryName]]);\r\n \r\n $query->andFilterWhere(['or', \r\n ['like', 'p.title', $this->keyword],\r\n ['like', 'p.town', $this->keyword],\r\n ['like', 'p.description', $this->keyword],\r\n ['like', 'p.state', $this->keyword],\r\n ['like', 'p.district', $this->keyword],\r\n \r\n ]);\r\n \r\n \r\n /**\r\n * Setup your sorting attributes\r\n * Note: This is setup before the $this->load($params) \r\n * statement below\r\n */\r\n// $dataProvider->setSort([\r\n// \r\n// 'attributes' => [\r\n// 'reference_id',\r\n// 'agentID' => [\r\n// 'asc' => ['u.agentID' => SORT_ASC],\r\n// 'desc' => ['u.agentID' => SORT_DESC],\r\n// 'label' => 'Agent ID',\r\n// 'default' => SORT_ASC\r\n// ],\r\n// 'user_id'=> [\r\n// 'asc' => ['u.first_name' => SORT_ASC],\r\n// 'desc' => ['u.first_name' => SORT_DESC],\r\n// 'default' => SORT_ASC\r\n// ],\r\n// 'property_category_id' => [\r\n// 'asc' => ['c.title' => SORT_ASC],\r\n// 'desc' => ['c.title' => SORT_DESC],\r\n// 'default' => SORT_ASC\r\n// ],\r\n// 'profile_id',\r\n// 'price',\r\n// 'town',\r\n// 'market_status',\r\n// 'lot_size',\r\n// 'listed_date',\r\n// 'expired_date',\r\n// ],\r\n// \r\n// ]);\r\n \r\n// echo $query->createCommand()->rawSql;die();\r\n return $dataProvider;\r\n }", "public function prepareProductCollection ($storeId)\n\t{\n\t\t$collection = parent::prepareProductCollection($storeId);\n\n\t\tMage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);\n\t\tMage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);\n\n\t\treturn $collection;\n\t}", "public function filterByMapPersonaScene($mapPersonaScene, $comparison = null)\n {\n if ($mapPersonaScene instanceof \\MapPersonaScene) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapPersonaScene->getSceneId(), $comparison);\n } elseif ($mapPersonaScene instanceof ObjectCollection) {\n return $this\n ->useMapPersonaSceneQuery()\n ->filterByPrimaryKeys($mapPersonaScene->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapPersonaScene() only accepts arguments of type \\MapPersonaScene or Collection');\n }\n }", "public function getCategoriesForListView(): Collection;", "public function getCategoryVouchers(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n\n $category = Category::find($request->category_id);\n if( !$category ){\n return $this->errorResponse(trans('messages.category.notfound'),null,404);\n }\n \n $city = City::find($request->city_id);\n\n if( !$city ){\n return $this->errorResponse(trans('messages.city.notfound'),null,404);\n }\n // it is a client ask to search with city only or city and region\n if( !$request->region_id ){\n $city = City::where('id',$request->city_id)->first();\n $stores = $city->stores()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang( $language, $stores, false);\n $stores = $stores->map(function ($item) use($language) {\n $vouchers = $item->vouchers;\n $vouchers = $this->toLang( $language, $vouchers, false);\n return $item;\n\n });\n return $this->dataResponse($stores,null,200);\n\n }\n\n $region = Region::where('id',$request->region_id)->where('city_id',$request->city_id)->first();\n if( !$region ){\n return $this->errorResponse(trans('messages.region.notfound'),null,404);\n }\n $branches = Branch::where('region_id',$request->region_id)->get();\n\n $storeResult = [];\n foreach( $branches as $key => $branch ){\n $stores = $branch->store()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false);\n foreach ($stores as $singleStore) {\n\n $vouchers = $singleStore->vouchers;\n $vouchers = $this->toLang($language,$vouchers,false);\n $storeResult[$key] = $singleStore;\n\n }\n }\n // To ensure that no repeated stores and return these only values in array\n $uiquedStores = array_values(array_unique($storeResult));\n \n return $this->dataResponse($uiquedStores,null,200);\n }", "public function categories()\n {\n // the passed URL path segments in the request.\n $categories = $this->request->getParam('pass');\n\n $posts = $this->Posts->find('categorized', [\n 'categories' => $categories\n ]);\n\n $this->set(['posts' => $posts, 'categories' => $categories]);\n\n }", "protected function getActiveCategories()\n {\n $categories = (new \\modules\\catalog\\categories\\CatalogCategories($this->_config));\n return $categories->setSubquery(' AND `statusId` = ?d', 1);\n }", "function filterByCategory ($filter = null, $results = [])\n{\n $items = makeList($results);\n if ($filter == null) return $items;\n $new = [];\n foreach ($items as $key => $item) {\n $filter = strtolower($filter);\n $target = strtolower($item->category);\n if (stripos($target, $filter) > -1 ) {\n $new[] = $item;\n }\n }\n return $new;\n}", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "public function filter_category() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_POST['rank_math_filter_redirections_top'] ) && ! isset( $_POST['rank_math_filter_redirections_bottom'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! Helper::has_cap( 'redirections' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$category_filter = isset( $_POST['rank_math_filter_redirections_top'] ) ? $_POST['redirection_category_filter_top'] : $_POST['redirection_category_filter_bottom'];\n\t\tif ( ! $category_filter || 'none' === $category_filter ) {\n\t\t\twp_safe_redirect( Helper::get_admin_url( 'redirections' ) );\n\t\t\texit;\n\t\t}\n\n\t\twp_safe_redirect( Helper::get_admin_url( 'redirections', [ 'redirection_category' => $category_filter ] ) );\n\t\texit;\n\t}", "public function getShopCategories(Request $request){\n // check params \n if(!$this->requiredParams($request, ['key'])){\n return response()->json(['status' => 'error' , 'message' => 'missing params' ] , 400);\n }\n\n $key = $this->checkParam($request->key);\n if ($key !== self::KEY) {\n return response()->json(['status' => 'error' , 'message' => 'invalid request' ] , 400);\n }\n\n $shop_id = $this->checkParam($request->shop_id);\n\n $shop_categories = Scategory::with('shopCategory.shop')->whereHas('shopCategory', function ($query) use($shop_id) {\n $query->where('shop_id',$shop_id);\n })->get();\n return response()->json(['status' => 'success' , 'message' => 'OK', 'data' => $shop_categories] , 200);\n\n }", "public function productCategoryMap(){\n\t\treturn $this->hasOne('App\\ProductCategoryMaps','product_id');\n\t}", "public function search($category)\n {\n // but if the criteria title is specified, we use it\n \n $boolQuery = new \\Elastica\\Query\\Bool();\n /*Fetch only VALIDATED place*/\n $queryStatus = new \\Elastica\\Query\\Match();\n $queryStatus->setFieldQuery('event.status', StatusType::VALIDATED);\n $boolQuery->addMust($queryStatus);\n \n if($category !== null){\n $queryCategory = new \\Elastica\\Query\\Match();\n $queryCategory->setFieldQuery('event.categories.slug', $category);\n $boolQuery->addMust($queryCategory);\n } \n \n// if($placeSearch->getBirthdayDiscount() != null && $placeSearch->getBirthdayDiscount() > 0 ){\n// $queryRange = new \\Elastica\\Query\\Range();\n// $queryRange->setParam('place.birthdayDiscount', ['gte' => 1]);\n// $boolQuery->addMust($queryRange);\n// }\n// \n// if(($placeSearch->getName() != null || $placeSearch->getCategories() != null ) && $placeSearch != null){\n// \n// if($placeSearch->getName() != null){\n// $query = new \\Elastica\\Query\\Match();\n// $query->setFieldQuery('place.name', $placeSearch->getName());\n// $query->setFieldFuzziness('place.name', 1);\n// $query->setFieldMinimumShouldMatch('place.name', '10%');\n// $boolQuery->addMust($query);\n// }\n// \n// if($placeSearch->getCategories() != null){ \n// foreach ($placeSearch->getCategories() as $cat){ \n// $categories[] = $cat->getName(); \n// }\n// $queryCategories = new \\Elastica\\Query\\Terms();\n// $queryCategories->setTerms('place.categories', $categories);\n// $boolQuery->addShould($queryCategories);\n// }\n// \n //} \n else {\n $query = new \\Elastica\\Query\\MatchAll();\n }\n $baseQuery = $boolQuery; \n\n // then we create filters depending on the chosen criterias\n $boolFilter = new \\Elastica\\Filter\\Bool();\n\n /*\n Dates filter\n We add this filter only the getIspublished filter is not at \"false\"\n */\n// if(\"false\" != $articleSearch->getIsPublished()\n// && null !== $articleSearch->getDateFrom()\n// && null !== $articleSearch->getDateTo())\n// {\n// $boolFilter->addMust(new \\Elastica\\Filter\\Range('publishedAt',\n// array(\n// 'gte' => \\Elastica\\Util::convertDate($articleSearch->getDateFrom()->getTimestamp()),\n// 'lte' => \\Elastica\\Util::convertDate($articleSearch->getDateTo()->getTimestamp())\n// )\n// ));\n// }\n//\n // Published or not filter\n// if($placeSearch->getIs24h() !== null && $placeSearch->getIs24h()){\n// //var_dump($placeSearch->getIs24h());die();\n// $boolFilter->addMust(\n// new \\Elastica\\Filter\\Term(['is24h' => $placeSearch->getIs24h()])\n// //new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// ); \n// \n// //$boolFilter->addMust('is24h', $placeSearch->getIs24h());\n// }\n// \n// if($placeSearch->getIsWifi() !== null && $placeSearch->getIsWifi()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// );\n// }\n// \n// if($placeSearch->getIsDelivery() !== null && $placeSearch->getIsDelivery()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isDelivery' => $placeSearch->getIsDelivery()]) \n// );\n// } \n\n $filtered = new \\Elastica\\Query\\Filtered($baseQuery, $boolFilter);\n\n $query = \\Elastica\\Query::create($filtered);\n\n return $this->find($query);\n }", "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "private function _getBaseSearchQuery()\n {\n $store = Mage::app()->getStore($this->getStoreId());\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection();\n\n $allowedVisibilities = Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds();\n $allowedStatuses = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();\n\n $query = $collection->getSearchEngineQuery()\n ->addFilter('terms', array('visibility' => $allowedVisibilities))\n ->addFilter('terms', array('status' => $allowedStatuses));\n\n if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {\n $query->addFilter('terms', array('store_id' => $this->getStoreId()));\n }\n\n // Append the query string for the virtual categories\n if ($rule = $this->getCategory()->getVirtualRulePreview()) {\n $queryString = $this->_getQueryStringFromRule($rule);\n $query->addFilter('query', array('query_string' => $queryString));\n }\n\n $query = $query->setLanguageCode(Mage::helper('smile_elasticsearch')->getLanguageCodeByStore($store));\n\n $query->setQueryType(\"category_products_layer\");\n\n // Mimic query assembling, because ->search() is never really called on it\n $eventData = new Varien_Object(\n array('query' => $query->getRawQuery(), 'query_type' => $query->getQueryType(), 'store_id' => $this->getStoreId())\n );\n Mage::dispatchEvent('smile_elasticsearch_query_assembled', array('query_data' => $eventData));\n\n $query = $eventData->getQuery();\n\n return $query;\n }", "protected function _renderFiltersBefore()\r\n {\r\n if ($this->getFilter('stores')) {\r\n $this->getSelect()->join(\r\n array('store_table' => $this->getTable('imaginato_contacts/enqueriesstoreview')),\r\n 'main_table.entity_id = store_table.enquery_id',\r\n array()\r\n );\r\n\r\n /*\r\n * Allow analytic functions usage because of one field grouping\r\n */\r\n $this->_useAnalyticFunction = true;\r\n }\r\n return parent::_renderFiltersBefore();\r\n }", "public function query(Category $model)\n {\n return $model->newQuery();\n }", "public function findCategotyList($storeId = null, $merchantId = null) {\n\n //echo $storeId.\" \".$merchantId;\n $categoryList = $this->find('all', array('recursive' => 3, 'fields' => array('is_active', 'position', 'id', 'name', 'store_id', 'start_time', 'end_time', 'imgcat', 'is_meal', 'days', 'has_topping', 'is_sizeonly', 'is_mandatory'), 'conditions' => array('Category.store_id' => $storeId, 'Category.is_active' => 1, 'Category.is_deleted' => 0), 'order' => array('position' => 'asc')));\n //echo \"<pre>\";print_r($categoryList);die;\n if ($categoryList) {\n return $categoryList;\n }\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category', 'categories_games', 'game_id', 'categorie_id');\n }", "public function subcategories(){\n return $this->hasMany(Category::class,'parent_category_id')->where('hidden', 0);\n }", "abstract public function filter(Builder $dataSource);", "public static function find()\n\t{\n\t\treturn new ArticleCategoryQuery(get_called_class());\n\t}", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "private function filterDatabaseCategoryToArray()\n {\n\n $dbCategory = Category::all(['id', 'name']);\n //dd($dbTags);\n $category = [];\n foreach ($dbCategory as $t) {\n //I've placed the name as the key in case of additional checking\n $category[$t->name] = $t->id;\n }\n\n return $category;\n }", "public function categories()\n {\n return $this->belongsTo(Category::class);\n }", "public function findByIdWithCategory($id);", "function get_product_category_filters($data) {\n $category_id = $data['category_id'];\n // Return category filters object\n return (object) [\n 'attributes' => get_product_category_attribute_terms($category_id),\n 'subcategories' => get_product_category_subcategories($category_id),\n 'price' => get_product_category_price_min_max($category_id)\n ];\n}", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "protected function _addColumnFilterToCollection($column)\n {\n if ($column->getId() == 'in_category') {\n $productIds = $this->_getSelectedProducts();\n if (empty($productIds)) {\n $productIds = 0;\n }\n if ($column->getFilter()->getValue()) {\n $this->getCollection()->addFieldToFilter('entity_id', array('in'=>$productIds));\n }\n elseif(!empty($productIds)) {\n $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>$productIds));\n }\n }\n else {\n parent::_addColumnFilterToCollection($column);\n }\n return $this;\n }", "public function getCategory() {}", "public function searchProductosCategoria($value){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1 and producto.nombre LIKE ?';\n $params=array($this->categoria,\"%$value%\");\n return Database::getRows($sql, $params);\n }", "public function getSelectedStore(){\n $data = $this->Stores->find()->contain([\n 'Brands' => function($q){\n return $q->select(['id','client_id','brand_name'])->contain([\n 'Clients' => function($q){\n return $q->select(['name','contact_no']);\n }\n ]);\n }\n ])->select([\n 'id','brand_id','name','is_customer_feedback','is_appdata','is_analytics','is_mall'\n ])->where([\n 'Stores.id' => $this->_appSession->read('App.selectedStoreID')\n ])->first();\n $this->set('data',$data);\n $this->set('_serialize',['data']);\n }" ]
[ "0.61245316", "0.5795205", "0.54388833", "0.54080635", "0.5310324", "0.53037584", "0.51992697", "0.515857", "0.5082083", "0.50504464", "0.5037116", "0.50092435", "0.49543518", "0.49331468", "0.49144766", "0.49113852", "0.49043414", "0.48971942", "0.48949262", "0.4886244", "0.48625565", "0.48599786", "0.48432717", "0.48432717", "0.483956", "0.4826621", "0.48151407", "0.479343", "0.47814792", "0.4778931", "0.4767074", "0.47537518", "0.47497815", "0.4738001", "0.47369927", "0.47329852", "0.47258517", "0.4725369", "0.4725044", "0.47137123", "0.4711635", "0.4701742", "0.4700859", "0.46984774", "0.46903342", "0.46793568", "0.46660855", "0.4660583", "0.46575874", "0.4651255", "0.46511534", "0.46506017", "0.46345574", "0.46337137", "0.4633356", "0.46315077", "0.4624631", "0.4623773", "0.46190205", "0.46131575", "0.46131575", "0.46105802", "0.4599789", "0.45989025", "0.45903555", "0.45886734", "0.45875224", "0.4578548", "0.45739424", "0.4570963", "0.45596206", "0.45590553", "0.45579633", "0.45570773", "0.45561013", "0.45556435", "0.4555603", "0.4549437", "0.45487118", "0.45445305", "0.45380315", "0.4534346", "0.45330533", "0.45319462", "0.45313862", "0.45264906", "0.45238358", "0.45236236", "0.45208532", "0.4517453", "0.45166185", "0.45160204", "0.45160124", "0.45129907", "0.45088512", "0.45056185", "0.45037672", "0.45009494", "0.4497793", "0.44974747" ]
0.6510042
0
Adds a JOIN clause to the query using the MapSceneStoreCategory relation
public function joinMapSceneStoreCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('MapSceneStoreCategory'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'MapSceneStoreCategory'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useMapSceneStoreCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinMapSceneStoreCategory($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'MapSceneStoreCategory', '\\MapSceneStoreCategoryQuery');\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }", "function joinQuery()\n {\n }", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "protected function joinStoreRelationTable(string $tableName, ?string $linkField): void\n {\n if ($this->getFilter('store')) {\n $this->getSelect()->joinLeft(\n ['store_table' => $this->getTable($tableName)],\n 'main_table.' . $this->getIdFieldName() . ' = store_table.' . $linkField,\n []\n )->group(\n 'main_table.' . $this->getIdFieldName()\n );\n }\n }", "public function addCategoryFilter($category)\n {\n if ($category instanceof Mage_Catalog_Model_Category) {\n $category = $category->getId();\n }\n if (!isset($this->_joinedFields['category'])) {\n $this->getSelect()->join(\n array('related_category' => $this->getTable('fvets_salesrep/category')),\n 'related_category.salesrep_id = main_table.id',\n array('position')\n );\n\n\t\t\tif (is_array($category)) {\n\t\t\t\t$this->getSelect()->where('related_category.category_id IN (?)', $category);\n\t\t\t} else {\n\t\t\t\t$this->getSelect()->where('related_category.category_id = ?', $category);\n\t\t\t}\n\n $this->_joinedFields['category'] = true;\n }\n return $this;\n }", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('oggetto_news/category_news')),\n 'related.news_id = main_table.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "protected function productsAll()\n\t{\n\t\t$this->adapter->joinLeftCategoryFlat();\n\t\t$this->adapter->joinTaxonomy();\n\t\t$this->adapter->joinParentCategory();\t\t\t\t\t\t\n\t}", "public function filterByMapSceneStoreCategory($mapSceneStoreCategory, $comparison = null)\n {\n if ($mapSceneStoreCategory instanceof \\MapSceneStoreCategory) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneStoreCategory->getSceneId(), $comparison);\n } elseif ($mapSceneStoreCategory instanceof ObjectCollection) {\n return $this\n ->useMapSceneStoreCategoryQuery()\n ->filterByPrimaryKeys($mapSceneStoreCategory->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneStoreCategory() only accepts arguments of type \\MapSceneStoreCategory or Collection');\n }\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function SQOfrag_AddJoins_forCatNum(fcSQL_Query $qo) {\n\t$sroDept = $this->SourceDepartments();\n\t$sroSupp = $this->SourceSuppliers();\n\t$qo->Select()->Source()->AddElements(\n\t array(\n\t new fcSQL_JoinElement($sroDept,'t.ID_Dept=d.ID'),\n\t new fcSQL_JoinElement($sroSupp,'t.ID_Supp=s.ID')\n\t )\n\t );\n\t$qo->Select()->Fields()->SetFields($this->Fields_all_forCompile_array());\n }", "public function joinSouscategorie($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Souscategorie');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Souscategorie');\n }\n\n return $this;\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "public function joinMapSceneRewcat($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapSceneRewcat');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapSceneRewcat');\n }\n\n return $this;\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function getarchives_join( $join, $r ) {\n\t\tglobal $wpdb;\n\t\t$this->get_archives_where_r = $r;\n\t\tif(isset($r['taxonomy']) && is_array($r['taxonomy']) )\n\t\t$join = $join . \" INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\";\n\n\t\treturn $join;\n\t}", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "public function joinCategoria($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Categoria');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Categoria');\n\t\t}\n\n\t\treturn $this;\n\t}", "public function joinCategoria($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Categoria');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Categoria');\n\t\t}\n\n\t\treturn $this;\n\t}", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "abstract public function join($alias_from, $rel_name, $alias_to);", "public function getCategories():ActiveQuery\n {\n return $this\n ->hasMany(Category::class, ['id' => 'categoryId'])\n ->viaTable(CategoryBloc::tableName(), ['blocId' => 'id']);\n }", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }", "public function get_post_joined_with_category(){\n $db = \\Config\\Database::connect();\n $builder = $db->table('posts');\n $builder->select('posts.id, posts.category_id, posts.title, posts.slug, posts.body, posts.created_at, categories.name');\n $builder->orderBy('posts.id', 'DESC');\n $builder->join('categories', 'posts.category_id = categories.id');\n $query = $builder->get();\n $results = $query->getResult();\n \n return $results;\n }", "protected static function _category_query_base($query, $special_mode=false)\n {\n $query\n ->from(\"products\")\n ->join(\"product_data\")->on(\"products.id\",\"=\",\"product_data.product_id\") \n ->join(\"product_categories_products\")->on(\"products.id\",\"=\",\"product_categories_products.product_id\")\n ->join(\"product_categories\")->on(\"product_categories_products.product_category_id\",\"=\",\"product_categories.id\")\n ->join(\"product_category_data\")->on(\"product_categories.id\",\"=\",\"product_category_data.product_category_id\")\n //->join(\"routes\")->on(\"product_category_data.route_id\",\"=\",\"routes.id\")\n ;\n \n switch ($special_mode) {\n case \"left_join_favorites\":\n $shopper_id=Service_User::instance()->get_user()->id;\n $query->join(\"shopper_favorite_products\",\"LEFT\")->on(\"products.id\",\"=\",\"shopper_favorite_products.product_id\")->on(\"shopper_favorite_products.shopper_id\",\"=\",db::expr($shopper_id));\n break;\n case \"join_favorites\":\n $shopper_id=Service_User::instance()->get_user()->id;\n $query->join(\"shopper_favorite_products\")->on(\"products.id\",\"=\",\"shopper_favorite_products.product_id\")->on(\"shopper_favorite_products.shopper_id\",\"=\",db::expr($shopper_id));\n break;\n \n default:\n break;\n }\n \n \n return $query;\n\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "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 getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "function wc_tab_manager_tabs_posts_join( $join, $query ) {\n\tglobal $wpdb, $typenow;\n\n\tif ( 'wc_product_tab' === $typenow ) {\n\t\t$join .= \" JOIN {$wpdb->posts} AS product_parents ON ( {$wpdb->posts}.post_parent = 0 OR ( {$wpdb->posts}.post_parent = product_parents.ID AND product_parents.post_status != 'trash' ) )\";\n\t}\n\n\treturn $join;\n}", "public function basic_join_setup()\r\n {\r\n \r\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "public function joinTableToSelect(Varien_Db_Select $select, $storeId)\n {\n\t\tif ($this->_useDefaultUrlSettings) {\n\t\t\treturn parent::joinTableToSelect($select, $storeId);\n\t\t}\n\n\t\t$rewriteIds = $this->_connection->fetchCol($this->_getNestedQuery($storeId));\n\n\t\t$select->joinLeft(\n\t\t\tarray('url_rewrite' => $this->_resource->getTableName('core/url_rewrite')),\n\t\t\t'url_rewrite.product_id = main_table.entity_id AND ' .\n\t\t\t$this->_connection->quoteInto('url_rewrite.url_rewrite_id IN (?)', $rewriteIds),\n\t\t\tarray('request_path' => 'url_rewrite.request_path'));\n\t\treturn $this;\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function joinCategoria($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Categoria');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Categoria');\n }\n\n return $this;\n }", "public function addCurrentStore()\r\n {\r\n $this->addFieldToFilter(\"main_table.store_id\", 0);\r\n \r\n $labelExpr = $this->getSelect()->getAdapter()\r\n ->getIfNullSql('store.value', 'main_table.value');\r\n $joinCondition = $this->getConnection()\r\n ->quoteInto(\r\n 'main_table.attribute_id = store.attribute_id AND store.store_id = ?', \r\n (int)Mage::app()->getStore()->getId());\r\n $this->getSelect()->joinLeft(\r\n array('store' => $this->getMainTable()),\r\n $joinCondition,\r\n array('store_value' => $labelExpr)\r\n );\r\n \r\n return $this;\r\n }", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function scopeModelJoin($query, $relation_name, $operator = '=', $type = 'left', $where = false) {\n $relation = $this->$relation_name();\n $table = $relation->getRelated()->getTable();\n if ($relation instanceof BelongsTo) {\n //this tables key pointing to remote table\n $one = $this->getTable() . \".\" . $relation->getForeignKey();\n //remote table primary key\n $two = $relation->getRelated()->getQualifiedKeyName();\n } else { //HasMany or HasOne\n //current table id column\n $one = $relation->getParent()->getQualifiedKeyName();\n //remote table column related to this id\n $two = $relation->getForeignKey();\n }\n //counties.state_id = state.id\n if (empty($query->columns)) {\n $query->select($this->getTable().\".*\");\n }\n\n //$join_alias = $table;\n $prefix = $query->getQuery()->getGrammar()->getTablePrefix();\n $join_alias = $relation_name;\n foreach (\\Schema::getColumnListing($table) as $related_column) {\n $query->addSelect(\\DB::raw(\"`$prefix$join_alias`.`$related_column` AS `$join_alias.$related_column`\"));\n }\n $two = str_replace($table . \".\", $join_alias . \".\", $two);\n return $query->join(\"$table AS $prefix$relation_name\", $one, $operator, $two, $type, $where); //->with($relation_name);\n\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "public function useSouscategorieQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinSouscategorie($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Souscategorie', '\\SouscategorieQuery');\n }", "protected function append_product_sorting_table_join( $sql ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! strstr( $sql, 'wc_product_meta_lookup' ) ) {\n\t\t\t$sql .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\t\treturn $sql;\n\t}", "function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "public static function datatables()\n {\n // ->join('categories','directories.category_id','=','categories.id')\n // ->leftJoin('users','directories.user_id','=','users.id')\n // ->leftJoin('provinces','directories.province_id','=','provinces.id')\n // ->leftJoin('cities','directories.city_id','=','cities.id');\n }", "public function addJoinWithVariables($type, $modelName, $alias, $condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addJoinWithVariables($type, $modelName, $alias, $condition, array());\n }", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "function getAlldata(){\n return db()->query(\"SELECT * FROM categories INNER JOIN travels ON categories.categoryID = travels.categoryID\");\n }", "function _add_where_clause($where_clauses, $join)\n {\n foreach ($where_clauses as $clause) {\n // $clause => array(\n // 'column' => 'ID',\n // 'value' =>\t1210,\n // 'compare' => '='\n // )\n // Determine where what the where clause is comparing\n switch ($clause['column']) {\n case 'author':\n case 'author_id':\n $this->object->_query_args['author'] = $clause['value'];\n break;\n case 'author_name':\n $this->object->_query_args['author_name'] = $clause['value'];\n break;\n case 'cat':\n case 'cat_id':\n case 'category_id':\n switch ($clause['compare']) {\n case '=':\n case 'BETWEEN':\n case 'IN':\n if (!isset($this->object->_query_args['category__in'])) {\n $this->object->_query_args['category__in'] = array();\n }\n $this->object->_query_args['category__in'][] = $clause['value'];\n break;\n case '!=':\n case 'NOT BETWEEN':\n case 'NOT IN':\n if (!isset($this->object->_query_args['category__not_in'])) {\n $this->object->_query_args['category__not_in'] = array();\n }\n $this->object->_query_args['category__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'category_name':\n $this->object->_query_args['category_name'] = $clause['value'];\n break;\n case 'post_id':\n case $this->object->get_primary_key_column():\n switch ($clause['compare']) {\n case '=':\n case 'IN':\n case 'BETWEEN':\n if (!isset($this->object->_query_args['post__in'])) {\n $this->object->_query_args['post__in'] = array();\n }\n $this->object->_query_args['post__in'][] = $clause['value'];\n break;\n default:\n if (!isset($this->object->_query_args['post__not_in'])) {\n $this->object->_query_args['post__not_in'] = array();\n }\n $this->object->_query_args['post__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'pagename':\n case 'postname':\n case 'page_name':\n case 'post_name':\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['page_name__like'] = $clause['value'];\n } elseif ($clause['compare'] == '=') {\n $this->object->_query_args['pagename'] = $clause['value'];\n } elseif ($clause['compare'] == 'IN') {\n $this->object->_query_args['page_name__in'] = $clause['value'];\n }\n break;\n case 'post_title':\n // Post title uses custom WHERE clause\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['post_title__like'] = $clause['value'];\n } else {\n $this->object->_query_args['post_title'] = $clause['value'];\n }\n break;\n default:\n // Must be metadata\n $clause['key'] = $clause['column'];\n unset($clause['column']);\n // Convert values to array, when required\n if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {\n $clause['value'] = explode(',', $clause['value']);\n foreach ($clause['value'] as &$val) {\n if (!is_numeric($val)) {\n // In the _parse_where_clause() method, we\n // quote the strings and add slashes\n $val = stripslashes($val);\n $val = substr($val, 1, strlen($val) - 2);\n }\n }\n }\n if (!isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query'] = array();\n }\n $this->object->_query_args['meta_query'][] = $clause;\n break;\n }\n }\n // If any where clauses have been added, specify how the conditions\n // will be conbined/joined\n if (isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query']['relation'] = $join;\n }\n }", "public function get_sitemap()\n\t{\n $this->db->select('*');\n $this->db->join($this->_table_name.'_lang', $this->_table_name.'.id = '.$this->_table_name.'_lang.category_id');\n $categories = parent::get();\n \n return $categories;\n\t}", "function joinon_Contact_and_Vehicle_singlerecord($rID, $where = NULL) {\r\n if ($where != NULL) { $this->db->where($where); } \r\n $this->db->join(\r\n 'contact', \r\n 'contact.Id = ' . $this->table_name. '.' . $this->contactId_fieldname, \r\n 'left outer'\r\n ); \r\n $this->db->join(\r\n '__vehicles', \r\n '__vehicles.__Id = ' . $this->table_name. '._VehicleId', \r\n 'left outer'\r\n ); \r\n return $this->get($rID);\r\n }", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "function custom_search_join($join) {\r\n if ( is_search() && isset($_GET['s'])) {\r\n global $wpdb;\r\n $join = \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id \";\r\n }\r\n return($join);\r\n}", "public function joinEsCities($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsCities');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsCities');\n }\n\n return $this;\n }", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "public function leftOuterJoin($table);", "public function visitJoinClause(\n /*IJoinClause*/ $node) /*: mixed*/ {\n $id = $node->getIdentifier();\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $left = null;\n $left_value = $node->getLeft();\n if ($left_value != null) {\n $left = /*(string)*/$left_value->accept($this);\n }\n $right = null;\n $right_value = $node->getRight();\n if ($right_value != null) {\n $right = /*(string)*/$right_value->accept($this);\n }\n $group = $node->getGroup();\n\n $result = 'join ';\n if ($id !== null) {\n $result .= '$'.$id.' in ';\n }\n $result .= $collection;\n if ($left !== null && $right !== null) {\n $result .= \" on $left equals $right\";\n if ($group !== null) {\n $result .= ' into '.$group;\n }\n }\n return $result;\n }", "function carton_exclude_order_comments_from_feed_join( $join ) {\n\tglobal $wpdb;\n\n if ( ! $join )\n \t$join = \" LEFT JOIN $wpdb->posts ON $wpdb->comments.\\\"comment_post_ID\\\" = $wpdb->posts.\\\"ID\\\" \";\n\n return $join;\n}", "public function categoryAdditionals()\n {\n return $this->where('categories.id', $this->id)\n ->join('categories_additionals', 'categories.id', 'categories_additionals.category_son_id')\n ->join(DB::raw('categories as category_contains'), 'category_contains.id', 'categories_additionals.category_father_id')\n ->select([DB::raw('category_contains.id as id'), DB::raw('category_contains.name as name')])\n ->get();\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "public function testImplicitJoinWithCartesianProductAndConditionInWhere(): void\n {\n $this->assertValidDQL('SELECT u, a FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u, Doctrine\\Tests\\Models\\CMS\\CmsArticle a WHERE u.name = a.topic');\n }", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "private function addHolidaycenterJoinToSelect(Select $select)\r\n {\r\n $select->join(\r\n 'holidaycenter',\r\n 'advert.holidaycenter = holidaycenter.id',\r\n [\r\n 'holidaycenter_id' => 'id',\r\n 'holidaycenter_registered' => 'registered',\r\n 'holidaycenter_updated' => 'updated',\r\n 'holidaycenter_status' => 'status',\r\n 'holidaycenter_name' => 'name',\r\n 'holidaycenter_email' => 'email',\r\n 'holidaycenter_contact' => 'contact',\r\n 'holidaycenter_logo' => 'logo',\r\n ]\r\n );\r\n\r\n return $select;\r\n }", "public function join ( $sTable, $sCondition, $sType = '' )\n {\n if ($sType != '')\n {\n $sType = strtoupper(trim($sType));\n $sType = (in_array($sType, $this->aJoinTypes)) ? $sType . ' ' : '';\n }\n /*\n Save.\n */\n $this->aJoin = array_merge($this->aJoin, array($sType, $sTable, $sCondition));\n /*\n Return for method chaining.\n */\n return $this;\n }", "public function innerjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower(get_class($classname));\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $this->query .= \" inner join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" inner join `\" . $this->join . \"` \";\n\n return $this;\n }", "final public function addJoin(YMKM_SQL_Entity_Join $s)\n {\n $this->doAddJoin($s);\n return $this;\n }", "public function useCategoriaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinCategoria($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Categoria', 'CategoriaQuery');\n\t}", "public function useCategoriaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinCategoria($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Categoria', 'CategoriaQuery');\n\t}", "public function useCategoriaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCategoria($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Categoria', '\\Agencia\\BaseDatosBundle\\Model\\CategoriaQuery');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(self::tablePrefix().'cms_post_category', ['post_id' => 'id']);\n }", "public function useCategoryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinCategory($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Category', '\\CategoryQuery');\n }", "public function useCategoryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinCategory($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Category', '\\CategoryQuery');\n }", "public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }", "public function productCategoryMap(){\n\t\treturn $this->hasOne('App\\ProductCategoryMaps','product_id');\n\t}", "public function joinCategorie($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Categorie');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Categorie');\n }\n\n return $this;\n }", "function sql_inner_join_statement(string $table_name, string $coloum_name, int $count)\n {\n $sql = \" FROM \" . $table_name . \" AS T1 \";\n for($i = 1; $i < $count; $i++){\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n \n $sql .= \"INNER JOIN $table_name AS $t_name USING ( \" . $coloum_name . \" ) \";\n }\n return $sql;\n }", "function fm_get_links_shared_by_cat($original, $catid) {\r\n\treturn get_records('fmanager_link',\"owner = $original AND category\",$catid);\t\r\n}", "public function joinCustomer($classId);" ]
[ "0.6256278", "0.5780101", "0.55464715", "0.5508541", "0.5336194", "0.5312877", "0.5299908", "0.51957047", "0.5000402", "0.49854267", "0.49719602", "0.49677968", "0.49652797", "0.49619377", "0.4960513", "0.49496529", "0.49472708", "0.49451014", "0.4917124", "0.48994577", "0.48528928", "0.48526058", "0.4844058", "0.48048264", "0.4778795", "0.47714627", "0.47520146", "0.47520146", "0.47473174", "0.47371134", "0.4736396", "0.4732954", "0.47177887", "0.4715207", "0.4701046", "0.46987486", "0.4696641", "0.46826276", "0.46617746", "0.4634853", "0.46313193", "0.46141982", "0.45960906", "0.45936522", "0.45813328", "0.45750174", "0.45470315", "0.45386288", "0.4535474", "0.45286444", "0.4500881", "0.45003462", "0.4494942", "0.44947287", "0.44920138", "0.44838333", "0.44808707", "0.44686607", "0.4464668", "0.44533077", "0.4451955", "0.44518426", "0.44496763", "0.44404265", "0.4431821", "0.44289577", "0.44266114", "0.4424063", "0.4422884", "0.44213843", "0.44173792", "0.44163966", "0.43997407", "0.43995693", "0.43969882", "0.4394719", "0.43907636", "0.43854916", "0.43709537", "0.43681562", "0.4365713", "0.43654016", "0.43638402", "0.4359732", "0.4358221", "0.43530652", "0.4350592", "0.43498054", "0.43449256", "0.43449256", "0.4339306", "0.43378034", "0.4335139", "0.4335139", "0.43117517", "0.43098918", "0.43098554", "0.43091878", "0.43091598", "0.43088785" ]
0.65634227
0
Use the MapSceneStoreCategory relation MapSceneStoreCategory object
public function useMapSceneStoreCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinMapSceneStoreCategory($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'MapSceneStoreCategory', '\MapSceneStoreCategoryQuery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function productCategoryMap(){\n\t\treturn $this->hasOne('App\\ProductCategoryMaps','product_id');\n\t}", "public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }", "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function filterByMapSceneStoreCategory($mapSceneStoreCategory, $comparison = null)\n {\n if ($mapSceneStoreCategory instanceof \\MapSceneStoreCategory) {\n return $this\n ->addUsingAlias(SceneTableMap::COL_SCENE_ID, $mapSceneStoreCategory->getSceneId(), $comparison);\n } elseif ($mapSceneStoreCategory instanceof ObjectCollection) {\n return $this\n ->useMapSceneStoreCategoryQuery()\n ->filterByPrimaryKeys($mapSceneStoreCategory->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMapSceneStoreCategory() only accepts arguments of type \\MapSceneStoreCategory or Collection');\n }\n }", "public function joinMapSceneStoreCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('MapSceneStoreCategory');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'MapSceneStoreCategory');\n }\n\n return $this;\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "function get_category() {\n return self::CATEGORY_CLUSTER;\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function getCategory()\n {\n }", "public function category()\n {\n return $this->belongsTo('App\\Models\\Site\\SiteMaintenanceCategory', 'category_id');\n }", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function category()\n\t{\n\t return $this->belongsTo(Category::class);\n\t}", "public function category()\n {\n \treturn $this->belongsTo('App\\Category');\n }", "public static function getInstance(){\n\t\treturn Singleton::getInstance('geoCategory');\n\t}", "public function getCategoryId();", "public function category() {\n return $this->belongsTo('Category','catID','catID');\n\n }", "public function category() {\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}", "function showCategory()\r\n {\r\n }", "public static function set_categories($map_controller, $on_backend = false, $group = false)\n\t{\n\t\t// Get locale\n\t\t$l = Kohana::config('locale.language.0');\n\t\n\t\t$parent_categories = array();\n\t\n\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t//Check to see if we're dealing with a group, and thus\n\t\t//should show group specific categories\n\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\tif($group != false)\n\t\t{\n\t\t\t//check and make sure the simpel groups category is installed\n\t\t\t$plugin = ORM::factory('plugin')\n\t\t\t\t->where('plugin_name', 'simplegroups')\n\t\t\t\t->where('plugin_active', '1')\n\t\t\t\t->find();\n\t\t\tif(!$plugin)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"A group was set in adminmap_helper::set_categories() when the SimpleGroupl plugin is not installed\");\n\t\t\t}\n\t\t\n\t\t\t$cats = ORM::factory('simplegroups_category');\n\t\t\tif(!$on_backend)\n\t\t\t{\t\n\t\t\t\t$cats = $cats->where('category_visible', '1');\n\t\t\t}\n\t\t\t$cats = $cats->where('parent_id', '0');\n\t\t\t$cats = $cats->where('applies_to_report', 1);\n\t\t\t$cats = $cats->where('simplegroups_groups_id', $group->id)\n\t\t\t\t->find_all() ;\n\t\t\tforeach ($cats as $category)\n\t\t\t{\t\t\t\t\n\t\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t// Get the children\n\t\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t$children = array();\n\t\t\t\tforeach ($category->children as $child)\n\t\t\t\t{\n\t\t\t\t\t// Check for localization of child category\n\n\t\t\t\t\t$translated_title = Simplegroups_category_lang_Model::simplegroups_category_title($child->id,$l);\n\n\t\t\t\t\tif($translated_title)\n\t\t\t\t\t{\n\t\t\t\t\t\t$display_title = $translated_title;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$display_title = $child->category_title;\n\t\t\t\t\t}\n\n\t\t\t\t\t$children[\"sg_\".$child->id] = array(\n\t\t\t\t\t\t$display_title,\n\t\t\t\t\t\t$child->category_color,\n\t\t\t\t\t\t$child->category_image\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t$translated_title = Simplegroups_category_lang_Model::simplegroups_category_title($category->id,$l);\n\n\t\t\t\tif($translated_title)\n\t\t\t\t{\n\t\t\t\t\t$display_title = $translated_title;\n\t\t\t\t}else{\n\t\t\t\t\t$display_title = $category->category_title;\n\t\t\t\t}\n\n\t\t\t\t// Put it all together\t\t\t\t\n\t\t\t\t$parent_categories[\"sg_\".$category->id] = array(\n\t\t\t\t\t$display_title,\n\t\t\t\t\t$category->category_color,\n\t\t\t\t\t$category->category_image,\n\t\t\t\t\t$children\n\t\t\t\t);\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n // Get all active top level categories\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\t$cats = ORM::factory('category');\n\t\tif(!$on_backend)\n\t\t{\t\n\t\t\t$cats = $cats->where('category_visible', '1');\n\t\t}\n\t\t$cats = $cats->where('parent_id', '0')\n\t\t\t->orderby('category_position', 'ASC')\n\t\t\t->find_all() ;\n\t\tforeach ($cats as $category)\n\t\t{\n\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t// Get the children\n\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t$children = array();\n\t\t\tforeach ($category->children as $child)\n\t\t\t{\n\t\t\t\t// Check for localization of child category\n\n\t\t\t\t$translated_title = Category_Lang_Model::category_title($child->id,$l);\n\n\t\t\t\tif($translated_title)\n\t\t\t\t{\n\t\t\t\t\t$display_title = $translated_title;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$display_title = $child->category_title;\n\t\t\t\t}\n\n\t\t\t\t$children[$child->id] = array(\n\t\t\t\t\t$display_title,\n\t\t\t\t\t$child->category_color,\n\t\t\t\t\t$child->category_image\n\t\t\t\t);\n\n\t\t\t\tif ($child->category_trusted)\n\t\t\t\t{ // Get Trusted Category Count\n\t\t\t\t\t$trusted = ORM::factory(\"incident\")\n\t\t\t\t\t\t->join(\"incident_category\",\"incident.id\",\"incident_category.incident_id\")\n\t\t\t\t\t\t->where(\"category_id\",$child->id);\n\t\t\t\t\tif ( ! $trusted->count_all())\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($children[$child->id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$translated_title = Category_Lang_Model::category_title($category->id,$l);\n\n\t\t\tif($translated_title)\n\t\t\t{\n\t\t\t\t$display_title = $translated_title;\n\t\t\t}else{\n\t\t\t\t$display_title = $category->category_title;\n\t\t\t}\n\n\t\t\t// Put it all together\n\t\t\t$parent_categories[$category->id] = array(\n\t\t\t\t$display_title,\n\t\t\t\t$category->category_color,\n\t\t\t\t$category->category_image,\n\t\t\t\t$children\n\t\t\t);\n\n\t\t\tif ($category->category_trusted)\n\t\t\t{ // Get Trusted Category Count\n\t\t\t\t$trusted = ORM::factory(\"incident\")\n\t\t\t\t\t->join(\"incident_category\",\"incident.id\",\"incident_category.incident_id\")\n\t\t\t\t\t->where(\"category_id\",$category->id);\n\t\t\t\tif ( ! $trusted->count_all())\n\t\t\t\t{\n\t\t\t\t\tunset($parent_categories[$category->id]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$map_controller->template->content->categories = $parent_categories;\n\t}", "public function category()\n\t{\n\t\treturn $this->belongsTo(Category::class);\n\t}", "public function getCategory()\n {\n return $this->hasOne(MgfSelectionCategory::className(), ['id' => 'category_id']);\n }", "function getGenreCategoryMapping() {\n\t\tassert(false);\n\t}", "public function getViewedCategory();", "public function category()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Categories\\Models\\Category');\n }", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('SongCategory','category');\n\t}", "public function createCategory();", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Categories::class);\n }", "protected function _initCategory() {\n $categoryId = (int) $this->getRequest()->getParam('id', false);\n $storeId = (int) $this->getRequest()->getParam('store');\n\n $category = Mage::getModel('catalog/category');\n $category->setStoreId($storeId);\n\n if ($categoryId) {\n $category->load($categoryId);\n if ($storeId) {\n $rootId = Mage::app()->getStore($storeId)->getRootCategoryId();\n if (!in_array($rootId, $category->getPathIds())) {\n $this->_redirect('*/*/', array('_current' => true, 'id' => null));\n return false;\n }\n }\n }\n\n Mage::register('category', $category);\n Mage::register('current_category', $category);\n\n return $category;\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('App\\Model\\Content\\Category');\n\t}", "public function categories()\n {\n return $this->belongsTo(Category::class);\n }", "public function categories() {\n return $this->belongsTo(\"Category\", \"category_id\", \"id\");\n }", "public function getCategory($name);", "public function category(){\n \treturn $this->belongsTo(\"Category\",\"category_id\");\n }", "public function categories()\n {\n \treturn $this->belongsTo( 'App\\Category', 'category_id');\n }", "public function findCategories();", "public function Category()\n {\n return $this->belongsTo(Category::class);\n }", "public function storesAction()\n {\n\n /**\n * @var $stores Mage_Core_Model_Mysql4_Store_Collection\n * @var $storeItem Mage_Core_Model_Store\n * @var $category Mage_Catalog_Model_Category\n */\n\n $stores = Mage::getResourceModel('core/store_collection');\n// $stores = Mage::app()->getStore()->getCollection();\n\n foreach ($stores as $storeItem)\n {\n echo \"<h2>Store info: {$storeItem->getName()}:{$storeItem->getCode()}</h2><br/>\";\n $category = Mage::getModel('catalog/category')\n ->load( $storeItem->getRootCategoryId() );\n echo \"<h2>Root category info: {$category->getName()}</h2><br/>\";\n echo \"<hr/>\";\n }\n\n }", "public function getCategory(){\n return $this->category;\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function category()\n {\n\n return $this->belongsTo(Category::class);\n\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Category','category_id','id');\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory(): string;", "public function categories()\n {\n return $this->belongsTo(Categories::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "protected function _initCatagory()\r\n\t{\r\n\t\tMage::dispatchEvent('vendor_catalog_controller_category_init_before', array('controller_action' => $this));\r\n\t\t$categoryId = (int) $this->getRequest()->getParam('id', false);\r\n\t\tif (!$categoryId) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$category = Mage::getModel('vendorscategory/category')\r\n\t\t->load($categoryId);\r\n\t\tif (!Mage::helper('vendorscategory')->canShow($category)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!Mage::registry(\"vendor_id\") && !Mage::registry(\"vendor\") && !Mage::registry(\"current_vendor\")){\r\n\t\t\t//echo $category->getVendorId();exit;\r\n\t\t\t$vendorObj = Mage::getModel('vendors/vendor')->load($category->getVendorId());\r\n\r\n\t\t\t//var_dump($vendorObj->getData());exit;\r\n\t\t\tMage::register('vendor_id', $vendorObj->getVendorId());\r\n\t\t\tMage::register('vendor', $vendorObj);\r\n\t\t\tMage::register('current_vendor', $vendorObj);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('current_vendor_category', $category);\r\n\t\tMage::register('current_vendor_entity_key', $category->getPath());\r\n\t\ttry {\r\n\t\t\tMage::dispatchEvent(\r\n\t\t\t'vendor_catalog_controller_category_init_after',\r\n\t\t\tarray(\r\n\t\t\t'category' => $category,\r\n\t\t\t'controller_action' => $this\r\n\t\t\t)\r\n\t\t\t);\r\n\t\t} catch (Mage_Core_Exception $e) {\r\n\t\t\tMage::logException($e);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\treturn $category;\r\n\t}", "public function category() {\n return $this->belongsTo('App\\Category');\n }", "public function category() {\n return $this->belongsTo('App\\Models\\category','cat_id');\n }", "function getCategories(){\n\treturn dbSelect('categories');\n}", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function category(){\n return $this->belongsTo('App\\Category', 'cat-id');\n }", "protected function assignCategory() \r\r\n {\r\r\n if (($this->category === false || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop()) && Category::inShopStatic($this->product->id_category_default, $this->context->shop)) {\r\r\n $this->category = new Category((int) $this->product->id_category_default, (int) $this->context->language->id);\r\r\n }\r\r\n\r\r\n $sub_categories = array();\r\r\n if (Validate::isLoadedObject($this->category)) {\r\r\n $sub_categories = $this->category->getSubCategories($this->context->language->id, true);\r\r\n\r\r\n //$rootCategory = $this.category\r\r\n // various assignements before Hook::exec\r\r\n $this->context->smarty->assign(array(\r\r\n 'category' => $this->category,\r\r\n 'rootCategory' => Category::getDepthCategory($this->category->id, 2),\r\r\n 'subCategories' => $sub_categories,\r\r\n 'id_category_current' => (int) $this->category->id,\r\r\n 'id_category_parent' => (int) $this->category->id_parent,\r\r\n 'return_category_name' => Tools::safeOutput($this->category->getFieldByLang('name')),\r\r\n 'categories' => Category::getHomeCategories($this->context->language->id, true, (int) $this->context->shop->id),\r\r\n ));\r\r\n }\r\r\n }", "protected function _initCategory()\r\n {\r\n $categoryId = (int)$this->getRequest()->getParam('id', FALSE);\r\n $storeId = (int)$this->getRequest()->getParam('store');\r\n\r\n $category = Mage::getModel('catalog/category');\r\n $category->setStoreId($storeId);\r\n\r\n if ($categoryId) {\r\n $category->load($categoryId);\r\n if ($storeId) {\r\n $rootId = Mage::app()->getStore($storeId)->getRootCategoryId();\r\n if (!in_array($rootId, $category->getPathIds())) {\r\n $this->_redirect('*/*/', array('_current' => TRUE, 'id' => NULL));\r\n return FALSE;\r\n }\r\n }\r\n }\r\n\r\n Mage::register('category', $category);\r\n Mage::register('current_category', $category);\r\n\r\n return $category;\r\n }", "public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public static function getCMSCategoriesByLocation($location, $id_shop = false)\n\t{\n\t}", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }" ]
[ "0.5841291", "0.56737554", "0.5660121", "0.564081", "0.55522436", "0.55522436", "0.55277133", "0.54719955", "0.5397655", "0.5324522", "0.53237915", "0.532295", "0.53157496", "0.53141874", "0.5284083", "0.52175844", "0.5213819", "0.52028006", "0.5202779", "0.5202779", "0.51830107", "0.5176799", "0.5167694", "0.5158496", "0.51555747", "0.51539356", "0.5148092", "0.5145352", "0.5135499", "0.51274955", "0.51266676", "0.5126023", "0.51134664", "0.5109624", "0.5105416", "0.51029706", "0.5102317", "0.5101948", "0.5101948", "0.5101948", "0.5091451", "0.50868803", "0.5085147", "0.50794244", "0.5078568", "0.50764203", "0.50728184", "0.5070389", "0.50631726", "0.50604326", "0.505967", "0.5058705", "0.5052035", "0.5052035", "0.5052035", "0.5048832", "0.5048204", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.5045148", "0.50437224", "0.504055", "0.504055", "0.5037183", "0.50354606", "0.50299865", "0.5028074", "0.5024788", "0.5021207", "0.5016147", "0.50141406", "0.50141406", "0.5013975", "0.50071806", "0.5005448", "0.49901107", "0.4985757", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603", "0.49832603" ]
0.6095754
0
Exclude object from result
public function prune($scene = null) { if ($scene) { $this->addUsingAlias(SceneTableMap::COL_SCENE_ID, $scene->getSceneId(), Criteria::NOT_EQUAL); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_exclude_id(){\n $data = get_object_vars($this);\n unset($data[\"id\"]);\n return $data;\n }", "protected function getExcludeFields() {}", "public function getAllExcept($id);", "public static function getExcludeFields() {}", "public function getExcludeQueryPart() {}", "public function getDoktypeExcludeWhere() {}", "public function getExclude()\n {\n return $this->exclude;\n }", "public function getAllFieldsExcludingAPI ($toExclude = array()) {\n $obj = $this->owner;\n\n // All Field Names\n $fieldNames = array_merge(\n array_keys($obj->allDatabaseFields()),\n array_keys($obj->hasOne()),\n array_keys($obj->hasMany())\n );\n\n // Removed fields in $toExclude\n $fieldNames = array_diff($fieldNames, $toExclude);\n\n return $obj->getFieldsForAPI($fieldNames);\n }", "public function get_exclusions() {\n return clone($this->exclude);\n }", "public function getIgnoreItems(): array;", "public function getAllowedExcludeFields() {}", "public function skipProperties() {}", "abstract protected function getDataTypesToExclude();", "public function unfilter() {\n\n \treturn new Octopus_Model_ResultSet(\n \t\t$this->_modelClass,\n \t\tnull,\n \t\t$this->_orderBy\n\t );\n\n }", "public function getModlogOmitFields();", "public function withoutTransformer();", "public function testOmit() {\n\t\t$array = array('one' => 1, 'two' => 2, 'three' => 3);\n\t\t$expected = array('three' => 3);\n\t\t$result = _::omit($array, 'one', 'two');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// test picking properties off an object\n\t\t$object = (object)$array;\n\t\t$expected = (object)$expected;\n\t\t$result = _::omit($object, 'one', 'two');\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "function BuyableCalculatedExcludedFrom(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->ExcludedFrom();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->ExcludedFrom();\n\t}", "public function clearExcludes()\r\n {\r\n foreach ($this->facetQueries as $facetQuery) {\r\n $facetQuery->clearExcludes();\r\n }\r\n\r\n return parent::clearExcludes();\r\n }", "private function filterNotItems(array $output): array\n {\n foreach ($this->not as $exclude) {\n $translator = new PathTranslator($output);\n $paths = $translator->path($exclude);\n\n if (0 === $paths->count()) {\n continue;\n }\n\n foreach ($paths as $keys) {\n if (null !== $keys) {\n $this->removeFromArray($output, $keys->getPath());\n }\n }\n }\n\n return $output;\n }", "public function allowAllPropertiesExcept() {}", "public function getIgnoreEnableFields() {}", "public function exclude_offered() {\n\t\treturn new PSU_Student_Finaid_Awards_ExcludeOfferedFilterIterator( $this->getIterator() );\n\t}", "public function exclude() {\n\t\t// If there is no arguments, return $this\n\t\t$numArgs = func_num_args();\n\t\tif($numArgs == 0){ return $this; }\n\t\t\n\t\t// If only a lone array is passed use it as parameters\n\t\t$firstArgument = func_get_arg(0);\n\t\tif ($numArgs == 1 and isset($firstArgument[0]) and is_array($firstArgument[0])) {\n\t\t\treturn $this->_f(false, $firstArgument);\n\t\t}\n\n\t\t// General case of filtering: arguments are conditions\n\t\treturn $this->_f(false, func_get_args());\n\t}", "public function negate()\n\t{\n\t\t$this->not_in = !$this->not_in;\n\t}", "public function getPayloadNotIncluded();", "public function withoutValue();", "public function getExcludedIds();", "public function except($values);", "public function skipUnknownProperties() {}", "public function getExcludeHideFromSearch()\n {\n return $this->excludeHideFromSearch;\n }", "function getIgnoreEnableFields() ;", "protected function exclude_spare()\n {\n return $this->collection = $this->collection->where('is_spare', 'f');\n }", "function applyIgnore( array $ignore );", "protected function getExtensionsToExclude() {}", "public function testExclude() {\n $this->assertEquals(array('foo' => 123), Hash::exclude(array('foo' => 123, 'bar' => 456, 'baz' => 789), array('bar', 'baz')));\n }", "public function negate()\n {\n $this->_not = true;\n return $this;\n }", "public function excludeFromSource($field);", "public function excludeFromExport(): self\n {\n $this->includeInExport = false;\n\n return $this;\n }", "public function except(...$post_ids): Collection;", "static public function showOnlyNotTargetVisits(){\n $registro = static::leftJoin(\"users\",\"visitors.user_id\",\"=\",\"users.id\")\n ->join('handling_times',\"visitors.handling_time_id\",\"=\",\"handling_times.id\")\n ->join('direction_tickets',\"visitors.direction_ticket_id\",\"=\",\"direction_tickets.id\")\n ->join('directions',\"direction_tickets.direction_id\",\"=\",\"directions.id\")\n ->join('sectors',\"directions.sector_id\",\"=\",\"sectors.id\")\n ->select('visitors.id','first_name','last_name','identification_card','phone','sector','input')\n ->where('output','=',null)\n ->orderBy('visitors.id', 'DESC')\n ->paginate(30);;\n return $registro;\n }", "public function getExcludes()\n {\n // code...\n return $this->__EXCLUDES__ ?? [];\n }", "public function getSourceExcludes();", "public function excludedVoters()\n {\n return $this->voters()->where('is_excluded', true);\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 getVariantListExceptCurrent()\n {\n $oList = $this->getVariantList();\n if (is_object($oList)) {\n $oList = clone $oList;\n }\n\n $sOxId = $this->getProduct()->getId();\n if (isset($oList[$sOxId])) {\n unset($oList[$sOxId]);\n }\n\n return $oList;\n }", "public function clear_exclusions() {\n $this->exclude = array();\n }", "public function testNoIntersection()\n {\n $config = array(\n 'default' => TRUE,\n );\n\n $request = array(\n 'Attributes' => array(\n 'eduPersonTargetedID' => array('[email protected]'),\n 'eduPersonAffiliation' => array('member'),\n 'cn' => array('user name'),\n 'mail' => array('[email protected]'),\n 'discardme' => array('somethingiswrong'),\n ),\n 'Destination' => array(\n 'attributes' => array('urn:oid:1.2.840.113549.1.9.1'),\n ),\n 'Source' => array(\n ),\n );\n\n $result = self::processFilter($config, $request);\n $attributes = $result['Attributes'];\n $this->assertCount(0, $attributes);\n $this->assertEmpty($attributes);\n }", "public function ignoreMember(MemberRepositoryInterface $target): PodiumResponse;", "public function getExclude() {\n \treturn array_keys($this->exclude);\n }", "public function skipCriteria( $status = TRUE );", "public function getIgnore()\n {\n return $this->ignore;\n }", "public function withoutIncludes(): self\n {\n $this->setDefaultIncludes([]);\n\n return $this;\n }", "public function getIgnoreItemsOnUpdate(): array;", "function dry() {\n\t\treturn !$this->item;\n\t}", "public function getRemovedObjects() {}", "public function getExcludeTypes()\n {\n return $this->exclude_types;\n }", "public function removeExclude($exclude)\r\n {\r\n foreach ($this->facetQueries as $facetQuery) {\r\n $facetQuery->removeExclude($exclude);\r\n }\r\n\r\n return parent::removeExclude($exclude);\r\n }", "public function negate()\n {\n return $this->copy(null, null, !$this->isNegative());\n }", "protected abstract function filter();", "public function filter();", "function shouldSkipUnknownProperties() ;", "public function disableDistinct() {\r\n $this->myCRUD()->disableDistinct();\r\n return $this;\r\n }", "public function withoutData(): EntityInterface;", "public function getEnableFieldsToBeIgnored() {}", "public function ignore($item=null) {\n $this->__ignoreObjects__ = $item === 2 || $item === 5;\n $this->__ignoreObjectLists__ = $item === 3 || $item === 5;\n return $this;\n }", "function tradeoff_excluded_by($definition)\n {\n return app(Models\\Resolution\\ExcludedBy::class)->setData($definition);\n }", "public function getUnexportedRecords()\n\t{\n\t\t$this->addFieldToFilter('export_date', array('null' => 1));\n\t\treturn $this;\n\t}", "public function getOrphaned() {\r\n\t\t\r\n\t\t$query = \"SELECT * FROM $this->att WHERE $this->att.event_id = 0\";\r\n\t\t\t\t\r\n\t\treturn $this->executeQuery($query);\r\n\t}", "function ithi_exclude_pages($query) {\n if ($query->is_search) {\n $query->set('post_type', 'post');\n }\n return $query;\n}", "protected function nonbillable()\n {\n return $this->builder->where('billable', false);\n }", "protected function getHtmlArmorExcludedFields() {\n\t\treturn [ 'id', 'class', 'aria' ];\n\t}", "protected function loadToIgnore(){\n\t\t\t$otherClass=$this->class;\n\t\t\t$this->toIgnore = array();\n\t\t\tif(isset($otherClass::$ignoreProperties) && is_array($otherClass::$ignoreProperties)){\n\t\t\t\t$this->toIgnore = $otherClass::$ignoreProperties;\n\t\t\t}\n\t\t}", "public function getExcludeListArray() {}", "protected function getDifferencesObject() {}", "function get_all_but_not_this_user($usr)\n{\n $user=$usr->__get('uid');\n $con = connect();\n\t$q1=mysqli_query($con,\"SELECT * FROM user WHERE UId != '$user'\");\n\treturn $q1;\n}", "public function getVotosNegativos()\n {\n return $this->getVotos()->where(['positivo' => false]);\n }", "public function findWithoutArchive()\n {\n $nowmoins = date('y-m-d', strtotime('- 1 month'));\n $todayConvert = DateTime::createFromFormat(\"y-m-d\",$nowmoins,null);\n dump($todayConvert);\n\n $qb = $this->createQueryBuilder('s');\n $qb->andwhere('s.datedebut > :todayConvert')->setParameter('todayConvert',$todayConvert);\n $query = $qb->getQuery();\n return $query->getResult();\n\n }", "function GetExcludedEvents();", "public function not() {\n\t\t$this->not = '!';\n\t\treturn $this;\n\t}", "public function newQueryWithoutRelationships();", "public function testThatGetAllUsersIncludeFieldsIsNotOverwritten()\n {\n $api = new MockManagementApi( [new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getAll( [ 'include_fields' => false ], [ 'field3' ], true );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'fields=field3', $query );\n $this->assertContains( 'include_fields=false', $query );\n }", "public function getListNotSent()\n {\n $this->getSelect()\n ->where('main_table.sent_sucess = ?', Emv_Emt_Model_Resending_Queue_Message::IS_NOT_SENT)\n ->orWhere('main_table.sent_sucess IS NULL')\n ->where('main_table.number_attempts IS NULL OR main_table.number_attempts < ?', Emv_Emt_Model_Resending_Queue_Message::MAX_ATTEMPT)\n ->order('main_table.id');\n\n return $this;\n }", "public function testFetchFilteredNoComments(): void\n {\n $users = new Select($this->orm, User::class);\n $users->load('posts', [\n 'where' => function (Select\\QueryBuilder $qb): void {\n $qb->distinct()\n ->with('comments', ['method' => Select\\JoinableLoader::LEFT_JOIN])\n ->where('comments.id', '=', null);\n },\n ])->orderBy('user.id');\n\n $this->assertEquals([\n [\n 'id' => 1,\n 'email' => '[email protected]',\n 'balance' => 100.0,\n 'posts' => [\n [\n 'id' => 3,\n 'user_id' => 1,\n 'title' => 'post 3',\n ],\n ],\n ],\n [\n 'id' => 2,\n 'email' => '[email protected]',\n 'balance' => 200.0,\n 'posts' => [\n [\n 'id' => 4,\n 'user_id' => 2,\n 'title' => 'post 4',\n ],\n ],\n ],\n ], $users->fetchData());\n }", "public function byCriterionNonEntity()\n {\n $this->dbFinder->findByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }", "function getEnableFieldsToBeIgnored() ;", "protected function getIgnoreAttributes(){\n\t\t\t$reflector = new ReflectionClass($this->class);\n\t\t\t$staticProperties = array_keys($reflector->getStaticProperties());\n\t\t\tif($this->keys){\n\t\t\t\treturn array_merge(\n\t\t\t\t\t\tarray_keys(get_class_vars(QueryBuilder::class)),\n\t\t\t\t\t\t$this->keys,\n\t\t\t\t\t\t$staticProperties,\n\t\t\t\t\t\t$this->toIgnore);\n\t\t\t}else{\n\t\t\t\treturn array_merge(\n\t\t\t\t\tarray_keys(get_class_vars(QueryBuilder::class), $staticProperties),\n\t\t\t\t\t$this->toIgnore);\n\t\t\t}\n\t\t}", "public function exclude($exclude = [])\n {\n $this->exclude = $exclude;\n return $this;\n }", "function accouk_exclude_pages_from_search_results($query) {\n\n if ($query->is_search) {\n $query->set('post_type', 'post');\n }\n\n return $query;\n\n}", "abstract public function filterFields();", "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 exclude_content_object($id)\n {\n $conditions = array();\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectInclude::class_name(),\n ContentObjectInclude::PROPERTY_CONTENT_OBJECT_ID\n ),\n new StaticConditionVariable($this->get_id())\n );\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectInclude::class_name(), ContentObjectInclude::PROPERTY_INCLUDE_ID\n ),\n new StaticConditionVariable($id)\n );\n $condition = new AndCondition($conditions);\n\n $include = DataManager::retrieve(\n ContentObjectInclude::class_name(),\n new DataClassRetrieveParameters($condition)\n );\n\n if ($include instanceof ContentObjectInclude)\n {\n return $include->delete();\n }\n else\n {\n return false;\n }\n }", "public function scrubObject(object $data) : object;", "public function get_unapproved_items() {\n return $this->query(\"SELECT * FROM `items` where NOT `approved` order by `premium` desc, `date`\");\n }", "public function filtering();", "public function createNot()\n {\n $o = new NotSelector();\n $this->appendSelector($o);\n\n return $o;\n }", "function discardQuery() {}", "public function removeUnusedObjects()\n {\n // Setze ein Array mit used-Einträgen auf false\n $entries = $this->crossReferenceTable->getAll();\n $used = [];\n foreach ($entries as $objectNumber => $value) {\n $used[$objectNumber] = false;\n }\n $used[0] = true; // Eintrag Nummer 0 muss existieren.\n\n // Laufe alle Referenzen durch\n $this->findIndirectReferences($this->trailerDictionary, $used);\n\n // Entferne nicht genutzte Objekte\n foreach ($used as $objectNumber => $objectUsed) {\n if (!$objectUsed) {\n $this->crossReferenceTable->removeEntry($objectNumber);\n //echo \"Removed Object $objectNumber\\n\";\n }\n }\n }", "public function negate() : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $rowB = [];\n\n foreach ($rowA as $valueA) {\n $rowB[] = -$valueA;\n }\n\n $b[] = $rowB;\n }\n\n return self::quick($b);\n }", "static function createIgnoreWith($fields) {\r\n return static::make($fields)->createIgnore();\r\n }" ]
[ "0.6944959", "0.66654503", "0.6381618", "0.62979996", "0.628891", "0.62113446", "0.6191469", "0.6156899", "0.6141459", "0.61324584", "0.60281223", "0.60165423", "0.5956303", "0.59227616", "0.59098727", "0.5855696", "0.5848707", "0.58305067", "0.5769087", "0.57627815", "0.5682693", "0.5678297", "0.5677802", "0.5677423", "0.5673128", "0.56475854", "0.5645802", "0.56318915", "0.56289166", "0.56222814", "0.5613124", "0.55875504", "0.5586565", "0.5554582", "0.55285555", "0.55018497", "0.5498342", "0.5470776", "0.5464928", "0.54644054", "0.54610956", "0.5444767", "0.5437374", "0.543017", "0.5418528", "0.5411589", "0.540702", "0.54065394", "0.54040396", "0.5379703", "0.53473324", "0.5345301", "0.53362745", "0.5315939", "0.5311046", "0.53086776", "0.5307359", "0.53034323", "0.52908045", "0.52905744", "0.528948", "0.5285819", "0.5285584", "0.52810645", "0.52700716", "0.5267865", "0.5254293", "0.5243209", "0.52397186", "0.52355224", "0.5235296", "0.522994", "0.5227584", "0.5223517", "0.5222273", "0.5219774", "0.521502", "0.5211996", "0.5211379", "0.521032", "0.5206424", "0.5203679", "0.51811755", "0.5162007", "0.5161003", "0.5155418", "0.5155142", "0.51512223", "0.5146605", "0.51404774", "0.5136579", "0.51052105", "0.50981575", "0.50972414", "0.5079792", "0.50760156", "0.50739896", "0.5073309", "0.50684124", "0.5065473", "0.50637484" ]
0.0
-1
Deletes all rows from the scene table.
public function doDeleteAll(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(SceneTableMap::DATABASE_NAME); } // use transaction because $criteria could contain info // for more than one table or we could emulating ON DELETE CASCADE, etc. return $con->transaction(function () use ($con) { $affectedRows = 0; // initialize var to track total num of affected rows $affectedRows += parent::doDeleteAll($con); // Because this db requires some delete cascade/set null emulation, we have to // clear the cached instance *after* the emulation has happened (since // instances get re-added by the select statement contained therein). SceneTableMap::clearInstancePool(); SceneTableMap::clearRelatedInstancePool(); return $affectedRows; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public function delete()\n {\n $stmt = $this->_db->prepare(\"DELETE FROM score;\");\n $stmt->execute();\n }", "function deleteAll() {\n\t\t$dbh=$this->getdbh();\n\t\t$sts = $dbh->exec('DELETE FROM '.$this->enquote($this->tablename));\n\t\treturn $sts;\n\t\n\t}", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "function deleteAll ($tablename) {\n\t\t$this->deleteWhere($tablename, NULL);\n\t}", "public function deleteAll(): void;", "public function delete_rows()\n {\n $tables = $this->file->sheets->first()->tables->filter(function($table) {\n $uniques = $table->columns->filter(function($column) { return $column->unique; })->map(function($column) {\n return 'C' . $column->id;\n })->toArray();\n\n $updates = array_merge(array_fill_keys($uniques, ''), ['deleted_by' => $this->user->id, 'deleted_at' => Carbon::now()->toDateTimeString()]);\n\n $query = DB::table($table->database . '.dbo.' . $table->name);\n\n !$this->isCreater() && $query->where('created_by', $this->user->id);\n\n return $query->whereIn('id', Input::get('rows'))->update($updates);\n });\n\n return ['tables' => $tables];\n }", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "public function refreshRows(){\n if (count($this->rows) > 0){\n foreach ($this->rows as $row){\n $this->removeRow($row);\n }\n }\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "public function delete_all()\n {\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "function erase() {\n //delete * from database\n }", "public function deleteAll()\n {\n return $this->model::query()->delete();\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "abstract public function deleteAll();", "public function deleteRows() {\n if ($this->db->deleteRows($this->table_name)) {\n $this->db->save();\n return true;\n } else {\n return false;\n }\n }", "public function eraseAll() {\n $where = '1';\n return $this->delete($where);\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function erase() {\n\t\tif ($this->empty) {\n\t\t\ttrigger_error(self::TEXT_AxonEmpty);\n\t\t\treturn;\n\t\t}\n\t\tif (method_exists($this,'beforeErase'))\n\t\t\t// Execute beforeErase event\n\t\t\t$this->beforeErase();\n\t\t$_cond=$this->criteria;\n\t\tF3::sql(\n\t\t\t'DELETE FROM '.$this->table.\n\t\t\t\t(is_null($_cond)?'':(' WHERE '.$_cond)).';',\n\t\t\t$this->db\n\t\t);\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterErase'))\n\t\t\t// Execute afterErase event\n\t\t\t$this->afterErase();\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public static function deleteAllPlayers() {\n \tCommonDao::connectToDb();\n \t$query = \"delete from player where player_id > 0\";\n \tmysql_query($query);\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function flush()\n {\n $this->table()->delete();\n }", "public function unlinkAll()\n {\n return $this->pivotTable()->delete($this->wherePivot($this->parentKey(), null))->run();\n }", "public function delete()\n {\n if ( !$this->loaded )\n $this->reload();\n\n $this->lock();\n\n try\n {\n $sql = \"DELETE FROM $this->_table_name\n WHERE\n $this->left_column >= $this->left\n AND $this->right_column <= $this->right\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n\n $this->delete_space($this->left, $this->size);\n }\n catch (PDOException $e)\n {\n $this->unlock();\n throw $e;\n }\n\n $this->unlock();\n }", "public function deleteFromMatrix() {\n DB::statement('DELETE FROM lemma_matrix WHERE lemma1='.$this->id.' OR lemma2='.$this->id);\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "public function delall()\n {\n }", "function delete_all()\n {\n if ($this->GET('sure')) {\n $this->table->delete();\n $this->table->write();\n $this->structure();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete all rows from table `' . $this->table->tablename() . '`?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete_all&table=' . $this->table->tablename() . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }", "public function deleteAll() {\n \n $stmt = $this->pdo->prepare('DELETE FROM stocks');\n $stmt->execute();\n return $stmt->rowCount();\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function clear_all(){\r\n\r\n if (isset($_POST['clear'])){\r\n global $connection;\r\n\r\n // Clear all entries\r\n $query = \"DELETE FROM games\";\r\n $result = mysqli_query($connection, $query);\r\n }\r\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function remove_all_rolls() {\r\n\t\t$rolls_count = $this->db\r\n\t\t\t->delete($this->rolls_table);\r\n\t}", "public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}", "public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "public function deleteTestEntities() {\n $statement = sprintf(\"DELETE FROM %s WHERE %s < 0 AND %s < 0\", static::TABLE, static::FIELDS[0], static::FIELDS[1]);\n\n $this->db->exec($statement);\n }", "public function deleteAllElements()\n\t\t{\n\t\t\t//Borramos todos los elementos para despues insertarlos\n\t\t\t$deleteAllElements = 'TRUNCATE TABLE `BreakingNews';\n\n\t\t\t$result = $this->connection->query($deleteAllElements);\n\t\t}", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "function deleteAllData() {\n $successObservers = $this->databaseDeleteRecord($this->tableObservers, NULL);\n $successActions = $this->databaseDeleteRecord($this->tableActions, NULL);\n $successGroups = $this->databaseDeleteRecord($this->tableGroups, NULL);\n if ($successObservers !== FALSE && $successActions !== FALSE && $successGroups !== FALSE) {\n return TRUE;\n }\n return FALSE;\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function deleteTable(){\n\t \n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('DELETE FROM wp_nouveautes_test WHERE datep_nouveaute > \"2014-04-13\"');\n\n\t\t$wpdb->query('DELETE FROM wp_custom_categories_test WHERE term_id > 247');\n\t\t\t\t \n\t\t$wpdb->query('TRUNCATE TABLE wp_subcategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_extracategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_updated');\n\t\t \t\t \n\t}", "public function clearTable()\n {\n return $this->getEntityManager()\n ->createQuery(\n 'DELETE CsvBundle:Product p'\n )\n ->getResult();\n }", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "function remove_rows($table_id, $data) {\n\t$cmsEditDel = new cmsEditDel($table_id, $data);\n\t$delete_id = $cmsEditDel->dbChange();\n\tunset($cmsEditDel);\n\t\n\tif (empty($delete_id)) return;\n\t\n\t$child = getChildTables($table_id);\n\treset($child);\n\twhile (list($table_id, $field_name) = each($child)) {\n\t\tremove_rows($table_id, array($field_name => $delete_id));\n\t}\n\t\n}", "public function deleteRow($row);", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function deleteAll() {\n\n $this->start();\n $_SESSION = array();\n\n }", "function deleteAll(){\n $sql = \"DROP TABLE books\";\n if(mysqli_query($GLOBALS['con'], $sql)){\n TextNode(\"success\", \"All records have been lost, oh boy...\");\n } else {\n TextNode(\"error\", \"Phew!, something went wrong deleting all records.\");\n }\n\n}", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function delete($table);", "public function deleteAll(): int\n {\n return $this->pdo->exec(\"TRUNCATE \" . $this->table);\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}", "function clearAllClicks()\n {\n global $wpdb;\n $query = \"TRUNCATE TABLE \" . $this->table_name;\n return $wpdb->query($query);\n }", "public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "public function resetTable();", "public function clear() {\n\t\t\n\t\t$queryString = \"\n\t\t\tMATCH (n)-[r]-()\n\t\t\tDELETE n, r\n\t\t\";\n\t\t\n\t\t$result = $this->query($queryString);\n\t\t\n\t\t$queryString = \"\n\t\t\tMATCH (n)\n\t\t\tDELETE n\n\t\t\";\n\t\t\n\t\t$result = $this->query($queryString);\n\t}", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }", "public function delete()\n {\n\n //If no log in is performed redirect to login page\n if (!$this->loggedIn()) {\n header('Location: index.php?c=login&m=login');\n }\n\n //If no game id is provided redirect to login page\n if (!isset($_GET['id'])) {\n header('Location: index.php?c=game&m=index');\n }\n\n $clean = $this->cleanInput($_GET['id']);\n\n //Select row to be deleted from games table\n $gamesCollection = new GamesCollection();\n $game = $gamesCollection->getGameById($clean);\n\n //Check for result query in main table 'games'\n //If no records are fetched for a game redirect\n if (is_null($game)) {\n header('Location: index.php?c=game&m=index');\n }\n\n //Select rows to be deleted from tables games_names , games_description and games_year\n $gamesNamesCollection = new GamesNamesCollection();\n $gameName = $gamesNamesCollection->getGameName($game->getNameId());\n\n $gamesDescriptionCollection = new GamesDescriptionCollection();\n $gameDescription = $gamesDescriptionCollection->getGameDescription($game->getDescriptionId());\n\n $gamesYearCollection = new GamesYearCollection();\n $gameYear = $gamesYearCollection->getGameYear($game->getYearId());\n\n\n // Use name , id , description , year from result query stored in '$game'\n // and delete records in tables games_names , games_description , games_year\n $gamesNamesCollection->delete($gameName->getId());\n $gamesDescriptionCollection->delete($gameDescription->getId());\n $gamesYearCollection->delete($gameYear->getId());\n\n //Delete game column from games table and delete image from folder\n unlink('../images/'.$game->getImage());\n $gamesCollection->delete($game->getId());\n\n //Assign a value to a variable containing the video id of the selected video_id column and later use this value to\n //delete records from table games_videos\n $gamesAdditionalCollection = new GamesAdditionalCollection();\n $gameVideo = $gamesAdditionalCollection->getGameVideoById($clean);\n\n //Assign a value to a variable containing the image id of the selected image_id column and later use this value to\n //delete records from table games_gallery_images\n $gameImage = $gamesAdditionalCollection->getGameImageById(array('games_id' => $clean));\n\n //Delete records from table games_additional_info\n $gamesAdditionalCollection->delete($clean);\n\n //Delete records from table games_videos\n $gamesVideosCollection = new GamesVideosCollection();\n $gamesVideosCollection->delete($gameVideo->getVideoId());\n\n //First select image_id from table games_additional_info and use it to delete records\n //from table games_gallery_images and image files from folder small_images\n $imageCollection = new GamesGalleryImagesCollection();\n\n //Fill an array with an image_id for an image or images\n $imagesIdArray = array();\n $imagesNamesArray = array();\n foreach($gameImage as $img) {\n $imagesIdArray[] = $img->getImageId();\n }\n //End\n\n //$imagesIdArray contains ids and they are used to fetch the images names from\n // table games_gallery_images and store them in $imageNamesArray array\n foreach($imagesIdArray as $imageId) {\n $imagesNamesArray[] = $imageCollection->getGameImage(array('id' => $imageId));\n }\n //End\n\n //$imagesNameArray array contains the images names and they are used to delete\n //the actual images from the folder small_images\n foreach($imagesNamesArray as $imageName) {\n unlink('../small_images/'.$imageName[0]->getImage());\n }\n\n ///Delete records from table games_gallery images using the ids stored in $imagesIdArray\n foreach($imagesIdArray as $imageGallery) {\n $imageCollection->delete($imageGallery);\n }\n\n header('Location: index.php?c=game&m=index');\n }", "function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}", "public function deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "public function run()\n {\n Model::unguard();\n\n DB::table('documents__objects')->delete();\n DB::table('documents__pool')->delete();\n }", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function run()\n {\n $this->db->query('DELETE FROM ' . $this->db->i($this->table));\n\n // nav-site\n $this->seedNavSite();\n\n // nav-footer\n $this->seedNavFooter();\n\n }", "public function deleteRows( $rows )\r\n {\r\n rsort( $rows );\r\n foreach ($rows as $row) {\r\n $this->deleteRow( $row );\r\n }\r\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public function deleteAllPersistentData()\n {\n foreach ($this->persistantMap as $key) {\n $this->store->delete($key);\n }\n }", "public function purgeUndoTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_undo\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', __METHOD__, TL_CRON);\n\t}", "public function removeAll()\n {\n return $this->getModel()->whereRaw('1=1')->delete();\n }", "function delete_all()\r\n\t{\r\n\t\tif ( ! empty($this->all))\r\n\t\t{\r\n\t\t\tforeach ($this->all as $item)\r\n\t\t\t{\r\n\t\t\t\tif ( ! empty($item->id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$item->delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$this->clear();\r\n\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\treturn FALSE;\r\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM grupo_usuario_tabelas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }", "function delete_all()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete_all();\n\t$this->view_logs();\n}", "public function delete()\n {\n return $this->pivot()->delete();\n }", "public function dropAllData()\n {\n $database_name = $this->conn->getDatabase();\n\n $tables = $this->conn->query(\"SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = '$database_name';\")->fetchAll();\n\n $queries = \"SET FOREIGN_KEY_CHECKS=0;\\n\";\n\n foreach ($tables as $aTable){\n $queries .= reset($aTable);\n }\n\n $this->conn->executeQuery($queries);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['pegawai_id'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['tgl_shift'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_lembur'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_extra'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['temp_id_auto'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function flush(): bool\n {\n $table = $this->table()->delete();\n $index = $this->database->sqlite_sequence()->delete([\n 'name' => 'records'\n ]);\n return $table && $index;\n }", "public static function deleteAllScenes($itemId){\n\t\t$scenes = Scene::all();\n\t\tforeach ($scenes as $scene) {\n\t\t\t# code...\n\t\t\tif($scene->item_id == $itemId){\n\t\t\t\tScene::destroy($scene->id);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7290502", "0.70480096", "0.6930507", "0.67548877", "0.6734376", "0.6725009", "0.6723652", "0.65539384", "0.65539384", "0.65539384", "0.65283173", "0.65130717", "0.6490685", "0.64865285", "0.6485865", "0.6455496", "0.6454708", "0.6449651", "0.6443803", "0.64252967", "0.639501", "0.63752127", "0.6366606", "0.63276875", "0.6299018", "0.6278692", "0.62600034", "0.62588197", "0.6247433", "0.62460494", "0.6218682", "0.62016183", "0.6188466", "0.6174502", "0.6163898", "0.61544657", "0.61427474", "0.6141532", "0.6124452", "0.6117322", "0.6107898", "0.6104304", "0.61010456", "0.6079886", "0.6060579", "0.60604405", "0.605307", "0.6036988", "0.60348064", "0.60308886", "0.6023242", "0.60183334", "0.6015271", "0.6011606", "0.6008365", "0.6007606", "0.5998797", "0.5987428", "0.5982909", "0.5975183", "0.59596545", "0.5957124", "0.59484994", "0.5943435", "0.59305984", "0.59235144", "0.5907483", "0.59022254", "0.5886968", "0.5882333", "0.58676493", "0.5866051", "0.58623236", "0.58534783", "0.5852855", "0.5851898", "0.5851829", "0.5824737", "0.5820143", "0.58075017", "0.58032453", "0.57993966", "0.57983714", "0.57824004", "0.57817894", "0.5774048", "0.5773026", "0.57703936", "0.57674325", "0.5762474", "0.57621527", "0.57580346", "0.5755314", "0.5741727", "0.57359755", "0.57014537", "0.5698161", "0.56976426", "0.5692952", "0.5690504", "0.5689769" ]
0.0
-1
Performs a DELETE on the database based on the current ModelCriteria
public function delete(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(SceneTableMap::DATABASE_NAME); } $criteria = $this; // Set the correct dbName $criteria->setDbName(SceneTableMap::DATABASE_NAME); // use transaction because $criteria could contain info // for more than one table or we could emulating ON DELETE CASCADE, etc. return $con->transaction(function () use ($con, $criteria) { $affectedRows = 0; // initialize var to track total num of affected rows SceneTableMap::removeInstanceFromPool($criteria); $affectedRows += ModelCriteria::delete($con); SceneTableMap::clearRelatedInstancePool(); return $affectedRows; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteBy($criteria, $params = false)\n {\n $query = $this->model->query();\n\n /*== FILTER ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;\n\n if (isset($filter->field))//Where field\n $field = $filter->field;\n }\n\n /*== REQUEST ==*/\n $model = $query->where($field ?? 'id', $criteria)->first();\n $model ? $model->delete() : false;\n }", "protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }", "function delete_by( $conds = array() )\n\t{\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\t\t// delete the record\n\t return $this->db->delete( $this->table_name );\n\t //print_r($this->db->last_query());die;\n\t \n \t}", "public function delete() {\n if ($this->_is_new) return false;\n\n if (isset($this->_data[$this->_key_field])) {\n $where = array($this->_key_field=>$this->_data[$this->_key_field]); \n } elseif ($this->_load_criteria) {\n $where = $this->_load_criteria;\n } else {\n return false;\n }\n\n Q::create($this->_structure['table'])->delete($where)->exec();\n if (isset($this->_structure['relations'])) {\n foreach($this->_structure['relations'] as $relation_name=>$info) {\n $this->detach(null, $relation_name);\n }\n }\n if (isset($this->_structure['abilities'])) {\n foreach($this->_structure['abilities'] as $ability_name=>$info) {\n $ability_name = ucfirst($ability_name);\n if (!is_object($this->_loaded_abilities[$ability_name])) continue;\n $objects = array(&$this);\n $this->_loaded_abilities[$ability_name]->unlink($objects);\n }\n }\n return null;\n }", "public static function deleteByCriteria($criteria, $params = array())\n {\n \treturn FactoryAbastract::dao(get_called_class())->deleteByCriteria($criteria, $params);\n }", "public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }", "public function delete(SearchCriteriaInterface $searchCriteria) : bool;", "function getDeleteStatement($model,&$args);", "public abstract function deleteModel(\\MPF\\Db\\Model $model);", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public static function delete_where($model, $conditions){\t\t\n $table = self::table_for($model);\n $condition_string = self::make_conditions($conditions);\n return self::do_query(\"DELETE FROM \" . $table . \" WHERE \" . $condition_string);\t\n\t}", "public function byCriterion()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))->method('count')->will($this->onConsecutiveCalls(0, 1));\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(0, $data);\n $data = $this->dbEraser->deleteByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockNoTableAnnotationEntity'));\n $this->assertEquals(1, $data);\n $this->assertEquals('MockNoTableAnnotationEntitys', $this->mockQueryBuilder->getDeleteTable());\n $this->assertEquals('example', $this->mockQueryBuilder->getDeleteCriterion()->toSQL());\n }", "public function delete($model);", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }", "public function delete()\n {\n $conn = $this->getConnection();\n\n if (!isset($this->attributes->{$this->primaryKey})) {\n $trace = debug_backtrace()[0];\n throw new ModelException(\n 'No object has been loaded',\n 8000,\n $trace['file'],\n $trace['line']\n );\n }\n $key = $this->attributes->{$this->primaryKey};\n\n $bind = $this->getNamedParam();\n\n $statement = $this->getStatement();\n $statement->setWhere($this->primaryKey, '=', $bind);\n $statement->setBindings($bind, $key);\n\n $this->query = $statement->getDelete();\n $delete = $conn->prepare($this->query);\n\n return $this->execute($delete, $statement);\n }", "public function delete(array $criteria)\n {\n return $this->connection->delete(self::getTableName(), $criteria);\n }", "public function deleteByCriterion(stubCriterion $criterion, stubBaseReflectionClass $entityClass);", "public function deleteBy($criteria)\n {\n if (!$this->isRepositoryDeletable()) {\n throw $this->createNotDeletableException();\n }\n\n return $this->trigger(__FUNCTION__, [\n 'criteria' => $criteria,\n ]);\n }", "public abstract function delete($model, $useTransaction);", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }", "public function delete() {\n $where = func_get_args();\n $this->_set_where($where);\n\n $this->_callbacks('before_delete', array($where));\n\n $result = $this->db->delete($this->_table());\n\n $this->_callbacks('after_delete', array($where, $result));\n\n return $this->db->affected_rows();\n }", "public function delete($where);", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function action_delete_delete(){\r\n\t\t\t//permission check\r\n\t\t\tif(!$this->user->can('Assumeownership', array('owner' => $this->user->id))){\r\n\t\t\t\t$this->throw_permission_error(Constant::NOT_OWNER);\r\n\t\t\t}\r\n\r\n\t\t\tif(!isset($this->myID) || !isset($this->myID2))\r\n\t\t\t{\r\n\t\t\t\t$error_array = array(\r\n\t\t\t\t\t\"error\" => \"Required Parameters Missing\",\r\n\t\t\t\t\t\"desc\" => \"Required Parameters Missing.\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->modelNotSetError($error_array);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$subject = Ent::eFact($this->myID, $this->myID2);\r\n\t\t\t$subject->delete_with_deps();\r\n\t\t\treturn $subject->getBasics();\r\n\t\t}", "public function delete($data=null,$model=null){\n if($this->model==null){\n $this->model=$model;\n }\n\n return $this->allMethodProcess(function() use($data){\n return $this->querySqlFormatter->getDeleteQueryFormatter([],['where'=>$this->where,'execute'=>$this->execute,'model'=>$this->subClassOf]);\n },\"no--autoscope\");\n\n }", "public function sql_for_delete() {\n\t\t// Check if model is writable\n\t\t$this->assertModelIsWritable();\n\n\t\t// Destination model\n\t\t$model = $this->model;\n\n\t\t// Cascade deletion calculation for model $model\n\t\tforeach ($model::metaGetRelationships() as $relationshipName => $relationship) {\n\t\t\t// Nexii tuples and children tuple deletion\n\t\t\tif (\n\t\t\t\t($relationship[\"type\"] == \"OneToMany\" or $relationship[\"type\"] == \"ManyToMany\") and\n\t\t\t\tisset($relationship[\"on_master_deletion\"]) and\n\t\t\t\t$relationship[\"on_master_deletion\"] == \"delete\"\n\t\t\t) {\n\t\t\t\t$this->addRelatedModel($relationshipName);\n\t\t\t}\n\t\t}\n\n\t\t// SQL code generation\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/delete/query.twig.sql\");\n\t\t$sql = $sqlT->render([\"query\" => $this]);\n\n\t\t// Return DELETE statement SQL code\n\t\treturn $sql;\n\t}", "public function delete($whereCondition = \"\") {\r\n if ($this->object->deleteRule()) {\r\n if (empty($whereCondition)) {\r\n $c = $this->getConditions();\r\n\r\n if (empty($c)) {\r\n $whereCondition .= $c;\r\n } else {\r\n $whereCondition = (int) $this->object->getId();\r\n }\r\n }\r\n\r\n\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->delete($this->object, $whereCondition);\r\n } else {\r\n return false;\r\n }\r\n }", "function delete(&$model, $conditions = null) {\n\t\tif (!$this->_useAlias) {\n\t\t\treturn parent::delete($model, $conditions);\n\t\t}\n\t\t$alias = $this->name($model->alias);\n\t\t$table = $this->fullTableName($model);\n\t\t$joins = implode(' ', $this->_getJoins($model));\n\n\t\tif (empty($conditions)) {\n\t\t\t$alias = $joins = false;\n\t\t}\n\t\t$complexConditions = false;\n\t\tforeach ((array)$conditions as $key => $value) {\n\t\t\tif (strpos($key, $model->alias) === false) {\n\t\t\t\t$complexConditions = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$complexConditions) {\n\t\t\t$joins = false;\n\t\t}\n\n\t\t$conditions = $this->conditions($this->defaultConditions($model, $conditions, $alias), true, true, $model);\n\t\tif ($conditions === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->execute($this->renderStatement('delete', compact('alias', 'table', 'joins', 'conditions'))) === false) {\n\t\t\t$model->onError();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function delete(Model $model);", "public function delete(Model $model);", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "function mongo_lite_delete($collection, $criteria)\n\t{\n\t\t$collection = mongo_lite($collection);\n\n\t\treturn $collection->delete($criteria);\n\t}", "function delete()\n {\n $this->_getConnection();\n if (false === $this->get($this->_data['id'])) {\n return false;\n }\n $this->preDelete();\n // Find the models linking to the current one through a foreign key.\n foreach ($this->_methods_list as $method=>$details) {\n if (is_array($details)) {\n // foreignkey\n $related = $this->$method();\n foreach ($related as $rel) {\n if ($details[0] == $this->_model\n and $rel->id == $this->_data['id']) {\n continue; // $rel == $this\n }\n // We do not really control if it can be deleted\n // as we can find many times the same to delete.\n $rel->delete();\n }\n } else {\n // manytomany\n $related = $this->$method();\n foreach ($related as $rel) {\n $this->delAssoc($rel);\n }\n }\n }\n $req = 'DELETE FROM `'.$this->_con->pfx.$this->_table.'` WHERE'.\"\\n\";\n $req .= '`id` = \\''.$this->_con->esc($this->_data['id']).'\\'';\n if (!$this->_con->execute($req)) {\n throw new Exception($this->_con->error());\n }\n $this->_reset();\n return true;\n }", "public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }", "public function delete (&$model, $conditions=array()) {\r\n\t\t\r\n\t\t$this->showError(__('Delete unavailable', true));\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function deleting($model)\n\t{\n\t}", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "public function delete() {\n\t\t$args = func_get_args();\n\n\t\t// no argument, so delete current object\n\t\tif (empty($args))\n\t\t\treturn $this->db->where('id', $this->id)->delete($this->table);\n\n\t\t// argument given, so delete that object\n\t\treturn $this->db->where('id', $args[0])->delete($this->table);\n\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleteByModel(Model $model): bool;", "public function delete() {\n// 'missionServiceUsers' => array(self::HAS_MANY, 'MissionServiceUser', 'id_service_user'),\n// //'serviceUserConditions' => array(self::MANY_MANY, 'Condition', 'tbl_service_user_condition(id_service_user, id_condition)'),\n// 'serviceUserConditions' => array(self::HAS_MANY, 'ServiceUserCondition', 'id_service_user'),\n\n\n parent::delete();\n }", "public function delete(Identifiable $model);", "public function delete() {\n $query = $this->queryBuilder->delete()->getQuery();\n return $this->query($query);\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "public function DELETE() {\n #\n }", "public function delete() \n {\n $this->_data['query'] = 'DELETE';\n $this->_data['from'] = ' FROM '.$this->_data['from'];\n $this->_data['query'] .= $this->_data['from'];\n if (func_num_args() > 0) {\n $this->where(func_get_args());\n }\n return $this;\n }", "public function delete($conditions=[])\n {\n $conditionsArray = isset($conditions)?$this->bindParamsConditionProcess($conditions):\"\"; \n $str_condition = isset($conditionsArray[0])?$conditionsArray[0]:\"\";\n $vals =isset($conditionsArray[1])?$conditionsArray[1]:\"\"; \n $vals['@collection'] = $this->_table;\n $q = 'FOR c IN @@collection '.$str_condition.' REMOVE c IN @@collection RETURN OLD'; \n //exit;\n $response = ['query'=> $q, 'bindVars'=> $vals];\n $result = $this->customQueryWithParams($response);\n return $result; \n }", "public function delete_by()\n\t{\n\t\t$where = func_get_args();\n\t\t$this->_set_where($where);\n\n\t\t$where = $this->trigger('before_delete', $where);\n\n\t\tif($this->soft_delete)\n\t\t{\n\t\t\t$result = $this->db->update($this->_table, array($this->soft_delete_key => TRUE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->delete($this->_table);\n\t\t}\n\n\t\t$this->trigger('after_delete', $result);\n\n\t\treturn $result;\n\t}", "public function delete_search_criteria($post_data){\n $userId = $post_data['userId'];\n $searchId = $post_data['searchId'];\n $data = array('deleteFlag' => 1);\n\n $this->db->where('userId',$userId);\n $this->db->where('searchId',$searchId); \n $this->db->update('searchcriteria',$data); \n if($this->db->affected_rows()>0){\n $this->db->where('userId',$userId);\n $this->db->where('searchId',$searchId); \n $this->db->update('commute',$data);\n if($this->db->affected_rows()>0)\n {\n return true;\n }else{\n return false;\n }\n }\n }", "public function delete() {\r\n return $this->orm->delete();\r\n }", "public function execute()\n {\n $resultRedirect = $this->resultRedirectFactory->create();\n $id = $this->getRequest()->getParam('id');\n if ($id) {\n $model = $this->customData;\n $model->load($id);\n try {\n $model->delete();\n $this->messageManager->addSuccessMessage(__('Data Deleted'));\n return $resultRedirect->setPath('*/*/index');\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage(__($e->getMessage()));\n return $resultRedirect->setPath('*/*/edit', ['id'=>$id]);\n }\n }\n }", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function onRelationManageDelete()\n {\n $this->beforeAjax();\n\n /*\n * Multiple (has many, belongs to many)\n */\n if ($this->viewMode == 'multi') {\n if (($checkedIds = post('checked')) && is_array($checkedIds)) {\n foreach ($checkedIds as $relationId) {\n if (!$obj = $this->relationModel->find($relationId)) {\n continue;\n }\n\n $obj->delete();\n }\n }\n }\n /*\n * Single (belongs to, has one)\n */\n elseif ($this->viewMode == 'single') {\n $relatedModel = $this->viewModel;\n if ($relatedModel->exists) {\n $relatedModel->delete();\n }\n\n $this->viewWidget->setFormValues([]);\n $this->viewModel = $this->relationModel;\n }\n\n return $this->relationRefresh();\n }", "function delete($table, array $conditions);", "public function deleteAction() {\n $post_data = $request = $this->getRequest()->getPost();\n\n $mapper = new Application_Model_DistractionMapper();\n $anzDeletedRows = $mapper->delete($post_data['id']);\n\n $this->view->success = ($anzDeletedRows > 0);\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function deleted(MActivityRule $model)\n\t{\n\t}", "function erase() {\n\t\tif (method_exists($this,'beforeErase') && !$this->beforeErase())\n\t\t\treturn;\n\t\t$this->exec(array('method'=>'remove','criteria'=>$this->criteria));\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterErase'))\n\t\t\t$this->afterErase();\n\t}", "public function delete() {\n\n\t\t// Database\n\t\t$db = $this->db;\n\n\t\t// SQL code for deletion\n\t\t$sql = $this->sql_for_delete();\n\n\t\t// Deletion execution\n\t\treturn $db::execute($sql);\n\t}", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "public function delete($where){\n return parent::delete($this->table,$where);\n }", "public function delete()\n {\n return static::queryBuilder()->delete()->where(array('id' => $this->{$this->_idField}))->execute();\n }", "function deleteRecordByCondition($tablename, $condition) {\n $ci = & get_instance();\n $ci->load->database();\n $ci->db->delete($tablename, $condition);\n}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "function delete($condition = NULL)\n {\n $db_table = $this->model2table();\n $c2 = isset($this->id) ? \" WHERE id=\" . $this->id : \"\";\n $c = isset($condition) ? \"WHERE $condition\" : $c2;\n\n $sql = \"DELETE FROM $db_table $c\";\n\n if (!$this->getDonotLog()) {\n $this->logDeletedData(\"$db_table $c\");\n }\n\n $this->varifysql($sql);\n $stmt = $this->get_conn()\n ->prepare(\"$sql\");\n\n $this->_beforeDelete($this);\n $stmt->execute();\n $this->_afterDelete($this);\n\n return $stmt->rowCount();\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "function doRealDelete()\n {\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function delete() \n\t{\n\t\tif ($this->id) {\n\t\t\t$this->query->fields(\"id\")->compareTo($this->id);\n\t\t\treturn $this->query->delete();\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static function deleteAll($condition = NULL, $params = []) {\n return parent::updateAll([\n 'isdeleted' => 1,\n 'deletedtime' => date(\"Y-m-d H:i:s\"),\n 'deleteduser' => \\Yii::$app->user->getId()\n ], $condition, $params);\n }", "public function delete (ValueObjectAbstract $valueObject);", "public function delete($entity);", "public function delete(OrmModelInterface $model): bool\n {\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "public function delete() {\n\t\tif (!$this->_loaded) {\n\t\t\tthrow new Kohana_Exception('Cannot delete :model model because it is not loaded.', array(':model' => $this->_object_name));\n\t\t}\n\t\t\n\t\tif ($this->_call_behaviors('trigger_before_delete') & ORM_Behavior::CHAIN_RETURN) {\n\t\t\treturn $this;\n\t\t}\t\t\n\t\t\n\t\t$return = parent::delete();\n\t\t\n\t\t$this->_call_behaviors('trigger_after_delete');\n\t\t\t\n\t\treturn $return;\n\t}", "public function delete($deleteCriteria):int{\n\t\t\tthrow NotIplementedError();\t\n\t\t}", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "function delete()\n {\n $this->object->select();\n $this->object->_query_args['is_select'] = FALSE;\n $this->object->_query_args['is_delete'] = TRUE;\n return $this->object;\n }", "public function delete()\n {\n $database = cbSQLConnect::adminConnect('object');\n if (isset($database))\n {\n return ($database->SQLDelete(self::$table_name, 'id', $this->id));\n }\n }", "public function deleted(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('deleted'));\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function delete() {\n\n if (!$this->isUsed()) {\n // Database deletion\n $result = Db::getInstance()->delete($this->def['table'], '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n\n if (!$result) {\n return false;\n }\n\n // Database deletion for multilingual fields related to the object\n\n if (!empty($this->def['multilang'])) {\n Db::getInstance()->delete(bqSQL($this->def['table']) . '_lang', '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n }\n\n return $result;\n } else {\n return false;\n }\n\n }", "public function delete()\n {\n $query = ['collection' => $this->collection, 'filter' => $this->filter->toArray()];\n\n return $this->connection->delete($query, $options = []);\n }", "public function byCriterionNonEntityClass()\n {\n $this->dbEraser->deleteByCriterion($this->mockConnection, $this->getMock('stubCriterion'), new stubReflectionClass('MockNoEntityAnnotationEntity'));\n }", "public function delete(Model $parent);", "public function deleteAction()\n {\n $request = $this->getRequest();\n if($request->isPost()){\n $id = $this->params()->fromPost('id');\n $combo = $this->modelCombo->findOneBy(array('id'=>$id));\n $combo->setIsdelete(1);\n $this->modelCombo->edit($combo);\n //$this->model->delete(array('id'=>$id));\n echo 1;\n }\n die;\n\n }", "public function delete()\n {\n return $this->query->batchDelete($this->filter);\n }", "abstract public function delete(Entity $oMappedEntity);", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete() {\n $sql = \"DELETE FROM archivos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos_tipos_contratos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos WHERE id=:id\";\n $args = array(\n \":id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "protected function performDeleteOnModel()\n {\n $this->performCascadeDelete();\n parent::performDeleteOnModel();\n }" ]
[ "0.71742123", "0.6940287", "0.6878338", "0.6871387", "0.6870411", "0.67544645", "0.67374706", "0.6723886", "0.67231476", "0.67134583", "0.6704745", "0.6659441", "0.66567934", "0.66559327", "0.66308695", "0.66101927", "0.6608142", "0.659862", "0.65924466", "0.65509707", "0.65356696", "0.65348357", "0.6532412", "0.6531784", "0.65317655", "0.6526033", "0.651528", "0.65120536", "0.651011", "0.64997697", "0.64997697", "0.6495735", "0.64803404", "0.6453913", "0.6432527", "0.6388669", "0.6380393", "0.6368295", "0.63647914", "0.63622385", "0.6341228", "0.6340561", "0.63394004", "0.6333551", "0.6331997", "0.6327006", "0.6322213", "0.6311521", "0.6300946", "0.62987345", "0.6295017", "0.6294074", "0.62919044", "0.6290686", "0.6286807", "0.62766135", "0.62761396", "0.6275305", "0.62735647", "0.62713605", "0.6262906", "0.62625366", "0.62536186", "0.6252786", "0.6243237", "0.62410057", "0.6230722", "0.6223362", "0.6220585", "0.6220161", "0.6217038", "0.62062484", "0.6196149", "0.6189935", "0.6185825", "0.61857265", "0.61850417", "0.61805797", "0.618025", "0.6166956", "0.61623335", "0.6160924", "0.61605394", "0.6150395", "0.6146757", "0.6145386", "0.61408037", "0.6139477", "0.6137921", "0.61370057", "0.61361533", "0.61359906", "0.61350965", "0.6132511", "0.6130328", "0.612686", "0.6125813", "0.61218625", "0.61218625", "0.6120421", "0.61203045" ]
0.0
-1
Create a new view instance. // Create a new view instance $view = new View('home.index'); // Create a new view instance of a bundle's view $view = new View('admin::home.index'); // Create a new view instance with bound data $view = new View('home.index', array('name' => 'Taylor'));
public function __construct($view, $data = array()) { Event::fire('orchestra.started: view'); $view = Theme::resolve()->parse($view); $this->view = $view; $this->data = $data; // In order to allow developers to load views outside of the normal loading // conventions, we'll allow for a raw path to be given in place of the // typical view name, giving total freedom on view loading. if (starts_with($view, 'path: ')) { $this->path = substr($view, 6); } else { $this->path = $this->path($view); } // If a session driver has been specified, we will bind an instance of the // validation error message container to every view. If an error instance // exists in the session, we will use that instance. if ( ! isset($this->data['errors'])) { if (Session::started() and Session::has('errors')) { $this->data['errors'] = Session::get('errors'); } else { $this->data['errors'] = new Messages; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function view($name_view){\n return new View($name_view);\n}", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "function __construct()\n {\n $this->view = new View(); \n }", "public function view(){\r\n\r\n\t$this->registry->template->blog_heading = 'This is the blog heading';\r\n\t$this->registry->template->blog_content = 'This is the blog content';\r\n\t$this->registry->template->show('blog_view');\r\n}", "public function createView();", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "function __construct(){\n $this->view=new View(); \n }", "function __construct()\n {\n $this->view = new View();\n }", "public function view() {\n $this->view->data['view'] = 'hehe';\n /*** load the index template ***/\n $this->view->show('index/view');\n }", "function index() {\n $template = $this->loadView(\"home/index\");\n $template->set('name', 'Jonh Doe');\n $template->render();\n }", "private function views()\n {\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'mage-bdd');\n\n $this->app['view']->addNamespace('mage-bdd', __DIR__.'/../../resources/views');\n }", "public function View($view,$data=Null){\r\n $fullpath=cf(\"BASE/MVCPATH\").\"views\".DS.ucwords($view).EXT;\r\n $this->Load($fullpath,$data);\r\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "function view($view){\r\r\n $this->view = $view;\r\r\n }", "public function view($view, $data) {\r\n require_once __DIR__ . '/../views/' . $view . '.php';\r\n }", "public function __construct()\n {\n $this->view = new Views('about');\n }", "function views() {\n\t\t$this->view_rename(APP . 'views');\n\t\tprint_r($this->view_rename);\n\t}", "public function view() {\r\n\r\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "public function personHistoryView(){\n $this->view('auditor/personHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "public function __construct()\n {\n $this->view = new View($this);\n }", "public function view() {\n }", "public function viewAction()\n\t{\n\t\t$view = new ViewModel();\n\t\t// this is not needed since it matches \"module/controller/action\"\n\t\t$view->setTemplate('content/article/view');\n\t\t$article = 'var article';\n\t\t$articleView = new ViewModel(array(\n\t\t\t'article' => $article\n\t\t));\n\t\t$articleView->setTemplate('content/article');\n\t\t$primarySidebarView = new ViewModel();\n\t\t$primarySidebarView->setTemplate('content/main-sidebar');\n\t\t$secondarySidebarView = new ViewModel();\n\t\t$secondarySidebarView->setTemplate('content/secondary-sidebar');\n\t\t$sidebarBlockView = new ViewModel();\n\t\t$sidebarBlockView->setTemplate('content/block');\n\t\t$secondarySidebarView->addChild($sidebarBlockView, 'block');\n\t\t$view->addChild($articleView, 'article')->addChild($primarySidebarView, 'sidebar_primary')->addChild($secondarySidebarView, 'sidebar_secondary');\n\t\t\n\t\treturn $view;\n\t}", "public function view($view, $data = []) {\n require_once \"../app/views/\" . $view . \".php\";\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "public function indexAction() {\n $this->view->render('home/index'); //path from the view folder\n //we already have view because it's set up in the parent, render is from view\n }", "public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function views()\n {\n }", "function view($name,$data = []){\n extract($data);\n\n return require \"../includes/views/{$name}.view.php\";\n}", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function view($view, $data = [])\n\t{\n\t\trequire_once '../app/views/' . $view . '.php';\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $views = $em->getRepository('EspaceParentBundle:view')->findAll();\n\n return $this->render('view/index.html.twig', array(\n 'views' => $views,\n ));\n }", "function view($name, $data = [])\n{\n extract($data); // reverse of the compact() function\n\n return require \"app/views/{$name}.view.php\";\n}", "private static function view()\n {\n $files = ['View'];\n $folder = static::$root.'MVC/View'.'/';\n\n self::call($files, $folder);\n\n $files = ['Template', 'Views'];\n $folder = static::$root.'MVC/View/Libs'.'/';\n\n self::call($files, $folder);\n\n $files = ['ViewNotFoundException'];\n $folder = static::$root.'MVC/View/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "function view($viewName, $data = []) {\n // which can then be used.\n // For example ['name' => 'Ted', 'age' => 32] extracts out to\n // $name = 'Ted';\n // $age = 32;\n extract($data);\n return require \"app/views/{$viewName}.view.php\";\n}", "public function getView()\n {\n }", "public function views($name, $data = array())\n { \n $this->var['output'] .= $this->CI->load->view($name, $data, true); \n return $this; \n }", "function view($name, $place) {\n return new Project\\View($name, $place);\n}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function indexAction()\n\t{\n\t\t$this->view->helloWorld = \"Howdy All!\";\n\t}", "function homepage(){ \n $view = new View ;\n $view -> main_part = $view -> render2('cms/homepageList');\n $view -> render('cms/layouts/layout');\n}", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView() {}", "public function actionView() {}", "public function view()\n {\n //\n }", "public function initializeView() {}", "public function initializeView() {}", "function index(){\n $data['varName'] = 'Carlos';\n $data['varLname'] = 'Rivera';\n \n $this->load->view(\"home\", $data);\n }", "public function officerHistoryView(){\n $this->view('auditor/officerHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "function view($view = null, $data = array())\n {\n $factory = app('view');\n\n if (func_num_args() === 0) {\n return $factory;\n }\n\n return $factory->display($view, $data);\n }", "public function view($view, $data = []) {\n // Check for the view file\n if(file_exists(\"../app/views/{$view}.view.php\")) {\n require_once \"../app/views/{$view}.view.php\";\n \n } else {\n // View does not exist\n die('View does not exist');\n }\n }", "public function getView(){ }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "function load_view($template){$this->hold_template = APPPATH . '/views/' . $template . EXT;}", "function view($view_name, $data_array = array()){\n\t\tif(is_array($view_name)){\n\t\t\tforeach($view_name as $view)\n\t\t\t\t$this->view($view);\t\n\t\t} else {\t\t\n\t\t\tif(!is_array($data_array)){\n\t\t\t\tthrow new Exception('The second argument of Page::View page must be an array.');\n\t\t\t} else {\n\t\t\t\t$this->view_list[] = array('name' => $view_name, 'data' => $data_array);\n\t\t\t}\n\t\t}\n\t}", "function mscaffolding_create_main_view($name)\n\t{\n\t\t$view = lfile_read(\"tools/scaffolding/views/view.php\");\n\t\t$view = str_replace(\"***NAME***\", $name, $view);\n\t\treturn lfile_write(\"data/scaffolding/\" . $name . \"/views/\" . $name . \".php\", $view);\n\t}", "function index() {\n\n $this->view->render();\n\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "public function view($view, $data=[]){\n // verificamos que el archivo de la vista exista dentro de la carpeta vistas\n if(file_exists('../app/views/'. $view. '.php')){\n //requerimos la vista\n require_once '../app/views/'. $view. '.php';\n }else{\n // si la vista no existe\n die('La vista no existe');\n }\n }", "public function getView() {}", "public function getView() {}", "function __construct($nm=NULL) {\r\n $this->view= new view();\r\n $this->loadmodel($nm);\r\n }", "function view($view = '', $data = [])\n{\n $views = str_replace(\".\",\"/\", $view);\n require_once dirname(__DIR__,1) . \"/view/\" . $views . \".php\";\n}", "function index()\n {\n $this->_view_edit('view');\n }", "public function index()\n {\n\n\n $this->view->render();\n }", "protected function initializeView() {\n\t}", "public function index() {\n $viewData = DB::table('view')->get();\n return view('admin.View.view', compact('viewData'));\n }", "public function actionView()\n {\n \n }", "public function __construct($view = null) {}", "protected function createView()\n {\n return new IndexView();\n }", "public function indexAction()\n {\n// $this->view = 'index';\n }", "protected function view($view) {\n\n //Page subtitle\n switch($view) {\n case \"create\" :\n $this->page_subtitle = \"Create \".$this->model_name;\n break;\n case \"edit\" :\n $this->page_subtitle = \"Amend \".$this->model_name;\n break;\n\n case \"show\" :\n $this->page_subtitle =\"View \".$this->model_name;\n break;\n case \"list\" :\n $this->page_subtitle = \"List \".$this->model_name;\n break;\n case \"permissions\" :\n $this->page_subtitle = $this->model_name. \" Permissions\";\n break;\n }\n \n }", "public function index(Request $request){\n // enter your stuff here if you want...\n\n\t//anything you put into $this->view_data will be available in the view...\n\t//$this->view_data['how_cool_is_fred'] = 'very'\n\t//will mean that you can use {{how_cool_is_fred}} etc etc..\n\t//remember to look in /resources/views/DURC\n\t//to find the DURC generated views. Once you override those views..\n\t//DURC will not overwrite them anymore... same thing with this file.. you can change it and it will not\n\t//be overwritten by subsequent files...\n\n\treturn(parent::index($request));\n }", "public function viewAction()\n {\n $blogpostId = $this->_registry->args[0];\n $blogpost = new Rwtt_Entity_BlogPost();\n $blogpost->loadById($blogpostId);\n $this->view->title = $blogpost->title;\n $this->view->content = $blogpost->content;\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function hcview ($view = null, $data = [], $mergeData = [])\n {\n if (!array_key_exists ($view, config ('hc.views'))) {\n return view ($view, $data, $mergeData);\n }\n\n return view (array_get (config ('hc.views'), $view), $data, $mergeData);\n }", "public function getView();", "function view( $view ){\n\tinclude getApplicationSystemPath() . \"/public/view/\" . $view;\t\n}", "public function __invoke(): View\n {\n return view('index');\n }", "protected function initializeStandaloneViewInstance() {}", "public function create(): View\n {\n //\n }", "public function view($view='home', $table='', $id=null)\n\t{\n\t\tdebug_message(\"controller->view($view,$table,$id)\");\n\t\t$data = array();\n\t\t$view = new View($view, $data);\n\t}", "public function __construct() {\n parent::__construct();\n $this->model = new homeModel();\n $this->view = new homeView();\n }", "public function __construct(){\r\n $this->view = new Views(\"./app/view\");\r\n $this->site = new Site();\r\n $this->user = new User();\r\n }", "protected function view($view, $data = [])\r\n {\r\n if (file_exists(ROOT_DIR . '/app/views/' . $view . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/views/' . $view . '.php';\r\n }\r\n }", "public function index(){\n\t\t//return View::make();\n\n\t\t//$a = 1;\n\t\t//return View::with(compact ('a'));\n\n\t\t//return View::with()->make('aa');\n //make和with顺序可以颠倒,因为在view/base里面的__toString的方法\n\t\treturn View::make()->with();\n\t}" ]
[ "0.74036056", "0.6990151", "0.6948996", "0.69027114", "0.68902916", "0.68635786", "0.68501335", "0.68501335", "0.6822354", "0.6822258", "0.67800826", "0.6771771", "0.67242604", "0.66825396", "0.66580737", "0.6635066", "0.66340137", "0.66088897", "0.6596603", "0.65809137", "0.6559934", "0.6508293", "0.6500543", "0.64925045", "0.64791614", "0.64582086", "0.6454053", "0.6451489", "0.6443715", "0.6419591", "0.6417426", "0.6417121", "0.6417121", "0.64084965", "0.63958853", "0.6395442", "0.6394122", "0.63883275", "0.63790816", "0.6365876", "0.6350272", "0.6350272", "0.6345369", "0.6337437", "0.6336368", "0.6331232", "0.63289016", "0.6328871", "0.6320076", "0.6315347", "0.63102674", "0.6307105", "0.63038135", "0.63038135", "0.62904733", "0.62882197", "0.62882197", "0.62856585", "0.6275763", "0.62640613", "0.6261651", "0.6259572", "0.6247172", "0.6244754", "0.6244754", "0.6244754", "0.6244754", "0.6244754", "0.62402874", "0.62384397", "0.6236846", "0.623119", "0.62257844", "0.6220982", "0.62200695", "0.62200695", "0.62161607", "0.6198479", "0.6193891", "0.61909145", "0.6187726", "0.6183166", "0.6168136", "0.6166908", "0.61632246", "0.6161121", "0.61605126", "0.6151221", "0.6132944", "0.6130348", "0.6108259", "0.61025155", "0.6091067", "0.6089253", "0.6082661", "0.6081524", "0.6080605", "0.6079523", "0.60655755", "0.60598284", "0.60592663" ]
0.0
-1
/ | Default 404 page
public function pageNotFound() { $data['content'] = $this->load->view('backend/404/notFound', '', true); $this->load->view('dashboard_layout', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notfound() {\n\t\t$this->fw->render('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 show404();", "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 action_404()\n\t{\n\t\t//return Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}", "public function indexAction(){\n $this->view->render('404');\n\t}", "public function action_404()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\r\n\t}", "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 action_404()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\n\t}", "function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }", "public function action_404()\r\n {\r\n return Response::forge(Presenter::forge('welcome/404'), 404);\r\n }", "public function error404()\n\t{\n\t\t//envoie une entête 404 (pour notifier les clients que ça a foiré)\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tView::show(\"errors/404.php\", \"Oups ! Perdu ?\");\n\t}", "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\treturn Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}", "public static function error404(){\n \t\t// header(\"Status: 404 Not Found\");\n \t\theader('Location: /');\n }", "public function error_404()\n\t{\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tmeta::set_title('This Page will be Forever Missed');\n\t\t$this->template\n\t\t\t->set('title', 'Missing Page')\n\t\t\t->set('content', View::factory('errors/404'));\n\t}", "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 }", "function _404() {\n die();\n }", "public function notFound()\r\n {\r\n\r\n $this->render('Page Not Found', '404.view');\r\n }", "public function Error404()\n\t{\n\t\t$this->Render();\n\t}", "public function handle_404()\n {\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 static function ErrorPage404()\n {\n header('HTTP/1.1 404 Not Found');\n header(\"Status: 404 Not Found\");\n header('Location: '.$_SERVER['HTTP_HOST'].'404');\n }", "public function show_404() \n\t{\n\t\trequire $this->load->view('404', 'error');\n\t\texit;\n\t}", "public function Error404() {\n\t\t$this -> Render();\n\t}", "public function force404();", "public function force404();", "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 static function error404()\r\n\t{\r\n\t\theader(\"HTTP/1.1 404 Not Found\");\r\n\t\theader(\"Status: 404 Not Found\");\r\n\t\texit();\r\n\t}", "public static function displayError404() {\n\n\t\t\tself::display('Main/Status/Error404', 'STATUS_TITLE_404', STATUS_CODE_404);\n\t\t}", "public function error404Action() \n {\n return '404 Page not found';\n }", "function error_404() {\n\t\theader($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n\t\texit();\n\t}", "function error_404()\n\t{\n\t\t$this->output->set_status_header('404');\n\t\t$this->template->set_template('error');\n\t\t$this->template->write('title', 'HappyPerks');\n\t\t$data = $this->template->write_view('content', '404/error', isset($data) ? $data : NULL,true);\n\t\tprx($data);\n\t\t// $this->template->render();\n\n\t}", "function not_found() {\n\treturn show_template('404');\n}", "public function pageNotFound404()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'faq');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | 404 Page Not found')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/page_not_found');\n }", "public function error404(){\n\t\t$this->loadErrorView('Cette page n\\'existe pas', 'Error 404', 404); \n\t}", "private function pageNotFound()\n {\n $this->theme->setTitle(\"Sidan saknas\");\n $this->views->add('error/404', [\n 'title' => 'Sidan saknas',\n ], 'main-wide');\n }", "public function action_404() {\n $this->template->content = View :: factory('error/404');\n }", "public function show404() {\n\t\t$heading = '404 Страница не найдена';\n\t\t$message = 'Запрошенная страница не найдена.';\n\t\tExceptions::showError($heading, $message, 'error404', 404);\n\t\texit;\n\t}", "function notFound() {\n header('HTTP/1.0 404 Not Found');\n }", "public function error404() {\n\t\t$this->render('error400');\n\t}", "public function index() {\n header('Location: ' . URLROOT . '/errors/page_not_found');\n }", "public function render404(): void\n {\n header('HTTP/1.0 404 Not Found');\n header('Location: /404');\n die();\n }", "public function notFound() :string {\n\t\theader('HTTP/1.0 404 Not Found');\n\t\tdie('404 not found');\n\t}", "public function index()\n\t{\n\t\tdie('404 error');\n\t}", "function e404(){\n\t\theader('HTTP/1.0 404 Not Found');\n\t\trequire 'secciones/error404.sec.php';\n\t\tdie();\n\t}", "public function ooops()\r\n\t{\r\n\t\t$this->template->view('utilities/404.php');\r\n\t}", "function show_404() \r\n\t{\r\n\t\t//$this->set_title('Página no encontrada');\r\n\t\t//$this->view('404');\r\n\t\t$this->CI->output->set_status_header('404');\r\n\t\t//$this->CI->load->view('errors/404');\r\n\t\tshow_404($this->CI->uri->uri_string());\r\n\t}", "function sysError404(){\n\tsysError( \"Please check the address and try again.\", \"The page you requested was not found.\", \"Page Not Found\" );\t\n\texit();\n}", "public function show404()\n {\n header(\"HTTP/1.1 404 Not Found\");\n $this->title .= 'ошибка 404'; \n $this->content = System::template('client/v_404.php');\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 error404()\n {\n }", "function show_404() {\n\t\tredirect( 'users', 'location' );\n\t\texit();\n\t}", "function error_404() {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n exit(); //don't do any additional php, we are done\n }", "function maybe_redirect_404()\n {\n }", "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 pageNotFound()\n {\n $this->_status = '404 Page Not Found';\n }", "function render404() {\r\n header(\"HTTP/1.0 404 Not Found\");\r\n echo \"Seite nicht gefunden!\";\r\n exit();\r\n }", "static function showError404()\n {\n header(\"HTTP/1.0 404 Not Found\");\n include(\"views/layout/404.php\");\n exit();\n }", "public function actionnotfound()\n {\n $this->render('notfound');\n }", "public function page404() {\n\n view('pages.404');\n\n }", "function notFound()\n{\n error404('<h1>404 Not Found</h1>The page that you have requested could not be found.');\n}", "static function http404()\n {\n header('HTTP/1.1 404 Not Found');\n exit;\n }", "public function Page404(){\n\t\t$data = array(\n\t\t\t'aplikasi'\t\t=> $this->app_name,\n\t\t\t'title_page' \t=> 'Page 404',\n\t\t\t'title' \t\t=> '',\n\t\t\t// 'c'\t\t\t\t=> $c\n\t\t);\n\t\t$this->load->view('layout/V_404', $data);\n\t}", "public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }", "function page_not_found()\n{\n header(\"HTTP/1.0 404 Not Found\");\n include __DIR__ . \"/../view/404.php\";\n die();\n}", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page_404',\n\t\t)\n\t);\n}", "public function set_404()\n {\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}", "public function Error()\r\n\t{\r\n\r\n $this->load->view('404');\r\n\r\n\t}", "public function index(){\n// if(!file_exists($indexSite)) {\n// throw new Exception('对不起, 你所使用的' . ACTION_NAME . '并未找到');\n// }\n $this->display('404/index');\n }", "public function show_404()\r\n\t{\r\n\t\t$this->CI =& get_instance();\r\n\t\techo $this->CI->template->load_page('_errors/error_404', array(), true, false);\r\n\t\texit;\r\n\t}", "public function redirect404(){\n\n\t\t$this->page = new PageGenerator($this->app);\n\t\t$this->page->setContentFile(__DIR__ . '/../Errors/404');\n\t\t\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n\t\t\n\t\t$this->send();\n\t\t\n\t}", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page-404',\n\t\t)\n\t);\n}", "function drupal_fast_404(){}", "public function error404(): void {\n $this->template->set( _ROOT_TPL_ . 'error404.html');\n\n $tplVars = [\n 'HDR_ERROR' => $this->locale['ERR_404'], \n 'TXT_ERROR' => $this->locale['TXT_SOMETHING_WRONG']\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content->html = $this->template->parse();\n }", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\n }", "function p404()\n{\n\thttp_response_code(404);\n\tView\\Json::render(['error'=>'page not found']);\n}", "public function notFound()\n {\n Controller::getController('PageNotFoundController')->run();\n }", "public function notfoundAction()\n {\n $this->render('error/notfound');\n }", "public function show404() {\n header(\"HTTP/1.0 404 Not Found\");\n throw new Exception('404 Not Found');\n }", "protected function redirectNotFound(){\r\n \theader('Location: '.BASE_URI.Routes::getUri('not_found'));\r\n }", "public static function respond404()\n {\n header($_SERVER['SERVER_PROTOCOL'].\" 404 Not Found\", true, 404); //.replace = true\n $view = new NWTemplate();\n $view->display('404.tpl');\n }", "private function notFound() {\n if (file_exists(APP . 'Controller/error.php')) {\n header('Location: ' . BASE_URL . 'error');\n } else {\n die('Sorry, the requested content could not be found');\n }\n }", "public function notFound(){\n \n View::renderTemplate('pageNotFound.html');\n \n }", "public function RenderError404PlainText ();", "public function NotFound() {\r\n\t\t$this->PrepareController();\r\n\t\t$this->View = 'notfound';\r\n\t\t$this->Render();\r\n }", "function show_404($page = '', $log_error = TRUE)\n\t{\n\t\t// Load Router and Core classes.\n \t$RTR =& load_class('Router', 'core');\n\n \t// Redirect to not found\n \theader(\"Location: \" . $RTR->config->config['base_url'] . 'app_access/not_found');\n \texit;\n }", "function page_404(){\n$content = array(\n\t\t\t\t 'contents' => buddyexpressdesk_print('page:notfound:msg'),\n\t\t\t\t 'title' => buddyexpressdesk_print('page:notfound:code'),\n\t\t\t);\nreturn buddyexpressdesk_view_page(buddyexpressdesk_print('site:home'), buddyexpressdesk_layout_view('page_article', $content));\n}", "public function nf404()\n {\n return view('main.404');\n }", "public function pageNotFound() {\n\n $this->page->getPage('page_not_found.tpl');\n }", "protected function response_404()\n {\n $this->log->write_log('debug', $this->TAG . ': response_404: ');\n $this->response_error(VALUE_STATUS_CODE_ERROR, 'Page not found / wrong method', 404);\n }", "static function show_404($page = '')\n\t{ \t\n\t\tself::initCoreComponent('SHIN_Exceptions');\n\t\tself::$_exceptions->show_404($page);\n\t\texit;\n\t}", "function display404()\n{\n global $page, $uri, $version, $baseRoot, $domain, $langue, $trad, $accepted_lang, $title_page, $desc_page, $share_img, $userfileRoot, $id_tracker, $analytics_label;\n $section = '404';\n header(\"HTTP/1.0 404 Not Found\"); \n include('includes/header.php');\n include('pages/404.php');\n include('includes/footer.php');\n exit();\n}", "private static function pageNotFound()\n {\n if (self::$notFound && is_callable(self::$notFound)) {\n call_user_func(self::$notFound);\n } else {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n throw new ExceptionHandler(\"Hata\", \"Controller bulunamadı\");\n }\n }", "public function redirect404()\n\t{\n\t\t$this->page = new Page($this->app);\n\t\t$this->page->setView('404.php');\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n \t$this->send();\n\t}", "function Errors_404()\n{\n\treturn \"<html>\n\t\t\t<head>\n\t\t\t\t<title>404 Not Found</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<h1>Not Found</h1>\n\t\t\t\t<p>The requested URL was not found on this server.</p>\n\t\t\t\t<p>Additionally, a 404 Not Found\n\t\t\t\terror was encountered while trying to use an ErrorDocument to handle the request.</p>\n\t\t\t</body>\n\t\t\t</html>\";\n}", "function redirect_guess_404_permalink()\n {\n }", "protected function redirectNotFound()\n {\n return Response::view('errors.404', array('pageTitle'=> Lang::get('messages.Error')), 404);\n }", "public static function error404($text = '') {\n header(\"{$_SERVER['SERVER_PROTOCOL']} 404 Not Found\");\n View::render(static::VIEW_ERROR_HTTP, [\n 'code' => 404,\n 'msg' => $text ? $text : 'Page not found.',\n ], static::LAYOUT_ERROR_HTTP, false, App::requestIsAjax());\n static::end(44);\n }" ]
[ "0.83574694", "0.8267631", "0.8238099", "0.8220821", "0.81490517", "0.8144881", "0.8117896", "0.81073153", "0.80780756", "0.8074733", "0.8071961", "0.8049352", "0.8008136", "0.7999048", "0.791967", "0.7918957", "0.79188925", "0.79167086", "0.7902099", "0.79005605", "0.78892714", "0.78889334", "0.7863051", "0.78529143", "0.7850476", "0.7846383", "0.7846383", "0.78430146", "0.78274477", "0.7827121", "0.781904", "0.78159827", "0.7814241", "0.7801108", "0.7800271", "0.77787477", "0.7775081", "0.7774622", "0.7769321", "0.77673894", "0.77594477", "0.7733026", "0.7716629", "0.77120626", "0.770739", "0.7697163", "0.7681371", "0.76759243", "0.7673926", "0.7670664", "0.7652157", "0.7649705", "0.76449174", "0.76221794", "0.761019", "0.76050663", "0.75958115", "0.75939554", "0.7582591", "0.75764084", "0.75719565", "0.75657946", "0.7557802", "0.75570357", "0.7535724", "0.75335807", "0.75292224", "0.75224257", "0.75207675", "0.75186837", "0.7515365", "0.7502446", "0.7502367", "0.75007546", "0.74934465", "0.7486024", "0.7483401", "0.74751776", "0.7472486", "0.74677724", "0.7458409", "0.74577725", "0.7457383", "0.74557376", "0.745128", "0.74297875", "0.7407064", "0.7401677", "0.7395047", "0.7385404", "0.73844814", "0.73717344", "0.7362367", "0.734374", "0.7333733", "0.73247695", "0.73193765", "0.7253701", "0.724986", "0.7226517" ]
0.72850186
97
Optional constructor argument has been provided for backwards compatability. TODO: Consider it to not be optional in 4.x, BC
public function __construct(SessionEngineInterface $session = null) { $this->session = $session ?: new PhpEngine(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($arg = null)\n {\n }", "private final function __construct() {}", "function __construct($arg0 = null) {\n\t}", "final private function __construct() {}", "final private function __construct() {}", "protected abstract function __construct();", "protected final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() { /* Do nothing here */ }", "private function __construct() { /* Do nothing here */ }", "abstract protected function __construct();", "public function __construct($a, $b, $c = null, $d = null) {}", "private function __construct () {}", "public abstract function __construct($variable = NULL);", "abstract public function __construct($value);", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();", "public function __construct ($value) {}", "public function __construct ($value) {}", "public function __construct ($value) {}", "abstract function __construct();", "private function __construct()\r\n {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct()\n {}", "private function __construct()\n {}" ]
[ "0.7205986", "0.7075132", "0.70221055", "0.7018512", "0.7018512", "0.6961811", "0.6878345", "0.6875533", "0.6875533", "0.6875533", "0.6873033", "0.6873033", "0.6872551", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.68725264", "0.6768977", "0.6768977", "0.6766163", "0.6727533", "0.67073697", "0.67071074", "0.66764027", "0.6609158", "0.6609158", "0.6609158", "0.6607876", "0.6607876", "0.6607876", "0.66047627", "0.6594294", "0.65871817", "0.65871817", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6581474", "0.6559798", "0.6559798" ]
0.0
-1
Checks if session started
public function started(): bool { return $this->session->started(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function session_started(){\n\t\t\tif(isset($_SESSION) && session_id()){\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function isStarted(){\n\t\t\treturn isset( $_SESSION );\n\t\t}", "protected function sessionStarted() {\n\n return \\session_id() !== \"\" || \\session_status() === PHP_SESSION_ACTIVE;\n }", "public static function isStarted(): bool {\n\t\treturn self::$sessionInstance->isStarted ();\n\t}", "public function canStartSession();", "function wv_is_session_started() {\n if (php_sapi_name() !== 'cli') {\n if (version_compare(phpversion(), '5.4.0', '>=')) {\n return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;\n } else {\n return session_id() === '' ? FALSE : TRUE;\n }\n }\n return FALSE;\n }", "private static function isStarted()\r\n {\r\n // several functions has been added in php 5.4\r\n // disallow determining session stuff when running from command line\r\n if (php_sapi_name() !== 'cli')\r\n {\r\n // are we on PHP 5.4 or higher?\r\n if (version_compare(phpversion(), '5.4.0', '>='))\r\n return (session_status() === PHP_SESSION_ACTIVE);\r\n else\r\n return (session_id() !== '');\r\n }\r\n\r\n return false;\r\n }", "function is_session_started(){\r\n\t\t\r\n\t\tif ( php_sapi_name() !== 'cli' ) {\r\n\t\t if ( version_compare(phpversion(), '5.4.0', '>=') ) {\r\n\t\t return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;\r\n\t\t } else {\r\n\t\t return session_id() === '' ? FALSE : TRUE;\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "function is_session_started() {\r\n if ( php_sapi_name() !== 'cli' ) {\r\n if ( version_compare(phpversion(), '5.4.0', '>=') ) {\r\n return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;\r\n } else {\r\n return session_id() === '' ? FALSE : TRUE;\r\n }\r\n }\r\n return FALSE;\r\n }", "public function hasSession() {}", "function is_session_started()\n{\n if ( php_sapi_name() !== 'cli' ) {\n if ( version_compare(phpversion(), '5.4.0', '>=') ) {\n return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;\n } else {\n return session_id() === '' ? FALSE : TRUE;\n }\n }\n return FALSE;\n}", "function is_session_started() {\n if (php_sapi_name() !== 'cli') {\n if (version_compare(phpversion(), '5.4.0', '>=')) {\n return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;\n } else {\n return session_id() === '' ? FALSE : TRUE;\n }\n }\n return FALSE;\n}", "public static function start() {\n\t if(self::isRequest()\n\t && (PHP_SESSION_ACTIVE == ($status = session_status())\n\t || (PHP_SESSION_NONE == $status && session_start()))) {\n\t return true;\n\t } else {\n\t if(!isset($_SESSION)) {\n\t // create a dummy session array\n\t $_SESSION = array();\n\t }\n\t return false;\n\t }\n\t}", "protected function checkIfStarted()\n {\n if (!$this->started) {\n throw new SessionException('Session not started.');\n }\n }", "public function hasSession()\n {\n if ($this->session) {\n return $this->session->isStarted();\n } else {\n return false;\n }\n }", "protected static function sessionExists() {\n return session_status() == 2;\n }", "public static function isSessionAutoStartEnabled() {}", "protected function hasStarted()\r\n {\r\n return isset($this->_session[$this->_stepsKey]);\r\n }", "private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "function guestbook_session_started($set = NULL) {\n static $session_started = FALSE;\n if (isset($set)) {\n $session_started = $set;\n }\n return $session_started && session_id();\n}", "private function isSessionAvailable(): bool\n {\n return $this->session !== null;\n }", "public function start() {\r\n\t\tif (!self::hasSession()) {\r\n\t\t\tself::session();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isStarted();", "public function isStarted();", "public function isStarted();", "public function isStarted() {}", "private function active(): bool\n {\n return session_status() === \\PHP_SESSION_ACTIVE;\n }", "public function checkSessionStatus(){\t\t\n\t\tif(isset($_SESSION[self::$session])){\n\t\t\treturn $_SESSION[self::$session];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasSession() {\r\n\t\treturn is_null($this->id) ? false : true;\r\n\t}", "function checkSession()\n {\n if(isset($_COOKIE['sessionId']))\n {\n $response = callApi('GET', 'session', ['sessionid' => $_COOKIE['sessionId']]);\n if($response['code'] == '200')\n return true;\n else\n return false;\n }\n }", "public static function hasSession() {\n\t if (session_status() == PHP_SESSION_ACTIVE) {\n\t return true;\n\t }\n\t return false;\n\t}", "private function session(){\n\t\tswitch (session_status()) {\n\t\t\tcase PHP_SESSION_DISABLED:\n\t\t\t\t$this->logout();\n\t\t\t\tbreak;\n\t\t\tcase PHP_SESSION_NONE:\n\t\t\t\tsession_start();\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase PHP_SESSION_ACTIVE:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasSession() {\n return !empty($this->session);\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "public function startSession(){\n if ( $this->sessionState == self::SESSION_NOT_STARTED ) {\n $this->sessionState = session_start();\n }\n \n return $this->sessionState;\n }", "static public function isInSession(){\n if (isset($_SESSION['in_session'])){\n return true;\n } else {\n return false;\n }\n }", "public function startSession(){\n\t\tif( $this->sessionState == self::SESION_NO_INICIADA){\n\t\t\t$this->sessionState = session_start();\n\t\t}\n\t\treturn $this->sessionState;\n\t}", "public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }", "static public function sessionIsValid()\n {\n try {\n $ret = false;\n\n session_start();\n\n // TODO: Make sure this is correct\n if (isset($_SESSION) && $_SESSION['sessionkey']) {\n $ret = true;\n\n // Update last activity time stamp\n $_SESSION['LAST_ACTIVITY'] = time();\n } else {\n session_unset();\n session_destroy();\n }\n\n return $ret;\n } catch (Exception $e) {\n return false;\n }\n }", "public function isStarted()\n\t{\n\t\treturn true;\n\t}", "public function isStarted() {\n }", "private function ensureStarted(): void\n {\n if (session_status() === PHP_SESSION_NONE) {\n session_start();\n }\n }", "public static function sessionStart() {\n\t\t\t//return false;\n\n\t\t//if(isset($_SESSION[\"PHPSESSID\"])) unset($_SESSION[\"PHPSESSID\"]);\n\t\tif(empty(session_id()))\n\t\t\t@session_start();\n\t\t//$_SESSION[\"PHPSESSID\"] = true;\n\t\treturn true;\n\t}", "public static function checkActive () {\n\t\tif ( trim( session_id() ) == FALSE ) {\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function isStarted()\n {\n return $this->_manager->isStarted();\n }", "function _session_is_valid(){\n\t\treturn session_is_valid($this->_state_session_id);\n\t}", "private function isSession () : bool {\n return !empty($_SESSION);\n }", "public function session_check(){\n if(isset($_SESSION['login_user_id'])){\n return true;\n } else {\n return false;\n }\n }", "public function start() {\n if (!$this->sessionStarted()) {\n if (\\session_start()) {\n\n $hash = md5($_SERVER['HTTP_USER_AGENT'] . \"---|---\" . $this->name);\n $_SESSION['_fingerprint'] = $hash;\n\n return mt_rand(0, 4) === 0 ? $this->refresh() : true; // 1/5, regenerate sid\n }\n }\n return false;\n }", "public static function isLoggedIn() \n {\n // Check whether the session index with the SESSION_KEY\n // has been set\n if (Session::keyExists(self::SESSION_KEY)) {\n return true; \n }\n else {\n return false;\n }\n }", "public function isActive() : bool\n {\n return \\session_status() === \\PHP_SESSION_ACTIVE;\n }", "function isStarted()\n {\n return (TRUE == $this->started);\n }", "public function start(){\n\t\t$this->current_time = $this->time->time;\n\t\t$this->data['user_id'] = ANONYMOUS;\n\t\t$boolValid = false;\n\n\t\t//Return, if we don't want a session\n\t\tif (defined('NO_SESSION')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remove old sessions and update user information if necessary.\n\t\tif($this->current_time - $this->session_length > $this->config->get('session_last_cleanup')){\n\t\t\t$this->cleanup($this->current_time);\n\t\t}\n\t\t//Cookie-Data\n\t\t$arrCookieData = array();\n\t\t$arrCookieData['sid']\t= get_cookie('sid');\n\t\t$arrCookieData['data']\t= get_cookie('data');\n\t\t$arrCookieData['data']\t= ( !empty($arrCookieData['data']) ) ? unserialize(base64_decode(stripslashes($arrCookieData['data']))) : '';\n\n\t\t//Let's get a Session\n\t\tif ($this->in->exists('s') && $this->in->get('s', '') != \"\"){\n\t\t\t//s-param\n\t\t\t$this->sid = $this->in->get('s', '');\n\t\t} else {\n\t\t\t$this->sid = $arrCookieData['sid'];\n\t\t}\n\n\t\t//Do we have an session? If yes, try to look if it's a valid session and get all information about it\n\t\tif ($this->sid != ''){\n\t\t\t$query = $this->db->query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM __sessions s\n\t\t\t\t\t\t\t\tLEFT JOIN __users u\n\t\t\t\t\t\t\t\tON u.user_id = s.session_user_id\n\t\t\t\t\t\t\t\tWHERE s.session_id = '\".$this->db->escape($this->sid).\"'\n\t\t\t\t\t\t\t\tAND session_type = '\".$this->db->escape((defined('SESSION_TYPE')) ? SESSION_TYPE : '').\"'\");\n\t\t\t$arrResult = $this->db->fetch_record($query);\n\t\t\t$this->db->free_result($query);\n\n\t\t\t$this->data = $arrResult;\n\t\t\tif (!isset($this->data['user_id'])){\n\t\t\t\t$this->data['user_id'] = ANONYMOUS;\n\t\t\t}\n\n\t\t\t//If the Session is in our Table && is the session_length ok && the IP&Browser fits\n\t\t\t//prevent too short session_length\n\t\t\tif ($arrResult && (($arrResult['session_start'] + $this->session_length) > $this->current_time) ){\n\t\t\t\t//If the IP&Browser fits\n\t\t\t\tif (($arrResult['session_ip'] === $this->env->ip) && ($arrResult['session_browser'] === $this->env->useragent)){\n\t\t\t\t\t//We have a valid session\n\t\t\t\t\t$this->data['user_id'] = ($this->data['user_id'] == (int)$arrResult['session_user_id']) ? intval($arrResult['session_user_id']) : $this->data['user_id'];\n\t\t\t\t\t$this->id = $this->data['user_id'];\n\t\t\t\t\t// Only update session DB a minute or so after last update or if page changes\n\t\t\t\t\tif ( ($this->current_time - $arrResult['session_current'] > 60) || ($arrResult['session_page'] != $this->env->current_page) ){\n\t\t\t\t\t\t$this->db->query(\"UPDATE __sessions SET :params WHERE session_id = ?\", array(\n\t\t\t\t\t\t\t'session_current'\t=> $this->current_time,\n\t\t\t\t\t\t\t'session_page'\t\t=> strlen($this->env->current_page) ? $this->env->current_page : '',\n\t\t\t\t\t\t), $this->sid);\n\t\t\t\t\t}\n\t\t\t\t\t//The Session is valid, copy the user-data to the data-array and finish the init. You you can work with this data.\n\n\t\t\t\t\tregistry::add_const('SID', \"?s=\".((!empty($arrCookieData['sid'])) ? '' : $this->sid));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//START Autologin\n\t\t$boolSetAutoLogin = false;\n\n\t\t//Loginmethod Autologin\n\t\t$arrAuthObjects = $this->get_login_objects();\n\t\tforeach($arrAuthObjects as $strMethods => $objMethod){\n\t\t\tif (method_exists($objMethod, 'autologin')){\n\t\t\t\t$arrAutologin = $objMethod->autologin($arrCookieData);\n\t\t\t\tif ($arrAutologin){\n\t\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//EQdkp Autologin\n\t\tif (!$boolSetAutoLogin){\n\t\t\t$arrAutologin = $this->autologin($arrCookieData);\n\t\t\tif ($arrAutologin){\n\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t}\n\t\t}\n\n\t\t//Bridge Autologin\n\t\tif (!$boolSetAutoLogin && $this->config->get('cmsbridge_active') == 1 && $this->config->get('pk_maintenance_mode') != 1){\n\t\t\t$arrAutologin = $this->bridge->autologin($arrCookieData);\n\t\t\tif ($arrAutologin){\n\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t}\n\t\t}\n\t\t//END Autologin\n\n\t\t//Let's create a session\n\t\t$this->create($this->data['user_id'], (isset($this->data['user_login_key']) ? $this->data['user_login_key'] : ''), $boolSetAutoLogin);\n\t\t$this->id = $this->data['user_id'];\n\t\treturn true;\n\t}", "public function hasSession()\n {\n $session = \\Session::get($this->instanceName) ?? collect([]);\n\n return $session->isNotEmpty();\n }", "public function checkUsersSession(){\n\t}", "public function isStarted()\n {\n return true;\n }", "public function isStarted()\n {\n return true;\n }", "public function isStarted()\n {\n return true;\n }", "public function maybeStartSession() {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "public function logged_in ()\n\t\t{\n\t\t\tif(!isset($_SESSION))\n\t\t\t{\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t\treturn isset($_SESSION['id']);\n\t\t}", "public static function isConnected() {\n return isset($_SESSION['userid']);\n }", "public function isValid()\n {\n // Initialize\n $bReturn = false;\n\n // Session should be started\n if (($this->_pStorage->status() == PHP_SESSION_ACTIVE )) {\n // Get stored UID\n $uidSaved = $this->_pStorage->getOffset(self::UID, APPLICATION_NAME);\n\n // Compare with the client uid\n $bReturn = ( $this->_iCRC == $uidSaved );\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }//if(...\n\n return $bReturn;\n }", "public static function isLoggedIn()\n {\n self::startSession();\n return isset($_SESSION['user']);\n }", "static public function isCurrentSessionValid() {\n\t\t$session = self::getCurrentSession();\n\t\t\n\t\tif (!empty($session)) {\n\t\t\t\n\t\t\t$now = new DateTime('now', new DateTimeZone('UTC'));\n\t\t\t$ssoSessionExpires = new DateTime($session->SSOSessionExpires);\n\t\t\t\n\t\t\tif ($ssoSessionExpires > $now) \n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t\tself::clearCurrentSession();\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn false;\n\t}", "protected function loggedIn() {\n return isset($_SESSION) && array_key_exists(self::user, $_SESSION);\n }", "public static function use_sessions()\n {\n \\Session::started() or \\Session::load();\n }", "public function exists()\n {\n // Initialize\n $bReturn = false;\n\n // Session should be started\n if (($this->_pStorage->status() == PHP_SESSION_ACTIVE )) {\n // Get stored UID\n $bReturn = $this->_pStorage->existsOffset(self::UID, APPLICATION_NAME);\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }//if(...\n\n return $bReturn;\n }", "public function isStarted()\n {\n return $this->started_at > 0;\n }", "public static function isExist() {\n return ((self::$_isSessionRunning) && !empty($_COOKIE[session_name()]));\n }", "public function checkLoginStatus()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth]) || isset($_SESSION[$this->sess_cookie_auth])) {\n\t\t\treturn true;\n\t\t}\n\t}", "function connected(){\n\treturn (isset($_SESSION['id']));\n}", "protected function checkSessionLifetime() {}", "private function sesion_iniciada()\n\t{\n\t\t$this->load->library(\"session\");\n\t\tif($this->session->userdata(\"isess\")){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function startSession() {}", "protected function isSessionValid() {\n if(empty($this->metadata)) {\n throw new \\RuntimeException(\n \"Session metadata key is missing from SESSION superglobal.\"\n );\n }\n return (\n $this->isValidFingerprint() === true &&\n (\n $this->metadata->isActive === true ||\n $this->isForwardedSession()\n )\n );\n }", "public static function start()\r\n {\r\n if (!self::isStarted())\r\n session_start();\r\n }", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public function verifySession() {\n\t\t$this->reload();\n\t\tif ($this->getSession() == session_id())\n\t\t\treturn true;\n\t\telse {\n\t\t\tif($_SESSION[\"loginUser\"])\n\t\t\t\tunset($_SESSION[\"loginUser\"]);\n\t\t\treturn false;\n\t\t}\n\t}", "function checkLoggedIn(){\n if (session_status()!==PHP_SESSION_ACTIVE) {\n session_start();\n }\n if(!isset($_SESSION['EMAIL'])){\n return false;\n }else return true;\n }", "public function isLoggedIn(){\n // Apakah user_session sudah ada di session\n if(isset($_SESSION['user_session']))\n {\n return true;\n }\n }", "public static function isLoggedIn(){\r\n\t\treturn isset($_SESSION[\"id\"]);\r\n\t}", "public function state()\n {\n return isset($_SESSION['id']);\n }", "public function checkSession() {\n if ($this->session->userdata('ohadmin')) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public static function startSession();", "public function hasStarted() {\n if($this->state != \"unavailable\" &&\n $this->state != \"available\") {\n \n return true;\n } else {\n return false;\n }\n }", "public function isSessionAutostartDisabled()\n {\n $checking_result = (Bootstrap::getIniParam('session.auto_start') == true) ? false : true;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_session_auto_start_enabled'), true, 'valiator');\n }\n\n return $checking_result;\n }", "public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}", "public function isLoggedIn()\n {\n return $this->session->has('user');\n }", "function sessionExists() {\n\t\tif ((isset($_SESSION['valid_user'])) && (($_SESSION['valid_user']) != null)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkCurrentSession()\n {\n if ($this->userSession->isLogged()) {\n foreach ($this->filterProviders('SessionCheckProviderInterface') as $provider) {\n if (!$provider->isValidSession()) {\n $this->logger->debug('Invalidate session for ' . $this->userSession->getUsername());\n $this->sessionStorage->flush();\n $this->preAuthentication();\n\n return false;\n }\n }\n }\n\n return true;\n }", "private static function _init() {\n if (session_status() == PHP_SESSION_DISABLED)\n throw new SessionDisabledException();\n if ('' === session_id()) {\n return session_start();\n }\n if (true === self::$REGENERATE_SESSION_ID) {\n return session_regenerate_id();\n } else {\n return true;\n }\n }", "static function verifyLogin(){\r\n\r\n // check if there's a session\r\n if(session_id() == '' && !isset($_SESSION)){\r\n session_start();\r\n }\r\n\r\n // if session is started, check if a user is login or not\r\n if(isset($_SESSION[\"loggedin\"])){\r\n \r\n return true;\r\n }\r\n else{\r\n session_destroy();\r\n \r\n return false;\r\n }\r\n }", "function inSession($name)\r\n {\r\n return(isset($_SESSION['insession.'.$this->readNamePath()]));\r\n }", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "static function start()\n {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "public function isStarted()\n\t{\n\t\tif($this->test_status_id == Test::STARTED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "public function sessionExists(): bool\n {\n $result = true;\n if (empty($_SESSION)) {\n $result = false;\n }\n return $result;\n }", "protected function isLogin()\n {\n $skey = \\Web\\Config\\Auth::$prefix . $this->sessionId;\n if (\\Web\\Config\\Auth::$username != $this->gdata($skey)) {\n return false;\n }else{\n $this->gexpire($skey, \\Web\\Config\\Auth::$expire);\n return true;\n }\n }" ]
[ "0.8435823", "0.84339964", "0.8287164", "0.81270486", "0.81091356", "0.7996144", "0.79635715", "0.79631275", "0.79214627", "0.7860717", "0.76598203", "0.76568764", "0.76434326", "0.7626496", "0.75521904", "0.74800104", "0.74690205", "0.7395942", "0.7376816", "0.7353803", "0.73532027", "0.73455477", "0.7317506", "0.7317506", "0.7317506", "0.7259538", "0.7230592", "0.72229236", "0.7183029", "0.7179959", "0.71348107", "0.7099012", "0.7095456", "0.70472115", "0.70333105", "0.70240855", "0.7022913", "0.7019517", "0.7018141", "0.70150334", "0.7009297", "0.6985377", "0.69832134", "0.6977725", "0.69736147", "0.69596636", "0.6924705", "0.6922232", "0.69127023", "0.6909544", "0.6894008", "0.68788075", "0.68584025", "0.68523717", "0.6840928", "0.6833305", "0.6833305", "0.6833305", "0.68282515", "0.6809314", "0.68061745", "0.67992675", "0.67918295", "0.67897433", "0.6788514", "0.67806137", "0.6774415", "0.6750727", "0.6728694", "0.6723142", "0.67163044", "0.671195", "0.6707756", "0.6698473", "0.66916955", "0.6690119", "0.6676724", "0.66702145", "0.66690016", "0.66672647", "0.66561747", "0.6652724", "0.6648936", "0.6646187", "0.66443455", "0.6639994", "0.66390437", "0.6637025", "0.6636655", "0.66253155", "0.66248316", "0.66218466", "0.6621803", "0.662042", "0.662042", "0.6617722", "0.66097265", "0.6605271", "0.6604477", "0.659838" ]
0.7743371
10
Sets and gets the session ID. New sessions will be started with this ID if it is a valid hexidemcial string with the same length as configured in Session.idLength
public function id(string $id = null) { if ($id === null) { return $this->session->id(); } if (! $this->session->started()) { $this->session->id($id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateId() {\n $this->Id = session_id();\n }", "protected function set_session_id() {\n $this->sessionid = static::$sessionidmockup;\n }", "final function setSession_id($value) {\n\t\treturn $this->setSessionId($value);\n\t}", "public function get_session_id()\n {\n }", "public function setSessionID($val)\n {\n $this->_session = $val;\n return $this;\n }", "public function regenerateId()\n {\n $oldSessionId = $this->getSessionId();\n if (version_compare(PHP_VERSION, '7.1.0', '>=')) {\n $newSessionId = session_create_id();\n } else {\n session_regenerate_id(false);\n $newSessionId = $this->getSessionId();\n $this->commitSession();\n ini_set('session.use_strict_mode', 0);\n session_id($oldSessionId);\n session_start();\n ini_set('session.use_strict_mode', 1);\n }\n $this->metadata->isActive = false;\n $this->metadata->expireDataAt = time() + $this->config->ttlAfterIdRegen;\n $this->metadata->forwardToSessionId = $newSessionId;\n $this->writeMetadata();\n $this->commitSession();\n $sessionData = $_SESSION;\n ini_set('session.use_strict_mode', 0);\n session_id($newSessionId);\n session_start();\n $_SESSION = $sessionData;\n $this->executeSessionIdChangeCallback($oldSessionId, $newSessionId);\n $this->executeGcNotificationCallback(\n $oldSessionId,\n $this->metadata->expireDataAt\n );\n $_COOKIE[$this->getSessionName()] = $newSessionId;\n return $this->initializeSessionMetadata();\n }", "private function generateSessionID() {\n $sid = \"\";\n do $sid = bin2hex(openssl_random_pseudo_bytes(SESSION_ID_SIZE));\n while ($this->memcache->get(PREFIX_SESSION.$this->sessionID) !== false);\n return $sid;\n }", "protected function setSessionId($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public static function regenerateSessionid();", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "public function regenerateId()\n {\n $this->checkIfStarted();\n\n $this->sessionId = $this->calculateSessionId();\n }", "public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return $this->sessionId;\n }", "public function getId()\n {\n return $this->getValue('session_id');\n }", "private function _set_new_session_id($id) {\n\t\t$this->_session_config['_started_session_id'] = $id;\n\t\tZamp::$core->_config['session_settings']['_started_session_id'] = $id;\n\t}", "protected function _getId ()\n {\n return session_id();\n }", "protected function getSessionId()\n {\n return \\Session::getId();\n }", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "function setSessionId($value) {\n\t\treturn $this->setColumnValue('session_id', $value, Model::COLUMN_TYPE_INTEGER);\n\t}", "public function getId(): string\n {\n return session_id();\n }", "public static function getId(){\n\t\treturn session_id();\n\t}", "public static function id($id = null){\n\t\t\tif(!empty($id)){\n\t\t\t\tSession::$id = $id;\n\t\t\t\tsession_id($id);\n\t\t\t}\n\t\t\tif($this->session_started()){\n\t\t\t\treturn session_id();\n\t\t\t}else{\n\t\t\t\treturn Session::$id;\n\t\t\t}\n\t\t}", "public function regenerateId()\n {\n $this->checkIfStarted();\n\n session_regenerate_id(true);\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return session_id();\n }", "private function getSessionId()\r\n\t{\r\n\t\t$sessionId = mt_rand(5,20);\r\n\t\t$this->sessionId = $sessionId;\r\n\t\treturn $sessionId;\r\n\t}", "public function createSessionId() {}", "protected function regenerateSessionId() {}", "protected function regenerateSessionId() {}", "public function newSessionId ($uid) {\n $this->sessionId = hash('sha256', time() . $uid . 'OldSalts');\n return $this->sessionId;\n }", "public static function get_id() {\n self::$_id = $_SESSION['id'];\n return self::$_id;\n }", "public function getSessionId() {\n $this->_session_id = $this->pub_session_id;\n return $this->pub_session_id;\n }", "public function setSessionId($id)\n {\n $this->_sessionId = $id;\n }", "public function getId() {\n return $this->sessionId;\n }", "protected function getSessionId()\n {\n $id = $this->di->session->get('requestRecorderId');\n\n if ($id == null) {\n $id = time();\n $this->di->session->set('requestRecorderId', $id); // Figure out something better than time()\n }\n\n return $id;\n }", "public function getId() {\n\t\treturn session_id();\n\t}", "public function getSessionId()\n {\n return session_id();\n }", "public function getSessionId() {}", "public function setId($id): void\n {\n session_id($id);\n }", "public function getSessionId();", "public function getSessionId();", "public function getSessionID();", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "function get_id () {\n\t\treturn $this->session_id ?: false;\n\t}", "public function getSessionID()\n {\n return $this->sessionID;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function regenerate() {\n $this->startSession();\n try {\n session_regenerate_id(true);\n } catch (\\ErrorException $e) {\n // OK as this will occur in testing\n }\n\n $this->sessionId = session_id();\n session_write_close();\n\n return $this->sessionId;\n }", "public function getSessionid()\n {\n return $this->sessionid;\n }", "public function getSessionID()\n {\n return $this->getKey('SessionID');\n }", "function getSessionId() {\n\t\treturn $this->session_id;\n\t}", "public function getSessionID() {\n return $this->sessionID;\n }", "private function sessionRegenerateId()\n {\n // even if the session were hijacked, it will be expired very soon, so doing this way we reduce chance of users's (or admin's) account penetration\n // again, it's not 100% way to do secure accounts, but it makes hijacking harder\n // and yes, i almost copied code from php.net ;)\n\n // step 0. make sure that session is active\n if (session_status() !== PHP_SESSION_ACTIVE) {\n session_start();\n }\n\n // step 1: create new session id\n $newSessionID = session_create_id($this->sessionIDPrefix);\n\n // outdated session, we don't need it\n $this->unsetSESSION('session_created');\n\n // step 2: push time of regenerating into current session\n $this->setSESSION('session_annihilated', time());\n\n // step 3: save new session id into old session\n $this->setSESSION('new_session_id', $newSessionID);\n\n // step 4: generate new session id and keep old session\n session_regenerate_id(false);\n\n // see? we create new session with new identifier, but old session is still alive!\n // in this session we don't need new id and destroy time\n $this->unsetSESSION('session_annihilated');\n $this->unsetSESSION('new_session_id');\n\n // and create time of creating to check it later\n $this->setSESSION('session_created', time());\n }", "public function getSessionId()\r\n\t{\r\n\t\treturn $this->session;\r\n\t}", "public function getSessionId(): string\n {\n return $this->sessionId;\n }", "public function getSessionID()\n {\n return $this->_session;\n }", "public function getSessionID(){\r\n\t\treturn $this->sessionID;\r\n\t}", "protected function calculateSessionId()\n {\n return substr(md5(uniqid()), 0, 26);\n }", "public static function getSessionid();", "public function id()\n\t{\n\t\t// If the driver is an instance of the Cookie driver, we are able to\n\t\t// just return any string since the Cookie driver has no real idea\n\t\t// of a server side persisted session with an ID.\n\t\treturn \\Core\\Str::random('alnum', 40);\n\t}", "public function getId()\n {\n return $this->_session->getId();\n }", "public function getSessionId(): string\n {\n return $this->getData(self::SESSION_ID);\n }", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "private function setId($id)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->idaccount = $id;\n }", "function regenerate_id () {\n\n # saves the old session's id\n $old_session_id = session_id();\n\n # regenerates the id\n session_regenerate_id();\n\n self::destroy($old_session_id);\n\n }", "public static function regenerate_sid() {\n\t\t$key = self::generate_sid();\n\t\tdatabase()->start_query('sessions', 'UPDATE')\n\t\t\t->set(array('key' => $key))\n\t\t\t->where(array('key' => self::$sid))\n\t\t\t\t->run();\n\t\tself::setcookie($key);\n\t}", "public function getId(): ?string\n {\n return $this->isStarted() ? session_id() : null;\n }", "public function getSessionId()\n {\n return $this->sessionId;\n }", "public static function getSessionId(){\n return self::$sessionId;\n }", "public static function getSessionId() {\n\t\tif(empty($id = session_id())) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $id;\n\t\t\n\t}", "public function getSessionId() {\r\n return $this->sessionId;\r\n }", "function MyApp_Session_SID_New()\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $sid=rand().rand().rand();\n $time=time();\n $this->Session=array\n (\n \"SID\" => $sid,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $this->LoginData[ \"Login\" ],\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 2,\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => $time,\n \"NAuthenticationAttempts\" => 0,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$this->Session);\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n\n return $sid;\n }", "public function setCookieID($id=NULL)\n {\t\n if($id!==NULL) {\n $this->cookieID = $id;\n } else {\n $this->cookieID = md5($this->time . $this->username . mt_rand(1,25) . $this->getRealIpAddr());\n }\n return $this->cookieID;\n }", "public function getId(): string\n {\n return session()->getId();\n }", "protected static function setUpSessionId (\\MvcCore\\IRequest $req) {\n\t\t$sessionCookieName = session_name();\n\t\t$rawCookieHeader = ';' . trim($req->GetHeader('Cookie', '-,=;a-zA-Z0-9') ?: '', ';') . ';';\n\t\t$sessionId = NULL;\n\t\tif (preg_match_all(\"#;\\s?{$sessionCookieName}\\s?\\=([^;]+)#\", $rawCookieHeader, $matches)) {\n\t\t\t$rawSessionIds = isset($matches[1]) ? $matches[1] : [];\n\t\t\tif (count($rawSessionIds) === 1)\n\t\t\t\t$sessionId = $rawSessionIds[0];\n\t\t\t// if count is higher than 1, it's session fixation atack request, \n\t\t\t// then generate new session id for response.\n\t\t}\n\t\tif ($sessionId === NULL) \n\t\t\t$sessionId = static::createId();\n\t\t$_COOKIE[$sessionCookieName] = $sessionId;\n\t\tsession_id($sessionId);\n\t}", "public function getSessionId()\n {\n\t\tif($this->session_id != null){\n\t\t\treturn $this->session_id;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n }", "public static function id($id = null)\n {\n return session_id($id);\n }", "public function id($id = null) {\n\t\t\tif ($id == null) {\n\t\t\t\t$id = session_id();\n\t\t\t}\n\t\t\tif (!isset($_SESSION['id'])) {\n\t\t\t\t$this->set(\"id\", session_id($id));\n\t\t\t}\n\t\t\treturn $this->get(\"id\");\n\t\t}", "public function setSessionID($sessID){\r\n\t\t$this->sessionID = $sessID;\r\n\t}", "private function getSessionId()\n {\n $request = Request::factory(self::$apiUrl . self::$authPath)\n ->method(Request::POST)\n ->headers('content-type', 'application/json')\n ->body(json_encode([\n 'domain' => self::$apiDomain,\n 'apiKey' => self::$apiKey,\n ]))\n ->execute();\n $setCookie = $request->headers('set-cookie');\n preg_match('/JSESSIONID=(?<id>\\w+);/', $setCookie, $jSessionId);\n\n return $jSessionId['id'];\n }", "public function id(string $newId = null) : string | false\n {\n if ($newId !== null && $this->isActive()) {\n throw new LogicException(\n 'Session ID cannot be changed when a session is active'\n );\n }\n return \\session_id($newId);\n }", "public function getSessionId()\n {\n $sessionId = $this->getSession();\n\n return $sessionId;\n }", "public function setSessionId($session_id) {\n $session_id = (string) $session_id;\n $this->fields[\"session_id\"] = $session_id;\n\n return $this;\n }", "public function setSessionid($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sessionid !== $v) {\n $this->sessionid = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SESSIONID] = true;\n }\n\n return $this;\n }", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "function sess_id()\n {\n return session_id();\n }", "public static function getSessionId($id = null) {\n return session_id();\n }", "public function startSession()\r\n {\r\n if (session_id() === '') {\r\n // Attempt to start a session\r\n session_start();\r\n\r\n $this->session_id = session_id() ?: false;\r\n }\r\n\r\n return $this->session_id;\r\n }", "function set_id ($id)\r\n {\r\n $_SESSION[\"id\"] = $id;\r\n }", "public function testSetId() {\n\n $obj = new iSessions();\n\n $obj->setId(10);\n $this->assertEquals(10, $obj->getId());\n }", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "public static function getId() {\n return (int)$_SESSION['user']['id'];\n }", "public function getSessionId(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_SESSION_ID);\n }", "public function setSessionId($session_id)\n {\n $this->session_id = $session_id;\n\n return $this;\n }", "public function setSessionId($session_id)\n {\n $this->session_id = $session_id;\n\n return $this;\n }", "public static function regenerateId($shouldDeleteOld = false) {\n $newSessionId = session_regenerate_id($shouldDeleteOld);\n if ($newSessionId) {\n Logger::getLogger()->LogDebug(\"Session ID regenerated, New Session ID: \". $newSessionId);\n }\n return $newSessionId;\n }", "public function getSessionID() {\n if(isset($this->data['booking']['session']['id'])) {\n return $this->data['booking']['session']['id'];\n }\n return null;\n\n }", "public function getSessionId()\n {\n $this->connect();\n return $this->stomp->getSessionId();\n }" ]
[ "0.72328407", "0.7065436", "0.6981813", "0.6813467", "0.6809063", "0.6770674", "0.6757281", "0.6728501", "0.67214084", "0.6709032", "0.67022544", "0.6700423", "0.6620656", "0.6613571", "0.6611518", "0.66015804", "0.6532502", "0.6526423", "0.65259004", "0.6512067", "0.6493659", "0.64914435", "0.64830357", "0.6470532", "0.647044", "0.6468587", "0.6439054", "0.6439054", "0.64370096", "0.6433015", "0.6421267", "0.64122075", "0.6408305", "0.63988316", "0.63878936", "0.6384063", "0.63772064", "0.63570803", "0.6344808", "0.6344808", "0.63261896", "0.63208187", "0.6317234", "0.6310115", "0.62948686", "0.62948686", "0.62948686", "0.62948686", "0.62948686", "0.62920314", "0.6284587", "0.6274373", "0.62711835", "0.627031", "0.62548023", "0.6252861", "0.6249891", "0.61955756", "0.61934423", "0.616231", "0.61482805", "0.6148274", "0.61431277", "0.6136938", "0.6136509", "0.61223024", "0.6110999", "0.61092365", "0.6084826", "0.60694456", "0.6068636", "0.60666215", "0.6053143", "0.6045842", "0.60454094", "0.60406214", "0.6036164", "0.6035197", "0.6015764", "0.60149264", "0.60061324", "0.59979254", "0.59969234", "0.5991298", "0.5988151", "0.5984794", "0.59766704", "0.59643936", "0.5954812", "0.5945274", "0.5929088", "0.5904353", "0.58783925", "0.58534473", "0.5844373", "0.5837061", "0.5837061", "0.5830656", "0.581764", "0.5816347" ]
0.6422949
30
Sets or gets the name. New sessions will be created with this id
public function name(string $name = null) { if ($name === null) { return $this->session->name(); } if (! $this->session->started()) { $this->session->name($name); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setCurrentName($name) {\n Session::put(Privilege::SESSION_NAME_NAME, $name);\n }", "public function setName(string $name): void\n {\n session_name($name);\n }", "private function setName($name)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->name = $name;\n }", "public static function name(string $name)\n {\n static::$name = $name;\n static::$session = null;\n }", "public function setSessionName($name = \"icepay_api_webservice_reportingsession\")\n {\n $this->_sessionName = $name;\n }", "function set_name ($name)\r\n {\r\n $_SESSION[\"name\"] = $name;\r\n }", "private function setSessionName(): void\n {\n $cookie = new Cookie($this->expiringTime - 1);\n if ($cookie->exists('sessionName')) {\n return;\n }\n\n // unset all session name cookies\n foreach ($_COOKIE as $key => $value) {\n if (strlen($key) === strlen($this->name)) {\n $cookie->unset($key);\n }\n }\n\n $cookie->save('sessionName', $this->name);\n }", "public function name($name = '') {\n\t\tif (!empty($name)) {\n\t\t\treturn session_name($name);\n\t\t}\n\t\telse {\n\t\t\treturn session_name();\n\t\t}\n\t}", "public function set_nameSession($_nameSession)\n {\n $this->_nameSession = $_nameSession;\n\n return $this;\n }", "public static function getCurrentName($name) {\n return Session::put(Privilege::SESSION_NAME_NAME);\n }", "public function get_nameSession()\n {\n return $this->_nameSession;\n }", "public function getName(): string\n {\n return session_name();\n }", "protected function setSession($name)\n {\n $options['name'] = $name;\n $this->session = LSPrincipal::getSession($options);\n \n return $this->session;\n }", "public function getName()\n {\n return 'session';\n }", "public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }", "function set_name($name) {\n $this->name = $name;\n }", "public function testSetName()\n {\n $session = new Session();\n $session->setName('oldName');\n\n $this->assertEquals('oldName', $session->getName());\n\n $session->open();\n $session->setName('newName');\n\n $this->assertEquals('newName', $session->getName());\n\n $session->destroy();\n }", "public function SetName ($name);", "function add_session($id, $name) {\n $this->start_session();\n $_SESSION['id'] = $id;\n $_SESSION['name'] = $name;\n setcookie('id', $id, time() + 60 * 60 * 24 * 7, '/');\n }", "public function set($name, $value) {\n Session::set($name, $value);\n }", "public function setName($name) {\r\n\t\t$this->name = $name;\r\n\t}", "public function setName($name) {\n\t\t$this->_name = $name;\n\t}", "public function __set( $name , $value ){\n\n \tif ( $this->sessionState == self::SESSION_NOT_STARTED ){\n \t\tself::$instance->startSession();\n \t}\n\n $_SESSION[$name] = $value;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "final public function set($name, $value)\n {\n $key = $this->getSessionKey($name);\n\n $_SESSION[$key] = $value;\n }", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function __set($name, $value) {\n $_SESSION[$this->myedb_session_key][$name] = $value;\n }", "public function getSession_name() {\r\n return $this->session_name;\r\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function getSessionName()\n {\n return session_name();\n }", "public function set_name($name);", "public function getName()\n {\n return $this->_session->getName();\n }", "function setName($name) {\n $this->name = $name;\n }", "public function setName($name){\n \n $this->name = $name;\n \n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName( string $name ) {\n\t\t$this->name = $name;\n\t}", "public static function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "function setDbName($sessionID, $name){\r\n\t\tif($this->userCanSetDbName()){\r\n\t\t\t// NOT IMPLEMENTED!!!!\r\n\t\t}\r\n\t}", "public function setName($name){\n $this->_name = $name;\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function set(string $name, $value) {\n //$this->open();\n $_SESSION[$name] = $value;\n }", "public function setName($name) \n {\n $this->name = $name;\n }", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function setName($name)\r\n {\r\n $this->name = $name;\r\n }", "public static function setsession($id, $name, $role_name){\n $_SESSION['id']=$id;\n $_SESSION['username']=$name;\n $_SESSION['role_name']=$role_name;\n }", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function getName(): string\n {\n return $this->isStarted() ? session_name() : $this->name;\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function setSession($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function setName($name) {\n\t\t$this->_name = (string)$name;\n\t}", "public function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }" ]
[ "0.79998034", "0.7661593", "0.7597834", "0.74118966", "0.7402539", "0.7344238", "0.7250525", "0.71150196", "0.7089861", "0.7067206", "0.6812387", "0.6810391", "0.67371744", "0.6694638", "0.66467214", "0.66435164", "0.6632918", "0.6629664", "0.6591485", "0.65524256", "0.6533064", "0.6530542", "0.6526104", "0.65233624", "0.651796", "0.651796", "0.651796", "0.651796", "0.651796", "0.651796", "0.651796", "0.651796", "0.65087694", "0.6489549", "0.6489549", "0.6479657", "0.6473749", "0.6472255", "0.6472255", "0.6472255", "0.6472255", "0.6472255", "0.6472255", "0.646818", "0.64670706", "0.6465195", "0.64500064", "0.6435403", "0.6429869", "0.64283884", "0.64233184", "0.6420451", "0.64173204", "0.6411825", "0.6406674", "0.6406674", "0.6406674", "0.6406674", "0.64035356", "0.6403167", "0.6399941", "0.6399078", "0.63818645", "0.6373711", "0.6373711", "0.6373677", "0.63717735", "0.6370601", "0.63580453", "0.6355674", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003", "0.63534003" ]
0.7311073
6
Reads an item from the session
public function read(string $key, $default = null) { return $this->session->read($key, $default); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read(string $name)\n {\n return $this->session()->read($name);\n }", "public static function Read($sessionid, $key);", "public function read(string $session_id)\n {\n }", "public function read() {\n\n try {\n $this->open();\n $fileHandle = fopen(self::FILEPATH, 'r');\n $sessionData = fread($fileHandle, 4096);\n fclose($fileHandle);\n return session_decode($sessionData);\n }\n catch (SessionException $e) {\n echo \"Error reading session from file: \" . $e->getMessage();\n }\n }", "public function get($key)\n {\n return $this->session->read($this->getSessionKey($key));\n }", "public function read($id)\n\t{\n\t\t$sess_id = 'sess_'.$id;\n\t\t$this->_setExpire($sess_id);\n\t\treturn $this->_db->get($sess_id);\n\t}", "public static function sessionReadHandler();", "public function readSession($id)\n\t{\n\t\t$data=$this->_cache->get($this->calculateKey($id));\n\t\treturn $data===false?'':$data;\n\t}", "function HTTP_SessionServer_SaveHandler_read($id)\n{\n $GLOBALS['__session']->open($id);\n return $GLOBALS['__session']->get($GLOBALS['__sessionName']);\n}", "public function get_session($id)\n\t\t{\n\t\t\treturn parent::get_item($id,'session_items');\n\t\t}", "public static function get($key) {\n $sessionValue = null;\n if (!empty($_SESSION[$key])) {\n $sessionValue = $_SESSION[$key];\n } else {\n Logger::getLogger()->LogDebug(\"Attempting to get invalid item \n from Session with key : \".$key);\n }\n return $sessionValue;\n }", "public function read($session_id)\n {\n return $this->handler->read($session_id);\n }", "public static function read($id){\n//\t\techo 'read'.$id.\"\\n<br>\";\n\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t$query='SELECT data FROM php_session WHERE id='.$db->escape($id);\n\t\t$db->query($query);\n\t\tif($db->readRow()) { return $db->row_data['data']; }\n\t\treturn false;\n\t}", "public function _read($sesID) {\n\n\t\t echo \"_read\";\n\n\t\t$sessionStatement = \"SELECT * FROM sessions\".\" WHERE id = '$sesID'\";\n\t\t$result = $this->DB->query($sessionStatement);\n\t\tif ($result === false) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (count($result) > 0) {\n\n\t\t\treturn $result[0][\"value\"];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public function get($key)\n {\n return $this->session->get($key);\n }", "public function read($id = NULL)\r\n\t{\r\n\t\t$data = NULL;\r\n\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (is_string($data = $this->_read($id)))\r\n\t\t\t{\r\n\t\t\t\t// Decode the base64 encoded data\r\n\t\t\t\t$data = base64_decode($data);\r\n\t\t\t\t// Unserialize the data\r\n\t\t\t\t$data = unserialize($data);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Ignore these, session is valid, likely no data though.\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\t// Error reading the session, usually\r\n\t\t\t// a corrupt session.\r\n\t\t\tthrow new Keke_Exception('Error reading session data.', NULL, 1);\r\n\t\t}\r\n\t\r\n\t\tif (is_array($data)){\r\n\t\t\t// Load the data locally\r\n\t\t\t$this->_data = $data;\r\n\t\t}\r\n\t}", "function read ($session_id) {\n\n # create database object if not create\n self::_connect();\n\n # get lock name\n $this->session_lock = $this->link->civ($this->security_code.$session_id);\n\n # obtain a lock with name and timeout\n $res = $this->link->direct('SELECT GET_LOCK(\"'.$this->session_lock.'\", '.$this->lock_timeout.')');\n\n if ($res) {\n if (@mysql_num_rows($res)) {\n unset($res);\n $res = $this->link->select(\n array('session_data'),\n $this->table_name,\n array(\n array('','session_id','=',$session_id,'AND'),\n array('','session_expire','>',time(),'AND'),\n array('','http_user_agent','=',self::_user_agant(),'')\n ),NULL,NULL,1\n );\n if ($res) {\n $fld = mysqli_fetch_assoc($res);\n mysqli_free_result($res);\n return $fld['session_data'];\n } else {\n mysqli_free_result($res);\n return '';\n }\n }\n }\n\n }", "public static function read() {\n if (func_num_args() > 0) {\n $keys = func_get_args();\n foreach ($keys as $keysEntry) {\n if (!is_string($keysEntry))\n throw new InvalidArgumentTypeException('Session key must be string value');\n }\n } else {\n throw new InvalidArgumentTypeException(\"To read session variable you must specify at least one key\");\n }\n self::_age();\n $target = & $_SESSION;\n foreach ($keys as $keysEntry) {\n if (isset($target[$keysEntry])) {\n $target = & $target[$keysEntry];\n } else {\n throw new UndefinedValueException(\"Value \\$_SESSION for keys (\" . implode(' ', $keys) . \") not defined\");\n }\n }\n return $target;\n }", "public function getItem()\n {\n $query = $this->grammar->compileGetItem($this);\n\n $result = $this->connection->getClient()->getItem($query);\n\n return $this->processor->processItem($result);\n }", "public function read(){\n\t\t$this->_getDAO(false);\n\t\tif($array = $this->dao->read($this->user->getID(), $this->ident)){\n\t\t\t$this->_setFromArray($array);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testReadingSession()\n {\n // Get session\n $session = $this->getWorkingReader()->getSession();\n\n //-- Validate\n $this->assertSame(Session::TYPE_RACE, $session->getType());\n $this->assertSame('Quick Race', $session->getName());\n $this->assertSame(5, $session->getMaxLaps());\n $this->assertSame(30, $session->getMaxMinutes());\n $this->assertSame(5, $session->getLastedLaps());\n }", "function _read($sessionid=false) {\n\t\t$qry = \"SELECT * FROM \" . TABLEPREFIX . \"sessions WHERE sessionid='\" . addslashes($sessionid) . \"'\";\n\t\t$result = $this->DbConnection->Query($qry);\n\t\tif (!$result) return '';\n\t\t$row = $this->DbConnection->Fetch($result);\n\t\tif (empty($row)) return '';\n\t\treturn stripslashes($row['sessiondata']);\n\t}", "public function read($key) {\r\n\t\t// Write and Close handlers are called after destructing objects since PHP 5.0.5\r\n\t\t// Thus destructors can use sessions but session handler can't use objects.\r\n\t\t// So we are moving session closure before destructing objects.\r\n\t\tregister_shutdown_function('session_write_close');\r\n\t\t$key = $this->create_key($key);\r\n\t\t\r\n\t\t$ret = GyroMemcache::get($key);\r\n\t\tif ($ret === false) {\r\n\t\t\t$ret = '';\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "function MyApp_Session_SID_Read($sid)\n {\n $this->Session=$this->Sql_Select_Hash\n (\n array\n (\n \"SID\" => $sid\n ),\n array(),\n TRUE,\n $this->GetSessionsTable()\n );\n }", "public function getItem() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $id = $params['id'];\n try {\n $item = new Item;\n $item->getItem($id);\n View::renderJson($item);\n } catch (Exception $e) {\n View::renderJson(['status' => 0, 'message' => $e]);\n }\n }", "public function read($sessionId)\n {\n return $this->cache->get($this->prefix .$sessionId);\n }", "function read($sess_id)\r\n\t{\r\n $sql = sprintf('SELECT sess_data FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));\r\n if (false != $result = $this->db->query($sql)) {\r\n if (list($sess_data) = $this->db->fetchRow($result)) {\r\n return $sess_data;\r\n }\r\n }\r\n return '';\r\n }", "public function getFromSession() {\n $data = $this->_getSession();\n \n return $data;\n }", "public function getSession()\n\t{\n\t\tif (isset($_SESSION[$this->getKey()]))\n\t\t{\n\t\t\treturn unserialize($_SESSION[$this->getKey()]);\n\t\t}\n\t}", "public static function sessionRead($sessionKey)\n {\n return self::get(self::$cachePrefix . $sessionKey);\n }", "function readItems() {return $this->_items;}", "public function read($id) {\n $crypto = $this->psl['crypt/crypto'];\r\n $store = $this->psl['store'];\n\n /* If no cookie is set, just drop it! */\r\n if(!isset($_COOKIE[$this->name])) {\r\n return false;\r\n }\r\n\r\n /* Read from store and decrypt. */\r\n try {\r\n $sessData = $store->read('session', $_COOKIE[$this->name]);\r\n\r\n if($sessData !== false ) {\r\n $return = $crypto->decrypt($sessData, $this->secret);\r\n } else {\r\n $return = false;\r\n }\r\n return $return;\r\n } catch (\\phpSec\\Exception $e) {\r\n return false;\r\n }\n }", "protected function _apc_read($id) {\r\n $id = 'osc_sess_' . $id;\r\n\t return apc_fetch($id);\r\n }", "function getItem() ;", "public function take($key)\n {\n $value = $this->session->take($key);\n\n return $value;\n }", "public function read($id)\r\n {\r\n\t$this->dataAccess->BeginTransaction();\r\n $sessionData = \"\";\r\n $readSessionDataQuery = \"SELECT `SessionData` FROM `Security.UserSessions` \" .\r\n \"WHERE (`ID` = :sessionID) FOR UPDATE;\";\r\n\t\t\r\n\t$parmSessionID = new QueryParameter(':sessionID', $id, PDO::PARAM_STR);\r\n\t$queryParms = array($parmSessionID);\r\n\t\r\n\t$errors = $this->dataAccess->CheckErrors();\r\n $success = false;\r\n\r\n\tif(strlen($errors) == 0) {\r\n if($this->dataAccess->BuildQuery($readSessionDataQuery, $queryParms)){\r\n\t\t$results = $this->dataAccess->GetSingleResult();\r\n if($results != null){\r\n $sessionData = $results['SessionData'];\r\n }\r\n }\r\n\t}\r\n \r\n // If no data found, must return empty string\r\n return $sessionData;\r\n }", "public function get($key)\n {\n return $this->session->get((string)$key, []);\n }", "public function getItem()\n {\n return $this->get(self::ITEM);\n }", "public function sess_read()\n\t{\n\t\treturn ($this->session_valid()) ? parent::sess_read() : FALSE;\n\t}", "public function read($key) {\n\t\treturn $this->_Memcached->get($key);\n\t}", "public function read($id = NULL) \n\t{\n\t\t$time = date('Y-m-d H:i:s', time() - $this->expiration);\n\t\t\n\t\t//Select the session\n\t\t$row = $this->_conn->query(\"SELECT * FROM {$this->table_name} WHERE {$this->primary_key} = '{$id}' AND last_activity > '{$time}' \");\n\t\treturn (!empty($row)) ? $row[0]['data'] : '';\n\t}", "public function userdata($item)\n\t{\n\t\tif(isset($_SESSION[$item]))\n\t\t{\n\t\t\t$value = $_SESSION[$item];\n\t\t\treturn $value;\n\t\t}\n\t}", "public function get($name) {\n if(!empty($_SESSION[$name])) return $_SESSION[$name];\n }", "public function get( $name ){\n\t\t\tif( $this->exists( $name ) ){\n\t\t\t\treturn $_SESSION[ $name ];\n\t\t\t}\n\n\t\t\tthrow new UnexpectedValueException( sprintf( 'Session doesn\\'t started: %s', $name ) );\n\t\t}", "public function fetchSessionData() {}", "private function read(){\n\t\t$result = $this->clsAccessPermission->toRead();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to reade!\");\n\t\t\treturn;\n\t\t}\n\t\t// Take the id from session.\n\t\tif(!empty($_SESSION ['PK']['ACCESSCRUD'])){\n\t\t\t$id = $_SESSION ['PK']['ACCESSCRUD'];\n\t\t\t$this->objAccessCrud->readOne ( $id );\n\t\t}\n\n\t\t$this->fieldValue[\"cl_id_access_profile\"] = $this->objAccessCrud->getIdAccessProfile();\n\t\t$this->fieldValue[\"cl_id_access_page\"] = $this->objAccessCrud->getIdAccessPage();\n\n\t\t$this->fieldValue[\"cl_crud\"] = $this->objAccessCrud->getCread();\n\t\t$this->fieldValue[\"cl_read\"] = $this->objAccessCrud->getRead();\n\t\t$this->fieldValue[\"cl_update\"] = $this->objAccessCrud->getUpdate();\n\t\t$this->fieldValue[\"cl_delete\"] = $this->objAccessCrud->getDelete();\n\n\t\t$this->fieldValue[\"cl_date_insert\"] = $this->objAccessCrud->getDateInsert();\n\t\t$this->fieldValue[\"cl_date_update\"] = $this->objAccessCrud->getDateUpdate();\n\n\t\treturn;\n\t }", "public static function read($name = null){\n\t\t\tif(empty($name)){\n\t\t\t\treturn $_SESSION;\n\t\t\t}else{\n\t\t\t\treturn array_extract($_SESSION, $name);\n\t\t\t}\n\t\t}", "public function _read($id)\n {\n return R::getCell(\n 'SELECT data FROM sessions WHERE sid = ? AND ip = ? LIMIT 1', [$id, $this->getIPAddress()]\n );\n }", "public static function get($name){\n return $_SESSION[$name];\n }", "public function get($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\treturn $sess;\n\t}", "public function read($sessionId) {\n try {\n // try to retrieve the session content first to see if it exists\n $result = $this->_tableRestProxy->getEntity($this->_sessionContainer, $this->_sessionContainerPartition, $sessionId);\n // get the entity instance\n $entity = $result->getEntity();\n // deflat the serialized data\n return unserialize(base64_decode($entity->getPropertyValue('data')));\n } catch (ServiceException $e) {\n // the entity doesn't exist, return empty string according to the spec:\n // http://www.php.net/manual/en/sessionhandlerinterface.read.php\n return '';\n }\n }", "public static function get($name) {\n return $_SESSION[$name];\n }", "public function getItem() {}", "public function getItem() {}", "public static function Get()\r\n {\r\n $data = Session::Exists(self::NAME) ? Session::Get(self::NAME) : null;\r\n Session::Remove(self::NAME);\r\n return $data;\r\n }", "abstract public function getItem();", "public static function get($name) {\n return $_SESSION[$name];\n }", "function readItemIndex() {return $this->_itemindex;}", "public function read($user, $ident);", "public function read($key)\n {\n if (is_string($key) === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n $prefixKey = '$PMM$' . $this->_prefix;\n if (isset($_SESSION[$prefixKey]) === true &&\n isset($_SESSION[$prefixKey][$key])) {\n return $_SESSION[$prefixKey][$key];\n }\n }", "public function get($key) {\n \n $this->start();\n return isset($_SESSION[$key]) ? $_SESSION[$key] : null;\n \n }", "public static function get($name)\n {\n return $_SESSION[$name];\n }", "function phpAds_SessionDataFetch()\n{\n global $session;\n $dal = new MAX_Dal_Admin_Session();\n\n // Guard clause: Can't fetch a session without an ID\n\tif (empty($_COOKIE['sessionRPID'])) {\n return;\n }\n\n $serialized_session = $dal->getSerializedSession($_COOKIE['sessionRPID']);\n // This is required because 'sessionRPID' cookie is set to new during logout.\n // According to comments in the file it is because some servers do not\n // support setting cookies during redirect.\n if (empty($serialized_session)) {\n return;\n }\n\n $loaded_session = unserialize($serialized_session);\n\tif (!$loaded_session) {\n // XXX: Consider raising an error\n return;\n }\n\t$session = $loaded_session;\n $dal->refreshSession($_COOKIE['sessionRPID']);\n}", "public function read($key) {}", "public static function get($key)\n {\n if (isset($_SESSION[$key])){\n return $_SESSION[$key];\n }\n }", "public static function get(string $name) {\n return $_SESSION[$name];\n }", "public function read() { \t\r\n \r\n \t\r\n\t if ( isset( $this->__sesionStorage->role) ) {\r\n\t \t\r\n\t \r\n\t\t\t\t\t\r\n\t \t\treturn $this->__sesionStorage->role;//->getRole();\r\n\t \t\t\r\n\t }\r\n\t \t\t\r\n\t else{\r\n\t // \t\trequire_once '../library/Components/LogIn/Log/library/Client.php';\t \r\n \t\t\treturn new LogIn_Log_library_Client();\r\n\t }\r\n \r\n }", "public function read(string $id): string|false\n {\n $pkField = $this->_table->getPrimaryKey();\n assert(is_string($pkField));\n $result = $this->_table\n ->find('all')\n ->select(['data'])\n ->where([$pkField => $id])\n ->disableHydration()\n ->first();\n\n if (empty($result)) {\n return '';\n }\n\n if (is_string($result['data'])) {\n return $result['data'];\n }\n\n $session = stream_get_contents($result['data']);\n\n if ($session === false) {\n return '';\n }\n\n return $session;\n }", "public function getItem();", "function _read($ses_id) {\n\t\t$done = false;\n\t\twhile ( ! $done ) {\n\t\t\t$result = mysql_query (\"Select `lock`, ISNULL(`lock`) as unlocked from phpSession where id='$ses_id'\", $this->db);\n\t\t\tif ( mysql_num_rows($result) > 0 ) {\n\t\t\t\t$temp = mysql_fetch_object($result);\n\t\t\t\tif ($temp->unlocked) {\n\t\t\t\t\t$done = true;\n\t\t\t\t} else if ( time() - strtotime($temp->lock) > 60 ) {\n\t\t\t\t\t$done = true;\n\t\t\t\t} else {\n\t\t\t\t\tsleep(2);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$done = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmysql_query (\"LOCK TABLES `phpSession` WRITE\", $this->db);\t\t\n\t\t$result = mysql_query (\"Select * from phpSession where id= '$ses_id'\", $this->db);\n\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t$temp = mysql_fetch_object ($result);\n\t\t\t$result = mysql_query(\"Update phpSession set `lock` = NOW() where id = '$ses_id'\", $this->db);\n\t\t\t$info = $temp->data;\n\t\t} else {\n\t\t\t$info = '';\n\t\t}\n\t\tmysql_query (\"UNLOCK TABLES\", $this->db);\n\t\treturn $info;\n\t}", "public function retrieve($item);", "public function userdata($item) {\n\t\tif (strcmp($item, 'session_id') === 0) {\n\t\t\treturn session_id();\n\t\t} else {\n\t\t\treturn isset($_SESSION[$item]) ? $_SESSION[$item] : FALSE;\n\t\t}\n\t}", "abstract protected function _read($id = NULL);", "public function get()\n {\n return $this->transmission->request(\"session-get\", array());\n }", "public static function get(string $key)\n {\n static::start();\n if (static::has($key)) {\n return $_SESSION[$key];\n }\n }", "function read($conn)\n{\n $response[\"loggedIn\"] = getSessionValue(\"user\", \"\") != \"\";\n if (!$response[\"loggedIn\"])\n {\n $response[\"error\"] = \"You must login to view your user account.\";\n return $response;\n } \n \n // return the user...\n $response[\"user\"] = getSessionValue(\"user\", \"\");\n $response[\"loggedIn\"] = getSessionValue(\"user\", \"\") != \"\";\n return $response;\n}", "public function get(string $name) {\n return $this->has($name) ? $_SESSION[$name] : false;\n }", "public function getItem() {\n\t\treturn $this->item;\n\t}", "public function getItem()\n\t{\n\t\tif (!isset($this->item))\n\t\t{\n\t\t\t$query = $this->_db->getQuery(true);\n\t\t\t$query->select('*');\n\t\t\t$query->from('#__document');\n\t\t\t$query->where('id = '.(int)$this->getState('document.id'));\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$item = $this->_db->loadObject();\n\n\t\t\t// Check for a database error.\n\t\t\tif ($this->_db->getErrorNum())\n\t\t\t{\n\t\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->item = $item;\t\t\n\t\t}\n\t\treturn $this->item; \n\t}", "function retrieveSessionData($pid) {\n\t\treturn tx_wecassessment_sessiondata::fetchSessionData('tx_wecassessment_pi1:' . $pid);\n\t}", "public function read ()\n {\n return $this->read();\n }", "public static function get ($key){\r\n\t\t\t\tif (isset($_SESSION[$key])) {\r\n\t\t\t\t\t# code...\r\n\t\t\t\t\treturn $_SESSION[$key];\r\n\t\t\t\t}else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}", "public function load($id)\n {\n return $this->session;\n }", "public static function get($name)\n {\n if(isset($_SESSION[$name]))\n {\n return $_SESSION[$name];\n }\n }", "private function getSession() {\n\t\t//read session file and fill the array\n\t\tif (file_exists ( self::SESSION_FILE )) {\n\t\t\t$this->session = unserialize ( file_get_contents ( self::SESSION_FILE ) );\n\t\t}\n\t\t\n\t\t//If the last session has expired, remove the session\n\t\tif (isset ( $this->session ) && $this->session ['lastlogin'] + (10 * 60) <= time ()) {\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t}\n\t}", "public function get( $key ) {\n if (isset($_SESSION[$key])){\n $out = $_SESSION[$key];\n }else{\n $out = false;\n }\n return $out;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "public function read($id) \r\n {\r\n echo __METHOD__,'<BR>'; \r\n echo 'id = ',$id,'<br>'; \r\n echo 'session_id = ',session_id(),'<br>'; \r\n // $sessinfo = DB::table('session')->where('session_id',\"'$id'\")->first();\r\n // $sessinfo = Session::where('session_id',$id)->get();\r\n $rs =R::getAll('select * from session where session_id = :id',array(':id'=>$id));\r\n // var_dump($rs);\r\n // var_dump($sessinfo->session_data);\r\n // $queries = DB::getQueryLog();\r\n // print_r($queries);\r\n // return $sessinfo->session_data;\r\n return $rs[0]['session_data'];\r\n exit();\r\n echo 'afterexit()<br>';\r\n // global $SESS_DBH, $SESS_LIFE;\r\n // // var_dump($SESS_DBH);\r\n // $qry = \"select session_data from sessions where session_id = '$key' \";\r\n // $qid = mysql_query($qry, $SESS_DBH);\r\n // // var_dump($qid);\r\n // if (list ($value) = mysql_fetch_row($qid)) {\r\n // return $value;\r\n // }\r\n // return false;\r\n\r\n $sess_file = $this->_path.$this->_name.\"_$id\";\r\n if (!file_exists($sess_file)) {\r\n // echo 'read false<br>';\r\n return false;\r\n } \r\n // echo 'session file = ',$sess_file,'<br>';\r\n $data = file_get_contents($sess_file);\r\n // var_dump($data);\r\n list($hmac, $iv, $encrypted)= explode(':',$data);\r\n $iv = base64_decode($iv);\r\n $encrypted = base64_decode($encrypted);\r\n $newHmac = hash_hmac('sha256', $iv . $this->_algo . $encrypted, $this->_auth);\r\n if ($hmac !== $newHmac) {\r\n return false;\r\n }\r\n $decrypt = mcrypt_decrypt(\r\n $this->_algo,\r\n $this->_key,\r\n $encrypted,\r\n MCRYPT_MODE_CBC,\r\n $iv\r\n );\r\n return rtrim($decrypt, \"\\0\"); \r\n // echo 'data =';\r\n // var_dump($data);\r\n // return $data;\r\n }", "public function readKeyOnly(): mixed\n {\n return $identity = $this->options->getStorage()->read();\n }", "protected function _read($var)\n\t{\n\t\treturn $this->memcached->get($this->key_prefix . $var);\n\t}", "function db_pwassist_session_read($pwassist_id)\n{\n\tglobal $ilDB;\n\n\t$q = \"SELECT * FROM usr_pwassist \".\n\t\t\"WHERE pwassist_id = \".$ilDB->quote($pwassist_id, \"text\");\n\t$r = $ilDB->query($q);\n\t$data = $ilDB->fetchAssoc($r);\n\n\treturn $data;\n}" ]
[ "0.6823653", "0.67266995", "0.66834855", "0.66744936", "0.6665238", "0.6632025", "0.65984213", "0.65935975", "0.6537237", "0.63527876", "0.6343315", "0.63387305", "0.6287014", "0.6247128", "0.62466514", "0.6216626", "0.62104845", "0.6200356", "0.61918485", "0.61811197", "0.61787385", "0.61776763", "0.61551857", "0.61384374", "0.6131702", "0.61295575", "0.60977894", "0.6090581", "0.6059046", "0.600347", "0.5998015", "0.5965301", "0.5955554", "0.5947082", "0.5940022", "0.5934271", "0.5932696", "0.59248924", "0.59141165", "0.59007066", "0.5897651", "0.58937514", "0.5886157", "0.58787364", "0.5874371", "0.5861908", "0.5852412", "0.5843826", "0.58435917", "0.58291537", "0.5818293", "0.58066857", "0.58059174", "0.58059174", "0.58030796", "0.5799493", "0.57950145", "0.57894176", "0.57811254", "0.5770554", "0.5770013", "0.5751805", "0.5746426", "0.57458985", "0.573013", "0.57038134", "0.5703401", "0.5701225", "0.5698769", "0.56984705", "0.56974965", "0.5683293", "0.567719", "0.5672461", "0.56699353", "0.56691337", "0.56646925", "0.56457835", "0.5624658", "0.56126434", "0.56100726", "0.5600504", "0.5598458", "0.5596983", "0.55906415", "0.55823976", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5581007", "0.5579045", "0.5577368", "0.55713445", "0.5566714", "0.5562117" ]
0.596817
31
Writes a value into the session, accepts dot notation
public function write(string $key, $value): void { $this->session->write($key, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function write(string $name, $value): void\n {\n $this->session()->write($name, $value);\n }", "public function setValue($name, $value) {\n if (strpos($name, '->')) {\n $name = explode('->', $name, 2);\n $_SESSION[$name[0]][$name[1]] = serialize($value);\n } else {\n $_SESSION[$name] = serialize($value);\n }\n return true;\n }", "function sess_write($key, $value) {\n\tif (empty($_COOKIE[session_name()]) && empty($value))\n\t{\n\t\treturn TRUE;\n\t}\n\t\n\t$Controller = getInstance()->Controller;\n\t\n\t$Session = new AppModel('Session');\n\t\n\t$result = $Session->findById($key);\n\t\n\t$user_id = 0;\n\t\n\tif (isset($Controller->User->user['id'])) \n\t{\n\t\t$user_id = $Controller->User->user['id'];\n\t}\n\t\n\tif (isset($result['Session']['id'])) \n\t{\n\t\t$Session->save(array('hostname'=>$_SERVER['REMOTE_ADDR'],'session'=>$value),array('id'=>$key));\n\t}\n\telse \n\t{\n\t $Session->create(array('id'=>$key,'hostname'=>$_SERVER['REMOTE_ADDR'],'session'=>$value));\n\t}\n\t\n\treturn TRUE;\n}", "public function set($key, $value)\n {\n $this->session->write($this->getSessionKey($key), $value);\n }", "public static function write($name, $value = ''){\n\t\t\tif(empty($name)){\n\t\t\t\ttrigger_error('Failed to set a session because no session name was provided.', E_USER_ERROR);\n\t\t\t}\n\t\t\tarray_inject($_SESSION, $name, $value);\n\t\t}", "public static function write($value) {\n self::_init();\n if (func_num_args() > 1) {\n $keys = array_slice(func_get_args(), 1);\n foreach ($keys as $keysEntry) {\n if (!is_string($keysEntry))\n throw new InvalidArgumentTypeException('Session key must be string value');\n }\n } else {\n throw new InvalidArgumentTypeException(\"To write session variable you must specify it's value and, at least, one key\");\n }\n $target = & $_SESSION;\n for ($keyIndex = 0; $keyIndex < count($keys); $keyIndex++) {\n $keysEntry = $keys[$keyIndex];\n if ($keyIndex < count($keys) - 1) {\n if (!isset($target[$keysEntry]) || !is_array($target[$keysEntry])) {\n $target[$keysEntry] = array(); //to avoid manually creation of subarrays create it at first attempt\n }\n $target = & $target[$keysEntry];\n } else {\n $target[$keysEntry] = $value;\n }\n }\n self::_age();\n }", "function set ($name,$value) {\r\n $_SESSION[$name]=$value;\r\n }", "abstract public function write( $value );", "public function set(string $name, $value) {\n //$this->open();\n $_SESSION[$name] = $value;\n }", "public function __set($key, $value) {\n $_SESSION[$key] = serialize($value);\n }", "public function __set($key, $value)\n {\n if (is_object($value)) {\n $_SESSION[$key.'__OBJECT'] = true;\n $value = serialize($value);\n }\n $_SESSION[$key] = $value;\n }", "public function storeValueInSession($name,$value)\n\t{\n\t\t$_SESSION['stored_forms'][$this->name.$this->target_type][$name] = $value;\n\t}", "public function __set($name, $value) {\n $_SESSION[$this->myedb_session_key][$name] = $value;\n }", "public function set($key, $value)\n {\n $this->session->set($key,$value);\n }", "public function set($key,$value) {\n\t\t$this->getFrontendUser()->setKey('ses', self::SESSIONNAMESPACE.$key, $value);\n\t\t$this->getFrontendUser()->storeSessionData();\n return true;\n\t}", "final public function set($name, $value)\n {\n $key = $this->getSessionKey($name);\n\n $_SESSION[$key] = $value;\n }", "public function setSession($value)\n\t{\n\t\t$_SESSION[$this->getKey()] = serialize($value);\n\t}", "public static function store($name, $value)\n\t{\n $_SESSION[$name] = $value;\n\t}", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\tif(is_array($this->value))\n\t\t\t{\n\t\t\t\tforeach($this->value as $key=>$session)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$key] = $session;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(is_string($this->value) and is_string($this->name))\n\t\t\t{\n\t\t\t\t$_SESSION[$this->name] = $this->value;\n\t\t\t}\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function write($key, $value);", "public static function put(string $name, $value): void {\n $_SESSION[$name] = $value;\n }", "public static function put($name, $value){\n return $_SESSION[$name] = $value;\n }", "public function set($name, $value){\n\t\t$_SESSION['tmobi'][$name] = $value;\n\t}", "public static function put($name, $value) {\n return $_SESSION[$name] = $value;\n }", "private function _writeValue($value)\n\t{\n\t\tfwrite($this->_stream, $value);\n\t}", "public static function sessionWriteHandler();", "public function set($name, $value) {\n Session::set($name, $value);\n }", "public function __set( $name , $value ){\n\n \tif ( $this->sessionState == self::SESSION_NOT_STARTED ){\n \t\tself::$instance->startSession();\n \t}\n\n $_SESSION[$name] = $value;\n }", "public static function setValue($name,$value)\n {\n $_SESSION[$name] = $value;\n }", "public function set($key, $value) {\n $key_name = $this->getSessionKeyName($key);\n Session::put($key_name, $value);\n }", "public function set($key,$value) {\n if($this->isLoggedIn()) {\n $bag = $_SESSION['bag'];\n $_SESSION['bag'][$key] = $value;\n // There's only a cookie if Remember Me is on.\n if(isset($_COOKIE) && array_key_exists($this->_cookieName,$_COOKIE)) {\n $cookieHash = $_COOKIE[$this->_cookieName];\n $cookieHash = preg_replace(\"/[^A-Za-z0-9]/\", '', $cookieHash);\n $this->writeCookieData($cookieHash);\n }\n }\n }", "public function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function __set($name,$value){\n\t\treturn $_SESSION[$name] = $value;\n\t}", "public function __set($name, $value)\n {\n $_SESSION[$this->prefix][$name] = $value;\n }", "private function _write( $name, $value )\n {\n setcookie( us($name), us($value), $this->expire, $this->path, $this->domain, $this->secure, $this->httponly );\n }", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public static function set($key, $value)\n\t{\n\t\t$_SESSION[(string)$key] = serialize($value);\n\t}", "public static\r\n function set($name, $value) {\r\n if(session_status() != PHP_SESSION_ACTIVE) {\r\n session_start();\r\n }\r\n if(!isset($name)) {\r\n session_register($name);\r\n }\r\n $_SESSION[\"\" . $name . \"\"] = $value;\r\n session_write_close();\r\n //define($name, $value);\r\n }", "public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }", "public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }", "private function _write_raw( $name, $value )\n {\n setrawcookie( us($name), us($value), $this->expire, $this->path, $this->domain, $this->secure, $this->httponly );\n }", "public static function register($key,$value)\n\t{\n\t\t$_SESSION[$key] = serialize($value);\n\t}", "public function set(string $key, $value): void\n {\n $this->startIfNotStarted();\n if (strpos($key, '.') === false) {\n $_SESSION[$key] = $value;\n } else {\n /** @psalm-suppress NullReference */\n ArrayManipulations::setToArrayByKey($key, $value, $_SESSION);\n }\n }", "public static function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public static function set($key, $value) {\n\t\t\t$_SESSION[base64_encode(BASE_PATH).'_'.$key] = $value;\n\t\t}", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public static function put($name, $value)\n {\n return $_SESSION[$name] = $value;\n }", "public function set($what, $value) {\n $_SESSION[$what] = $value;\n }", "public function sess_write()\r\r\n\t{\r\r\n\t\tif( ! $this->parent->check_write())\r\r\n\t\t{\r\r\n\t\t\t$_SESSION = array();\r\r\n\t\t\tforeach($this->parent->userdata as $key => $val)\r\r\n\t\t\t{\r\r\n\t\t\t\t$_SESSION[$key] = $val;\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t$this->parent->track_write();\r\r\n\t\t}\r\r\n\t}", "protected function _apc_write($id, $value) {\r\n $id = 'osc_sess_' . $id;\r\n\r\n if ( apc_exists($id) ) {\r\n \t$var = apc_delete($id);\r\n return apc_add($id, $value, $this->_life_time);\r\n \r\n } else {\r\n return apc_add($id, $value, $this->_life_time);\r\n }\r\n }", "public static function storeSession(string $key, $value): void\n {\n $GLOBALS['TSFE']->fe_user->setAndSaveSessionData($key, $value);\n }", "public static function set($key, $value)\n {\n // Check logged in state\n if (!self::isLoggedIn()) {\n return false;\n }\n\n // Set the value in the Session, including prefixes\n Session::set(self::SESSION_PREFIX . $key, $value);\n }", "public function set(string $name, $value)\n {\n $_SESSION[$this->prefix]['vars'][$name] = $value;\n }", "private function write($key,$value) {\r\n}", "public function set($param, $value)\n {\n $this->session->set($param, $value);\n }", "function fsl_session_set($name,$value,$timeout = NULL){\n $_SESSION[$name] = fsl_encrypt($value);\n\t\t\t\tif(!empty($timeout)) $_SESSION[$name.'_timeout'] = $timeout + time();\n\t\t\n return true;\n}", "function set_data($name,$value) {\n $this->store_in_session('page_data',$name,$value);\n\n }", "public function set( $name, $value ){\n\t\t\tif( !$this->isStarted() ){\n\t\t\t\t$this->startAll();\n\t\t\t}\n\n\t\t\t$_SESSION[ $name ] = $value;\n\t\t}", "public final function set($property, $value) \n\t{\n\t\t$_SESSION[$property] = $value;\n\t}", "protected function setPersistentData($key, $value)\n {\n $this->_sessionNamespace->{$key} = $value;\n }", "public function set($name, $value)\n {\n $_SESSION[$this->_index][$name] = $value;\n }", "public function __set($name, $value)\n {\n if (in_array($name, $this->properties)) {\n $this->data[$name] = $value;\n $this->syncSessionProperty($name, $value);\n }\n }", "public function set($key, $value) {\n \n $this->start();\n $_SESSION[$key] = $value;\n \n }", "function HTTP_SessionServer_SaveHandler_write($id, $sess_data)\n{\n $GLOBALS['__session']->put($GLOBALS['__sessionName'], $sess_data);\n return true;\n}", "public static function saveSessionValue($name, $value, $encrypt=FALSE)\n {\n try\n {\n $fullname = CONST_NM_RAPTOR_CONTEXT.'_'.$name;\n $allnamesname = CONST_NM_RAPTOR_CONTEXT.'_allnames';\n if(!isset($_SESSION[$allnamesname]) || !is_array($_SESSION[$allnamesname]))\n {\n $_SESSION[$allnamesname] = array($allnamesname);\n }\n if($value != NULL)\n {\n $_SESSION[$allnamesname][$fullname] = microtime(TRUE); //When the value got set\n if(!$encrypt)\n {\n $_SESSION[$fullname] = $value;\n } else {\n $scrambed = self::getFastScrambled($value);\n $_SESSION[$fullname] = $scrambed;\n }\n } else {\n $_SESSION[$fullname] = NULL;\n unset($_SESSION[$allnamesname][$fullname]);\n }\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "public function __set($name, $value) {\n\t\tif (is_string($name))\n\t\t{\n\t\t\t$this->session[$name] = $value;\n\t\t\t$_SESSION[$name] = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Expect a string key name');\n\t\t}\n\t}", "private function namespaceSet($var, $value) {\r\n\t\t$_SESSION[self::SESSION_NAMESPACE][$var] = $value;\r\n\t}", "protected function writeSession() {\n // write the session\n $session = null;\n if ($this->request->hasSession()) {\n $session = $this->request->getSession();\n if ($session->isChanged()) {\n $session->write();\n }\n\n if (!$session->getAll()) {\n $session = null;\n }\n }\n\n // log the session\n if (!$this->log) {\n return;\n }\n\n if ($session) {\n $this->log->logDebug('Current session:', $session->getId(), System::LOG_SOURCE);\n\n if ($this->valueDecorator) {\n $variables = $session->getAll();\n\n ksort($variables);\n\n foreach ($variables as $name => $value) {\n $this->log->logDebug('- ' . $name, $this->valueDecorator->decorate($value), System::LOG_SOURCE);\n }\n }\n } else {\n $this->log->logDebug('No session loaded', '', System::LOG_SOURCE);\n }\n }", "public static function set(string $key, $value) {\n\t\treturn self::$sessionInstance->set ( $key, $value );\n\t}", "abstract public function write( $key, $value );", "public static function sessionWrite($sessionKey, $value)\n {\n $sessionKey = addslashes($sessionKey);\n $value = addslashes($value);\n $session = self::get(self::$cachePrefix . $sessionKey);\n\n if ($session === false)\n {\n // insert key into memcache for 5 minutes\n return self::add(self::$cachePrefix . $sessionKey, $value, false, 300);\n }\n else\n {\n // update memcache key\n return self::replace(self::$cachePrefix . $sessionKey, $value, false, 300);\n }\n }", "public static function set($key, $value){\n\t\t$_SESSION[$key] = $value;\n\t}", "private function syncSessionProperty($name, $value) {\n if (session_id() &&\n in_array($name, $this->syncedProperties) &&\n isset($this->company) &&\n isset($this->email)) {\n\n if (!isset($_SESSION[self::SESSION_KEY]) ||\n !isset($_SESSION[self::SESSION_KEY][$this->company])) {\n $_SESSION[self::SESSION_KEY] = array(\n $this->company => array($this->email => array())\n );\n } elseif (!isset($_SESSION[self::SESSION_KEY][$this->company][$this->email])) {\n $_SESSION[self::SESSION_KEY][$this->company][$this->email] = array();\n }\n\n $_SESSION[self::SESSION_KEY][$this->company][$this->email][$name] = $value;\n }\n }", "public function set ($key, $value) {\n\t\t$_SESSION[$key] = $value;\n\t}", "public function put($key, $value) {\n\n if (!$this->sessionStarted()) {\n throw new \\DomainException(\"Cant set value on NULL session\");\n }\n\n $_SESSION[$key] = $value;\n\n return true;\n }", "public function setAttribute($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "function set_session_value($params){\n if($params['name'] && $params['value']){\n $_SESSION[$params['name']] = $params['value'];\n }\n}", "public function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function setSessionData($name, $value) {\n if (isset(self::$_session)) {\n self::$_session[$name] = $value;\n } else {\n $_SESSION[$name] = $value;\n }\n }", "public function setValue($key, $value) {\n $this->startSession();\n $_SESSION [$key] = $value;\n $this->sessionData = null;\n session_write_close();\n }", "public static function set(string $key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function put($key, $value = null)\n {\n $_SESSION[$key] = $value;\n }", "public function set(\n string $key,\n $value,\n ): void {\n $this->start();\n\n $_SESSION[$this->getSessionName($key)] = $value;\n }", "public function set($key, $value)\n\t{\n\t\t$_SESSION[$key] = $value;\n\t}", "public static function set($key, $value)\r\n {\r\n $_SESSION[$key] = $value;\r\n }", "function setSessValue($k, $v){\n $k = _APPNAME .'#'.$k;\n $_SESSION[$k] = $v;\n }", "public function set($key, $value = null) {\n\t\t\tif (!isset($_SESSION)) {\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t\tif (is_array($key)) {\n\t\t\t\tforeach ($key as $name => $val) {\n\t\t\t\t\t$_SESSION[$name] = htmlspecialchars($val, ENT_QUOTES, 'UTF-8');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$_SESSION[$key] = [];\n\n\t\t\t\t\tforeach ($value as $name => $var) {\n\t\t\t\t\t\t$_SESSION[$key][$name] = htmlspecialchars($var, ENT_QUOTES, 'UTF-8');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_SESSION[$key] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public function write() {\n\n try {\n $this->open();\n $sessionData = session_encode(); // Returns an encoded string containing the session data.\n $fileHandle = fopen(self::FILEPATH, \"w+\"); // Open the file\n fwrite($fileHandle, $sessionData); // Write the session data to file\n fclose($fileHandle);\n }\n catch(SessionException $e) {\n echo \"Error writing session to file: \" . $e->getMessage();\n }\n }", "public static function set($key, $value) {\n $_SESSION[$key] = $value;\n }", "protected function setSessionValue($name, $value)\r\n {\r\n if (!isset($_SESSION)) { session_start(); }\r\n \r\n $_SESSION[$name] = $value;\r\n }", "function update_session($session_name, $field, $value) {\n $_SESSION[APP_ID . $session_name][$field] = $value;\n return $_SESSION[APP_ID . $session_name];\n}", "public function write( $name )\n {\n $value = $this->getValue( $name );\n $this->_write( $name, $value );\n }", "public function set($name, $value = null)\n\t{\n\t\tif ( $value === null )\n\t\t\tunset($_SESSION[$name]);\n\t\telse\n\t\t\t$_SESSION[$name] = $value;\n\t}", "public function setSessionValue($key, $value) \n {\n $_SESSION[$key] = $value;\n }", "public function write() {\n\t\t$database = Registry::get(\"database\");\n\t\t$v = \"value='\" . $this -> value . \"'\";\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE server.configs SET \" . $v . \" WHERE key_='\" . $this -> key . \"'\");\n\t}", "function set($variable, $value) {\n\t\t$_SESSION[$variable] = $value;\n\t}" ]
[ "0.6874833", "0.6698516", "0.6631728", "0.63473207", "0.63001645", "0.6299633", "0.6206894", "0.6145414", "0.61328804", "0.61146003", "0.611225", "0.6099091", "0.6096094", "0.60322535", "0.60182613", "0.6005788", "0.59970236", "0.598189", "0.5974623", "0.59569305", "0.59521675", "0.5944472", "0.5937961", "0.59108794", "0.58989847", "0.58970135", "0.58955425", "0.5886572", "0.5883513", "0.588316", "0.58643705", "0.5862631", "0.584626", "0.58368784", "0.58323336", "0.5831816", "0.5831816", "0.5808873", "0.5804997", "0.5793008", "0.5793008", "0.5789282", "0.57853675", "0.5774759", "0.5763402", "0.5761148", "0.5754896", "0.573879", "0.57213414", "0.5713284", "0.5708153", "0.5698675", "0.56885475", "0.5664221", "0.5662839", "0.5655639", "0.56501013", "0.5647393", "0.5631592", "0.5631124", "0.5626837", "0.56253785", "0.5621951", "0.56205946", "0.5611458", "0.56046164", "0.56026316", "0.55999494", "0.5597263", "0.557498", "0.5574934", "0.5568081", "0.556481", "0.55599934", "0.5548992", "0.55483085", "0.554756", "0.5539778", "0.5522067", "0.55210197", "0.552053", "0.5510205", "0.550889", "0.5477186", "0.5466802", "0.545838", "0.54459673", "0.54406273", "0.542773", "0.54088724", "0.5408685", "0.5407735", "0.5405102", "0.5401589", "0.53909415", "0.5388426", "0.5387195", "0.53848773", "0.537943", "0.5367225" ]
0.6788624
1
Checks if a key exists in the session
public function exists(string $key): bool { return $this->session->exists($key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function keyExists($key)\n {\n if (isset($_SESSION[$key])) {\n return true;\n }\n else {\n return false;\n }\n }", "public static function exists($key = \"\")\n\t{\n\t\tif(empty($key)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isset($_SESSION[$key]);\n\t}", "public static function exists(string $key): bool {\n\t\treturn self::$sessionInstance->exists ( $key );\n\t}", "public function has(/*string*/ $key) /*bool*/\n {\n return isset($_SESSION[self::KEY][$key]);\n }", "#[Pure]\n public function has(string $key) : bool\n {\n return isset($_SESSION[$key]);\n }", "public static function isExist($key) {\n return isset($_SESSION[self::$appSessionName][$key]);\n }", "public function exists($key) {\n return array_key_exists($key, $_SESSION);\n }", "public static function exists(string $key): bool\n {\n return isset($_SESSION[$key]) ? true : false;\n }", "public function has($key)\n {\n return isset($_SESSION[$key]);\n }", "public function has($key)\n {\n return isset($_SESSION[$key]);\n }", "public function has( $key ) {\n return isset( $_SESSION[$key] );\n }", "public static function has(string $key): bool\n {\n static::start();\n return isset($_SESSION[$key]);\n }", "public function has($key)\n\t{\n\t\treturn isset($_SESSION[$key]);\n\t}", "public static function contain($key): bool\n {\n if (isset($_SESSION[$key])) {\n return true;\n }\n return false;\n }", "public static function has($key)\n {\n return array_key_exists($key, self::$session);\n }", "public function has($key) {\n\t\t$sessionData = $this->getFrontendUser()->getKey('ses', self::SESSIONNAMESPACE.$key);\n\t\tif ($sessionData == '') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static function has($key)\n\t{\n\t\treturn (isset($_SESSION[(string)$key]));\n\t}", "public function has($sKey): bool\n {\n return session()->exists($sKey);\n }", "public static function has($key)\n {\n if (array_key_exists($key, $_SESSION) && $_SESSION[$key] !== null) {\n return true;\n }\n return false;\n }", "public function exist($key);", "public static function exist($key) ;", "public static function isExistInTemp($key) {\n return isset($_SESSION[self::$appSessionName][self::$storageName][$key]);\n }", "public function _key_exists($key)\n {\n return $this->db\n ->where('auth_key', $key)\n ->count_all_results('login_keys') > 0;\n }", "public function keyExists(string $key): bool;", "public function exists($key);", "public function check($key = null) {\n $lookupKey = $this->getConfig('sessionKey');\n if ($key !== null) {\n $lookupKey .= '.' . $key;\n }\n return $this->getView()->getRequest()->getSession()->check($lookupKey);\n }", "function exists($key);", "public function offsetExists($identifier) {\n if (isset($_SESSION) && is_array($_SESSION)) {\n return array_key_exists($this->_compileKey($identifier), $_SESSION);\n }\n return FALSE;\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function exists($key){\n\n //get exists\n if($this->client->exists($key)){\n return true;\n }\n return false;\n }", "public function isKeyExist($key)\n {\n if(isset($this->list[$key]))\n {\n return true;\n }\n\n return false;\n }", "public function exists(string $key);", "public function isExistInCache($key);", "public function exists($key): bool;", "public function hasKey() {\n return $this->_has(1);\n }", "public function exists($key){\n return isset($_COOKIE[$key]);\n }", "public function itemExists($key);", "public function exists($key) {\n return false;\n }", "public function valid() {\n\t\t$key = key($this->session);\n\n\t\treturn ($key == null || $key == false) ? false : true;\n\t}", "public function hasKey()\n {\n return isset($this->key);\n }", "public function hasKey()\n {\n return isset($this->key);\n }", "public function has($key)\n {\n $query = $this->db->createQueryBuilder();\n\n $value = $query\n ->select('count(*)')\n ->from('sessions')\n ->where($query->expr()->eq('name', ':key'))\n ->setParameter(':key', $key)\n ->execute()->fetchColumn();\n\n return (bool)$value;\n }", "public function has($key) : bool;", "public static function isExist($key) {\n return isset($_COOKIE[$key]);\n }", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function has($key);", "public function exists($key){\n\t\treturn apc_exists($key);\n\t}", "public function is_key($key) {\n try{\n return isset($this->Items[$key]);\n }catch(Exception $e){\n throw $e;\n }\n }", "public function has(string $key, mixed $value = null): bool\n {\n return is_null($value)\n ? isset($_SESSION[$key])\n : isset($_SESSION[$key]) && $_SESSION[$key] == $value;\n }", "public function exists(string $key): bool\n {\n }", "public function keyExists($key)\n {\n return apc_exists($key);\n }", "public function has(string $key): bool {}", "public function issetKey(string $key) : bool;", "function has($key);", "public static function get($key){\t\t\n\t\treturn (isset($_SESSION[$key])) ? $_SESSION[$key] : false;\n\t}", "public function exists( $name ){\n\t\t\treturn isset( $_SESSION[ $name ] );\n\t\t}", "public function hasKey($key) {\n if ($this->client) {\n return $this->client->exists($key);\n }\n return false;\n }", "public function hasKey()\n\t{\n\t\treturn !empty($this->key);\n\t}", "public function containsKey($key): bool;", "public function containsKey($key): bool;", "public static function exists($name) {\n return (isset($_SESSION[$name])) ? true : false;\n }", "public function get ($key) {\n\t\treturn isset($_SESSION[$key]) ? $_SESSION[$key] : false;\n\t}", "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 }", "function KeyExist () { // verifie l'existence des cles pour connexions ssh\n\treturn file_exists('/var/remote_adm/.ssh/id_rsa.pub');\n}", "public function exist($keyName);", "public function exists($key) {\n return apc_exists($key);\n }", "public static function exists($name){\n return isset($_SESSION[$name]) ? TRUE : FALSE;\n }", "public function has(string $key) : bool;", "public function query_exists($key) {\n\t\t\treturn \\uri\\query::exists($this->object, $key);\n\t\t}", "public function hasKey($key){\n $item = CacheManager::getInstance('files')->getItem($key);\n return !is_null($item->get());\n }", "public function exist(string $key): bool\r\n {\r\n return isset($this->$key) === true;\r\n }", "public function exists ($key)\n {\n return apc_exists($key);\n }", "public function containsKey($key);", "public function containsKey($key) {\n return array_key_exists($key, $this->_hash);\n }", "public function has(string $key): bool;", "public function has(string $key): bool;" ]
[ "0.817908", "0.81336594", "0.8129862", "0.8044306", "0.8043965", "0.8010374", "0.8004572", "0.79649186", "0.79416645", "0.79416645", "0.7857791", "0.7834408", "0.78128517", "0.7810932", "0.7801226", "0.77910507", "0.7779032", "0.7612454", "0.7493532", "0.74776816", "0.74679667", "0.74675715", "0.7370793", "0.7292515", "0.7220135", "0.7168721", "0.71578187", "0.7142912", "0.711015", "0.711015", "0.711015", "0.711015", "0.711015", "0.711015", "0.711015", "0.711015", "0.711015", "0.7083782", "0.7082631", "0.70552146", "0.70442027", "0.703102", "0.70090413", "0.6989328", "0.6970253", "0.6964876", "0.6937799", "0.6935753", "0.6935753", "0.6906504", "0.68894273", "0.6881371", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.6864587", "0.68419933", "0.6833704", "0.68314654", "0.6829658", "0.68289495", "0.6805157", "0.67791045", "0.6777145", "0.6770234", "0.676739", "0.67513454", "0.6727862", "0.67164725", "0.67164725", "0.67136943", "0.67111856", "0.6710975", "0.6702262", "0.67005724", "0.669743", "0.6697275", "0.6691715", "0.66791224", "0.6671501", "0.66710496", "0.66706914", "0.66648674", "0.6660531", "0.6645503", "0.6645503" ]
0.78497416
11
Deletes a key in the session
public function delete(string $key): bool { return $this->session->delete($key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function delete(string $key): void {\n\t\tself::$sessionInstance->delete ( $key );\n\t}", "public function delete($key)\n\t{\n\t\tunset($_SESSION[$key]);\n\t}", "public static function del($key) {\t\t\t\n\t\t\tif(isset($_SESSION[base64_encode(BASE_PATH.'_'.$key)]))\n\t\t\tunset($_SESSION[base64_encode(BASE_PATH.'_'.$key)]);\n\t\t}", "public function delete($key)\n {\n unset($_SESSION[$key]);\n return;\n }", "public static function delete(string $key)\n {\n if (isset($_SESSION[$key])) {\n unset($_SESSION[$key]);\n }\n }", "public function deleteSessionValue($key) \n {\n unset($_SESSION[$key]);\n }", "public function delete($key) {\n\n $this->start();\n unset($_SESSION[$key]);\n\n }", "public function delete($key) {\n $key_name = $this->getSessionKeyName($key);\n\n Session::forget($key_name);\n }", "public function delete($key)\n {\n $this->session->delete($this->getSessionKey($key));\n }", "public function del($key);", "public function delete(string $key): void\n {\n $this->ensureStarted();\n unset($_SESSION[$key]);\n }", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public static function delete($key = \"\")\n\t{\n\t\tif(empty($key)) {\n\t\t\treturn false;\n\t\t}\n\t\tif(self::exists($key)) {\n\t\t\tunset($_SESSION[$key]);\n\t\t}\n\t}", "public function delete( $key );", "public function remove(string $key)\n {\n unset($_SESSION[$key]);\n }", "public function delete(\n string $key,\n ): void {\n $this->start();\n\n unset($_SESSION[$this->getSessionName($key)]);\n }", "public static function remove($key)\n {\n unset($_SESSION[$key]);\n }", "public function delete($key)\n {\n // don't start a new session to remove something that isn't there\n $this->lazyStart();\n unset($this->_store[$key]);\n }", "public function remove($key)\n {\n $this->session->remove((string)$key);\n }", "public static function delete($key)\n\t{\n\t\tforeach (func_get_args() as $key)\n\t\t{\n\t\t\tunset($_SESSION[(string)$key]);\n\t\t}\n\t}", "public function remove($key) {\n unset($_SESSION[static::$storageKey][$key]);\n }", "public function delete($sKey)\n {\n session()->forget($sKey);\n }", "public function delete($key): void;", "abstract public function delete($key);", "public static function remove($key) {\n if (!is_null(Session::get($key))) {\n unset($_SESSION[$key]);\n }\n }", "abstract public function delete( $key );", "abstract public function delete ($key);", "public function deleteMatch($key)\n {\n $tmp = $this->session->read($this->storeNamespace);\n if (is_array($tmp)) {\n $flat = Hash::flatten($tmp);\n foreach ($flat as $k => $v) {\n if (strstr($k, $key)) {\n $this->session->delete($this->getSessionKey($k));\n }\n }\n }\n }", "public function delete(string $key): void;", "public function remove(string $key)\n {\n if (isset($_SESSION[$key])) {\n $_SESSION[$key] = '';\n unset($_SESSION[$key]);\n }\n }", "public function deleteItem($key);", "public function remove($key)\n {\n $this->has_changes = true;\n unset($this->sess_data[$key]);\n }", "public function erase($key);", "public static function remove(string $key): void\n {\n static::start();\n if (static::has($key)) {\n unset($_SESSION[$key]);\n }\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public function remove($key)\n\t{\n\t\t$this->check();\n\n\t\tif (!isset($_SESSION[$key]))\n\t\t\treturn;\n\n\t\t$var = $_SESSION[$key];\n\t\tunset($_SESSION[$key], $var);\n\t}", "public function destory()\n\t{\n\t\t$key = $this->getKey();\n\t\tif ( isset($_SESSION[$key]) ) unset($_SESSION[$key], $key);\n\t}", "public function delete_key($key){\n if($this->driver==\"file\"){\n $this->file->delete_file($this->path.md5($key).\".txt\");\n }\n if($this->driver==\"redis\"){\n $this->redis->hDel($this->path,md5($key));\n }\n }", "public static function delete($key)\n {\n $sessionPrefix = Box::getConfig()->framework['sessionPrefix'];\n if (isset($_SESSION[$sessionPrefix . $key])) {\n $value = $_SESSION[$sessionPrefix . $key];\n unset($_SESSION[$sessionPrefix . $key]);\n return $value;\n }\n\n return null;\n }", "public static function delete($key)\n {\n if (self::has($key)) {\n unset(self::$__request[$key]);\n }\n }", "public function delete($key) {\n\t\treturn $this->engine->delete($key);\n\t}", "function dbRemoveSessionKey($session_key) {\n\t$dbconn = dbConnect();\n\t$success = false;\n\t\n\t$prepare_ret = pg_prepare($dbconn, 'delete_session_key', 'DELETE FROM active_api_session_keys WHERE session_key = $1');\n\tif ($prepare_ret) {\n\t\t$resultobj = pg_execute($dbconn, 'delete_session_key', array($session_key));\n\t\tif ($resultobj) {\n\t\t\t$success = true;\n\t\t} else {\n\t\t\tdie(\"Query failed: \" . pg_last_error());\n\t\t}\n\t} else {\n\t\tdie(\"Prepared statement failed: \" . pg_last_error());\n\t}\n\n\tdbClose($dbconn);\n\treturn $success;\n}", "public function delete( $key ) {\n unset( $_SESSION[$key] );\n return $this;\n }", "public function delete($key) {\n\t\t// and return the result\n\t\treturn eaccelerator_rm($key);\n\t}", "public function delete($key) {\n unset($_SESSION[$key]);\n return $this;\n }", "function delete($key) {\n\t\tunset($this->_cache[$key]);\n\t}", "function delete($key) {\n\t\t\treturn $this->inst->delete($key);\n\t\t}", "public function delete($key){\n return $this->connection->del($key);\n }", "private function removeEntryIdFromSession()\n {\n Session::forget($this->session_key);\n }", "public function deleteData($key)\n {\n if(isset($_SESSION[$key])){\n unset($_SESSION[$key]);\n return true;\n }\n return false;\n }", "protected function _removeKey($key) {}", "public function remove($key) {}", "public static function remove($key): void\n {\n if (isset($_SESSION[$key])) {\n unset($_SESSION[$key]);\n } else {\n throw new InvalidArgumentException(\"no $key in the session\");\n }\n }", "public function delete ($key)\n {\n return apc_delete($key);\n }", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function deleteItem($key)\n {\n }", "public function unlink($key);", "public function delInCache($key);", "public function delete( $key )\n\t{\n\t\t$this->getObject()->delete( $key );\n\t}", "public function delete(string $key) : bool;", "public static function delete ( $key ) {\n return self::getAdapter()->delete( $key );\n }", "function rm($key) {\n }", "public function delete($key, string $array = ''): void\n {\n if ($array === '') {\n unset($_SESSION[$key]);\n } else {\n unset($_SESSION[$array][$key]);\n }\n }", "function _delete($key){\n $this->_set($key, null);\n }", "public function clear(/*string*/ $key) /*void*/\n {\n unset($_SESSION[self::KEY][$key]);\n }", "private function delKey($key)\n {\n $this->model::where('key', $key)->get()->map(function($row){ $row->delete(); });\n }", "public function delete($key) {\n\t\t$debugger = Application::getInstance()->getDiContainer()->getDebugger();\n\n\t\t// If we have a debugger, we have to log the query\n\t\tif (!$this->debuggerDisabled && $debugger !== false) {\n\t\t\t$debugger->addItem(new StorageItem('dummy', 'dummy.' . $this->currentConfigurationName,\n\t\t\t\tStorageItem::METHOD_DELETE . ' ' . $key, null, 0));\n\t\t}\n\t}", "public function delete($key) {\n\t\tif ($this->isValidKey($key)) {\n\t\t\treturn $this->deleteKey($key);\n\t\t}\n\t}", "public function delete($key) {\n return apc_delete($key);\n }", "function delete ($key) {\n return $this->memcached->delete($key);\n }", "public function unsetKey(string $key);", "public function unset($key) {\n\t\t\tif (!isset($_SESSION)) {\n\t\t\t\t$this->response->throwErr(\"There's no active session\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\tif (is_array($key)) {\n\t\t\t\tforeach ($key as $field) {\n\t\t\t\t\t$this->unset_session_var($field);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->unset_session_var($key);\n\t\t\t}\n\t\t}", "public function remove(string $key);", "public function delete(string $key): bool;", "public function delete(string $key): bool;", "public function delete(string $key): bool;", "public function delete($key)\n {\n return $this->send(['command'=>'delete', 'key'=>$key, 'seq'=>$this->getSequence()]);\n }", "public static function delete_value($key) {\n\t\tglobal $woocommerce;\n\n\t\t// WooCommerce 2.1\n\t\tif(version_compare($woocommerce->version, '2.1', '>=')) {\n\t\t\tif(isset($woocommerce->session)) {\n\t\t\t\t$woocommerce->session->set($key, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// WooCommerce 2.0\n\t\tif(version_compare($woocommerce->version, '2.0', '>=')) {\n\t\t\tif(isset($woocommerce->session)) {\n\t\t\t\tunset($woocommerce->session->$key);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// WooCommerce < 2.0\n\t\tif(version_compare($woocommerce->version, '1.6', '<=')) {\n\t\t\tunset($_SESSION[$key]);\n\t\t\treturn;\n\t\t}\n\t}", "public static function delete(string $key)\n {\n return \\apcu_delete(self::PREFIX.$key);\n }", "abstract public function remove($key);", "public function delete($key) {\n\t\tif ($this->has($key)) {\n\t\t\tunlink($this->_dir . $key);\n\t\t}\n\t}", "public function deleteKey( $key )\n {\n /** @var $client \\Memcached */\n $client = $this->getClient();\n $client->delete( $key );\n }", "function remove($key);", "function remove($key);", "static function remove( $key ) {\r\n\t\tif ( isset( $_SESSION['learn_press'][$key] ) ) {\r\n\t\t\tunset( $_SESSION['learn_press'][$key] );\r\n\t\t}\r\n\t}", "public function deleteByKey($key)\n {\n // Direct delete from memcached and local cache\n unset($this->cache[$key]);\n foreach ($this->mc as $mc) {\n $mc->delete($key);\n }\n }", "public function remove($key){\n\n }", "public function destroy(Request $request, $key);", "public static function remove($key, $index)\n {\n array_splice($_SESSION[$key], $index, 1);\n }", "public function delete($key)\n {\n if(isset($_COOKIE[$key])){\n unset($_COOKIE[$key]);\n setcookie($key, '', time() - 3600);\n }\n }", "function remove($key) {\n return apc_delete($key);\n }" ]
[ "0.84499407", "0.84224606", "0.827625", "0.8266195", "0.82585204", "0.8231618", "0.82116246", "0.81914514", "0.80130404", "0.79817563", "0.785809", "0.785535", "0.785535", "0.785535", "0.78541803", "0.78486556", "0.78026885", "0.7792469", "0.7773179", "0.77723366", "0.77267516", "0.7688633", "0.76809055", "0.76226276", "0.7542337", "0.7483506", "0.7481553", "0.7424542", "0.74111265", "0.74086624", "0.7344904", "0.73376995", "0.73063874", "0.729527", "0.72627294", "0.72560775", "0.72548527", "0.7223509", "0.721921", "0.7212207", "0.71924865", "0.7170606", "0.71382165", "0.709755", "0.7078329", "0.7066304", "0.7055317", "0.7041213", "0.7030534", "0.70265776", "0.70064735", "0.6998916", "0.69967276", "0.69809234", "0.69782", "0.69457746", "0.69404227", "0.69404227", "0.69404227", "0.69404227", "0.69404227", "0.69404227", "0.69404227", "0.69404227", "0.6938502", "0.69270635", "0.6923995", "0.6916931", "0.69125634", "0.69122064", "0.69012153", "0.68816555", "0.68746483", "0.6873527", "0.68716717", "0.6858612", "0.68414724", "0.6822571", "0.68164504", "0.6812148", "0.6803054", "0.6787376", "0.67681867", "0.67681867", "0.67681867", "0.67617995", "0.6759468", "0.6749316", "0.67448324", "0.67365444", "0.67318267", "0.6730634", "0.6730634", "0.67279273", "0.67026156", "0.6699511", "0.6680565", "0.666807", "0.6658746", "0.66527665" ]
0.73119587
32
Clears the session data
public function clear(): void { $this->session->clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function clear() {\n $_SESSION = array();\n\n // Destroy the session cookie and cookie header\n $sessionCookie = Cookie::loadCookie(session_name());\n $sessionCookie->unset();\n $sessionCookie->delete();\n\n // Clear out other possible values\n if (isset($_GET[session_name()]))\n unset($_GET[session_name()]);\n\n if (isset($_POST[session_name()]))\n unset($_POST[session_name()]);\n }", "public function clear()\n {\n $this->session->sess_destroy();\n }", "function clearSession(){\n\t\t\n\t\t$this->dm->session->sess_destroy();\n }", "public function clear(){\n @session_destroy();\n @session_start();\n }", "public static function clear(): void\n {\n $_SESSION = [];\n }", "function clear_session()\n\t{\n\t\t$fields = array('institution__institutions'=>'', 'role__jobroles'=>'', 'headline'=>'', 'summary'=>'', 'details'=>'', 'publishstart'=>'', 'publishend'=>'');\n\t\t$this->native_session->delete_all($fields);\n\t}", "public function clearAll() {\n $this->startSession();\n $_SESSION = array();\n $this->sessionData = null;\n session_write_close();\n }", "public function clear()\n {\n $this->session = array();\n\n if (array_key_exists($this->namespace, $_SESSION)) {\n unset($_SESSION[$this->namespace]);\n }\n }", "public static function clear()\n\t{\n\t\tSession::instance()->delete(Message::SESSION_VAR);\n\t}", "protected function clearSessionData()\n {\n $this->_checkoutSession\n ->unsetData('temando_consolidated_packaging')\n ->unsetData('selected_delivery_options')\n ->unsetData('destination_type');\n }", "public function removeSessionData() {}", "function clearState()\n {\n $this->Session->write($this->sessionVariableName, null);\n }", "public function clear()\n {\n session()->flush();\n }", "public function clear() {\n $_SESSION[static::$storageKey] = array();\n }", "public static function clear_session_token()\n {\n self::set_session_token('');\n }", "protected function clearSession(): void\n {\n $this->get('session')->clear();\n $session = new Session();\n $session->invalidate();\n }", "public function sessionClear()\n {\n session()->forget('zipcode');\n session()->forget('addr_city');\n session()->forget('addr_area');\n session()->forget('addr_street');\n session()->forget('deliver');\n session()->forget('payment_method');\n session()->forget('invoice_type');\n }", "protected static function unsetSessionData() {\n if (isset(self::$_session)) {\n self::$_session = array();\n } else {\n unset($_SESSION['salesforce_wsdl']);\n unset($_SESSION['salesforce_location']);\n unset($_SESSION['salesforce_sessionId']);\n }\n }", "public function clear()\n {\n $this->session->delete($this->storeNamespace);\n }", "private function unsetSessionData(){\n if(isset($_SESSION['searchKeyword'])){\n $this->session->unset_userdata('searchKeyword');\n }\n if(isset($_SESSION['timecon'])){\n $this->session->unset_userdata('timecon');\n }\n\n }", "function destroySessionData() {\n\t\tglobal $TSFE;\n\n\t\t$TSFE->fe_user->setKey ('ses', 'tx_frontendformslib', '');\n\t\tunset ($this->sessionData);\n\t}", "function payswarm_clear_session() {\n // clear existing stored session\n $session = payswarm_get_session();\n if($session !== false) {\n delete_transient('ps_sess_' . $session['id']);\n }\n\n // clear cookie\n payswarm_clear_session_cookie();\n}", "public static function clear() {\n FPCAuthentication_Result::startSession();\n unset($_SESSION[self::FPC_LOGIN_RESULT_KEY]);\n }", "function clear(){\r\n\t\t$_SESSION[self::_KEY_][get_class($this)]->reset();\r\n\t}", "public function clear_session_data() {\n\n\t\tunset( WC()->session->wc_braintree_paypal_cart_nonce );\n\t\tunset( WC()->session->wc_braintree_paypal_cart_customer_details );\n\t}", "public function resetSessionData(){\n\t\t$_SESSION['Order__id'] = null;\n\t\t$_SESSION['transactionAmount'] = null;\n\t\t\n\t}", "public function unsetSession();", "public static function clear() {\n\t if(session_status() === PHP_SESSION_ACTIVE) {\n\t session_unset();\n\t }\n\t}", "public function removeSessionData(): void\n {\n $this->response->getSession()->remove(config('form.session_key'));\n }", "function clearSession(){\n\tsession_destroy();\n}", "public function clear()\n {\n Session::clear('Checkout.ShoppingCart.Items');\n Session::clear('Checkout.ShoppingCart.Discount');\n Session::clear(\"Checkout.PostageID\");\n }", "public function reset() {\n foreach ($this->syncedProperties as $property) {\n unset($this->data[$property]);\n }\n\n if (session_id()) {\n unset($_SESSION[self::SESSION_KEY]);\n }\n }", "function clearAdminSession()\n\t {\n\t \n\t \t$array_items = array ('admin_id','email','admin_logged_in','admin_type','admin_role_id','admin_info');\n\t $this->session->unset_userdata($array_items);\n\t\t\n\t }", "public function clearMasterpassSessionData()\n {\n $customerSession = $this->getCustomerSession();\n $customerSession->unsetData(self::MASTERPASS_SESSION_KEY);\n }", "public function logout() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n unset($s->$key);\n $this->setAuthed(false);\n }", "public function clearSession()\n {\n unset($_SESSION['opencast']['files'][$this->name]);\n if(is_array($_SESSION['opencast']['files'])) \n {\n foreach($_SESSION['opencast']['files'] as $key => $file) {\n if($file['time'] < (time() - \n (60 * 60 * 24 * OC_CLEAN_SESSION_AFTER_DAYS )) )\n {\n unset($_SESSION['opencast']['files'][$key]);\n }\n }\n }\n }", "static public function clearCurrentSession() {\n\t\t\n\t\t$session = self::getCurrentSession();\n\t\t\n\t\tif (!empty($session)) {\n\t\t\t\n\t\t\tself::deleteSession($session->SSOSessionId);\n\t\t}\n\t}", "function clear_session()\n{\n\tunset($_SESSION['username']);\n\tunset($_SESSION['session_logged_in']);\n\tunset($_SESSION['profile_id']);\n\tunset($_SESSION['initiated']);\n\tclear_session_permissions();\n}", "public function reset()\n\t{\n\t\tforeach ($_SESSION as $name=>$value)\n\t\t\tunset($_SESSION[$name]);\n\t\t\t\n\t\t$this->reset_db_sessions();\n\t}", "private function _clearSessionVariables()\n {\n Mage::getSingleton('checkout/session')->setHashdigest(null)\n ->setMerchantid(null)\n ->setCrossreference(null)\n ->setTransactiondatetime(null)\n ->setCallbackurl(null)\n ->setPareq(null)\n ->setPares(null)\n ->setMd(null)\n ->setAcsurl(null)\n ->setTermurl(null)\n ->setThreedsecurerequired(null)\n ->setIshostedpayment(null)\n ->setStatuscode(null)\n ->setMessage(null)\n ->setPreviousstatuscode(null)\n ->setPreviousmessage(null)\n ->setOrderid(null)\n ->setRedirectedpayment(null);\n // do not clear the order id as after the a failed payment the customer still might want to repeat the payment attempt\n //->setPaymentsensegatewayOrderId(null);\n }", "public function CleanSession()\n {\n unset($_SESSION[SESSION_ENTRY]);\n }", "function clearSession() {\n\t\tif(Configure::read('debug') >= 1) {\n\t\t\t$this->Session->del('Registration');\n\t\t\t$this->Session->del('Event');\n\t\t\t$this->Session->del('errors');\n\t\t\t$this->Session->del('adminLoggedIn');\n\t\t\t$this->Session->del('loggedIn');\n\t\t\t$this->Session->setFlash('Session rensad');\n\t\t} else {\n\t\t\t$this->Session->setFlash('You can\\'t use debug functions when not in debug mode.');\n\t\t\t$this->redirect(array('controller' => 'events', 'action' => 'index'));\n\t\t}\n\t}", "function clear() \n\t{\n\t\t//If there is no session to delete (not started)\n\t\tif (session_id() === '') return;\n\n\t\t// Get the session name\n\t\t$name = session_name();\n\n\t\t// Destroy the session\n\t\tsession_destroy();\n\n\t\t// Delete the session cookie (if exists)\n\t\tif (isset($_COOKIE[$name])) \n\t\t{\n\t\t\t//Get the current cookie config\n\t\t\t$params = session_get_cookie_params();\n\n\t\t\t// Delete the cookie from globals\n\t\t\tunset($_COOKIE[$name]);\n\n\t\t\t//Delete the cookie on the user_agent\n\t\t\tsetcookie($name, '', time()-43200, $params['path'], $params['domain'], $params['secure']);\n\t\t}\n\t}", "public function clear()\n {\n return $this->session->forget($this->config->get('cart.session_name'));\n }", "public function resetSession() {}", "public function logout () {\n $this->clear();\n }", "function session_clean()\n {\n session_unset();\n }", "function phpAds_SessionDataDestroy()\n{\n $dal = new MAX_Dal_Admin_Session();\n\n\tglobal $session;\n $dal->deleteSession($_COOKIE['sessionRPID']);\n\n MAX_cookieAdd('sessionRPID', '');\n MAX_cookieFlush();\n\n\tunset($session);\n\tunset($_COOKIE['sessionRPID']);\n}", "protected function clearUserDataFromStorage()\n {\n $this->session->remove($this->getName());\n\n $recaller = $this->recaller();\n\n if (! is_null($recaller)) {\n $this->getCookieJar()->queue($this->getCookieJar()\n ->forget($this->getRecallerName()));\n\n $this->provider->deleteRememberToken($recaller->id(), $recaller->token());\n }\n }", "public static function clearSession(){\n\t\t$params = session_get_cookie_params();\n\t\tsetcookie(session_name(), '', time() - 42000,\n\t\t\t$params[\"path\"], $params[\"domain\"],\n\t\t\t$params[\"secure\"], $params[\"httponly\"]\n\t\t);\n\t\tsession_destroy();\n\t\tsession_write_close();\n\t}", "function clearConfigSession()\n {\n \t//clear session db info\n\t\t$this->setGeneralSession('db_name', '');\n\t\t$this->setGeneralSession('db_username', '');\n\t\t$this->setGeneralSession('db_password', '');\n\t\t$this->setGeneralSession('status', '');\n }", "function clearLogin() {\n $_SESSION['uid'] = null;\n $_SESSION['bid'] = null;\n $_SESSION['mid'] = null;\n unset($_SESSION['uid']);\n unset($_SESSION['mid']);\n unset($_SESSION['bid']);\n}", "function clearSessionData($name = '', $clearErrors = true){\n\t\tif(!$name) $name = $this->owner->FormName();\n\t\t\\Session::clear(\"FormInfo.{$name}.data\");\n\t\tif($clearErrors) \\Session::clear(\"FormInfo.{$name}.errors\");\n\t}", "public function forgetSession()\n\t{\n\t\tif (isset($_SESSION[$this->getKey()]))\n\t\t{\n\t\t\tunset($_SESSION[$this->getKey()]);\n\t\t}\n\t}", "public function clearCache()\n {\n $tokens = $this->session()->getTokens();\n\n $tokens->deleteAll();\n $this->session()->destroy();\n $this->log()->notice('Your saved machine tokens have been deleted and you have been logged out.');\n }", "protected function forgetOldSessionData()\n {\n if (session()->has($this->sessionKey)) {\n session()->forget($this->sessionKey);\n }\n }", "protected function clearAllPersistentData()\n {\n foreach ($this->_sessionNamespace as $key => $value) {\n unset($this->_sessionNamespace->{$key});\n }\n }", "function clearSession(){\n\t\tunset($_SESSION['video_links']);\n\t\tunset($_SESSION['document_links']);\n\t\tunset($_SESSION['local_documents']);\n\t\tunset($_SESSION['title']);\n\t\tunset($_SESSION['text']);\n\t\tunset($_SESSION['tmp_folder']);\n\t\tunset($_POST);\n\t\t$training_title = \"\";\n\t\t$training_video_link = \"\";\n\t\t$training_document_link=\"\";\n\t\t$training_local_file_link = \"\";\n\t\t$training_local_file_name = \"\";\n\t\t$training_text = \"\";\n\t\t$training_id = -1;\t\n\t\t$arr_video_links = array();\n\t\t$arr_document_links = array();\t\n\t\t$arr_documents = array();\n\t}", "public static function forceClearUserSession()\n {\n global $user;\n $uid = $user->uid;\n error_log(\"About to clear session via forceClearUserSession for user $uid\");\n unset($_SESSION['CREATED']); \n unset($_SESSION[CONST_NM_RAPTOR_CONTEXT]);\n\n $all_literalnames = self::getAllSessionValueNames();\n foreach($all_literalnames as $onename=>$onevalue)\n {\n unset($_SESSION[$onename]);\n }\n error_log(\"Cleared session via forceClearUserSession for user $uid\");\n }", "protected function clearUserSessionFromCache()\r\n\t{\r\n\t\t$this->cache->tags([$this->config['cache.prefix'], '_s' . session_id()])->flush();\t\t\r\n\t}", "public function reset_session() {\n\t\tSession::instance()\n\t\t\t->destroy();\n\t\tSession::$instances = array();\n\t}", "public function logout()\n {\n $this->flushSession();\n }", "public function logout()\n\t{\n\t\t$this->user = null;\n\n\t\t$this->session->forget(static::$key);\n\t}", "private function logout() {\n $_SESSION['user'] = null;\n $_SESSION['valid'] = false;\n }", "public function destory()\n\t{\n\t\t$key = $this->getKey();\n\t\tif ( isset($_SESSION[$key]) ) unset($_SESSION[$key], $key);\n\t}", "function auth_clear()\n{\n session_delete(auth_namespace());\n _app('auth', null);\n}", "public static function destroy_all()\n\t{\n\t\t$_SESSION['Session_Master'] = array();\n\t}", "public static function destroy(){\n unset($_SESSION[self::$appSessionName]);\n }", "public function logOut(){\n $_SESSION=[];\n session_destroy();\n }", "public function logout(){\n\t\t\t// remove all session variables\n\t\t\tsession_unset();\n\t\t\t// destroy the session\n\t\t\tsession_destroy(); \n\t\t}", "public function clear(Request $request)\n {\n $request->session()->forget('pid');\n $request->session()->forget('title');\n $request->session()->forget('description');\n $request->session()->forget('pstatus');\n }", "function session_clear() {\n $exists = \"no\";\n $session_array = explode(\";\",session_encode());\n for ($x = 0; $x < count($session_array); $x++) {\n $name = substr($session_array[$x], 0, strpos($session_array[$x],\"|\")); \n\tif (session_is_registered($name)) {\n\t session_unregister($name);\n\t $exists = \"yes\";\n\t}\n }\n if ($exists != \"no\") {\n session_destroy();\n }\n}", "public function logout()\n\t{\n\t\t$unset_array = array('set_id', 'access_pass', 'username');\n\t\t$this->session->unset_userdata($unset_array);\n\t}", "public static function invalidate() {\n\t //remove session cookie from browser\n\t if ( isset( $_COOKIE[session_name()] ) ) {\n\t setcookie( session_name(), \"\", time()-3600, \"/\" );\n\t }\n\t //clear session\n\t self::clear();\n\t //clear session from disk\n\t session_destroy();\n\t}", "function clear_session() {\n global $SESSION_LOGIN_VARS;\n\n $keep_info = array();\n foreach ($_SESSION as $key => $value) {\n // keep the login variables\n if (array_key_exists($key, $SESSION_LOGIN_VARS)) {\n $keep_info[$key] = $value;\n }\n }\n session_unset();\n $_SESSION = array_merge($_SESSION, $keep_info);\n}", "public function logout()\n {\n\t // unsets all cookies and session data\n process_logout(); \n }", "function destroySession(){\n\t\tforeach ($_SESSION as $key => $value) {\n\t\t\t$_SESSION[$key] = \"\";\n\t\t}\n\t\tsession_unset();\n\t\tsession_destroy();\n\t}", "public function logout() {\r\n\t\tSession::delete($this->_sessionName);\r\n\t}", "public static function logout() {\n $_SESSION = array();\n self::$loggedin = false;\n self::$guest = false;\n }", "public function logout(){\n\t\t$_SESSION['ip'] = '';\n\t\t$_SESSION['username'] = '';\n\t\t$_SESSION['uid'] = '';\n\t\tsession_destroy();\n\t}", "protected function emptyMessagesFromSession()\n {\n $this->session->set('messages', null);\n }", "public function logout()\n {\n $this->user = null;\n $this->synchronize();\n unset($_SESSION);\n }", "static function logout() {\n unset($_SESSION['id']);\n unset($_SESSION['login']);\n unset($_SESSION['password']);\n }", "function destroy () {\r\n $_SESSION = array();\r\n session_destroy();\r\n }", "function clearUserSession()\n{\n # if the user is logged in the SESSION variables get cleared and user is forwarded with a logout message\n unset($_SESSION['adminUserName']);\n unset($_SESSION['teamRegion']);\n unset($_SESSION['isLoggedIn']);\n}", "public function logout(){\n session_unset();\n session_destroy();\n }", "public function clearCookies()\n {\n $this->cookie_data = array();\n }", "function sess_destroy ()\n {\n if (isset($_COOKIE[session_name()])) {\n setcookie(session_name(), '', (time()-42000), '/');\n }\n\n //Destroy the Session Array\n $_SESSION = array();\n\n //Destroy the userdata array - in case any further calls after the destory session is called, \"stale\" information is not called upon.\n $this->userdata = array();\n\n //Complete the session destory process by calling PHP's native session_destroy() function\n session_destroy();\n }", "public function destruir(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }", "public function clear()\n\t{\n\t\t$this->connection()->delete('cookies');\n\t}", "function destroy()\r\n {\r\n unset($_SESSION[$this->_options['sessionVar']]);\r\n }", "public function logout()\n {\n $this->deleteSession();\n }", "abstract public function resetSession();", "public function destroy(){\n\t\tsession_unset();\n\t\t$id = $this->getId();\n\t\tif (!empty($id)) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public static function doLogout() {\n session()->forget('auth_token');\n session()->flush();\n }", "public function iDestroyMyCookies() {\n $this->getSession()->reset();\n }", "public function logout()\r\n {\r\n session_unset();\r\n session_destroy(); \r\n }", "public function clear_cart()\n {\n unset($_SESSION['cart']);\n }", "public static function logout()\n\t{\n\t\t$_SESSION['loggedin'] = false;\n\t\t$_SESSION['showchallenge'] = null;\n\t\t$_SESSION['adminlastchosen'] = null;\n\t\t$_SESSION['login'] = '';\n\t\t$_SESSION['user_id'] = '';\n\t\t$_SESSION['email'] = '';\n\t\tsetcookie('logged_in', '');\n\t\tsetcookie('username', '');\n\t}", "public function logout(){\n session_unset($_SESSION[\"user\"]);\n }" ]
[ "0.85011107", "0.84386665", "0.84187394", "0.8414252", "0.8280842", "0.82295424", "0.8225159", "0.8167639", "0.8141959", "0.81023395", "0.807125", "0.80709845", "0.8032487", "0.79974014", "0.7947647", "0.79195285", "0.791609", "0.7858781", "0.78530055", "0.78288305", "0.7813554", "0.77374583", "0.773659", "0.7706277", "0.7655881", "0.7648431", "0.7646794", "0.76382786", "0.76223314", "0.7605122", "0.75974625", "0.75813293", "0.7549534", "0.7540176", "0.753833", "0.75284636", "0.7525543", "0.75085044", "0.749225", "0.7463922", "0.74481446", "0.7410705", "0.7408385", "0.7373752", "0.73623663", "0.73529786", "0.7351937", "0.7338802", "0.73154557", "0.72992456", "0.7291348", "0.7283568", "0.72754997", "0.72695357", "0.72471964", "0.72212726", "0.720955", "0.71935815", "0.71914995", "0.71880645", "0.7187905", "0.7184659", "0.71766067", "0.7153597", "0.71478826", "0.71426487", "0.7134984", "0.71314627", "0.7121324", "0.7114375", "0.71131617", "0.71082824", "0.7101893", "0.709199", "0.70864433", "0.70828825", "0.7067854", "0.7065351", "0.7061697", "0.7056601", "0.70532304", "0.7050042", "0.70494026", "0.70493263", "0.70445955", "0.7037342", "0.7034011", "0.7033739", "0.7026281", "0.7009713", "0.7004654", "0.7003416", "0.70014167", "0.69992524", "0.69795376", "0.69789755", "0.6977531", "0.69698834", "0.6954353", "0.6953946" ]
0.8422579
2
Gets the session data as an array
public function toArray(): array { return $this->session->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get(): array\n {\n return session($this->sessionKey, []);\n }", "public function to_array() /*array*/\n {\n return $_SESSION[self::KEY];\n }", "private function getSessionData()\n {\n $session = Shopware()->Session();\n $sessionData = $session->getIterator()->getArrayCopy();\n $sessionData['id'] = Shopware()->SessionID();\n\n return $sessionData;\n }", "public function getAllValues() {\n\n if (!$this->sessionData) {\n $this->startSession();\n $this->sessionData = isset($_SESSION) ? $_SESSION : array();\n session_write_close();\n }\n\n return $this->sessionData;\n }", "public function get_arrSession()\n {\n return $this->arrSession;\n }", "public function getFromSession() {\n $data = $this->_getSession();\n \n return $data;\n }", "public function getAll() {\n // this is a kind of bad because sesData is just a property with no protected or private config\n\t\t$sessionData = $this->getFrontendUser()->sesData;\n foreach($sessionData as $k=>$v){\n if( stristr($k,self::SESSIONNAMESPACE)===false ){\n unset($sessionData[$k]);\n }else{\n $sessionData[$k] = unserialize($v);\n }\n }\n\t\treturn $sessionData;\n\t}", "function get_db_session_data()\r\n\t{\r\n\t\t$query = $this->mongo_db->select('user_data')->get('ci_sessions');\r\n\t\t$user = array(); /* array to store the user data we fetch */\r\n\t\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t $udata = unserialize($row->user_data);\r\n\t\t /* put data in array using username as key */\r\n\t\t $user['user_name'] = $udata['user_name']; \r\n\t\t $user['is_logged_in'] = $udata['is_logged_in']; \r\n\t\t}\r\n\t\treturn $user;\r\n\t}", "function get_db_session_data()\r\n\t{\r\n\t\t$query = $this->db->select('user_data')->get('ci_sessions');\r\n\t\t$user = array(); /* array to store the user data we fetch */\r\n\t\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t $udata = unserialize($row->user_data);\r\n\t\t /* put data in array using username as key */\r\n\t\t $user['user_name'] = $udata['user_name']; \r\n\t\t $user['is_logged_in'] = $udata['is_logged_in']; \r\n\t\t}\r\n\t\treturn $user;\r\n\t}", "#[Pure]\n public function getAll() : array\n {\n return $_SESSION;\n }", "public function getItems(): array\n {\n return $_SESSION['cart'] ?? [];\n }", "public static function sessionData(): object {\n return Session::instance()->get(AccessControl::SESSION_AUTH_KEY);\n }", "public function getSessionInfo()\n {\n $select = sprintf('\n SELECT\n session_id,\n session_timestamp,\n ip,\n success\n FROM\n %sfaquser\n WHERE\n user_id = %d',\n PMF_Db::getTablePrefix(),\n $this->getUserId()\n );\n\n $res = $this->config->getDb()->query($select);\n if (!$res or $this->config->getDb()->numRows($res) != 1) {\n return [];\n }\n\n return $this->config->getDb()->fetchArray($res);\n }", "public function data()\n {\n return (empty(\\Session::flash())) ? array('token' => \\Token::getToken()) : array_merge(\\Session::flash(), array('token' => \\Token::getToken()));\n }", "public function fetchSessionData() {}", "public function getSessionData()\n {\n return $this->getSession()->get(\"FormInfo.{$this->FormName()}.data\");\n }", "public function get_all_session()\n\t\t{\n\t\t\treturn parent::get_all_items('session_items');\n\t\t}", "public function getAll() {\n return $_SESSION;\n }", "public function getSession()\n {\n $session = array(null, null);\n foreach ($this->readAll() as $cookie) {\n // Check for http || https\n if (strpos($cookie['name'], 'SESS') === 0\n || strpos($cookie['name'], 'SSESS') === 0\n ) {\n $session = array($cookie['name'], $cookie['value']);\n break;\n }\n }\n\n return $session;\n }", "public static function getAll(): array {\n\t\treturn self::$sessionInstance->getAll ();\n\t}", "public function get_session()\n {\n return $this->db->get_where(\"data_manager\", [\"kode\" => $this->session->userdata(\"kode\")])->row_array();\n }", "private function unserializePhpSession( $data )\r\n {\r\n if( strlen( $data) == 0)\r\n {\r\n return array();\r\n }\r\n\r\n // match all the session keys and offsets\r\n preg_match_all('/(^|;|\\})([a-zA-Z0-9_]+)\\|/i', $data, $matchesarray, PREG_OFFSET_CAPTURE);\r\n\r\n $returnArray = array();\r\n\r\n $lastOffset = null;\r\n $currentKey = '';\r\n foreach ( $matchesarray[2] as $value )\r\n {\r\n $offset = $value[1];\r\n if(!is_null( $lastOffset))\r\n {\r\n $valueText = substr($data, $lastOffset, $offset - $lastOffset );\r\n $returnArray[$currentKey] = unserialize($valueText);\r\n }\r\n $currentKey = $value[0];\r\n\r\n $lastOffset = $offset + strlen( $currentKey )+1;\r\n }\r\n\r\n $valueText = substr($data, $lastOffset );\r\n $returnArray[$currentKey] = unserialize($valueText);\r\n\r\n return $returnArray;\r\n }", "public function all(): array\n {\n return session()->all();\n }", "public function all()\n {\n return $_SESSION;\n }", "public function session_list()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "protected function _getSessionFromCookie(){\n\t\n\t\tif (isset($_COOKIE) && isset($_COOKIE[$this->_cookie_var_name])){\n\t\t\treturn json_decode($_COOKIE[$this->_cookie_var_name], true);\n\t\t} else\n\t\t\treturn array();\n\t\n\t}", "public function get(string $session_name) {\n return $_SESSION[$session_name] ?? [];\n }", "public function get()\n {\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->toApiArray($cart);\n }", "public function return_user_array(){\n\n\t\tsession_id() == '' ? session_start(): NULL;\n\n\t\tif(!$this->check_login()){\n\t\t\treturn false;\n\t\t\texit;\n\t\t\t}\n\n\t\treturn $_SESSION['userLgInfo'];\n\t\t}", "public function retrieveValuesFromSession()\n\t{\n\t\tif (isset($_SESSION['stored_forms'][$this->name.$this->target_type]))\n\t\t\treturn $_SESSION['stored_forms'][$this->name.$this->target_type];\n\t\telse\n\t\t\treturn array();\n\t}", "public static function getAll()\n\t{\n\t\treturn $_SESSION;\n\t}", "public function getSessions()\n\t{\n\t\treturn $this->session->all();\n\t}", "public static function all()\n {\n return $_SESSION;\n }", "public function collect()\n {\n return $this->session->all();\n }", "public function actionGetListaSessions()\r\n\t\t{\r\n\t\t\treturn $varSession = [\r\n\t\t\t\t\t\t\t'postData',\r\n\t\t\t\t\t\t\t'conf',\r\n\t\t\t\t\t\t\t'begin',\r\n\t\t\t\t\t];\r\n\r\n\t\t}", "protected abstract function get_sessions();", "public function getSession()\n\t{\n\t\tif (isset($_SESSION[$this->getKey()]))\n\t\t{\n\t\t\treturn unserialize($_SESSION[$this->getKey()]);\n\t\t}\n\t}", "public function getData(): array\n {\n return $this->cookieData;\n }", "public function contents() {\n return Session::get_all();\n }", "public function getAll() {\n \n $this->start();\n return $_SESSION;\n \n }", "public function sessions() {\r\n\t\treturn self::request(self::HTTP_GET, 'sessions');\r\n\t}", "public function getSessionData($sessionId)\n {\n\n $time_start = microtime(true);\n\n $data = [];\n $server_name = $_SERVER['SERVER_NAME'];\n\n $cache_type = (string) Mage::getConfig()->getNode('global/session_save');\n if ('cache_type' == $sessionId) return $cache_type;\n\n if ('db' == $cache_type) {\n $redis_session = new Cm_RedisSession_Model_Session();\n $contents = $redis_session->read($sessionId);\n } else {\n $session_path = Mage::getBaseDir('session');\n $file = $session_path . '/sess_' . $sessionId;\n $contents = file_get_contents($file);\n }\n\n if (!$contents) {\n Mage::log('Session ' . $cache_type . ' ' . $sessionId . ' is not found');\n return $data;\n }\n\n session_start();\n session_decode($contents);\n\n // Customer Session\n $customerId = $_SESSION[\"customer\"][\"id\"];\n if ($customerId) {\n $data[\"customer_id\"] = $customerId;\n $data[\"wishlist_count\"] = $_SESSION[\"customer\"][\"wishlist_item_count\"];\n $checkout = $_SESSION[\"checkout\"];\n $quote_id = $checkout[\"quote_id_1\"];\n $data[\"quote_id\"] = $quote_id;\n $cart = Mage::getModel('sales/quote')->getCollection()\n ->addFieldToFilter('entity_id', $quote_id)\n ->getFirstItem();\n $items = $cart->getAllVisibleItems();\n $cartData = $cart->getData();\n $data[\"subtotal\"] = $cartData[\"subtotal\"];\n $data[\"customer_firstname\"] = $cartData[\"customer_firstname\"];\n $data[\"customer_lastname\"] = $cartData[\"customer_lastname\"];\n $data[\"customer_email\"] = $cartData[\"customer_email\"];\n $data[\"total_qty\"] = count($items);\n $store_id = Mage::app()->getStore();\n foreach ($items as $item) {\n $product = array();\n $productId = $item->getProductId();\n $itemProduct = $item->getProduct();\n $productSKU = $item->getSku();\n $productName = $itemProduct->getName();\n $product[\"product_id\"] = $productId;\n $product[\"product_sku\"] = $productSKU;\n $product[\"product_qty\"] = $item->getQty();\n $product[\"product_url\"] = Mage::getResourceSingleton('catalog/product')->getAttributeRawValue($productId, 'url_key', $store_id);\n\n $productModel = Mage::getModel('catalog/product')->load($productId);\n $productImage = (string) Mage::helper('catalog/image')->init($productModel, 'thumbnail')->resize('150x150');\n\n $totalPrice = $itemProduct->getPrice();\n $productType = $productModel->getTypeId();\n $product[\"product_type\"] = $productType;\n if ($productType == \"configurable\") {\n $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($productModel);\n $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();\n foreach($simple_collection as $simple_product){\n if ($productSKU == $simple_product->getSku()) {\n $productName = $simple_product->getName();\n $totalPrice = $simple_product->getPrice();\n $productImage = (string) Mage::helper('catalog/image')->init($simple_product, 'thumbnail')->resize('150x150');\n break;\n }\n }\n }\n if ($productType == \"bundle\") {\n if($itemProduct->getFinalPrice()) {\n $totalPrice = (string) $itemProduct->getFinalPrice();\n } else if ($itemProduct->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {\n $optionCol= $itemProduct->getTypeInstance(true)\n ->getOptionsCollection($itemProduct);\n $selectionCol= $itemProduct->getTypeInstance(true)\n ->getSelectionsCollection(\n $itemProduct->getTypeInstance(true)->getOptionsIds($itemProduct),\n $itemProduct\n );\n $optionCol->appendSelections($selectionCol);\n $price = $itemProduct->getPrice();\n\n foreach ($optionCol as $option) {\n if($option->required) {\n $selections = $option->getSelections();\n $minPrice = min(array_map(function ($s) {\n return $s->price;\n }, $selections));\n if($itemProduct->getSpecialPrice() > 0) {\n $minPrice *= $itemProduct->getSpecialPrice()/100;\n }\n\n $price += round($minPrice,2);\n }\n }\n $totalPrice = (string) $price;\n } else {\n $totalPrice = (string) 0;\n }\n }\n\n $product[\"product_name\"] = $productName;\n $product[\"product_price\"] = $totalPrice;\n $product[\"product_image\"] = $productImage;\n\n $options = $itemProduct->getTypeInstance(true)->getOrderOptions($itemProduct);\n $result = array();\n if ($options)\n {\n if (isset($options['options']))\n {\n $result = array_merge($result, $options['options']);\n }\n if (isset($options['additional_options']))\n {\n $result = array_merge($result, $options['additional_options']);\n }\n if (!empty($options['attributes_info']))\n {\n $result = array_merge($options['attributes_info'], $result);\n }\n }\n $product[\"attributes\"] = $result;\n $data[\"cart\"][] = $product;\n }\n }\n $time_end = microtime(true);\n session_destroy(session_id());\n $data[\"execution_time\"] = $time_end - $time_start;\n\n return $data;\n }", "public function getSessionInfo()\n {\n return $this->execute('user/session', 'GET');\n }", "protected function getSessionVars()\n {\n return $GLOBALS[\"BE_USER\"]->getSessionData($this->extensionName);\n }", "protected function collectSessionData() {\n\n\t\t$time_started = time();\n\t\t$time_ended = $time_started;\n\n\t\t$user_guid = elgg_get_logged_in_user_guid();\n\n\t\t$ip_address = $this->getIpAddress();\n\n\t\t$geolite = elgg_get_config('geolite_db');\n\t\tif (file_exists($geolite)) {\n\t\t\t$reader = new Reader($geolite);\n\t\t\t$geoip = $reader->get($ip_address);\n\t\t} else {\n\t\t\t$geoip = [];\n\t\t}\n\n\t\t$city = '';\n\t\tif (!empty($geoip['city']['names']['en'])) {\n\t\t\t$city = $geoip['city']['names']['en'];\n\t\t}\n\n\t\t$state = '';\n\t\tif (!empty($geoip['subdivisions'])) {\n\t\t\t$state = array_shift($geoip['subdivisions']);\n\t\t\tif (!empty($state['names']['en'])) {\n\t\t\t\t$state = $state['names']['en'];\n\t\t\t}\n\t\t}\n\n\t\t$country = '';\n\t\tif (!empty($geoip['country']['iso_code'])) {\n\t\t\t$country = $geoip['country']['iso_code'];\n\t\t}\n\n\t\t$latitude = '';\n\t\tif (!empty($geoip['location']['latitude'])) {\n\t\t\t$latitude = $geoip['location']['latitude'];\n\t\t}\n\n\t\t$longitude = '';\n\t\tif (!empty($geoip['location']['longitude'])) {\n\t\t\t$longitude = $geoip['location']['longitude'];\n\t\t}\n\n\t\t$timezone = '';\n\t\tif (!empty($geoip['location']['time_zone'])) {\n\t\t\t$timezone = $geoip['location']['time_zone'];\n\t\t}\n\n\t\treturn [\n\t\t\t'user_guid' => $user_guid,\n\t\t\t'time_started' => $time_started,\n\t\t\t'time_ended' => $time_ended,\n\t\t\t'ip_address' => $ip_address,\n\t\t\t'city' => $city,\n\t\t\t'state' => $state,\n\t\t\t'country' => $country,\n\t\t\t'latitude' => $latitude,\n\t\t\t'longitude' => $longitude,\n\t\t\t'timezone' => $timezone,\n\t\t];\n\t}", "public static function sess()\n {\n $SESS = \\Request::session()->all();\n //var_dump($SESS);\n\n return $SESS;\n }", "public function getData(): array\n {\n return $this->getAllClaims();\n }", "static private function getSSOSessionMapping() {\n\t\t$f = 'sessions/SessionMapping.txt';\n\t\t\n\t\tif (file_exists($f)){\n\t\t\t$data = file_get_contents($f);\t\t\n\t\t\t$result = unserialize($data);\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t\treturn array();\n\t}", "protected abstract function loadSessionData();", "public function getLoggedIn()\n\t{\n\t\t$answer = array();\n\t\tif ($this->authmodule == false)\n\t\t\treturn $answer;\n\t\tif (!$this->getContainer('auth')->checkSession()) {\n\t\t\t$answer['sid'] = session_id();\n\t\t\t$answer['auth'] = 'false';\n\t\t\t$answer['status'] = 403;\n\t\t\t$answer['message'] = 'bad session';\n\t\t\t$answer['data'] = array();\n\t\t}\n\t\t\n\t\treturn $answer;\n\t}", "function phpAds_SessionDataFetch()\n{\n global $session;\n $dal = new MAX_Dal_Admin_Session();\n\n // Guard clause: Can't fetch a session without an ID\n\tif (empty($_COOKIE['sessionRPID'])) {\n return;\n }\n\n $serialized_session = $dal->getSerializedSession($_COOKIE['sessionRPID']);\n // This is required because 'sessionRPID' cookie is set to new during logout.\n // According to comments in the file it is because some servers do not\n // support setting cookies during redirect.\n if (empty($serialized_session)) {\n return;\n }\n\n $loaded_session = unserialize($serialized_session);\n\tif (!$loaded_session) {\n // XXX: Consider raising an error\n return;\n }\n\t$session = $loaded_session;\n $dal->refreshSession($_COOKIE['sessionRPID']);\n}", "public function get()\n {\n return $this->transmission->request(\"session-get\", array());\n }", "public function getUserSession(){\n return $this->getParam('user-data', 'auth');\n }", "public function loginData()\n {\n return ([\n [3, \"12345678\", 302, \"admin\"]\n ]);\n }", "public function getBasket(): array\n {\n $basket = array_filter(\n $this->session->all(),\n function ($key) {\n return 0 === strpos($key, self::SESSION_PREFIX);\n },\n ARRAY_FILTER_USE_KEY\n );\n\n return $this->removePrefix($basket);\n }", "private function ReadSession(){\n\n if( !file_exists(SESSIONS.$_COOKIE['USERID'].'.json') ){\n $json=array();\n $json['validatedBadges']=[];\n $json_enc=json_encode($json);\n $cookieID = '';\n if( !isset($_COOKIE['USERID']) ){\n $cookieID = date('ymdhis').md5(rand(0,9999999));\n setcookie('USERID', date('ymdhis').md5(rand(0,9999999)), time()+3600*24*30*12*10 );\n }else{\n $cookieID = $_COOKIE['USERID'];\n }\n file_put_contents(SESSIONS.$cookieID.'.json', $json_enc);\n\n return $json;\n }\n\n $json = file_get_contents(SESSIONS.$_COOKIE['USERID'].'.json');\n return json_decode($json,true);\n }", "public function toArray()\n {\n $this->data['login'] = $this->getParam('login', self::TYPE_OUTPUT);\n return $this->data;\n }", "public function get_sessions($request){\r\n\t\treturn $request['session'];\r\n\t}", "public function sessions() {\n return $this->rich_model->get_sessions();\n // return $this->rich_model->get_mikrotik_sessions();\n }", "public function consultaSesiones()\r\n\t{\r\n\t\t$this->db->select('id, data');\r\n\t\t$query = $this->db->get('ci_sessions');\r\n\t\tif($query->num_rows() > 0){\r\n\t\t\treturn $query->result_array();\r\n\t\t}else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function all()\n {\n return $this->getCartSession();\n }", "private function selectSessionVars() {\r\n\r\n //prelevo le variabili e le metto nell'array VARS\r\n if ($this->encrypt_data==1) {\r\n $this->SQLStatement_GetEncryptedSessionVars->bindParam('sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_GetEncryptedSessionVars->execute();\r\n $val = $this->SQLStatement_GetEncryptedSessionVars->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n } else {\r\n $this->SQLStatement_GetSessionVars->bindParam('sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_GetSessionVars->execute();\r\n $val = $this->SQLStatement_GetSessionVars->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n //var_dump($val);\r\n return $val;\r\n\r\n }", "function get ($session_id) {\n\t\t$session_data = $this->get_internal($session_id);\n\t\tunset($session_data['data']);\n\t\treturn $session_data;\n\t}", "public function getListSessions()\n {\n return $this->getProperty('listSessions');\n }", "public function _user()\n {\n if (!$this->Session->check($this->sessionKey)) {\n return array($this->userModel => array($this->userModelPrimary => 0));\n } else {\n $user = $this->Session->read($this->sessionKey);\n if ($user === array()) {\n return array($this->userModel => array($this->userModelPrimary => 0));\n }\n\n return $user;\n }\n }", "public function getSessionInstances()\n {\n $sessionObjects = [];\n foreach ($this->objects as $information) {\n if (isset($information['i']) && $information['s'] === ObjectConfiguration::SCOPE_SESSION) {\n $sessionObjects[] = $information['i'];\n }\n }\n return $sessionObjects;\n }", "public function getLoggedData(): array{\n if(!$this->logged) throw new ClientNotLogged();\n else return $this->clientData;\n }", "public function userdata($key = NULL)\n\t{\n\t\tif (isset($key))\n\t\t{\n\t\t #return isset($this->sess_name[$key]) ? $this->sess_name['$key'] : NULL ;\n\t\t\treturn isset($_SESSION[$key]) ? $_SESSION[$key] : NULL;\n\t\t}\n\t\telseif (empty($_SESSION))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$userdata = array();\n\t\t$_exclude = array_merge(\n\t\t\tarray($this->sess_name),\n\t\t\t$this->get_flash_keys(),\n\t\t\t$this->get_temp_keys()\n\t\t);\n\n\t\tforeach (array_keys($_SESSION) as $key)\n\t\t#foreach (array_keys($this->sess_name) as $key)\n\t\t{\n\t\t\tif ( ! in_array($key, $_exclude, TRUE))\n\t\t\t{\n\t\t\t\t$userdata[$key] = $_SESSION[$key];\n\t\t\t\t#$userdata[$key] = $this->sess_name[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn $userdata;\n\t}", "protected function get_sessions()\n {\n }", "public function getSessionTds()\n {\n return $this->sessionTds;\n }", "public static function getConnexionData()\n {\n return SessionUser::getAll();\n }", "function retrieveSessionData($pid) {\n\t\treturn tx_wecassessment_sessiondata::fetchSessionData('tx_wecassessment_pi1:' . $pid);\n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function processSessionData($data)\n {\n if ($this->expandPage !== null) {\n $data['expandPage'] = $this->expandPage;\n $store = true;\n } else {\n $this->expandPage = (int)$data['expandPage'];\n $store = false;\n }\n return [$data, $store];\n }", "public function viewSession(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM sessionz ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "function parse_sessions($content)\n{\n if (!$content || !is_string($content)) {\n return [];\n }\n $json = json_decode($content);\n if ($json && count($json)) {\n return $json;\n }\n return [];\n}", "public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }", "public static function getSessionData($name) {\n if (isset(self::$_session)) {\n return isset(self::$_session[$name]) ? self::$_session[$name] : NULL;\n } else {\n return $_SESSION[$name];\n }\n }", "function fetchSessionData($key)\t{\n\t\t$id = $GLOBALS['TSFE']->fe_user->id;\t\t\n\t\t// Gets SesData if any\n\t\tif ($id)\t{\n\t\t\t$dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_session_data', 'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($id, 'fe_session_data'));\n\t\t\tif ($sesDataRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres))\t{\n\t\t\t\t$sesData = unserialize($sesDataRow['content']);\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($dbres);\n\t\t}\n\t\t\t// delete old data:\n\t\tif ((rand()%100) <= 1) {\t\t// a possibility of 1 % for garbage collection.\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < ' . intval(time()-3600*24));\t\t// all data older than 24 hours are deleted.\n\t\t}\n\t\t\n\t\treturn $sesData[$key];\n\t}", "public function getData () : array {\n\t\treturn $this->data;\n\t}", "public function getSession(string $token): array\n {\n /** @var Session $session */\n $session = $this->sessionRepository->getFirst(['token' => $token]);\n\n /** @var User $user */\n $user = $this->userRepository->getById($session->user);\n\n $sessionInfo = $this->createSessionInfoStructure($user, $token);\n\n return $sessionInfo;\n }", "public static function read($name = null){\n\t\t\tif(empty($name)){\n\t\t\t\treturn $_SESSION;\n\t\t\t}else{\n\t\t\t\treturn array_extract($_SESSION, $name);\n\t\t\t}\n\t\t}", "public function getResults(){\n $success=null;\n $error=null;\n if(isset($_SESSION['success'])){\n $success=$_SESSION['success'];\n unset($_SESSION['success']);\n // reload毎に毎回nullにしてsessionをしないといけないからunsetする(前の状態に戻る)\n }\n if(isset($_SESSION['error'])){\n $success=$_SESSION['error'];\n unset($_SESSION['error']);\n }\n return [$success,$error];\n // 配列形式の変数をlistに格納する\n}", "public function parse($session_data){\n\t\t\n\t\tif ($session_data != '' && !is_array($session_data)){\n\t\t\treturn @unserialize($session_data);\n\t\t} else \n\t\t\treturn $session_data;\n\t\n\t}", "public function getData($key) {\r\n return (isset($_SESSION[$key])) ? $_SESSION[$key] : null;\r\n }", "public function getSession()\n {\n return $this['session'];\n }", "public function storeSessionData() {}", "public function storeSessionData() {}", "public function get_session()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "public function session()\n\t\t{\n\t\t\treturn $this->get_session();\n\t\t}", "public function get($key = null)\n {\n if (is_null($key)) {\n return $_SESSION;\n }\n\n if (array_key_exists($key, $_SESSION)) {\n return $_SESSION[$key];\n }\n\n return [];\n }", "protected function getStorage()\n {\n return unserialize(Session::retrieve(__NAMESPACE__));\n }", "public static function getAllSessionValueNames()\n {\n try\n {\n $allnamesname = CONST_NM_RAPTOR_CONTEXT.'_allnames';\n if(!isset($_SESSION[$allnamesname]) || !is_array($_SESSION[$allnamesname]))\n {\n $_SESSION[$allnamesname] = array();\n }\n return $_SESSION[$allnamesname];\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "protected function getPersistent()\n {\n $arrValue = array();\n if ($this->getSessionStorage()->has('sorting')) {\n $arrValue = $this->getSessionStorage()->get('sorting');\n }\n\n if (array_key_exists($this->getEnvironment()->getDataDefinition()->getName(), $arrValue)) {\n return $arrValue[$this->getEnvironment()->getDataDefinition()->getName()];\n }\n\n return array();\n }", "public function index()\n {\n return Session::all();\n }", "public function arrayItems() {\r\n $quoteId = Mage::getSingleton('checkout/session')->getQuote()->getId();\r\n $session = Mage::getModel('giftwrap/selection')->getSelectionByQuoteId(\r\n $quoteId);\r\n $productIds = array();\r\n if ($session) {\r\n foreach ($session as $value) {\r\n $productIds[] = $value['itemId'];\r\n }\r\n }\r\n return $productIds;\r\n }", "public function body() {\n\t\t\tif (isset($_SESSION)) {\n\t\t\t\t$body = array();\n\t\t\t\tforeach($_SESSION as $key => $value) {\n\t\t\t\t\t$body[$key] = $value;\n\t\t\t\t}\n\t\t\t\treturn count($body) > 0 ? $body : null;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function getSession(){\r\n return $this->session;\r\n }", "function cek_session(){\n echo '<pre>';\n print_r($this->session->all_userdata());\n echo '</pre>';\n }" ]
[ "0.8357069", "0.81819624", "0.8078636", "0.8069849", "0.7985134", "0.77018416", "0.76733875", "0.7570909", "0.74662596", "0.74065953", "0.73699516", "0.73189926", "0.7288434", "0.7242024", "0.72310865", "0.7223157", "0.72029644", "0.71379673", "0.7127504", "0.70879734", "0.7018859", "0.70125794", "0.70102185", "0.69686335", "0.6958412", "0.6955669", "0.69284457", "0.6918085", "0.6908806", "0.6898374", "0.6886803", "0.68856", "0.68855387", "0.68782306", "0.68738097", "0.68404275", "0.6830192", "0.6826518", "0.6817741", "0.6809221", "0.67523634", "0.67522293", "0.67387146", "0.6687308", "0.66783434", "0.6662637", "0.6641985", "0.66365135", "0.6632466", "0.65937734", "0.65869", "0.6578878", "0.6573906", "0.65586066", "0.65581995", "0.65577525", "0.6557566", "0.6551431", "0.6541439", "0.65382564", "0.6530132", "0.6529905", "0.6506727", "0.65042233", "0.64765066", "0.64725965", "0.6465118", "0.64615995", "0.6439813", "0.6420849", "0.6409372", "0.64043385", "0.6390154", "0.6390154", "0.63714653", "0.636515", "0.6363817", "0.6343578", "0.63289434", "0.6325823", "0.62990046", "0.62943524", "0.6291119", "0.628981", "0.6289494", "0.628879", "0.6285725", "0.6251457", "0.6250555", "0.6243557", "0.62400484", "0.62338006", "0.62300795", "0.6222379", "0.6215033", "0.6214861", "0.6197578", "0.61964655", "0.6196256", "0.6195175" ]
0.79399043
5
Quickpay will return a json object as the body
public function getResponseBody(){ if (is_string($this->data)){ // JSON is valid return $this->data; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pay(): JsonResponse;", "public static function getJson()\n {\n return '{\"credit_card_id\":\"TestSample\",\"payer_id\":\"TestSample\",\"last4\":\"TestSample\",\"type\":\"TestSample\",\"expire_month\":123,\"expire_year\":123}';\n }", "function jsonSerialize() {\n return [ \"licenseType\" => $this->licenseType,\n \"supportUntil\" => $this->supportUntil,\n \"buyer\" => $this->buyer,\n \"itemId\" => $this->itemId,\n \"itemName\" => $this->itemName,\n \"hash\" => $this->hash,\n \"lastValidation\" => $this->lastValidation,\n \"purchaseCode\" => $this->purchaseCode ];\n }", "public function to_json()\n {\n return json_encode($this->body);\n\t}", "private function encodeRequest()\n {\n $request = array('receipt-data' => $this->getReceiptData());\n\n if (!is_null($this->_sharedSecret)) {\n\n $request['password'] = $this->_sharedSecret;\n }\n\n return json_encode($request);\n }", "public function makePayment () {\n \n // sent to bank for verification and transaction code\n \n srand(time());\t\t\t\t\n $pool = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#%&\";\n for($index = 0; $index < 20; $index++) {\n $sid .= substr($pool,(rand()%(strlen($pool))), 1);\n }\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n $error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t \n $data[\"transaction_code\"] = $sid;\n\n $data = json_encode($data);\n \n return $data; \n }", "public function payInvoice(){\n $data = axios();\n if( ($data['payTotal'] > 0) && $data['payInvoice'] != 0):\n $response = $this->credits->addPayInvoice($data);\n echo json_encode($response); \n endif; \n }", "function get_produck_json(){\n header('Content-Type: application/json');\n echo $this->crud_model->get_all_produk();\n }", "private function getJSON(){\n return json_encode($this->getResponseStructure());\n }", "public function create()\n {\n $buyout = new Buyout(); \n //$pivot = ['quantity'=>null];\n $data = [\n 'buyout' => $buyout,\n // 'pivot' => $pivot,\n ];\n\n return response()->json($data);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['store_id'] = $this->storeId;\n $json['store_name'] = $this->storeName;\n $json['total'] = $this->total;\n $json['total_without_tax'] = $this->totalWithoutTax;\n $json['tax'] = $this->tax;\n $json['purchase_date'] = $this->purchaseDate;\n $json['recorded_at'] = $this->recordedAt;\n $json['order_number'] = $this->orderNumber;\n $json['receipt_id'] = $this->receiptId;\n $json['receipt_image_url'] = $this->receiptImageUrl;\n $json['receipt_image_urls'] = $this->receiptImageUrls;\n\n return $json;\n }", "public function toJSON () {\r\n \treturn json_encode($this->_response);\r\n }", "public function jsonSerialize()\n {\n return $this->getBody(true);\n }", "public function json()\n\t{\n\t\t//return \"prices json\";\n\t\treturn Response::json(Price::all());\n\t}", "public function json() {\n\t\t$json = parent::json();\n\t\t$json['upsell_text'] = wp_kses_post( $this->upsell_text );\n\n\t\treturn $json;\n\t}", "private function json() {\n if( $this->format === 'application/hal+json' ) {\n header('Content-Type: application/hal+json; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\JsonWriter(true);\n return $writer->execute($hal_response);\n } else {\n header('Content-Type: application/json; charset=utf-8', TRUE, $this->status);\n return json_encode($this->content, JSON_NUMERIC_CHECK);\n }\n }", "public function create_coin_post() {\n header(\"Content-Type: application/json; charset=UTF-8\");\n echo CryptoDB::newCoinPOST(); \n }", "public function get() {\n // $this->isAdmin();\n\n $data = \"This is a test\";\n\n $this->sendHeaders();\n \n $resBody = (object) array();\n $resBody->status = \"200\";\n $resBody->message = \"valid request\";\n $resBody->data = \"This is the data\";\n echo json_encode($resBody);\n\n }", "public static function getJson()\n {\n return '{\"sender_batch_header\":' .PayoutSenderBatchHeaderTest::getJson() . ',\"items\":' .PayoutItemTest::getJson() . ',\"links\":' .LinksTest::getJson() . '}';\n }", "public function json();", "function bunq_CreateRequest($amount, $description, $redirect, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t//$user = $users[$user]->getUserPerson();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$requestMap = [\n\t\tBunqMeTab::FIELD_BUNQME_TAB_ENTRY => [\n\t\t\tBunqMeTabEntry::FIELD_AMOUNT_INQUIRED => new Amount($amount, 'EUR'),\n\t\t\tBunqMeTabEntry::FIELD_REDIRECT_URL => $redirect,\n\t\t\tBunqMeTabEntry::FIELD_DESCRIPTION => $description\n\t\t]\n\t];\n\t$createBunqMeTab = BunqMeTab::create($apiContext, $requestMap, $userId, $monetaryAccountId)->getValue();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $createBunqMeTab)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}", "public function toJson()\n {\n $array = [];\n if(count($this->_headers))\n {\n $array['Header'] = [\n 'context' => [\n '_jsns' => 'urn:zimbra',\n ],\n ];\n foreach ($this->_headers as $name => $value)\n {\n $array['Header']['context'][$name] = array('_content' => $value);\n }\n }\n if($this->_request instanceof Request)\n {\n $reqArray = $this->_request->toArray();\n $reqName = $this->_request->requestName();\n $array['Body'][$reqName] = $reqArray[$reqName];\n }\n return json_encode((object) $array);\n }", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "public function get_wallet_list_post()\n{\n\n $pdata = file_get_contents(\"php://input\");\n $postdata = json_decode($pdata,true);\n\n if (isset($postdata['company_id']))\n {\n \n $id = $postdata['company_id'];\n $data = $this->model->getAllwhere('wallet_details',array('company_id'=> $id));\n }else{\n $data = $this->model->getAllwhere('wallet_details');\n }\n\n \n\n $resp = array('rccode' => 200,'message' =>\"success\",'wallet_details'=>$data);\n $this->response($resp);\n}", "public function getRequestJson(){\n $requestArray = $this->prepareRequestContent($this->prepareRequestMeta());\n \n return json_encode($requestArray);\n }", "public function getPayPalResponse(){\r\n\t\t\r\n\t}", "public function jsonSerialize()\n {\n return array('title' => $this->title,\n 'size' => $this->size,\n 'unit_price' => $this->unitPrice,\n 'description' => $this->description);\n }", "public function getBodyObject()\r\n {\r\n }", "function get_product_json() {\n header('Content-Type: application/json');\n echo $this->ProductsModel->get_all_product();\n }", "public function paymentNotify()\n {\n $response = $this->client->request($this->methods['post'], 'pay' , [\n 'json' => [\n 'AGR_TRANS_ID' => $this->agr_trans_id,\n 'VENDOR_TRANS_ID' => $this->vendor_trans_id,\n 'STATUS' => $this->status,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->agr_trans_id. $this->vendor_trans_id. $this->status. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }", "public function toJson(){\n $info = array(\n \"status\" => $this->status,\n \"authorizedAmount\" => $this->authorizedAmount,\n \"lastFour\" => $this->lastFour,\n \"cardType\" => $this->cardType,\n \"currency\" => $this->currency,\n \"paymentProfileId\" => $this->paymentProfileId\n );\n\n $error = array(\n \"status\" => \"Server returned a \" . $this->status . \"status code.\",\n \"body\" => \"Response Body: <pre>\" . print_r($this->respBody,true) . \"</pre>\",\n \"curlInfo\" => \"Curl Info: <pre>\" . print_r($this->log,true) . \"</pre>\"\n );\n\n return json_encode($this->hasError ? $error : $info);\n }", "public function index()\n {\n return response()->json(Payment::all()); \n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "public function getJson()\n {\n /**\n * Get helper, product and store objects\n */\n $_product = $this->getProduct();\n $_store = $_product->getStore();\n\n /**\n * Set product default values\n */\n $productName = self::NULL_PRODUCT_NAME;\n $productShortDescription = self::NULL_PRODUCT_SHORT_DESCRIPTION;\n $productStatus = self::NULL_PRODUCT_STATUS;\n $productPrice = 0;\n $productPriceCurrency = self::DEFAULT_CURRENCY;\n\n /**\n * Set product data from product object\n */\n if ($_product) {\n /**\n * Get product name\n */\n if (strlen($_product->getName())) {\n $productName = $this->escapeHtml($_product->getName());\n }\n\n /**\n * Get product image\n */\n $productImage = $this->getImage($_product, 'product_page_image_small', [])->getData('image_url');\n\n /**\n * Get product description\n */\n if (strlen($_product->getShortDescription())) {\n $productShortDescription = $this->escapeHtml($_product->getShortDescription());\n }\n }\n\n $siteName = $this->_scopeConfig->getValue('general/store_information/name', ScopeInterface::SCOPE_STORE);\n if (!$siteName) {\n $siteName = 'Magento Store';\n }\n\n $logo = $this->_helper->getLogoSrc();\n\n if ($this->pageConfig->getTitle()->get()) {\n $pageContentHeading = $this->pageConfig->getTitle()->get();\n } else {\n $pageContentHeading = $productName;\n }\n\n $json = array(\n \"@context\" => \"http://schema.org\",\n \"@type\" => \"Article\",\n \"author\" => $siteName,\n \"image\" => array(\n '@type' => 'ImageObject',\n 'url' => $productImage,\n 'width' => self::PRODUCT_IMAGE_WIDTH,\n 'height' => self::PRODUCT_IMAGE_HEIGHT,\n ),\n \"name\" => $productName,\n \"description\" => $productShortDescription,\n \"datePublished\" => $_product->getCreatedAt(),\n \"dateModified\" => $_product->getUpdatedAt(),\n \"headline\" => mb_substr($pageContentHeading, 0, 110, 'UTF-8'),\n \"publisher\" => array(\n '@type' => 'Organization',\n 'name' => $siteName,\n 'logo' => array(\n '@type' => 'ImageObject',\n 'url' => $logo,\n ),\n ),\n \"mainEntityOfPage\" => array(\n \"@type\" => \"WebPage\",\n \"@id\" => $this->getUrl(),\n ),\n );\n\n return str_replace('\\/', '/', json_encode($json));\n }", "public function execute(){\n\n $body = '{\"payer_id\":\"' . $this->payer_id . '\"}';\n $client = new Client();\n try{\n $paymentInfo = $client->request('POST', $this->execute_url, ['headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $body\n ]);\n }\n catch (\\Exception $ex) {\n $error = json_encode($ex->getMessage());\n return($error);\n }\n $this->parsePaymentBody($paymentInfo);\n return $this->paymentBody;\n\n }", "function get_json_payment( $c_transactions) {\n\n global $return_url, $cancel_url;\n\n $payment = '{\n \"intent\": \"sale\",\n \"redirect_urls\":\n {\n \"return_url\": \"'.$return_url.'\",\n \"cancel_url\": \"'.$cancel_url.'\"\n },\n \"payer\":\n {\n \"payment_method\": \"paypal\"\n },\n \"transactions\": ['.$c_transactions.'] \n }';\n\n return $payment;\n\n}", "public function quoteAction()\n {\n $result = array();\n \n try {\n \n //hash to get quote\n $hash = $this->getRequest()->getParam('hash');\n \n if (!$hash){\n //json post\n if ($postBody = file_get_contents('php://input')){\n \n $data = (array)json_decode($postBody);\n \n } else {\n \n $data = $this->getRequest()->getPost();\n }\n \n if (is_array($data) && count($data)>0){\n \n $model = $this->getModel();\n $productIdOrSku = $data['product'];\n $model->loadOptions($productIdOrSku);\n $result = $model->validateCartData($data);\n \n if (!$result['error']){\n \n $result = $model->addToCart($data);\n \n if (!$result['error']){\n \n $quoteUrl = Mage::getUrl('customconfigurable/index/quote/hash/'.$result['data']);\n $result = array('Location' => $quoteUrl);\n }\n }\n \n } else {\n \n $result['error'] = true;\n $result['data'] = 'No post data';\n }\n \n } else {\n \n $model = $this->getModel();\n $model->loadOptions();\n \n $result = $model->getQuote($hash);\n \n if (!$result['error']){ \n unset($result['error']);\n $result['hash'] = $hash;\n $result['quote'] = $result['data'];\n unset($result['data']);\n }\n \n }\n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n }\n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "public function actionPayResult()\n {\n// $tickets->createTicket(61);\n \\Yii::$app->response->format = Response::FORMAT_XML;\n $arrParams = $_POST;\n $order_id = $arrParams['pg_order_id'];\n if (PG_Signature::check($arrParams['pg_sig'], $this->action->id, $arrParams, $this->merchant_secret_key)) {\n if ($arrParams['pg_result'] == 1) {\n Orders::updateAll(['paid' => 1], ['id' => $order_id, 'paid' => 0]);\n $tickets = new Tickets();\n $tickets->createTicket($order_id);\n $result = [\n 'pg_salt'=>$arrParams['pg_salt'],\n 'pg_status'=>'ok',\n 'pg_description'=> \"Оплата принята\",\n ];\n } else {\n $result = [\n 'pg_salt'=>$arrParams['pg_salt'],\n 'pg_status'=>'error',\n 'pg_description'=> 'Оплата принята',\n 'pg_error_description'=> 'Платёж не прошёл',\n ];\n }\n $result['pg_sig'] = PG_Signature::make($this->action->id, $result, $this->merchant_secret_key);\n return $result;\n } else {\n new BadRequestHttpException();\n }\n }", "function create() {\n\n if ( ! authCheck(['salesperson', 'manager']) ) {\n\n return json_encode(['success' => false, 'authorised' => false]);\n\n } else {\n\n $requestBody = file_get_contents('php://input');\n $data = json_decode($requestBody);\n\n // make quote\n $quote = new \\App\\Quote;\n $quote->owner = $_COOKIE['userid'];\n $quote->customer_name = getPropertySafely($data, 'customer_name');\n $quote->address = getPropertySafely($data, 'address');\n $quote->date = (getPropertySafely($data, 'date')) ? getPropertySafely($data, 'date') . ' 00:00:00': '1970-01-01 00:00:00';\n $quote->appointment_number = getPropertySafely($data, 'appointment_number');\n $quote->product_price = getPropertySafely($data, 'total_product_price');\n $quote->installation_price = getPropertySafely($data, 'total_installation_price');\n $quote->cost_price = getPropertySafely($data, 'total_price');\n $quote->save();\n $quoteId = $quote->id;\n\n foreach($data->products as $productName => $product) {\n\n foreach ($product as $rowId => $row) {\n\n // make quote product (\"Item\")\n $quoteProduct = new \\App\\QuoteProduct;\n $quoteProduct->quote_id = $quoteId;\n $quoteProduct->product = $productName;\n $quoteProduct->row = $rowId;\n $quoteProduct->save();\n $quoteProductId = $quoteProduct->id;\n\n foreach ($row as $settingName => $value) {\n\n // make quote product setting (could specify product to remove quote products table)\n $qpSetting = new \\App\\QuoteProductSetting;\n $qpSetting->quote_id = $quoteId;\n $qpSetting->quote_product_id = $quoteProductId;\n $qpSetting->setting = $settingName;\n if ($settingName == \"location\" || $settingName == \"description\" ) {\n $qpSetting->valueString = $value;\n } else {\n $qpSetting->value = $value;\n }\n $qpSetting->save();\n\n }\n }\n }\n\n //die();\n \n return json_encode(['success' => true, 'id' => $quoteId]);\n }\n }", "function jsonAction()\n {\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n $request_data = $this->_getAllParams();\n\n $method_name = $this->_getParam('method');\n if(!isset($method_name))\n {\n echo \"Inconsistent request\";\n exit;\n }\n\n $request_data = $this->_getAllParams();\n // Handle XML-RPC request\n $this->kwWebApiCore = new KwWebApiRestCore($this->apiSetup, $this->apicallbacks, array_merge($request_data, array('format' => 'json')));\n }", "public function jsonSerialize() {\n $result = array();\n if (!is_null($this->id)) {\n $result[\"id\"] = intval($this->id);\n }\n if (!is_null($this->typeid)) {\n $result[\"typeid\"] = intval($this->typeid);\n }\n if (!is_null($this->name)) {\n $result[\"name\"] = strval($this->name);\n }\n if (!is_null($this->allowetickets)) {\n $result[\"allowetickets\"] = intval($this->allowetickets);\n }\n if (!is_null($this->availability)) {\n $result[\"availability\"] = $this->availability;\n }\n if (!is_null($this->deliverystatusaftertrigger)) {\n $result[\"deliverystatusaftertrigger\"] = intval($this->deliverystatusaftertrigger);\n }\n if (!is_null($this->feedescription)) {\n $result[\"feedescription\"] = strval($this->feedescription);\n }\n if (!is_null($this->internalremark)) {\n $result[\"internalremark\"] = strval($this->internalremark);\n }\n if (!is_null($this->logo)) {\n $result[\"logo\"] = strval($this->logo);\n }\n if (!is_null($this->mailorganization)) {\n $result[\"mailorganization\"] = (bool)$this->mailorganization;\n }\n if (!is_null($this->needsaddress)) {\n $result[\"needsaddress\"] = (bool)$this->needsaddress;\n }\n if (!is_null($this->ordermailtemplateid_delivery)) {\n $result[\"ordermailtemplateid_delivery\"] = intval($this->ordermailtemplateid_delivery);\n }\n if (!is_null($this->ordermailtemplateid_deliverystarted)) {\n $result[\"ordermailtemplateid_deliverystarted\"] = intval($this->ordermailtemplateid_deliverystarted);\n }\n if (!is_null($this->shortdescription)) {\n $result[\"shortdescription\"] = strval($this->shortdescription);\n }\n if (!is_null($this->visibility)) {\n $result[\"visibility\"] = strval($this->visibility);\n }\n if (!is_null($this->isarchived)) {\n $result[\"isarchived\"] = (bool)$this->isarchived;\n }\n if (!is_null($this->createdts)) {\n $result[\"createdts\"] = Json::packTimestamp($this->createdts);\n }\n if (!is_null($this->lastupdatets)) {\n $result[\"lastupdatets\"] = Json::packTimestamp($this->lastupdatets);\n }\n\n\n if (is_array($this->custom_fields)) {\n foreach ($this->custom_fields as $key => $value) {\n $result[\"c_\" . $key] = $value;\n }\n }\n\n return $result;\n }", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "private function storePurchaseOrder() {\n return $this->json('POST', 'api/pch_purchase_order', $this->tempJson);\n }", "function createCheckoutPayload() {\n /*\n * Merchant model\n */\n $merchant = new stdClass();\n $merchant->notification_url = 'https://merchant.com/order/step3_checkout_confirm.php'; // url where you will receive Aplazame webhook events as described in https://aplazame.com/en/docs/api/checkout-confirmation/ or https://aplazame.com/integraciones/api/checkout-confirmation/\n $merchant->success_url = \"/success\"; // url that the customer is sent to after confirming their order.\n $merchant->pending_url = \"/pending\"; // url that the customer is sent to if the order status is pending.\n $merchant->error_url = \"/error\"; // url that the customer is sent to if there is an error in the checkout.\n $merchant->dismiss_url = \"/checkout\"; // url that the customer is sent to if the customer chooses to back to the e-commerce, by default is /.\n $merchant->ko_url = \"/ko\"; // url that the customer is sent to if Aplazame refuses the order.\n\n /*\n * Article model\n */\n $article = new stdClass();\n $article->id = '89793238462643383279'; // The article ID.\n $article->name = 'Reloj en oro blanco de 18 quilates y diamantes'; // Article name.\n $article->url = 'http://shop.example.com/product.html'; // Article url.\n $article->image_url = 'http://shop.example.com/product_image.png'; // Article image url.\n $article->quantity = 2; // Article quantity.\n $article->price = Aplazame\\Serializer\\Decimal::fromFloat(4020.00); // Article price (tax is not included). (4,020.00 €)\n $article->description = 'Movimiento de cuarzo de alta precisión'; // Article description.\n $article->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Article tax rate. (21.00%)\n $article->discount = Aplazame\\Serializer\\Decimal::fromFloat(5.00); // The discount amount of the article. (5.00 €)\n\n // ... rest of articles in the shopping cart.\n\n /*\n * Articles collection\n */\n $articles = array( $article, );\n\n /*\n * Order model\n */\n $order = new stdClass();\n $order->id = '28475648233786783165'; // Your order ID.\n $order->currency = 'EUR'; // Currency code of the order.\n $order->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Order tax rate. (21.00%)\n $order->total_amount = Aplazame\\Serializer\\Decimal::fromFloat(4620.00); // Order total amount. (4,620.00 €)\n $order->articles = $articles; // Articles in cart.\n $order->discount = Aplazame\\Serializer\\Decimal::fromFloat(160.00); // The discount amount of the order. (160.00 €)\n $order->cart_discount = Aplazame\\Serializer\\Decimal::fromFloat(0.50); // The discount amount of the cart. (0.50 €)\n\n /*\n * Customer address model\n */\n $customerAddress = new stdClass();\n $customerAddress->first_name = 'John'; // Address first name.\n $customerAddress->last_name = 'Coltrane'; // Address last name.\n $customerAddress->street = 'Plaza del Valle Boreal nº10'; // Address street.\n $customerAddress->city = 'Madrid'; // Address city.\n $customerAddress->state = 'Madrid'; // Address state.\n $customerAddress->country = 'ES'; // Address country code.\n $customerAddress->postcode = '28080'; // Address postcode.\n $customerAddress->phone = '601234567'; // Address phone number.\n $customerAddress->address_addition = 'Cerca de la plaza Pontífice Sulyvahn'; // Address addition.\n\n /*\n * Customer model\n */\n $customer = new stdClass();\n $customer->id = '1618'; // Customer ID.\n $customer->email = '[email protected]'; // The customer email.\n $customer->type = 'e'; // Customer type, the choices are g:guest, n:new, e:existing.\n $customer->gender = 0; // Customer gender, the choices are 0: not known, 1: male, 2:female, 3: not applicable.\n $customer->first_name = 'John'; // Customer first name.\n $customer->last_name = 'Coltrane'; // Customer last name.\n $customer->birthday = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('1990-08-21 13:56:45')); // Customer birthday.\n $customer->language = 'es'; // Customer language preferences.\n $customer->date_joined = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('2014-08-21 13:56:45')); // A datetime designating when the customer account was created.\n $customer->last_login = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('2020-08-27 19:57:56')); // A datetime of the customer last login.\n $customer->address = $customerAddress; // Customer address.\n\n /*\n * Billing address model\n */\n $billingAddress = new stdClass();\n $billingAddress->first_name = 'Bill'; // Billing first name.\n $billingAddress->last_name = 'Evans'; // Billing last name.\n $billingAddress->street = 'Calle Central Yharnam 92'; // Billing street.\n $billingAddress->city = 'Madrid'; // Billing city.\n $billingAddress->state = 'Madrid'; // Billing state.\n $billingAddress->country = 'ES'; // Billing country code.\n $billingAddress->postcode = '28080'; // Billing postcode.\n $billingAddress->phone = '601765432'; // Billing phone number.\n $billingAddress->address_addition = 'Cerca del Gran Puente'; // Billing address addition.\n\n /*\n * Shipping info model\n */\n $shippingInfo = new stdClass();\n $shippingInfo->first_name = 'Django'; // Shipping first name.\n $shippingInfo->last_name = 'Reinhard'; // Shipping last name.\n $shippingInfo->street = 'Plaza del Valle Boreal nº10'; // Shipping street.\n $shippingInfo->city = 'Madrid'; // Shipping city.\n $shippingInfo->state = 'Madrid'; // Shipping state.\n $shippingInfo->country = 'ES'; // Shipping country code.\n $shippingInfo->postcode = '28080'; // Shipping postcode.\n $shippingInfo->name = 'Planet Express'; // Shipping name.\n $shippingInfo->price = Aplazame\\Serializer\\Decimal::fromFloat(5.00); // Shipping price (tax is not included). (5.00 €)\n $shippingInfo->phone = '601234567'; // Shipping phone number.\n $shippingInfo->address_addition = 'Cerca de la plaza Pontífice Sulyvahn'; // Shipping address addition.\n $shippingInfo->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Shipping tax rate. (21.00%)\n $shippingInfo->discount = Aplazame\\Serializer\\Decimal::fromFloat(1.00); // The discount amount of the shipping. (1.00 €)\n\n /*\n * Checkout model\n */\n $checkout = new stdClass();\n $checkout->toc = true;\n $checkout->merchant = $merchant;\n $checkout->order = $order;\n $checkout->customer = $customer;\n $checkout->billing = $billingAddress;\n $checkout->shipping = $shippingInfo;\n\n return $checkout;\n}", "public function jsonSerialize() {\n\t\t$register = array();\n\t\tforeach ($this->player->getInventory()->getContents() as $inv) {\n\t\t\t$in = $inv->getName();\n\t\t\tif (!in_array($in, $register, true)) {\n\t\t\t\t$register[] = $in;\n\t\t\t\t$buttons[] = [\n\t\t\t\t\t\"text\" => $in,\n\t\t\t\t];\n\t\t\t\t$this->data[] += $inv;\n\t\t\t}\n\t\t}\n\t\treturn [\"type\" => \"form\",\n\t\t\t\t\"title\" => \"§d§lITEMSHOP.com\",\n\t\t\t\t\"content\" => \"売りたいアイテムを選択してください\\n§a現在の所持金 → §e{$this->money}¥\\n\\n\",\n\t\t\t\t\"buttons\" => $buttons\n\t\t\t ];\n\t}", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function jsonSerialize()\n {\n return [\n 'sku' => $this->getSku(),\n 'quantity' => $this->getQuantity()\n ];\n }", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function response()\n {\n $metadata = $this->metadata;\n $tmp = array();\n \n if ($this->showConfigRoot != false) {\n $tmp['root'] = $metadata['root'];\n $tmp['totalProperty'] = $metadata['totalProperty'];\n $tmp['successProperty'] = $metadata['successProperty'];\n $tmp['messageProperty'] = $metadata['messageProperty'];\n }\n \n $tmp[$metadata['root']] = (empty($this->data)) ? array() : $this->data;\n $tmp[$metadata['successProperty']] = $this->success;\n \n // if metadata Is String return as Raw else create new array\n if ($this->showMetaData != false)\n if ($metadata['onlyRaw'] === true) {\n $tmp['metaData'] = \"|1|2|3|4|5|...5|||\";\n } else {\n $tmp['metaData'] = $this->metadata;\n }\n $rawJson = json_encode($tmp);\n if ($metadata['onlyRaw'] === true) {\n return str_replace('\"|1|2|3|4|5|...5|||\"', $metadata['raw'], $rawJson);\n }\n \n return $rawJson;\n }", "public function json()\n\t{\n\t\t$order_data = array();\n\t\t/*\n\t\t\t\"rows\" => array(\n\t\t\t\t\"id\",\n\t\t\t\t\"item\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t\t\"amount\", \"price\",\n\t\t\t),\n\t\t\t\"items\" => array(\"id\", \"name\", \"amount\", \"price\", \"total\"),\n\t\t\t\t\"purveyances\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"company\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"company_section\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"weekdays\", \"time_from\", \"time_to\", \"days\"\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"purchaser\" => array(\n\t\t\t\t\"id\", \"name\",\n\t\t\t\t\"customers\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t*/\n\t\t\n\t\t$purchaser = obj($this->prop(\"purchaser\"));\n\t\tif (true || !$purchaser->is_saved())\n\t\t{\n\t\t\t// FIXME: Only temporarily!\n\t\t\t$__purchaser_id = users::is_logged_in() ? user::get_current_person() : null;\n\t\t\t$purchaser = obj($__purchaser_id, array(), crm_person_obj::CLID);\n\t\t}\n\t\t$order_data[\"purchaser\"] = array(\n\t\t\t\"id\" => $purchaser->id(),\n\t\t\t\"name\" => $purchaser->name(),\n\t\t\t\"customers\" => array(),\n\t\t);\n\t\tif ($purchaser->is_a(crm_person_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->company()->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t\t$order_data[\"purchaser\"][\"company\"] = $purchaser->company()->id();\n\t\t\t\n\t\t}\n\t\telseif ($purchaser->is_a(crm_company_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t}\n\t\t$customer_count = isset($customers) ? $customers->count() : 0;\n\t\tif ($customer_count > 0)\n\t\t{\n\t\t\tforeach ($customers->names() as $customer_id => $customer_name)\n\t\t\t{\n\t\t\t\t$order_data[\"purchaser\"][\"customers\"][$customer_id] = array(\n\t\t\t\t\t\"id\" => $customer_id,\n\t\t\t\t\t\"name\" => $customer_name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$order_data[\"rows\"] = array();\n\t\t$order_data[\"items\"] = array();\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$item_data = array(\n\t\t\t\t\"id\" => $row->prop(\"prod\"),\n\t\t\t\t\"name\" => $row->prop(\"prod_name\"),\n\t\t\t);\n\t\t\t$order_data[\"rows\"][$row->id()] = array(\n\t\t\t\t\"id\" => $row->id(),\n\t\t\t\t\"item\" => $item_data,\n\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\"buyer_rep\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"purveyance_company_section\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"planned_date\" => $row->prop(\"planned_date\"),\n\t\t\t\t\"planned_time\" => $row->prop(\"planned_time\"),\n\t\t\t);\n\n\t\t\tif (!isset($order_data[\"items\"][$item_data[\"id\"]]))\n\t\t\t{\n\t\t\t\t$item = obj($item_data[\"id\"]);\n\t\t\t\t$purveyance_data = array();\n\t\t\t\t$purveyances = $item->get_purveyances();\n\t\t\t\tif ($purveyances->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$purveyance = $purveyances->begin();\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] = array(\"company\" => array());\n\t\t\t\t\t\tif (is_oid($company_id = $purveyance->prop(\"company\")))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$company = obj($company_id, array(), crm_company_obj::CLID);\n\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"] = array(\n\t\t\t\t\t\t\t\t\"id\" => $company->id(),\n\t\t\t\t\t\t\t\t\"name\" => $company->get_title(),\n\t\t\t\t\t\t\t\t\"address\" => $company->get_address_string(),\n\t\t\t\t\t\t\t\t\"section\" => array(),\n\t\t\t\t\t\t\t\t\"sections\" => array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (is_oid($section_id = $purveyance->prop(\"company_section\")))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$section = obj($section_id, array(), crm_section_obj::CLID);\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"section\"] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section->id(),\n\t\t\t\t\t\t\t\t\t\"name\" => $section->name(),\n//\t\t\t\t\t\t\t\t\t\"address\" => $section->get_address_string(),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($company->get_sections()->names() as $section_id => $section_name)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"sections\"][] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section_id,\n\t\t\t\t\t\t\t\t\t\"name\" => $section_name,\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$purveyance_data[$purveyance->id()] += array(\n\t\t\t\t\t\t\t\"weekdays\" => $purveyance->prop(\"weekdays\"),\n\t\t\t\t\t\t\t\"time_from\" => $purveyance->prop(\"time_from\"),\n\t\t\t\t\t\t\t\"time_to\" => $purveyance->prop(\"time_to\"),\n\t\t\t\t\t\t\t\"days\" => $purveyance->prop(\"days\")\n\t\t\t\t\t\t);\n\t\t\t\t\t} while ($purveyance = $purveyances->next());\n\t\t\t\t}\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]] = $item_data + array(\n\t\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\t\"total\" => $row->prop(\"price\") * $row->prop(\"items\"),\n\t\t\t\t\t\"purveyances\" => $purveyance_data,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"amount\"] += $row->prop(\"items\");\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"total\"] += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t\t}\n\t\t}\n\n\t\t$json = new json();\n\t\treturn $json->encode($order_data, aw_global_get(\"charset\"));\n\t}", "function create(){\n // echo \"create function\";\n // sanitize\n $user_id=htmlspecialchars(strip_tags($_POST['user_id']));\n\n $maintenance_id=htmlspecialchars(strip_tags($_POST['maintenance_id']));\n $wallet_amt=htmlspecialchars(strip_tags($_POST['wallet_amt']));\n $remain_amt=htmlspecialchars(strip_tags($_POST['remain_amt']));\n $enter_amount=htmlspecialchars(strip_tags($_POST['enter_amount']));\n $wallet_chbx=htmlspecialchars(strip_tags($_POST['wallet_chbx']));\n\n $subscription_list = (array)json_decode($_POST['subscription_list'],true);\n // print_r($subscription_list);\n $total_amt_have = $enter_amount;\n global $item;\n global $subscription;\n global $user;\n\n if($wallet_chbx == 1){\n $total_amt_have = $total_amt_have + $wallet_amt;\n $wallet_amt = 0;\n }\n\n foreach ($subscription_list as $key => $val)\n {\n // print_r($val);\n $pending = $val[\"total_amt_to_paid\"] - $val[\"paid_amt\"];\n\n if($total_amt_have!=0){\n\n $val[\"paid_amt\"] = $val[\"paid_amt\"] + $total_amt_have;\n\n $total_amt_have = 0;\n if($val[\"paid_amt\"]>$val[\"total_amt_to_paid\"]){\n\n $total_amt_have = $val[\"paid_amt\"] - $val[\"total_amt_to_paid\"];\n $val[\"paid_amt\"] = $val[\"total_amt_to_paid\"];\n }\n\n\n $subscription_response = $subscription->updatebydict($val,$user_id,$val[\"id\"]);\n }\n \n }\n\n if($total_amt_have >0){\n $wallet_amt = $wallet_amt + $total_amt_have;\n $user_response = $user->updatebydict(array('wallet_amt'=>$wallet_amt),$user_id);\n \n }\n\n return json_encode(\n array(\n \"success\" => array(\n \"code\" => \"201\",\n \"message\" => \"Payment was created.\",\n \"data\" => array(\n \"id\" => \"\",\n \"wallet_amt\" => $wallet_amt\n )\n )\n )\n );\n\n \n \n \n }", "public static function getJson()\n {\n return '{\"email\":\"TestSample\",\"external_remember_me_id\":\"TestSample\",\"buyer_account_number\":\"TestSample\",\"first_name\":\"TestSample\",\"last_name\":\"TestSample\",\"payer_id\":\"TestSample\",\"phone\":\"TestSample\",\"phone_type\":\"TestSample\",\"birth_date\":\"TestSample\",\"tax_id\":\"TestSample\",\"tax_id_type\":\"TestSample\",\"billing_address\":' .AddressTest::getJson() . ',\"shipping_address\":' .ShippingAddressTest::getJson() . '}';\n }", "final public function call_rental_price_api($cart_item): object {\n\t\t$product_id = $cart_item['product_id'];\n\t\t$sku = get_post_meta( $product_id, '_sku', true );\n\t\t$itemsQuantity = $cart_item['quantity'];\n\t\t// echo \"<pre>\";print_r($cart_item);echo \"</pre>\";\n\t\tif(isset($cart_item['wrp_date_range'])){\n\t\t\t$wrp_date_range = $cart_item['wrp_date_range'];\n\t\t\t$start_arr \t\t=\texplode(' ',$wrp_date_range['date_start']); \n\t\t\t$start \t\t\t=\t$start_arr[0].'T'.$start_arr[1];\n\t\t\t$end_arr \t\t=\texplode(' ',$wrp_date_range['date_end']); \n\t\t\t$end \t\t\t= \t$end_arr[0].'T'.$end_arr[1];\n\t\t}else{\n\t\t\t$start \t= date('Y-m-d') ;\n\t\t\t$end \t= date(\"Y-m-d\", strtotime(\"+ 1 day\"));\n\t\t}\n\t\t\t\n\t\t$endpoint = get_option('endpoint_url'); \n\t\t$post_url = $endpoint.'/calcPrices';\t\n\t\t$body = array( 'items' => array(array('start' => $start,\n\t\t\t\t\t\t'end'=>$end,\n\t\t\t\t\t\t'sku' => $sku,\n\t\t\t\t\t\t'qty' => ''.$itemsQuantity.'')));\n\n\t $request = new WP_Http();\n\t $response = $request->post( $post_url, array( 'body' => json_encode($body) ) );\t \n\t // $response['response']['code'] = 200;\n\t if($response['response']['code'] == 200){\n\t \t// process responce here..\n\t \t/*$response['body'] ='\n\t\t\t \t{\n\t\t\t\t \"items\": [\n\t\t\t\t {\n\t\t\t\t \"start\": \"2019-05-01T07:00:00.000Z\",\n\t\t\t\t \"end\": \"2019-05-07T03:00:00.000Z\",\n\t\t\t\t \"sku\": \"GD3\",\n\t\t\t\t \"qty\": 1,\n\t\t\t\t \"dur\": 14.00,\n\t\t\t\t \"periodCode\": \"Day\",\n\t\t\t\t \"periodName\": \"Day\",\n\t\t\t\t \"amount\": 210.00,\n\t\t\t\t \"avQty\": 5\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t}\n\t\t\t';*/\n\n\t\t\t\n\t\t\t$price_array = json_decode($response['body']);\n\t\t\t$rentalPrice = $price_array->items[0];\n\t\t\treturn $rentalPrice;\n\t }\n\t else{\n\t \treturn (object) array();\n\t }\t\n\t}", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "public function jsonSerialize()\n {\n $json = array();\n $json['price'] = $this->price;\n $json['store_id'] = $this->storeId;\n $json['sku'] = $this->sku;\n $json['price_from'] = $this->priceFrom;\n $json['price_to'] = $this->priceTo;\n $json['extension_attributes'] = $this->extensionAttributes;\n\n return $json;\n }", "protected function getAccountRequest()\n {\n\n $resourcePath = '/shipping/v1/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'GET', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_pay()\n {\n// $core->toPay();\n $pay = new \\Wxpay\\Weixinpay();\n $order = array(\n 'body' => 'test',\n 'total_fee' => 1,\n 'out_trade_no' => strval(time()),\n 'product_id' => 1\n );\n $pay->pay($order);\n\n }", "function payment() {\n\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/payment';\n\t\t$json = file_get_contents($url);\n\t\treturn json_decode($json);\n\t}", "public function create(): JsonResponse;", "public function jsonProvider() {\n return '{\n \"data\": {\n \"attributes\": {\n \"object_domain\": \"contact\",\n \"object_id\": \"1\",\n \"due\": \"2019-01-25T07:50:14+00:00\",\n \"urgency\": 1,\n \"description\": \"Need to verify this guy house.\",\n \"items\": [\n \"Visit his house\",\n \"Capture a photo\",\n \"Meet him on the house\"\n ],\n \"task_id\": \"123\"\n }\n }\n }';\n}", "public function callback(){\n $data = Rave::verifyTransaction(request()->txref);\n dd($data); // view the data response\n if ($data->status == 'success') {\n if(session()->get($this->requestVar)['']['page_type'] == 'cart'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n } \n \n \n \n //Payment from basket checkout page\n \n if(session()->get($this->requestVar)['']['page_type'] == 'basket'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n \n }\n \n }\n }", "function jsonSerialize()\n {\n return [\n 'id' => $this->id,\n 'title' => $this->title,\n 'quantity' => $this->quantity,\n 'clientName' => $this->clientName,\n 'address' => $this->address,\n 'email' => $this->email,\n 'state' => $this->state,\n 'dispatchingTime'=> $this->dispatchingTime\n ];\n }", "public function formProduk()\n {\n $this->parser['listMerchant'] = userMerchant::all()->toArray();\n $res['status'] = true;\n $res['html'] = view('admin.dashBoardAdmin.product.formProduct', $this->parser)->render();\n return response()->json($res);\n }", "public function getJsonString(){\n\t\treturn json_encode(array($this->getRequestData()));\n\t}", "public function json() {\n return json_encode($this->response);\n }", "public function jsonSerialize() {\n return [\n 'item_id' => $this->itemId,\n 'item_name' => $this->itemName,\n 'item_price' => $this->itemPrice,\n 'state' => $this->state\n ];\n }", "public function index(): JsonResponse\n {\n $buyers = Buyer::has('transactions')->get();\n return response()->json(['data'=>$buyers],200);\n }", "public function getBody():\\stdClass{\n\t return $this->body??$this->setBody(new \\stdClass);\n\t}", "public function __toString() {\n\t\t$data = array();\n\t\tforeach ($this->fields as $name => $field) {\n\t\t\t$data += [$name => $field->toJson()];\n\t\t}\n\t\t$top = array(\"success\"=>$this->success,\"data\"=>$data,\"text\"=>$this->text);\n\t\treturn json_encode($top);\n\t}", "public function jsonSerialize()\n {\n return array('headers' => $this->headers, 'body' => $this->body);\n }", "public function json(){ return json_encode( $this->objectify() ); }", "public function getBody(): string\n {\n $body = [\n 'Customer' => $this->getCustomer()->toArray(),\n 'Message' => $this->getMessage()->toArray(),\n 'Shipments' => $this->getShipmentsArray()\n ];\n $body= json_encode($this->filterEmptyArrayValues($body));\n return $body;\n }", "function requestPayout($get_access_token){\n global $new_json; // Request JSON for payout\n // echo 'Test==';\n //print_r($new_json); die; \n$access_token='Bearer '.$get_access_token;\n ///// Load Api data////\n$domain = \"https://api.sandbox.paypal.com/v1/oauth2/token\";\n\n\n$url = 'https://api.sandbox.paypal.com/v1/payments/payouts';\n\n\n$headers[] = 'Accept: application/json';\n$headers[] = 'Authorization: Bearer A21AAGMlHEpgdv_Fm4smWsm7CwWfdrRz458Mp14mzVnU0S1zIORyX-ATQeni2P9bCdzrk7FPLnuKPynwIg8ZhnznY6zDu08bw';\n//$headers[] = \"Content-Type: application/x-www-form-urlencoded\";\n\n\n\n\n//$postdata = json_encode($data);\n\n$postdata_stop='{\n \"sender_batch_header\": {\n \"sender_batch_id\": \"1001\",\n \"email_subject\": \"You have a payout!\",\n \"email_message\": \"You have received a payout! Thanks for using our service!\"\n },\n \"items\": [\n {\n \"recipient_type\": \"EMAIL\",\n \"amount\": {\n \"value\": \"0\",\n \"currency\": \"USD\"\n },\n \"note\": \"Thanks for your patronage!\",\n \"sender_item_id\": \"123\",\n \"receiver\": \"[email protected]\"\n },\n {\n \"recipient_type\": \"EMAIL\",\n \"amount\": {\n \"value\": \"0\",\n \"currency\": \"USD\"\n },\n \"note\": \"Thanks for your patronage!\",\n \"sender_item_id\": \"345\",\n \"receiver\": \"[email protected]\"\n }\n \n ]\n}';\n\n //$postdata=$new_json; // Custom JSON\n \n\n$headers_arr=array('Authorization: '.$access_token,'Content-Type: application/json');\n\n\n$ch = curl_init($url);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n\n\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $new_json);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_arr);\n$result = curl_exec($ch);\n \n//print_r ($result);\ncurl_close($ch);\n\nreturn $result;\n\n}", "public function webhook(){\r\n\t\t\r\n\t\t$json = array();\r\n\r\n\t\tif($this->request->server['REQUEST_METHOD'] == 'POST'){\r\n\t\t\t\r\n\t\t\t$post = array();\r\n\t\t\tif(isset($this->request->post['coin_short_name']) && $this->request->post['coin_short_name'] != '' && isset($this->request->post['address']) && $this->request->post['address'] != '' && isset($this->request->post['type']) && $this->request->post['type'] != ''){\r\n\t\t\t\t$post = $this->request->post;\r\n\t\t\t}else{\r\n\t\t\t\t$post_json = json_decode(file_get_contents('php://input'),TRUE);\r\n\r\n\t\t\t\tif(isset($post_json['coin_short_name']) && $post_json['coin_short_name'] != '' && isset($post_json['address']) && $post_json['address'] != '' && isset($post_json['type']) && $post_json['type'] != '' ){\r\n\t\t\t\t\t$post = $post_json;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!empty($post)){\r\n\r\n\t\t\t\tif($post['type'] == 'receive'){\r\n\t\t\t\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\t\t\t$address = $post['address'];\r\n\r\n\t\t\t\t\t/*** check if address exists in oc_coinremitter_order ***/\r\n\t\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\t\t\t\t\t$order_info = $this->model_extension_coinremitter_payment_coinremitter->getOrderByAddress($address);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!empty($order_info)){\r\n\r\n\t\t\t\t\t\tif($order_info['payment_status'] == 'pending' || $order_info['payment_status'] == 'under paid'){\r\n\r\n\t\t\t\t\t\t\t$orderId = $order_info['order_id'];\r\n\r\n\t\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\tif(!empty($order_cart)){\r\n\r\n\t\t\t\t\t\t\t\t/*** check if expired time of invoice is defined or not. If defined then check if invoice has any transaction or not. If no transaction is found and invoice time is expired then change invoice status as expired ***/\r\n\r\n\t\t\t\t\t\t\t\t/*** Get webhook by address***/\r\n\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\tif(isset($order_info['expire_on']) && $order_info['expire_on'] != ''){\r\n\t\t\t\t\t\t\t\t\tif(time() >= strtotime($order_info['expire_on'])){\r\n\t\t\t\t\t\t\t\t\t\t$getWebhookByAddressRes = $this->model_extension_coinremitter_payment_coinremitter->getWebhookByAddress($address);\t\r\n\t\t\t\t\t\t\t\t\t\tif(empty($getWebhookByAddressRes)){\r\n\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status as expired\r\n\t\t\t\t\t\t\t\t\t\t\t$status = 'expired';\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\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\tif($order_cart['order_status'] != 'Canceled'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order history status to canceled, add comment ***/\r\n\t\t\t\t\t\t $comments = 'Order #'.$orderId;\r\n\t\t\t\t\t\t $is_customer_notified = true;\r\n\t\t\t\t\t\t $this->model_checkout_order->addHistory($orderId, 7, $comments, $is_customer_notified); // 7 = Canceled\t\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\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif($status == ''){\r\n\r\n\t\t\t\t\t\t\t\t\t$coin = $post['coin_short_name'];\r\n\t\t\t\t\t\t\t\t\t$trxId = $post['id'];\r\n\r\n\t\t\t\t\t\t\t\t\t/*** now get wallet data from oc_coinremitter_wallet with use of coin ***/\r\n\t\t\t\t\t\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\t\t\t\t\t\t\t\t\tif(!empty($wallet_info)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t/*** now get transaction from coinremitter api call ***/\r\n\t\t\t\t\t\t\t\t\t\t$get_trx_params = array(\r\n\t\t\t\t\t\t\t\t\t\t\t'url'\t\t=> 'get-transaction',\r\n\t\t\t\t\t\t\t\t\t\t\t'api_key'\t=>\t$wallet_info['api_key'],\r\n\t\t\t\t\t\t 'password'\t=>\t$wallet_info['password'],\r\n\t\t\t\t\t\t 'id'\t\t=>\t$trxId,\r\n\t\t\t\t\t\t 'coin'\t\t=>\t$coin\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t$getTransaction = $this->obj_curl->commonApiCall($get_trx_params);\r\n\t\t\t\t\t\t\t\t\t\tif(!empty($getTransaction) && isset($getTransaction['flag']) && $getTransaction['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$transaction = $getTransaction['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($transaction['type']) && $transaction['type'] == 'receive'){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** now check if transaction exists in oc_coinremitter_webhook or not if does not exist then insert else update confirmations ***/\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\t$webhook_info = $this->model_extension_coinremitter_payment_coinremitter->getWebhook($transaction['id']);\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(empty($webhook_info)){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//insert record\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$insert_arr = array(\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order_id' => $orderId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'address' => $transaction['address'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'transaction_id' => $transaction['id'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'txId' => $transaction['txid'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'explorer_url' => $transaction['explorer_url'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_amount' => $transaction['amount'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'coin' => $transaction['coin_short_name'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_date' => $transaction['date']\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted_id = $this->model_extension_coinremitter_payment_coinremitter->addWebhook($insert_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($inserted_id > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Inserted successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"system error. Please try again later.\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update confirmations if confirmation is less than 3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($webhook_info['confirmations'] < 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'] <= 3 ? $transaction['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook_info['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"confirmations updated successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process start ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Now, get all webhook transactions which have lesser than 3 confirmations ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$webhook_res = $this->model_extension_coinremitter_payment_coinremitter->getSpecificWebhookTrxByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get wallet info if and only if webhook_res has atleast one data ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($webhook_res)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($webhook_res as $webhook) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Get confirmation from coinremitter api (get-transaction) ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$get_trx_params['id'] = $webhook['transaction_id']; \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getTransactionRes = $this->obj_curl->commonApiCall($get_trx_params);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($getTransactionRes) && isset($getTransactionRes['flag']) && $getTransactionRes['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$transactionData = $getTransactionRes['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transactionData['confirmations'] <= 3 ? $transactionData['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get sum of paid amount of all transations which have 3 or more than 3 confirmtions ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid_res = $this->model_extension_coinremitter_payment_coinremitter->getTotalPaidAmountByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(isset($total_paid_res['total_paid']) && $total_paid_res['total_paid'] > 0 ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = $total_paid_res['total_paid'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($total_paid == $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid > $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'over paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid != 0 && $total_paid < $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'under paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($status != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($status == 'paid' || $status == 'over paid' || $status == 'under paid'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order status as complete ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->add_order_success_history($orderId);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process end ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = 'Transaction type is not receive';\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}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$msg = 'Something went wrong while getting transactions. Please try again later'; \r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($getTransaction['msg']) && $getTransaction['msg'] != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$msg = $getTransaction['msg']; \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$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = $msg; \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$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Wallet not found\";\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t$json['msg'] = \"Order is expired\";\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$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t$json['msg'] = \"Order not found\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = \"Order status is neither a 'pending' nor a'under paid'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = \"Address not found\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Invalid type\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = \"Only post request allowed\";\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\r\n\t}", "public function getInfoPayment()\n {\n $response = $this->client->request($this->methods['post'],'sandbox', [\n 'json' => [\n 'MERCHANT_TRANS_ID' => $this->merchant_trans_id,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->merchant_trans_id. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }", "public function index()\n {\n return formatResponse(false,([\n \"purchase_request_details\"=>$this->purchaseRequestDetail->latest()->get()\n ]));\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['advocate_token'] = $this->advocateToken;\n $json['request_status_slug'] = $this->requestStatusSlug;\n $json['request_action_slug'] = $this->requestActionSlug;\n $json['currency_code'] = $this->currencyCode;\n $json['amount'] = $this->amount;\n $json['description'] = $this->description;\n $json['advocates_paypal_username'] = $this->advocatesPaypalUsername;\n\n return $json;\n }", "public function jsonSerialize()\n {\n $jsonObject = parent::jsonSerialize();\n $jsonObject->result = $this->information[ self::INFORMATION_RESULT ];\n\n return $jsonObject;\n }", "public function execute()\n {\n try {\n $this->cart->removeAllFailed();\n } catch (\\Exception $e) {\n $this->logger->critical($e);\n $this->messageManager->addError(__('Exception occurred during update quote'));\n }\n $data = [];\n $response = $this->resultRawFactory->create();\n $response->setHeader('Content-type', 'text/json');\n $response->setContents($this->jsonEncoder->encode($data));\n return $response;\n }", "function serializationAction(& $body)\n{\n\t$rawResponse = & $body->getResults();\n\n\terror_log (\"[SWX] INFO Method call result = $rawResponse\");\n\n\tadapterMap($rawResponse);\n\n\t$swxAssembler = new SwxAssembler();\n\n\tob_start();\n\n\t$swxAssembler->writeSwf($rawResponse, $GLOBALS['swx']['debug'], 4, $GLOBALS['swx']['url']);\n\n\t$rawResponse = ob_get_contents();\n\tob_end_clean();\n\n\t$body->setResults($rawResponse);\n}", "function spf_get_shop_products(){\nwp_send_json([\n 'message' => 'thank you the endpoint is fine'\n], 200);\n}", "public function index()\n {\n \n $purchases=PurchaseTransaction::all();\n $supplier=Supplier::all();\n $warehouse=Warehouse::all();\n return response()->json([\n 'data'=>$purchases,'dataSupplier'=>$supplier,'dataWarehouse'=>$warehouse\n ],200);\n }", "public function get_body()\n {\n return json_decode(file_get_contents('php://input'), TRUE);\n }", "public function getPayerAuthenticationResponse();", "private function json($data){\n header('Content-type: application/json');\n return json_encode($data);\n }", "public function getObject()\n\t{\n\t\t$application = \\Trinity\\Basement\\Application::getApplication();\n\t\t$broker = $this->_serviceLocator->get('web.Broker');\n\t\t$json = new Json($application);\n\n\n\n\t\treturn $json;\n\t}", "public function makePayment($amountTobePaid)\n {\n\n $this->transactionId = uniqid();\n $encodedAuth = base64_encode($this->apiUser . \":\" . $this->apiPassword);\n $postRequest = array(\n \"total_amount\" => $amountTobePaid,\n \"return_url\" => $this->returnUrl,\n \"notify_url\" => $this->notifyUrl,\n \"transaction_id\" => $this->transactionId,\n \"description\"=> \"PayUnit web payments\"\n );\n $cURLConnection = curl_init();\n if($this->mode === \"test\"){\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/sandbox/gateway/initialize\");\n }else{\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/api/gateway/initialize\");\n }\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postRequest)); \n $secArr = array(\n \"x-api-key: {$this->apiKey}\",\n \"authorization: Basic: {$encodedAuth}\",\n 'Accept: application/json',\n 'Content-Type: application/json',\n \"mode: {$this->mode}\"\n );\n $all = array_merge($postRequest,$secArr);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER,$all);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n $jsonArrayResponse = json_decode($apiResponse);\n echo(isset($jsonArrayResponse));\n if(isset($jsonArrayResponse->body->transaction_url)){\n echo(\"dfdgdg\");\n //die();\n header(\"Location: {$jsonArrayResponse->body->transaction_url}\");\n exit(); \n }\n else{\n echo($apiResponse);\n }\n }", "public function json()\n {\n $code = 200;\n\n if (!Request::has(\"no_response_code\") || Request::input('no_response_code') != \"yes\") {\n $code = $this->getCode();\n }\n\n return response()->json($this->getResponse(), $code);\n }" ]
[ "0.6975679", "0.6027713", "0.6019814", "0.5992985", "0.59398997", "0.58507484", "0.58489287", "0.5825267", "0.57986796", "0.5787133", "0.5776419", "0.5772957", "0.5771879", "0.57670623", "0.57630676", "0.56703794", "0.5658695", "0.5631877", "0.5630311", "0.5625119", "0.56210303", "0.5611831", "0.56112015", "0.5597921", "0.5576366", "0.5575248", "0.55738264", "0.5572883", "0.55696774", "0.55617756", "0.5560568", "0.55559933", "0.555214", "0.555214", "0.555214", "0.55497134", "0.5547893", "0.55471265", "0.5540463", "0.5538883", "0.55381465", "0.55370444", "0.5534198", "0.55222064", "0.55065286", "0.55016106", "0.5501577", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54998726", "0.54989994", "0.5494378", "0.549184", "0.5485217", "0.5483105", "0.5483021", "0.5481772", "0.54798263", "0.5478659", "0.5477451", "0.5469712", "0.546733", "0.54346937", "0.542658", "0.54234815", "0.54223245", "0.5420742", "0.5418967", "0.5413885", "0.5413409", "0.5412797", "0.5410691", "0.53953755", "0.5387802", "0.5387665", "0.5385749", "0.5378686", "0.5377362", "0.53744435", "0.5370014", "0.5345504", "0.5343141", "0.53379834", "0.5334409", "0.532998", "0.5326398", "0.5325842", "0.532485", "0.5322715", "0.5318757", "0.531846", "0.5317727", "0.53163296" ]
0.0
-1
Define the rotation value
public function setRotation($rotation) { $this->rotation = $rotation; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rotation($value) {\n return $this->setProperty('rotation', $value);\n }", "public function getRotation() {}", "public function getRotation() {}", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "public function rotateBy($rotation) {}", "public function rotate()\n {\n // not possible in php?\n }", "public function setRotation(array $value)\n {\n $this->rotation = self::mutateToPgArray($value);\n }", "abstract public function rotate($amount);", "public function orientation($value) {\n return $this->setProperty('orientation', $value);\n }", "public function orientation($value) {\n return $this->setProperty('orientation', $value);\n }", "public function orientation($value) {\n return $this->setProperty('orientation', $value);\n }", "public function __construct($rotation)\n {\n $this->rotation = $rotation;\n }", "function rotation($angle)\n\t{\n\t\t$this->rotation = $angle;\n\t\treturn $this;\n\t}", "private function RiseSetAngle()\n\t{\n\t\t//var earthRad = 6371009; // in meters\n\t\t//var angle = DegreeMath.Acos(earthRad/(earthRad+ elv));\n\t\t$angle = 0.0347 * sqrt($this->_elv); // an approximation\n\t\treturn 0.833 + $angle;\n\t}", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "public function getAngle()\n {\n return $this->angle;\n }", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "public function getAngle()\n\t{\n\t\treturn $this->angle;\n\t}", "public function getAngle(): float\n {\n return $this->angle;\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function getRotateControl()\n {\n return $this->rotateControl;\n }", "function convertRadians($Value) \r\n{\r\n return $Value * pi() / 180;\r\n}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotateRight();", "function writeOrientation($value)\r\n {\r\n if (($this->ControlState & csDesigning) == csDesigning)\r\n {\t\t\t\t\r\n\t\t\t\r\n global $allowupdates;\r\n\r\n //This mean this property is being updated in the IDE, specifically\r\n //so we need to switch coordinates\r\n if ($allowupdates)\r\n {\r\n $this->switchDimensions();\r\n }\t\t\t\r\n\t\t\t\r\n }\r\n else\r\n {\r\n //If not, we need to check if the value has changed before switching dimensions\r\n if ($this->_orientation!=$value) $this->switchDimensions();\r\n }\r\n $this->_orientation=$value;\r\n }", "public function rotateLeft();", "public function rotate($angle) {\n\t\t$this->angle = $angle;\n\t\tparent::rotate($angle);\n\t}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public static function deg90()\n {\n return static::createWithDegree(Degree::DEG_90);\n }", "public function getRotation()\n {\n return self::accessPgArray($this->rotation);\n }", "public function rotate(int $rotations);", "public function getOrientation();", "public function setOrientation(?int $value): void {\n $this->getBackingStore()->set('orientation', $value);\n }", "public function setOrientation($o)\n {\n $this->orientation = $o;\n }", "abstract protected function initRotues();", "function radToDeg() { # :: Num -> Float\n return new Num\\Float(rad2deg($this->value));\n }", "public function rotate($degrees);", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "function degree_to_radian($input)\n {\n return $input / 180.0;\n }", "public static function deg180()\n {\n return static::createWithDegree(Degree::DEG_180);\n }", "public function deg2rad() : self\n {\n return $this->map('deg2rad');\n }", "public function setRotateControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof RotateControl)) {\n $this->rotateControl = $args[0];\n $this->mapOptions['rotateControl'] = true;\n } elseif (isset($args[0]) && is_string($args[0])) {\n if ($this->rotateControl === null) {\n $this->rotateControl = new RotateControl();\n }\n\n $this->rotateControl->setControlPosition($args[0]);\n $this->mapOptions['rotateControl'] = true;\n } elseif (!isset($args[0])) {\n $this->rotateControl = null;\n\n if (isset($this->mapOptions['rotateControl'])) {\n unset($this->mapOptions['rotateControl']);\n }\n } else {\n throw MapException::invalidRotateControl();\n }\n }", "public static function deg270()\n {\n return static::createWithDegree(Degree::DEG_270);\n }", "public function rad2deg() : self\n {\n return $this->map('rad2deg');\n }", "public function getDegAttribute(): int\n {\n return $this->attributes['deg'];\n }", "public function getOrientation()\r\n {\r\n return $this->_orientation;\r\n }", "public function set_orientation($mode){\n $this->orient=$mode;\n }", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getOrientation()\n {\n return $this->orientation;\n }", "public function getOrientation()\n {\n return $this->orientation;\n }", "public function orientationCalculationOn()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_ORIENTATION_CALCULATION_ON, $payload);\n }", "function getOrientation() { return $this->readOrientation(); }", "public function getOrientation() {\n\t\treturn $this->orientation;\n\t}", "function getOrientation() { return $this->readOrientation(); }", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "public function getRandomOrientation() {\n\t\treturn self::$orientation[rand(0,1)];\n\t}", "function readOrientation() { return $this->_orientation;}", "private function _getRandomAngle() {\r\n\t\t// Choose which random angle to use.\r\n\t\treturn (rand(0, 1)) ? rand(0, 60) : rand(300, 360);\r\n\t}", "public function normalizeRotation($rotation, \\SetaPDF_Core_DataStructure_Rectangle $box) {}", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function rotate ($arr)\n{//rotate function is called in the right sidebar - an example of rotation (on day of month)\n\tif(is_array($arr))\n\t{//Generate item in array using date and modulus of count of the array\n\t\treturn $arr[((int)date(\"j\")) % count($arr)];\n\t}else{\n\t\treturn $arr;\n\t}\n}", "function rotate ($arr)\n{//rotate function is called in the right sidebar - an example of rotation (on day of month)\n\tif(is_array($arr))\n\t{//Generate item in array using date and modulus of count of the array\n\t\treturn $arr[((int)date(\"j\")) % count($arr)];\n\t}else{\n\t\treturn $arr;\n\t}\n}", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "function getRotation($startX,$startY,$endX,$endY,$rotation,$coordinatesArr,$type) {\n $rotation= $rotation * 1;\n $h = ($startX + $endX)/2;\n $k = ($endY + $startY)/2;\n $r = deg2rad($rotation);\n\n //Start Top Left Point - Move To Origin\n $tempStartTLX= $startX- $h;\n $tempStartTLY = $startY- $k;\n //Start Top Right Point;\n $tempStartTRX= $endX- $h;\n $tempStartTRY = $startY- $k;\n //Start Bootom Left Point\n $tempStartBLX= $startX- $h;\n $tempStartBLY = $endY- $k;\n //Start Bottom Right Point\n $tempEndBRX = $endX - $h;\n $tempEndBRY = $endY -$k;\n if(strcmp($type,\"provideInterface\")==false){\n $rectLHSStartx = $startX-3;\n $rectLHSStarty = $k - (5);\n //$rectLHSEndx = $startX +15 ;\n $rectLHSEndx = $startX;\n $rectLHSEndy = $k + (5);\n\n $rectRHSStartx = $endX -10;\n $rectRHSStarty = $k - (15);\n $rectRHSEndx = $endX;\n $rectRHSEndy = $k + (15);\n\n }else{\n $rectLHSStartx = $startX ;\n $rectLHSStarty = $k - (15);\n $rectLHSEndx = $startX +10;\n $rectLHSEndy = $k + (15);\n\n $rectRHSStartx = $endX;\n $rectRHSStarty = $k - (5);\n $rectRHSEndx = $endX+3;\n $rectRHSEndy = $k + (5);\n }\n /*\n //Start Top Left Point - Move To Origin\n $tempStartTLX= $startX- $h;\n $tempStartTLY = $startY- $k;\n //Start Top Right Point;\n $tempStartTRX= $endX- $h;\n $tempStartTRY = $startY- $k;\n //Start Bootom Left Point\n $tempStartBLX= $startX- $h;\n $tempStartBLY = $endY- $k;\n //Start Bottom Right Point\n $tempEndBRX = $endX - $h;\n $tempEndBRY = $endY -$k;\n*/\n //Start Top Left Point - Rotate shape\n $rotatedStartTLX = $tempStartTLX*cos($r) - $tempStartTLY*sin($r);\n $rotatedStartTLY = $tempStartTLX*sin($r) + $tempStartTLY*cos($r);\n //Start Top Right Point;\n $rotatedStartTRX = $tempStartTRX*cos($r) - $tempStartTRY*sin($r);\n $rotatedStartTRY = $tempStartTRX*sin($r) + $tempStartTRY*cos($r);\n //Start Bottom Right Point\n $rotatedStartBRX = $tempEndBRX*cos($r) - $tempEndBRY*sin($r);\n $rotatedStartBRY = $tempEndBRX*sin($r) + $tempEndBRY*cos($r);\n //Start Bootom Left Point\n $rotatedStartBLX = $tempStartBLX*cos($r) - $tempStartBLY*sin($r);\n $rotatedStartBLY = $tempStartBLX*sin($r) + $tempStartBLY*cos($r);\n\n\n //Start Top Left Point + Move To old location\n $rotatedStartTLX= $rotatedStartTLX+ $h;\n $rotatedStartTLY = $rotatedStartTLY+ $k;\n $coordinates = array($rotatedStartTLX,$rotatedStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedStartTRX= $rotatedStartTRX+ $h;\n $rotatedStartTRY = $rotatedStartTRY+ $k;\n $coordinates = array($rotatedStartTRX,$rotatedStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedStartBRX = $rotatedStartBRX + $h;\n $rotatedStartBRY = $rotatedStartBRY +$k;\n $coordinates = array($rotatedStartBRX,$rotatedStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedStartBLX= $rotatedStartBLX+ $h;\n $rotatedStartBLY = $rotatedStartBLY+ $k;\n $coordinates = array($rotatedStartBLX,$rotatedStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n \n //LHS Rectangle\n //Start Top Left Point - Move To Origin\n $temprectLHSStartTLx = $rectLHSStartx-$h;\n $temprectLHSStartTLy = $rectLHSStarty-$k;\n //Start Top Right Point;\n $temprectLHSStartTRx = $rectLHSEndx-$h;\n $temprectLHSStartTRy = $rectLHSStarty-$k;\n //Start Bottom Left Point\n $temprectLHSStartBLx = $rectLHSStartx-$h;\n $temprectLHSStartBLy = $rectLHSEndy-$k;\n //Start Bottom Right Point\n $temprectLHSEndBRx = $rectLHSEndx - $h;\n $temprectLHSEndBRy = $rectLHSEndy-$k;\n\n //Start Top Left Point - Rotate shape\n $rotatedLHSStartTLX = $temprectLHSStartTLx*cos($r) - $temprectLHSStartTLy*sin($r);\n $rotatedLHSStartTLY = $temprectLHSStartTLx*sin($r) + $temprectLHSStartTLy*cos($r);\n //Start Top Right Point;\n $rotatedLHSStartTRX = $temprectLHSStartTRx*cos($r) - $temprectLHSStartTRy*sin($r);\n $rotatedLHSStartTRY = $temprectLHSStartTRx*sin($r) + $temprectLHSStartTRy*cos($r);\n //Start Bottom Right Point\n $rotatedLHSStartBRX = $temprectLHSEndBRx*cos($r) - $temprectLHSEndBRy*sin($r);\n $rotatedLHSStartBRY = $temprectLHSEndBRx*sin($r) + $temprectLHSEndBRy*cos($r);\n //Start Bootom Left Point\n $rotatedLHSStartBLX = $temprectLHSStartBLx*cos($r) - $temprectLHSStartBLy*sin($r);\n $rotatedLHSStartBLY = $temprectLHSStartBLx*sin($r) + $temprectLHSStartBLy*cos($r);\n\n //Start Top Left Point + Move To old location\n $rotatedLHSStartTLX= $rotatedLHSStartTLX+ $h;\n $rotatedLHSStartTLY = $rotatedLHSStartTLY+ $k;\n $coordinates = array($rotatedLHSStartTLX,$rotatedLHSStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedLHSStartTRX= $rotatedLHSStartTRX+ $h;\n $rotatedLHSStartTRY = $rotatedLHSStartTRY+ $k;\n $coordinates = array($rotatedLHSStartTRX,$rotatedLHSStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedLHSStartBRX = $rotatedLHSStartBRX + $h;\n $rotatedLHSStartBRY = $rotatedLHSStartBRY +$k;\n $coordinates = array($rotatedLHSStartBRX,$rotatedLHSStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedLHSStartBLX= $rotatedLHSStartBLX+ $h;\n $rotatedLHSStartBLY = $rotatedLHSStartBLY+ $k;\n $coordinates = array($rotatedLHSStartBLX,$rotatedLHSStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n\n //RHS Rectangle\n //Start Top Left Point - Move To Origin\n $temprectRHSStartTLx = $rectRHSStartx-$h;\n $temprectRHSStartTLy = $rectRHSStarty-$k;\n //Start Top Right Point;\n $temprectRHSStartTRx = $rectRHSEndx-$h;\n $temprectRHSStartTRy = $rectRHSStarty-$k;\n //Start Bottom Left Point\n $temprectRHSStartBLx = $rectRHSStartx-$h;\n $temprectRHSStartBLy = $rectRHSEndy-$k;\n //Start Bottom Right Point\n $temprectRHSEndBRx = $rectRHSEndx - $h;\n $temprectRHSEndBRy = $rectRHSEndy-$k;\n\n //Start Top Left Point - Rotate shape\n $rotatedRHSStartTLX = $temprectRHSStartTLx*cos($r) - $temprectRHSStartTLy*sin($r);\n $rotatedRHSStartTLY = $temprectRHSStartTLx*sin($r) + $temprectRHSStartTLy*cos($r);\n //Start Top Right Point;\n $rotatedRHSStartTRX = $temprectRHSStartTRx*cos($r) - $temprectRHSStartTRy*sin($r);\n $rotatedRHSStartTRY = $temprectRHSStartTRx*sin($r) + $temprectRHSStartTRy*cos($r);\n //Start Bootom Left Point\n $rotatedRHSStartBLX = $temprectRHSStartBLx*cos($r) - $temprectRHSStartBLy*sin($r);\n $rotatedRHSStartBLY = $temprectRHSStartBLx*sin($r) + $temprectRHSStartBLy*cos($r);\n //Start Bottom Right Point\n $rotatedRHSStartBRX = $temprectRHSEndBRx*cos($r) - $temprectRHSEndBRy*sin($r);\n $rotatedRHSStartBRY = $temprectRHSEndBRx*sin($r) + $temprectRHSEndBRy*cos($r);\n\n //Start Top Left Point + Move To old location\n $rotatedRHSStartTLX= $rotatedRHSStartTLX+ $h;\n $rotatedRHSStartTLY = $rotatedRHSStartTLY+ $k;\n $coordinates = array($rotatedRHSStartTLX,$rotatedRHSStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedRHSStartTRX= $rotatedRHSStartTRX+ $h;\n $rotatedRHSStartTRY = $rotatedRHSStartTRY+ $k;\n $coordinates = array($rotatedRHSStartTRX,$rotatedRHSStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedRHSStartBRX = $rotatedRHSStartBRX + $h;\n $rotatedRHSStartBRY = $rotatedRHSStartBRY +$k;\n $coordinates = array($rotatedRHSStartBRX,$rotatedRHSStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedRHSStartBLX= $rotatedRHSStartBLX+ $h;\n $rotatedRHSStartBLY = $rotatedRHSStartBLY+ $k;\n $coordinates = array($rotatedRHSStartBLX,$rotatedRHSStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n //headsize width=10 height=12\n /*echo \"Your rotation is \".$r.\"|||\".$h.\"||\".$k.\"||\";\n echo $startX.\" k \".$startY.\" k \".$endX.\" k \".$endY.\" k \".$rotation.\"||||\";\n\n foreach($coordinatesArr as $test){\n echo \"coord\".$test[0];\n echo \"coord\".$test[1];\n }*/\n\n return $coordinatesArr;\n}", "public function toRadian($value)\n {\n return $value * (M_PI / 180);\n }", "function readOrientation() { return $this->_orientation; }", "public function rotateLeft(): Orientation\n {\n return new North();\n }", "public function normalizeRotationAndOrigin($rotation, \\SetaPDF_Core_DataStructure_Rectangle $box) {}", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function RotatedText($x, $y, $txt, $angle){\r $this->Rotate($angle,$x,$y);\r $this->Text($x,$y,$txt);\r $this->Rotate(0);\r }", "public function rotation($direction)\n\t{\n \n $direction = strtoupper($direction);\n\n $data[\"queen\"]= $this->queen_model->get_queen();\n if($data['queen']==null) {\n //error_no_queen_yet : 405\n $this->respond_errors(\"error no queen yet\",405);\n return;\n }\n $queen=$this->queen_model->mapper($data['queen']);\n\n $errors=$queen->rotate($direction);\n\n if (sizeof($errors)>0){\n //error_bad_direction_value :1\n $this->respond_errors($errors,100);\n\n }else{\n $this->queen_model->update_queen_facing($queen);\n $this->respond($queen,200);\n \n }\n\n }", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function rotate($phi, Form_Point $center = null) {\r\n\t\t/* PROTECTED REGION ID(php.implementation._14_0_b6f02e1_1211871307421_631477_281__14_0_b6f02e1_1214478889937_90346_236) ENABLED START */\r\n\t\t// TODO: implementation of method 'forms_Circle.rotate(...)'\r\n\t\tthrow new Exception('The implementation of the method forms_Circle::rotate is missing !');\r\n\t\t/* PROTECTED REGION END */\r\n\t}", "public function setOrientation($orientation);", "public function setOrientation($orientation);", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function _rotate_image_resource($img, $angle)\n {\n }", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "public function landscape($value) {\n return $this->setProperty('landscape', $value);\n }", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "private function rotor($rotor) {\r\n $system = $this->getSystem();\r\n $enigma = $system->getEnigma();\r\n\r\n $setting = $enigma->getRotorSetting($rotor);\r\n $wheel = $enigma->getRotor($rotor);\r\n\r\n $html = <<<HTML\r\n<p><label for=\"rotor-$rotor\">Rotor $rotor:</label>\r\n<select id=\"rotor-$rotor\" name=\"rotor-$rotor\">\r\nHTML;\r\n\r\n $rotors = ['', 'I', 'II', 'III', 'IV', 'V'];\r\n for($i=1; $i<=5; $i++) {\r\n $id = $rotors[$i];\r\n $selected = $wheel == $i ? \" selected\" : \"\";\r\n $html .= <<<HTML\r\n<option value=\"$i\"$selected>$id</option>\r\nHTML;\r\n\r\n }\r\n $html .= <<<HTML\r\n</select>&nbsp;&nbsp;\r\n<label for=\"initial-$rotor\">Setting:</label>\r\n<input class=\"initial\" id=\"initial-$rotor\" name=\"initial-$rotor\" type=\"text\" value=\"$setting\">\r\n</p>\r\nHTML;\r\n\r\n return $html;\r\n }", "function RotatedText($x, $y, $txt, $angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "function MoveWheels(){\n echo \"Wheels rotate. <br>\";\n $this->wheels = 10;\n }", "public function setAngle($angle)\n {\n if (is_int($angle) || is_float($angle)) {\n $this->angle = $angle;\n return $this;\n } else {\n throw new InvalidArgumentException(get_class($this) . '::angle must been float type');\n }\n }" ]
[ "0.7669374", "0.73732454", "0.7372722", "0.72917587", "0.7174715", "0.7172608", "0.6971963", "0.6614611", "0.6481834", "0.6359775", "0.629478", "0.629478", "0.629478", "0.6217216", "0.621382", "0.6192261", "0.61694515", "0.6121847", "0.6111367", "0.6055668", "0.60412", "0.5955481", "0.5955481", "0.5955481", "0.58633125", "0.5838362", "0.5801518", "0.5801518", "0.5801518", "0.5788354", "0.5780531", "0.57362497", "0.5711341", "0.570599", "0.5681253", "0.5665074", "0.5653582", "0.5592189", "0.5546351", "0.5545824", "0.55150634", "0.54994833", "0.5475163", "0.5458473", "0.5433194", "0.541365", "0.54042023", "0.5397443", "0.5369899", "0.53688043", "0.53626907", "0.53383034", "0.5321081", "0.53093684", "0.5271181", "0.52473426", "0.52473426", "0.5233352", "0.5225604", "0.52137905", "0.52056795", "0.5199427", "0.514832", "0.5148277", "0.5089636", "0.50653887", "0.5056006", "0.504484", "0.50439346", "0.50439346", "0.5039206", "0.5025932", "0.50168645", "0.5016425", "0.50070536", "0.50042105", "0.4994137", "0.4966222", "0.49589515", "0.495742", "0.49528283", "0.49386624", "0.49206942", "0.4917613", "0.4917613", "0.49129313", "0.49129313", "0.49073052", "0.4901492", "0.49010915", "0.49010915", "0.48781604", "0.48734885", "0.48576856", "0.48554504", "0.48541883", "0.485045", "0.48440585", "0.48409864", "0.4830024" ]
0.52903116
54
Make a run of rotation
public function rotate($rotation = null) { if (is_null($rotation)) { $rotation = $this->rotation; } $cipher = $this->getSubstitutions(); $this->setSubstitutions( array(Helper::rotate($cipher[0], $rotation)) ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rotate()\n {\n // not possible in php?\n }", "public function rotateBy($rotation) {}", "abstract public function rotate($amount);", "public function rotateRight();", "abstract protected function initRotues();", "public function rotate(int $rotations);", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "public function rotateLeft();", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "public function execute()\n {\n $lastRotationFlag = $this->_flagFactory->create()->loadSelf();\n $lastRotationTime = $lastRotationFlag->getFlagData();\n $rotationFrequency = 3600 * 24 * (int)$this->_coreConfig->getValue('system/rotation/frequency', 'default');\n if (!$lastRotationTime || $lastRotationTime < time() - $rotationFrequency) {\n $this->eventFactory->create()->rotate(\n 3600 * 24 * (int)$this->_coreConfig->getValue('system/rotation/lifetime', 'default')\n );\n }\n $lastRotationFlag->setFlagData(time())->save();\n }", "private function rotate() {\r\n $temp = $this->teams_1[1];\r\n for($i = 1; $i < (count($this->teams_1) - 1); $i++) {\r\n $this->teams_1[$i] = $this->teams_1[$i + 1];\r\n }\r\n $this->teams_1[count($this->teams_1) - 1] = end($this->teams_2);\r\n for($i = (count($this->teams_2) - 1); $i > 0; $i--) {\r\n $this->teams_2[$i] = $this->teams_2[$i - 1];\r\n }\r\n $this->teams_2[0] = $temp;\r\n return true;\r\n }", "public function getRotation() {}", "public function getRotation() {}", "function rotate ($arr)\n{//rotate function is called in the right sidebar - an example of rotation (on day of month)\n\tif(is_array($arr))\n\t{//Generate item in array using date and modulus of count of the array\n\t\treturn $arr[((int)date(\"j\")) % count($arr)];\n\t}else{\n\t\treturn $arr;\n\t}\n}", "function rotate ($arr)\n{//rotate function is called in the right sidebar - an example of rotation (on day of month)\n\tif(is_array($arr))\n\t{//Generate item in array using date and modulus of count of the array\n\t\treturn $arr[((int)date(\"j\")) % count($arr)];\n\t}else{\n\t\treturn $arr;\n\t}\n}", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "public function rotate() : Tetris {\n // rotate the block\n $rotatedBlock = $this->block->rotate();\n\n // calculate the x-difference so that the block appears to be roated in-place (i.e. centric)\n $diffX = ($this->block->getWidth() - $rotatedBlock->getWidth()) / 2;\n $diffX = $diffX < 0 ? floor($diffX) : ceil($diffX);\n\n // calculate the y-difference so that the block appears to be roated in-place (i.e. centric)\n $diffY = ($this->block->getHeight() - $rotatedBlock->getHeight()) / 2;\n $diffY = $diffY < 0 ? floor($diffY) : ceil($diffY);\n\n // calculate the rotated block's x-coordinate\n $x = $this->block->getX() + $diffX;\n // calculate the roated block's y-coordinate\n $y = $this->block->getY() - $diffY;\n\n // clear the block\n $this->block->clear();\n\n // check if there is enough space for the rotated block\n if ($this->map->canHave($rotatedBlock, $x, $y)) {\n // position the rotated block\n $rotatedBlock->setX($x);\n $rotatedBlock->setY($y);\n\n // replace the currently moving block with the rotated block\n $this->block = $rotatedBlock;\n\n // paint the rotated block\n $this->block->paint();\n } else {\n // re-paint the not-rotated block as-was\n $this->block->paint();\n }\n\n // return the game for chained method calling\n return $this;\n }", "function getRotation($startX,$startY,$endX,$endY,$rotation,$coordinatesArr,$type) {\n $rotation= $rotation * 1;\n $h = ($startX + $endX)/2;\n $k = ($endY + $startY)/2;\n $r = deg2rad($rotation);\n\n //Start Top Left Point - Move To Origin\n $tempStartTLX= $startX- $h;\n $tempStartTLY = $startY- $k;\n //Start Top Right Point;\n $tempStartTRX= $endX- $h;\n $tempStartTRY = $startY- $k;\n //Start Bootom Left Point\n $tempStartBLX= $startX- $h;\n $tempStartBLY = $endY- $k;\n //Start Bottom Right Point\n $tempEndBRX = $endX - $h;\n $tempEndBRY = $endY -$k;\n if(strcmp($type,\"provideInterface\")==false){\n $rectLHSStartx = $startX-3;\n $rectLHSStarty = $k - (5);\n //$rectLHSEndx = $startX +15 ;\n $rectLHSEndx = $startX;\n $rectLHSEndy = $k + (5);\n\n $rectRHSStartx = $endX -10;\n $rectRHSStarty = $k - (15);\n $rectRHSEndx = $endX;\n $rectRHSEndy = $k + (15);\n\n }else{\n $rectLHSStartx = $startX ;\n $rectLHSStarty = $k - (15);\n $rectLHSEndx = $startX +10;\n $rectLHSEndy = $k + (15);\n\n $rectRHSStartx = $endX;\n $rectRHSStarty = $k - (5);\n $rectRHSEndx = $endX+3;\n $rectRHSEndy = $k + (5);\n }\n /*\n //Start Top Left Point - Move To Origin\n $tempStartTLX= $startX- $h;\n $tempStartTLY = $startY- $k;\n //Start Top Right Point;\n $tempStartTRX= $endX- $h;\n $tempStartTRY = $startY- $k;\n //Start Bootom Left Point\n $tempStartBLX= $startX- $h;\n $tempStartBLY = $endY- $k;\n //Start Bottom Right Point\n $tempEndBRX = $endX - $h;\n $tempEndBRY = $endY -$k;\n*/\n //Start Top Left Point - Rotate shape\n $rotatedStartTLX = $tempStartTLX*cos($r) - $tempStartTLY*sin($r);\n $rotatedStartTLY = $tempStartTLX*sin($r) + $tempStartTLY*cos($r);\n //Start Top Right Point;\n $rotatedStartTRX = $tempStartTRX*cos($r) - $tempStartTRY*sin($r);\n $rotatedStartTRY = $tempStartTRX*sin($r) + $tempStartTRY*cos($r);\n //Start Bottom Right Point\n $rotatedStartBRX = $tempEndBRX*cos($r) - $tempEndBRY*sin($r);\n $rotatedStartBRY = $tempEndBRX*sin($r) + $tempEndBRY*cos($r);\n //Start Bootom Left Point\n $rotatedStartBLX = $tempStartBLX*cos($r) - $tempStartBLY*sin($r);\n $rotatedStartBLY = $tempStartBLX*sin($r) + $tempStartBLY*cos($r);\n\n\n //Start Top Left Point + Move To old location\n $rotatedStartTLX= $rotatedStartTLX+ $h;\n $rotatedStartTLY = $rotatedStartTLY+ $k;\n $coordinates = array($rotatedStartTLX,$rotatedStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedStartTRX= $rotatedStartTRX+ $h;\n $rotatedStartTRY = $rotatedStartTRY+ $k;\n $coordinates = array($rotatedStartTRX,$rotatedStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedStartBRX = $rotatedStartBRX + $h;\n $rotatedStartBRY = $rotatedStartBRY +$k;\n $coordinates = array($rotatedStartBRX,$rotatedStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedStartBLX= $rotatedStartBLX+ $h;\n $rotatedStartBLY = $rotatedStartBLY+ $k;\n $coordinates = array($rotatedStartBLX,$rotatedStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n \n //LHS Rectangle\n //Start Top Left Point - Move To Origin\n $temprectLHSStartTLx = $rectLHSStartx-$h;\n $temprectLHSStartTLy = $rectLHSStarty-$k;\n //Start Top Right Point;\n $temprectLHSStartTRx = $rectLHSEndx-$h;\n $temprectLHSStartTRy = $rectLHSStarty-$k;\n //Start Bottom Left Point\n $temprectLHSStartBLx = $rectLHSStartx-$h;\n $temprectLHSStartBLy = $rectLHSEndy-$k;\n //Start Bottom Right Point\n $temprectLHSEndBRx = $rectLHSEndx - $h;\n $temprectLHSEndBRy = $rectLHSEndy-$k;\n\n //Start Top Left Point - Rotate shape\n $rotatedLHSStartTLX = $temprectLHSStartTLx*cos($r) - $temprectLHSStartTLy*sin($r);\n $rotatedLHSStartTLY = $temprectLHSStartTLx*sin($r) + $temprectLHSStartTLy*cos($r);\n //Start Top Right Point;\n $rotatedLHSStartTRX = $temprectLHSStartTRx*cos($r) - $temprectLHSStartTRy*sin($r);\n $rotatedLHSStartTRY = $temprectLHSStartTRx*sin($r) + $temprectLHSStartTRy*cos($r);\n //Start Bottom Right Point\n $rotatedLHSStartBRX = $temprectLHSEndBRx*cos($r) - $temprectLHSEndBRy*sin($r);\n $rotatedLHSStartBRY = $temprectLHSEndBRx*sin($r) + $temprectLHSEndBRy*cos($r);\n //Start Bootom Left Point\n $rotatedLHSStartBLX = $temprectLHSStartBLx*cos($r) - $temprectLHSStartBLy*sin($r);\n $rotatedLHSStartBLY = $temprectLHSStartBLx*sin($r) + $temprectLHSStartBLy*cos($r);\n\n //Start Top Left Point + Move To old location\n $rotatedLHSStartTLX= $rotatedLHSStartTLX+ $h;\n $rotatedLHSStartTLY = $rotatedLHSStartTLY+ $k;\n $coordinates = array($rotatedLHSStartTLX,$rotatedLHSStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedLHSStartTRX= $rotatedLHSStartTRX+ $h;\n $rotatedLHSStartTRY = $rotatedLHSStartTRY+ $k;\n $coordinates = array($rotatedLHSStartTRX,$rotatedLHSStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedLHSStartBRX = $rotatedLHSStartBRX + $h;\n $rotatedLHSStartBRY = $rotatedLHSStartBRY +$k;\n $coordinates = array($rotatedLHSStartBRX,$rotatedLHSStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedLHSStartBLX= $rotatedLHSStartBLX+ $h;\n $rotatedLHSStartBLY = $rotatedLHSStartBLY+ $k;\n $coordinates = array($rotatedLHSStartBLX,$rotatedLHSStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n\n //RHS Rectangle\n //Start Top Left Point - Move To Origin\n $temprectRHSStartTLx = $rectRHSStartx-$h;\n $temprectRHSStartTLy = $rectRHSStarty-$k;\n //Start Top Right Point;\n $temprectRHSStartTRx = $rectRHSEndx-$h;\n $temprectRHSStartTRy = $rectRHSStarty-$k;\n //Start Bottom Left Point\n $temprectRHSStartBLx = $rectRHSStartx-$h;\n $temprectRHSStartBLy = $rectRHSEndy-$k;\n //Start Bottom Right Point\n $temprectRHSEndBRx = $rectRHSEndx - $h;\n $temprectRHSEndBRy = $rectRHSEndy-$k;\n\n //Start Top Left Point - Rotate shape\n $rotatedRHSStartTLX = $temprectRHSStartTLx*cos($r) - $temprectRHSStartTLy*sin($r);\n $rotatedRHSStartTLY = $temprectRHSStartTLx*sin($r) + $temprectRHSStartTLy*cos($r);\n //Start Top Right Point;\n $rotatedRHSStartTRX = $temprectRHSStartTRx*cos($r) - $temprectRHSStartTRy*sin($r);\n $rotatedRHSStartTRY = $temprectRHSStartTRx*sin($r) + $temprectRHSStartTRy*cos($r);\n //Start Bootom Left Point\n $rotatedRHSStartBLX = $temprectRHSStartBLx*cos($r) - $temprectRHSStartBLy*sin($r);\n $rotatedRHSStartBLY = $temprectRHSStartBLx*sin($r) + $temprectRHSStartBLy*cos($r);\n //Start Bottom Right Point\n $rotatedRHSStartBRX = $temprectRHSEndBRx*cos($r) - $temprectRHSEndBRy*sin($r);\n $rotatedRHSStartBRY = $temprectRHSEndBRx*sin($r) + $temprectRHSEndBRy*cos($r);\n\n //Start Top Left Point + Move To old location\n $rotatedRHSStartTLX= $rotatedRHSStartTLX+ $h;\n $rotatedRHSStartTLY = $rotatedRHSStartTLY+ $k;\n $coordinates = array($rotatedRHSStartTLX,$rotatedRHSStartTLY);\n array_push($coordinatesArr,$coordinates);\n //Start Top Right Point;\n $rotatedRHSStartTRX= $rotatedRHSStartTRX+ $h;\n $rotatedRHSStartTRY = $rotatedRHSStartTRY+ $k;\n $coordinates = array($rotatedRHSStartTRX,$rotatedRHSStartTRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bottom Right Point\n $rotatedRHSStartBRX = $rotatedRHSStartBRX + $h;\n $rotatedRHSStartBRY = $rotatedRHSStartBRY +$k;\n $coordinates = array($rotatedRHSStartBRX,$rotatedRHSStartBRY);\n array_push($coordinatesArr,$coordinates);\n //Start Bootom Left Point\n $rotatedRHSStartBLX= $rotatedRHSStartBLX+ $h;\n $rotatedRHSStartBLY = $rotatedRHSStartBLY+ $k;\n $coordinates = array($rotatedRHSStartBLX,$rotatedRHSStartBLY);\n array_push($coordinatesArr,$coordinates);\n\n //headsize width=10 height=12\n /*echo \"Your rotation is \".$r.\"|||\".$h.\"||\".$k.\"||\";\n echo $startX.\" k \".$startY.\" k \".$endX.\" k \".$endY.\" k \".$rotation.\"||||\";\n\n foreach($coordinatesArr as $test){\n echo \"coord\".$test[0];\n echo \"coord\".$test[1];\n }*/\n\n return $coordinatesArr;\n}", "function matrixRotation($matrix, $r) {\n for($i = 0; $i < (min(count($matrix), count($matrix[0])) / 2); $i++)\n {\n $layerLength = getLayerLength($matrix, $i);\n $matrix = rotateLayer($matrix, $i, $r % $layerLength);\n }\n\n return $matrix;\n}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function rotation($direction)\n\t{\n \n $direction = strtoupper($direction);\n\n $data[\"queen\"]= $this->queen_model->get_queen();\n if($data['queen']==null) {\n //error_no_queen_yet : 405\n $this->respond_errors(\"error no queen yet\",405);\n return;\n }\n $queen=$this->queen_model->mapper($data['queen']);\n\n $errors=$queen->rotate($direction);\n\n if (sizeof($errors)>0){\n //error_bad_direction_value :1\n $this->respond_errors($errors,100);\n\n }else{\n $this->queen_model->update_queen_facing($queen);\n $this->respond($queen,200);\n \n }\n\n }", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "function MoveWheels(){\n echo \"Wheels rotate. <br>\";\n $this->wheels = 10;\n }", "public function rotate($degrees);", "function rotate($arr,$x_dat,$t_dat,$path,$direction,$halfTree,$frame_delay,$sparkles,$window_degrees,$username,$sequence_duration){\n\t\t// now rotate image that we just made, dat file is $x_dat\n\t\t$x_arr=read_file($x_dat,$path); // target megatree 32 strands, all 32 being used. read data into an array\n\t\t$minStrand =$arr[0]; // lowest strand seen on target\n\t\t$minPixel =$arr[1]; // lowest pixel seen on skeleton\n\t\t$maxStrand =$arr[2]; // highest strand seen on target\n\t\t$maxPixel =$arr[3]; // maximum pixel number found when reading the skeleton target\n\t\t$maxI =$arr[4]; // maximum number of pixels in target\n\t\t$tree_rgb =$arr[5];\n\t\t$tree_xyz =$arr[6];\n\t\t$file =$arr[7];\n\t\t$min_max =$arr[8];\n\t\t$tree_user_string_pixel =$arr[9];\n\t\t$file = $arr[7];\n\t\t//\tdefine the front half of the megatree. strand=1 is center of tree facing street\n\t\t//\tget a window of the strands that shoudl be shown.\n\t\t//\tif window=360 degrees, then we show all\n\t\t//\t180 drgrees we only show strands that are +/- 90 degrees each side of strand 1\n\t\t//\n\t\t$window_array=getWindowArray($minStrand,$maxStrand,$window_degrees);\n\t\tfor($l=1;$l<=$maxStrand;$l++){\n\t\t\t$lxxx = substr($l+1000,1,3);\n\t\t\t$tokens=explode(\".\",$t_dat);\n\t\t\t$base=$tokens[0];\n\t\t\t$dat_file = $path . \"/\" . $base . \"_r_$lxxx\" . \".dat\"; // for spirals we will use a dat filename starting \"S_\" and the tree model\n\t\t\t$dat_file_array[]=$dat_file;\n\t\t\t$fh_dat = fopen($dat_file, 'w') or die(\"can't open file\");\n\t\t\tfwrite($fh_dat,\"# $dat_file\\n\");\n\t\t\t$full_path = $path . \"/\" . $x_dat;\n\t\t\t$fh = fopen($full_path, 'r') or die(\"can't open file $full_path\");\n\t\t\t$i=0;\n\t\t\tfor($s=1;$s<=$maxStramd;$s++)\t\t\t$amperage[$l][$s]=0; // we calcultare amperage for each strand.\n\t\t\twhile(!feof($fh)){\n\t\t\t\t$line = fgets($fh);\n\t\t\t\t$tok=preg_split(\"/ +/\", $line);\n\t\t\t\t$cnt = count($tok);\n\t\t\t\tif($cnt<7) continue;\n\t\t\t\t$device=$tok[0];\t// 0 device name\n\t\t\t\t$strand=$tok[1];\t// 1 strand#\n\t\t\t\t$pixel=$tok[2];// 2 pixel#\t\n\t\t\t\t$p=$pixel;\n\t\t\t\t$s=$strand;\n\t\t\t\t$x=$tok[3]; // 3 X value\n\t\t\t\t$y=$tok[4];\t// 4 Y value\n\t\t\t\t$z=$tok[5];\t// 5 Z value\n\t\t\t\tif(empty($tok[6]))\t\t\t\t$rgb_val=0;\n\t\t\t\telse\t\t\t$rgb_val=$tok[6];\n\t\t\t\tif($direction==\"ccw\")\t\t\t$new_s = $strand+$l; // CCW\n\t\t\t\telse\t\t\t$new_s = $strand-$l; // CW\n\t\t\t\tif($new_s>$maxStrand) $new_s = $new_s - $maxStrand;\n\t\t\t\tif($new_s<$minStrand) $new_s = $new_s + $maxStrand;\n\t\t\t\t$xyz=$tree_xyz[$new_s][$p];\n\t\t\t\tif($sparkles>0){\n\t\t\t\t\tif($sparkles>100) $sparkles=100;\n\t\t\t\t\t$rnd=rand(1,100);\n\t\t\t\t\tif($rnd<$sparkles){\n\t\t\t\t\t\t$r=$g=$b=255;\t\t\n\t\t\t\t\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t\t\t\t\t$H=$HSL['H']; \n\t\t\t\t\t\t$S=$HSL['S']; \n\t\t\t\t\t\t$V=$HSL['V']; \n\t\t\t\t\t\t$rgb_val=HSV_TO_RGB ($H, $S, $V);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(in_array($new_s,$window_array)){\n\t\t\t\t\t$tree_rgb[$new_s][$p]=$rgb_val;\n\t\t\t\t\t//\t\tfwrite($fh_dat,sprintf (\"t1 %4d %4d %9.3f %9.3f %9.3f %d # %4d %4d %9.3f %9.3f %9.3f\\n\",$new_s,$p,$xyz[0],$xyz[1],$xyz[2],$rgb_val,$strand,$pixel,$x,$y,$z));\n\t\t\t\t\t//\n\t\t\t\t\t// get the VALUE of the rgb value, this tells how intense the LED is turned on\n\t\t\t\t\t$r = ($rgb_val >> 16) & 0xFF;\n\t\t\t\t\t$g = ($rgb_val >> 8) & 0xFF;\n\t\t\t\t\t$b = $rgb_val & 0xFF;\n\t\t\t\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t\t\t\t$H=$HSL['H']; \n\t\t\t\t\t$S=$HSL['S']; // Saturation. 1.0 = Full on, 0=off\n\t\t\t\t\t$V=$HSL['V']; \n\t\t\t\t\tif($rgb_val>0){\n\t\t\t\t\t\t$amperage[$l][$new_s] += $V*0.060; // assume 29ma for pixels tobe full on\n\t\t\t\t\t\t//printf ( \"<pre>S,p=%d,%d rgb=%d,%d,%d HSV=%f,%f,%f amperage=%f</PRE>\\n\", $s,$p,$r,$g,$b,$H,$S,$V,$amperage);\n\t\t\t\t\t\tfwrite($fh_dat,sprintf (\"t1 %4d %4d %9.3f %9.3f %9.3f %d\\n\",$s,$p,$xyz[0],$xyz[1],$xyz[2],$rgb_val));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($fh); // x_dat\n\t\tfclose($fh_dat); // dat_file\n\t\t$base_t_dat=$t_dat;\n\t\t//show_elapsed_time($script_start,\"Finished Rotate image about Z axis\");\n\t\t// make_rotate_gp($path,$base_t_dat,$x_dat,$height,$dat_file_array);\n\t\tmake_gp($batch,$path,$x_dat,$t_dat,$dat_file_array,$min_max,$username,$frame_delay,$amperage,$sequence_duration,$show_frame);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "public function rotate(?callable $copy = null): void;", "public function rotation($value) {\n return $this->setProperty('rotation', $value);\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "abstract public function spin(): array;", "public function rotate($index){\n if($this->game->get_current_turn()==$this->game->getPlayer1()){\n $this->game->getPlayer1()->ReturnStock()[$index]->Rotate();\n }else{\n $this->game->getPlayer2()->ReturnStock()[$index]->Rotate();\n }\n }", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "function create() {\n Comparrot::create();\n}", "public function turnRight();", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "public function turnWheel() {\n\n $this->setGumballs($this->getGumballs() - 1);\n }", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "public function __construct($rotation)\n {\n $this->rotation = $rotation;\n }", "function execTurn($desiredAngle)\n{\n log1(\"Executing execTurn\");\n return evaluateOutput(execute(BACKEND_SCRIPT. ' -turn ' .$desiredAngle));\n}", "public function spin()\n\t{\n\t\t$this->number = $this->generate_random_number(self::MIN_WHEEL_NUMBER, self::MAX_WHEEL_NUMBER);\n\n\t\t$this->color = $this->find_number_color($this->number);\n\t}", "Function rotate($data, $length, $steps){\n$index=0;\n $result=array();\n for($i=$steps+1;$i<$length;$i++){\n $result[$index]=$data[$i];\n $index++;\n }\n for ($i=0;$i<=$steps;$i++){\n $result[$index]=$data[$i];\n $index++;\n }\n return $result;\n}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "public function turn()\n {\n }", "function rotation($angle)\n\t{\n\t\t$this->rotation = $angle;\n\t\treturn $this;\n\t}", "function run();", "function run();", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "public function setRotation(array $value)\n {\n $this->rotation = self::mutateToPgArray($value);\n }", "public function landscape() {\n\t}", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "function orbit()\n{\n\n}", "public function rotate($angle) {\n\t\t$this->angle = $angle;\n\t\tparent::rotate($angle);\n\t}", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "function rotationInArray($array, $a, $b){\n $c = 0;\n $c = $array[$a];\n $array[$a] = $array[$b];\n $array[$b] = $c;\n return $array;\n}", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "private function advance(): void\n {\n if ($this->rotors[1]->isNotchOpen()) {\n $this->rotors[2]->advance();\n $this->rotors[1]->advance();\n }\n if ($this->rotors[0]->isNotchOpen()) {\n $this->rotors[1]->advance();\n }\n $this->rotors[0]->advance();\n }", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedText($x,$y,$txt,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "function RotatedText($x, $y, $txt, $angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Text($x,$y,$txt);\n $this->Rotate(0);\n}", "public function rotate($steps)\n {\n $cmd = 'sudo python '. __DIR__ . '/python/stepper.py ' . $steps;\n $this->process->setCommandLine($cmd);\n $this->process->run();\n\n if (!$this->process->isSuccessful()) {\n throw new \\RuntimeException($this->process->getErrorOutput());\n }\n\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "function RotatedText($x, $y, $txt, $angle){\r $this->Rotate($angle,$x,$y);\r $this->Text($x,$y,$txt);\r $this->Rotate(0);\r }", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "function run()\r\n {\r\n }", "function rotarMatriz($numeroFilas, $numeroColumnas, $matrizInicial) \n{ \n global $filasMatriz, $columnasMatriz; \n $fila = 0; \n $columna = 0; \n $siguienteFilaElementoPrimero = 0; \n $filaActual = 0; \n \n /* \n row - Staring row index \n m - ending row index \n col - starting column index \n n - ending column index \n i - iterator \n */\n while ($fila < $numeroFilas && $columna < $numeroColumnas) \n { \n \n if ($fila + 1 == $numeroFilas || \n $columna + 1 == $numeroColumnas) \n break; \n \n // Store the first element \n // of next row, this element \n // will replace first element \n // of current row \n $siguienteFilaElementoPrimero = $matrizInicial[$fila + 1][$columna]; \n \n /* Move elements of first row \n from the remaining rows */\n for ($i = $columna; $i < $numeroColumnas; $i++) \n { \n $filaActual = $matrizInicial[$fila][$i]; \n $matrizInicial[$fila][$i] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n $fila++; \n \n /* Move elements of last column \n from the remaining columns */\n for ($i = $fila; $i < $numeroFilas; $i++) \n { \n $filaActual = $matrizInicial[$i][$numeroColumnas - 1]; \n $matrizInicial[$i][$numeroColumnas - 1] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n $numeroColumnas--; \n \n /* Move elements of last row \n from the remaining rows */\n if ($fila < $numeroFilas) \n { \n for ($i = $numeroColumnas - 1; \n $i >= $columna; $i--) \n { \n $filaActual = $matrizInicial[$numeroFilas - 1][$i]; \n $matrizInicial[$numeroFilas - 1][$i] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n } \n $numeroFilas--; \n \n /* Move elements of first column \n from the remaining rows */\n if ($columna < $numeroColumnas) \n { \n for ($i = $numeroFilas - 1; \n $i >= $fila; $i--) \n { \n $filaActual = $matrizInicial[$i][$columna]; \n $matrizInicial[$i][$columna] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n } \n $columna++; \n } \n \n // Print rotated matrix\n echo \"<pre>\"; \n for ($i = 0; $i < $filasMatriz; $i++) \n { \n for ($j = 0; $j < $columnasMatriz; $j++) \n {\n if($matrizInicial[$i][$j] < 10)\n {\n echo \" \". $matrizInicial[$i][$j]. \" \"; \n } else {\n if($matrizInicial[$i][$j] < 100) {\n echo \" \". $matrizInicial[$i][$j] . \" \"; \n } else {\n echo $matrizInicial[$i][$j] . \" \"; \n }\n }\n }\n echo \"<br>\"; \n }\n echo \"</pre>\";\n}", "function Rotate($x,$y) {\n if( $this->a == 0 || $this->a == 360 ) {\n return array($x + $this->transx, $y + $this->transy );\n }\n else {\n $x1=round($this->m[0][0]*$x + $this->m[0][1]*$y,1) + $this->m[0][2] + $this->transx;\n $y1=round($this->m[1][0]*$x + $this->m[1][1]*$y,1) + $this->m[1][2] + $this->transy;\n return array($x1,$y1);\n }\n }", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function normalizeRotation($rotation, \\SetaPDF_Core_DataStructure_Rectangle $box) {}", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function normalizeRotationAndOrigin($rotation, \\SetaPDF_Core_DataStructure_Rectangle $box) {}", "public function rotateRight(): Orientation\n {\n return new South();\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function RotatedText($x, $y, $txt, $angle)\r\r\n{\r\r\n\t$this->Rotate($angle,$x,$y);\r\r\n\t$this->Text($x,$y,$txt);\r\r\n\t$this->Rotate(0);\r\r\n}", "function kramsannyaArray($array){\n if (count($array) % 2 != 0){\n echo $text = \"<br> F..U <br>\";\n $array[] = count($array);\n };\n vievRandomArray($array);\n for ($x = 0; $x < count($array) / 2; $x++){\n $array = rotationInArray($array, count($array) / 2 - $x -1, count($array) / 2 + $x);\n }\n return $array;\n}", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "public function roll(): void\n {\n $this->lastRoll = rand(1, $this->numSides);\n }", "function rotate(array &$items)\r\n{\r\n $itemCount = count($items);\r\n if($itemCount < 3) {\r\n return;\r\n }\r\n $lastIndex = $itemCount - 1;\r\n $factor = (int) ($itemCount % 2 === 0 ? $itemCount / 2 : ($itemCount / 2) + 1);\r\n $topRightIndex = $factor - 1;\r\n $topRightItem = $items[$topRightIndex];\r\n $bottomLeftIndex = $factor;\r\n $bottomLeftItem = $items[$bottomLeftIndex];\r\n for($i = $topRightIndex; $i > 0; $i -= 1) {\r\n $items[$i] = $items[$i - 1];\r\n }\r\n for($i = $bottomLeftIndex; $i < $lastIndex; $i += 1) {\r\n $items[$i] = $items[$i + 1];\r\n }\r\n $items[1] = $bottomLeftItem;\r\n $items[$lastIndex] = $topRightItem;\r\n}", "function rotate(array &$items)\r\n{\r\n $itemCount = count($items);\r\n if($itemCount < 3) {\r\n return;\r\n }\r\n $lastIndex = $itemCount - 1;\r\n $factor = (int) ($itemCount % 2 === 0 ? $itemCount / 2 : ($itemCount / 2) + 1);\r\n $topRightIndex = $factor - 1;\r\n $topRightItem = $items[$topRightIndex];\r\n $bottomLeftIndex = $factor;\r\n $bottomLeftItem = $items[$bottomLeftIndex];\r\n for($i = $topRightIndex; $i > 0; $i -= 1) {\r\n $items[$i] = $items[$i - 1];\r\n }\r\n for($i = $bottomLeftIndex; $i < $lastIndex; $i += 1) {\r\n $items[$i] = $items[$i + 1];\r\n }\r\n $items[1] = $bottomLeftItem;\r\n $items[$lastIndex] = $topRightItem;\r\n}", "abstract public function flip();", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "public function testPreprocessingUnrotate()\n {\n }", "function rotativeMatrix($phi,$tetha,$psi)\n{\n $phi2=deg2rad($phi);\n $tetha2=deg2rad($tetha);\n $psi2=deg2rad($psi);\n $r11=(cos($psi2)*cos($tetha2)*cos($phi2))-(sin($psi2)*sin($phi2));\n $r12=(-cos($psi2)*cos($tetha2)*sin($phi2))-(sin($psi2)*sin($phi2));\n $r13=cos($psi2)*sin($tetha2);\n $r21=(sin($psi2)*cos($tetha2)*cos($phi2))+(cos($psi2)*sin($phi2));\n $r22=(-sin($psi2)*cos($tetha2)*sin($phi2))+(cos($psi2)*cos($phi2));\n $r23=sin($psi2)*sin($tetha2);\n $r31=-sin($tetha2)*cos($phi2);\n $r32=sin($tetha2)*sin($phi2);\n $r33=cos($tetha2);\n return [$r11,$r12,$r13,$r21,$r22,$r23,$r31,$r32,$r33];\n}", "public function makeVerticalRotation() {\n\t\t$this->addMakeVerticalRotationJs = true;\n\n\t\treturn $this;\n\t}", "public function rot()\n {\n $this->status = APPLE_DECAYED;\n $this->color = APPLE_DECAYED_COLOR;\n\n return $this->save();\n }", "function _rotate_image_resource($img, $angle)\n {\n }", "public static function flip_iamge(){\n\n}", "public function setRotateControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof RotateControl)) {\n $this->rotateControl = $args[0];\n $this->mapOptions['rotateControl'] = true;\n } elseif (isset($args[0]) && is_string($args[0])) {\n if ($this->rotateControl === null) {\n $this->rotateControl = new RotateControl();\n }\n\n $this->rotateControl->setControlPosition($args[0]);\n $this->mapOptions['rotateControl'] = true;\n } elseif (!isset($args[0])) {\n $this->rotateControl = null;\n\n if (isset($this->mapOptions['rotateControl'])) {\n unset($this->mapOptions['rotateControl']);\n }\n } else {\n throw MapException::invalidRotateControl();\n }\n }", "public function run()\n {\n Model::unguard();\n\n //$this->call(TracuuFaker::class);\n //$this->call(SanphamFaker::class);\n //$this->call(DeliveryFaker::class);\n $this->call(updateImages::class);\n\n Model::reguard();\n }", "public function flip(): self;", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }" ]
[ "0.70802075", "0.6964867", "0.67434204", "0.6566614", "0.64377826", "0.6317348", "0.6231812", "0.61665076", "0.6034561", "0.60315335", "0.59111595", "0.58517414", "0.58454657", "0.5844273", "0.58268905", "0.58268905", "0.58208203", "0.57345927", "0.57217675", "0.57217675", "0.57217675", "0.56073755", "0.5579621", "0.5526071", "0.5515921", "0.5511018", "0.55069214", "0.5500498", "0.5498483", "0.5445557", "0.5444222", "0.5409758", "0.5409758", "0.53970397", "0.53640497", "0.5339331", "0.5288578", "0.5280496", "0.52343", "0.5230966", "0.5227306", "0.52266496", "0.5189362", "0.5174218", "0.51738024", "0.51610047", "0.51591724", "0.5158808", "0.5143086", "0.51073617", "0.5085324", "0.50766677", "0.50426686", "0.5021353", "0.5021353", "0.5021169", "0.49961725", "0.49891746", "0.498323", "0.497968", "0.497243", "0.4961362", "0.49414447", "0.49072775", "0.49041447", "0.4893078", "0.4893078", "0.48352942", "0.48350075", "0.48334602", "0.48283836", "0.48243687", "0.48218253", "0.47942936", "0.47911447", "0.47490203", "0.47372603", "0.47316968", "0.47135705", "0.4698818", "0.46927562", "0.46901506", "0.4678743", "0.46782598", "0.4671512", "0.4657464", "0.4657464", "0.46474952", "0.46458608", "0.4644569", "0.46433237", "0.4640744", "0.46319482", "0.46284258", "0.46214277", "0.46169224", "0.46113154", "0.46056986", "0.4605664", "0.46019617", "0.45954084" ]
0.0
-1
Get the group and check for validity / authorization
protected function SetupPanel() { $this->objGroup = Group::Load($this->strUrlHashArgument); if (!$this->objGroup) return $this->ReturnTo('#groups'); if (!$this->objGroup->IsLoginCanView(QApplication::$Login)) return $this->ReturnTo('#groups'); $this->objDelegate = new EditGroupParticipationDelegate($this, '#groups'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsergroup() {}", "private function validateGroup(){\n\n\t global $db;\n\t \n\t #see if this is a guest, if so, do some hard-coded checks.\n\t\tif($this->user == \"guest\"){\n\t\t if(($this->user == \"guest\") and ($this->gid == 0)){\n\t\t return(true);\n\t\t }else{\n\t\t return(false);\n\t\t }\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT id FROM ebb_groups WHERE id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$validateGroup = $db->affectedRows();\n\n\t\t\tif($validateGroup == 1){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}", "protected function GetGroup() {\r\n\t\t\treturn $this->group;\r\n\t\t}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup()\n {\n $this->getParam('group');\n }", "private function setGroup() {\n if (Request::has(\"include-group-read\") && Request::input(\"include-group-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-group-write\") && Request::input(\"include-group-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-group-execute\") && Request::input(\"include-group-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function findGroupId($group) {\r\n\t\t\r\n\t\t$group = strtolower(preg_replace('/[^\\w\\-]/','', $group));\r\n\t\t\r\n\t\tGLOBAL $wgYammerCacheDir;\r\n\t\t\r\n\t\t# Authentication tests\r\n\t\tif(!$this->isOAuthAuthenticated()) {\r\n\t\t\treturn $this->performAuth();\r\n\t\t}\r\n\t\tif(empty($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please specify <code>$wgYammerCacheDir</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\tif(!is_dir($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please make sure that <code>$wgYammerCacheDir</code> as defined in your LocalSettings.php exists and is a directory. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# Try and see if the id is available in cache\r\n\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($group). '.txt';\r\n\t\tif(is_file($file)) {\r\n\t\t\treturn file_get_contents($file);\r\n\t\t}\r\n\t\t\r\n\t\t# Cache miss, we are going to process the groups list until the group is found\r\n\t\t\r\n\t\t$letter = strtolower(substr($group, 0, 1));\r\n\t\t$page = 0;\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\t$url = sprintf(self::YAMMER_URI_GROUPS_BY_LETTER, $letter, $page);\r\n\t\t\t$body = $this->signedRequest($url);\r\n\t\t\t\r\n\t\t\t# Make sure there are groups in the response\r\n\t\t\tif(false === stripos($body, '<id>')) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t# Try and parse the groups. \r\n\t\t\tif(!preg_match_all('#<response>(.*?)</response>#ims', $body, $m)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Process each group\r\n\t\t\tforeach($m[1] as $responseBody) {\r\n\t\t\t\t# Fetch group name and group id\r\n\t\t\t\t$name = preg_match('#<name>(.*?)</name>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t$id = preg_match('#<id>(.*?)</id>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t\r\n\t\t\t\t# Skip this response if either name or id is empty\r\n\t\t\t\tif(empty($name) || empty($id)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# Create a cache file with the group id\r\n\t\t\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($name).'.txt';\r\n\t\t\t\tif(!is_file($file)) {\r\n\t\t\t\t\t$f = fopen($file, 'w');\r\n\t\t\t\t\tfwrite($f, $id);\r\n\t\t\t\t\tfclose($f);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# We found the correct group\r\n\t\t\t\tif($name == strtolower($group)) {\r\n\t\t\t\t\treturn $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Increase page number\r\n\t\t\t$page++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Group with name \"'.$group.'\" was not found');\r\n\t}", "function MyMod_Data_Group_Actual_Get()\n {\n $this->PostInitItems();\n\n if (!empty($this->CurrentDataGroup))\n {\n $group=$this->CurrentDataGroup;\n }\n else\n {\n $group=$this->GetCGIVarValue($this->GroupDataCGIVar());\n }\n\n $groups=$this->MyMod_Data_Group_Defs_Get();\n if (!preg_grep('/^'.$group.'$/',array_keys($groups)))\n {\n $group=\"\";\n }\n\n if (\n empty($group)\n ||\n !$this->MyMod_Item_Group_Allowed($groups[ $group ])\n )\n {\n //No group found (or group found was not allowed)\n //Localize first allowed data group\n foreach ($groups as $rgroup => $groupdef)\n {\n if ($this->MyMod_Item_Group_Allowed($groups[ $rgroup ]))\n {\n $group=$rgroup;\n break;\n }\n }\n }\n\n return $group;\n }", "function get_group($group_url_name) {\n error_reporting(0);\n \t$api_key = $this->options->get('api_key');\n\t \n \tif (!$api_key || !$group_url_name)\n \t return FALSE;\n\t\n $this->mu_api = new MeetupAPIBase($api_key, 'groups');\n $this->mu_api->setQuery( array('group_urlname' => $group_url_name) ); \n set_time_limit(0);\n $this->mu_api->setPageSize(200);\n \t$this->mu_api->setFormat('json-alt');\n\t\n $group_info = $this->mu_api->getResponse();\n\t\n return (count($group_info->results) > 0) ? $group_info->results[0] : FALSE;\n \n }", "function user_getgroup()\n\t{\n\t\t$id = $this->user_getid();\n\t\t$perms = $this->DB->database_select('users', 'gid', array('uid' => $id), 1);\n\t\treturn ($perms === false) ? false : $perms['gid'];\n\t}", "public function getGroup();", "public function getGroup();", "public function getGroup();", "function get_member_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'), array(\n\t\t\t'select' => array()\n\t\t));\n\t\t\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_member_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_member_group($vars['group_id'], $vars['select'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_member_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "public function postGroup()\n {\n $group = $this->em->newEntity( 'friends\\model\\Group' );\n $loadable = $this->role->applyLoadable( $group );\n $loadable->loadData();\n if( $loadable->validate() )\n {\n $active = $this->role->applyActive( $group );\n $active->save();\n $jump = $this->view->get( 'appUrl' ) . 'group';\n header( 'Location: ' . $jump );\n exit;\n }\n return $this->getGroup();\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function groupExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$search = FormUtil::getPassedValue('group', null, 'GETPOST');\n\t\t$return = false;\n\t\tif($search == 'admin') {\n\t\t\t$return = true;\n\t\t} else {\n\t\t\tif($search != '') {\n\t\t\t\t$where = 'name = \\'' . mysql_escape_string($search) . '\\'';\n\t\t\t} else {\n\t\t\t\t$where = '';\n\t\t\t}\n\t\t\t$offset = (integer)FormUtil::getPassedValue('offset', -1);\n\t\t\tif($offset == null) {\n\t\t\t\t$offset = -1;\n\t\t\t}\n\t\t\t$limit = (integer)FormUtil::getPassedValue('limit', -1);\n\t\t\tif($limit == null) {\n\t\t\t\t$limit = -1;\n\t\t\t}\n\n\t\t\t$groups = UserUtil::getGroups($where, 'name', $offset, $limit);\n\n\t\t\tif(count($groups) >= 1) {\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "function checkBluegroup($group=null){\n if ($group) {\n// define('IIP_AUTH_GROUP', trim($group));\n // check for group cached response\n// if (! in_array($group, $GLOBALS['ltcuser']['groups'])) {\n // search bluegroups\n $result = $this->group_auth($GLOBALS['ltcuser']['dn'], $group);\n if (defined('IIP_AUTH_ERRNO') && IIP_AUTH_ERRNO == 3) {\n $this->_do_ldap_error();\n }\n \n // check for an auth failure and bail\n if (! $result) {\n $this->_do_auth_error();\n }\n \n // cache the results in session\n $GLOBALS['ltcuser']['groups'][] = $group;\n $_SESSION['ltcuser'] = $GLOBALS['ltcuser'];\n }\n }", "public function getGroup() {\n return $this->group;\n }", "function isAdminOfThisGroup($groupId)\n{\n\t$_c_user_id = (isset($_COOKIE[$GLOBALS['c_id']]) ? $_COOKIE[$GLOBALS['c_id']] : 0);\n\n\tif ($_c_user_id != 0 && isUserLoggedIn($user_id)) {\n \n\t\t$db = new db_util();\n\n\t $sql = \"SELECT * \n\t FROM vm_group \n\t WHERE v_group_leader_id='$_c_user_id' \n\t AND v_group_id = '$groupId'\";\n\n\t $result = $db->query($sql);\n\n\t if ($result !== false) {\n\t // if there any error in sql then it will false\n\t if ($result->num_rows > 0) {\n\t // if the sql execute successful then it give \n\t \n\t return true;\n\t }\n\t }\n }\n \n return false;\n}", "public function GetGroupDetails(){\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n $group_id = $_POST['group_id'];\n $authkey = $_POST['authkey'];\n $format = $_POST['format'];\n $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($group_id) && !empty($authkey)){\n $result = $res->CheckAuthentication('', $authkey, $conn);\n if($result!=false){\n $result=$res->get_group_details($group_id, $conn);\n }\n else{\n $error = array('status' => \"0\",\"msg\" => \"Not authorised to do this\");\n ($_REQUEST['format'] == 'xml') ? $this->response($this->xml($error), 200) : $this->response($this->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($this->json($error), 200);\n }\n }", "public static function get($group);", "function get_this_group($grp_id)\n{\n\t$db=new db_util();\n\t$query_string=\"SELECT * FROM vm_group WHERE v_group_id=$grp_id\";\n\t$result=$db->query($query_string);\n\treturn $result;\n}", "function &getGroup() {\n\t\treturn $this->Group;\n\t}", "function getGroup() ;", "public function getGroup()\n {\n return $this->_getVar('user_group');\n }", "function getGroup()\n {\n return Factory::create('group', $this->_gid);\n }", "public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }", "public function listgroup() { \n \n if (!is_null(auth()->guard('api')->user()->groups)){\n \n //$user->find(Auth::user()->id); \n $data = auth()->guard('api')->user()->groups->toArray();\n $response = [ \n 'success' => true, \n 'data' => $data, \n 'message' => 'Group retrieved successfully.' \n ]; \n return response()->json($response, 200);\n }\n else { \n return response()->json(['error' => 'Unauthorised'], 401); \n } \n }", "public function userInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$group = FormUtil::getPassedValue('group', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\tif($group == 'admin') {\n\t\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t\t$return = true;\n\t\t\t} else {\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t\t$return = false;\n\t\t\tforeach($groups as $item) {\n\t\t\t\t$itemgroup = UserUtil::getGroup($item);\n\t\t\t\tif($itemgroup['name'] == $group) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function checkGroup($pdo)\n{\n\tif(isset($_GET['group'])){// is there a group Cookie - otherwise he might be on the start page\n\t\t\n\t\t$get_group = $_GET['group'];\t\t\t\n\t\t$stmt = $pdo->prepare(\"SELECT groupname FROM dsa_groups WHERE hash=?\");\n\t\t$stmt->execute([$get_group]); \n\t\t$groupName = $stmt->fetch();\n\t\tif(isset($groupName[0])){\n\t\t\treturn($groupName[0]);\n\t\t}\n\t\t\n\t\telse //group name not found\t\t\n\t\t{\t\t\t\n\t\t\t?>\t\t\t\t\t\n\t\t\t\tRaum nicht gefunden\t\t\t\t\t\n\t\t\t<?php\n\t\t}\n\t\t\n\t} //no grp cookie found\n\telse \n\t{\n\t\treturn(false);\n\t}\n\t\t\t\n}", "function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public abstract function getGroup();", "public function hasGroup()\n {\n return $this->_has('_group');\n }", "private function getGroupID(){\n\n\t global $db;\n\t \n\t #set to 0, guest has no group setup.\n\t\tif($this->user == \"guest\"){\n\t\t $getGID = 0;\n\t\t return($getGID);\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT gid FROM ebb_group_users WHERE Username='\".$this->user.\"' AND Status='Active' LIMIT 1\";\n\t\t\t$getGID = $db->fetchResults();\n\n\t\t\treturn($getGID['gid']);\n\t\t}\n\t}", "function checkIfExistingGroup($chamber, $group) {\r\n $sql = $this->db->prepare(\"SELECT groupID FROM GROUPS WHERE name='$group' AND chamberID=$chamber\");\r\n if ($sql->execute()){\r\n if (!($sql->rowCount() == 0))\r\n return $sql->fetch(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }\r\n }", "public static function getGroup(){\n\t\treturn FW_DAO_UserGroup::getInstance();\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "function acf_get_valid_field_group( $field_group = false ) {\n\treturn acf_validate_field_group( $field_group );\n}", "public function getGroup()\n {\n $this->group = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->group = $this->temp_files[$this->path]->group;\n\n return;\n }", "public function getGroup(): GroupInterface;", "public function getGroup($groupId);", "private function validateGroupStatus(){\n\t\n\t global $db;\n\t \n\t #see if this is guest, if so, do some hard-coded checks.\n\t\tif($this->user == \"guest\"){\n\t\t if(($this->user == \"guest\") and ($this->gid == 0)){\n\t\t return(true);\n\t\t }else{\n\t\t return(false);\n\t\t }\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT gid FROM ebb_group_users WHERE Username='\".$this->user.\"' AND Status='Active' LIMIT 1\";\n\t\t\t$validateGroupStatus = $db->affectedRows();\n\n\t\t\tif($validateGroupStatus == 1){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}", "function DBDataFormDataGroup()\n {\n $groups=$this->GetPermittedDataGroups();\n\n $group=$this->CGI_GET(\"Group\");\n if (empty($group))\n {\n $group=array_keys($groups);\n $group=array_shift($group);\n }\n\n if (empty($groups[ $group ])) { $group=\"Basic\"; }\n\n return $group;\n }", "public static function getGroup($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_MANAGE_USERS));\n\n if($access) {\n\n /** @var array $groups */\n $group = self::$UserGroupService->getGroup(isset($param[1]) ? $param[1] : 0);\n\n //set data\n CoreApi::setData('group', $group);\n\n }else{\n\n CoreNotification::set('You are not authorized to view group', CoreNotification::ERROR);\n\n }\n }", "public function getGroup() {\n\t\tif (empty($this->group)) {\n\t\t\t$this->group = $this->groupsTable->findById($this->groupId);\n\t\t}\n\t\treturn $this->group;\n\t}", "public function procAuthGroup($ar=NULL) {\n $p=new XParam($ar,array());\n $login=$p->get('logingroup');\n $password = $p->get('passwordgroup');\n // recherche si ce login est dans le groupe des CE : il ne peut pas passer par le login std\n $ors=selectQueryGetAll('SELECT * FROM '.self::$tableGROUPS.' WHERE logingrp=\"'.addslashes($login).'\" and passwordgrp=\"'.md5($password).'\"');\n if (count($ors) != 1){\n XShell::setNextData('messagegroup', XLabels::getSysLabel('xsession.login_not_accepted'));\n XLogs::notice(get_class(), 'Rejet user groupe ');\n return false;\n }\n setSessionVar('EPL_GROUP', $ors[0]);\n return true;\n }", "private function getCSRContactGroup()\n\t{\n\t\tforeach ($this->getContactGroups() as $group) {\n\t\t\tif ($group->getName() === $this->groepNaam) {\n\t\t\t\treturn $group;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function acl_verify_access($group = false) {\n\t\t\n\t\t//debug($this->controller);\n\t\t\n\t\t\n\t\tif (!$group) {\n\t\t\t$username = $this->controller->Authsome->get('username');\n\t\t\t$group_name = $this->controller->Authsome->get($this->settings['group_model'].'.name');\n\t\t\t$group_id = $this->controller->Authsome->get($this->settings['group_model'].'.id');\n\t\t}\n\t\t\n\t\t$controller = $this->controller->params['controller'];\n\t\t$action = $this->controller->params['action'];\n\n\t\t//////////////////////////////////////////////////////////\n\t\t// Original SQL Query (sorts in order of precedence explained in header, gets first match)\n\t\t// Result is the most specific ACL rule.\n\t\t//\n\t\t// SELECT permission FROM auth_acls \n\t\t// WHERE auth_group_id IN ('1', '*') AND controller IN ('deployments', \"*\") AND action IN ('run', \"*\") \n\t\t// ORDER BY auth_group_id DESC, controller DESC, action DESC\n\t\t// LIMIT 1\n\t\t//////////////////////////////////////////////////////////\n\n\t\t$acl_model = ClassRegistry::init($this->settings['acl_model']);\n\n\t\t//////////////////////////////////////////////////////////\n\t\t// Special Debugging for ACL DB Data\n\t\t//\n\t\t$DEBUG_SQL = FALSE;\n\t\t\n\t\tif ($DEBUG_SQL) {\n\t\t\t$params_debug = array(\n\t\t\t\t// 'fields' => array('permission'), // <------- COMMENTED FOR DEBUG\n\t\t\t\t'conditions' => array('auth_group_id' => array($group_id, '*'),\n\t\t\t\t\t\t\t\t\t 'controller' => array($controller, '*'),\n\t\t\t\t\t\t\t\t\t 'action' => array($action, '*'),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t'order' => array('auth_group_id DESC', 'controller DESC', 'action DESC', 'permission ASC'),\n\t\t\t\t//'limit' => '1' // <------- COMMENTED FOR DEBUG\n\t\t\t);\n\t\t\t\n\t\t\t// DEBUG: SHOW FULL ACL MATCH SET (NOT JUST FIRST RESULT)\n\t\t\tdebug($acl_model->find('all', $params_debug));\n\t\t\texit();\n\t\t}\n\t\t//////////////////////////////////////////////////////////\n\n\t\t$params = array(\n\t\t\t'fields' => array('permission'),\n\t\t\t'conditions' => array('auth_group_id' => array($group_id, '*'),\n\t\t\t\t\t\t\t\t 'controller' => array($controller, '*'),\n\t\t\t\t\t\t\t\t 'action' => array($action, '*'),\n\t\t\t\t\t\t\t\t ),\n\t\t\t'order' => array('auth_group_id DESC', 'controller DESC', 'action DESC', 'permission ASC'),\n\t\t\t'limit' => '1'\n\t\t);\n\t\t\n\t\t// TESTING: SHOW FULL ACL MATCH SET\n\t\t$result = $acl_model->find('first', $params);\n\t\t$acl_model_name = $this->settings['acl_model'];\n\t\t\n\t\t// Permit if no ACL entry found\n\t\tif (empty($result[$acl_model_name]['permission'])) {\n\t\t\t$acl_permitted = true;\n\t\t\n\t\t} else if ($result[$acl_model_name]['permission'] == 'allow') {\n\t\t\t// Permit if ACL allowed\n\t\t\t$acl_permitted = true;\n\t\t} else {\n\t\t\t$acl_permitted = false;\n\t\t}\n\t\t\n\t\t// Return boolean value of whether user-group is permitted here.\n\t\treturn $acl_permitted;\n\t}", "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 }", "function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "function isMemberOfThisGroup($groupId)\n{\n\t$_c_user_id = (isset($_COOKIE[$GLOBALS['c_id']]) ? $_COOKIE[$GLOBALS['c_id']] : 0);\n\n\tif ($_c_user_id != 0 && isUserLoggedIn()) {\n \n\t\t$db = new db_util();\n\n\t $sql = \"SELECT * \n\t FROM vm_member_list \n\t WHERE vm_member_id='$_c_user_id' \n\t AND vm_group_id = '$groupId'\";\n\n\t $result = $db->query($sql);\n\n\t if ($result !== false) {\n\t // if there any error in sql then it will false\n\t if ($result->num_rows > 0) {\n\t // if the sql execute successful then it give \n\t \n\t return true;\n\t }\n\t }\n }\n \n return false;\n}", "private function getUserGroup(): int {\n return $this->core->getUser()->getGroup();\n }", "public static function group()\n {\n return static::$group;\n }", "public static function group()\n {\n return static::$group;\n }", "function get_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->get($id);\n\t}", "public function getGroup()\n\t{\n\t return $this->groupService->getGroup($this->ownerid);\n\t}", "function group()\r\n {\r\n $group = false;\r\n\r\n if ( $this->GroupID > 0 )\r\n {\r\n $group = new eZUserGroup( $this->GroupID );\r\n }\r\n\r\n return $group;\r\n }", "function acf_get_valid_field_group($field_group = \\false)\n{\n}", "function get_cur_group() {\n\t\tif (!isset($_SESSION['dfl_group'])) {\n\t\t\t// return comma-separated list of default groups from database\n\t\t\tlgi_mysql_fetch_session(\"SELECT GROUP_CONCAT(`name`) AS `dfl_group` FROM %t(usergroups) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' AND p.`dfl`=TRUE\", $this->userid);\n\t\t\t// maybe there were no groups defined and it is not specified in the certificate; then use username\n\t\t\t// TODO this will work only if usercerts.fixedgroups if TRUE, but I'm too lame to check that right now\n\t\t\tif (!isset($_SESSION['dfl_group']))\n\t\t\t\t$_SESSION['dfl_group'] = $this->userid;\n\t\t}\n\t\treturn $_SESSION['dfl_group'];\n\t}", "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 getGroups() {}", "public function getGroup(Trio_Wizard_Model_Wizard $wizard) {\n\t\tif ($wizard->getGroupId()) {\n\t\t\t$group = Mage::getModel('wizard/group')->load($wizard->getGroupId());\n\n\t\t\tif ($group->getId()) {\n\t\t\t\treturn $group;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function createGroup(Request $request) {\n $user = $request->get('auth');\n $group = (object) $request->input('group');\n $immunity = User::getImmunity($user->userId);\n\n Condition::precondition(empty($group->name), 400, 'A group needs to have a name!');\n Condition::precondition($group->immunity >= $immunity || $group->immunity < 0, 400, 'Immunity can only be 0 to');\n\n $nameIsUnique = Group::withName($group->name)->count('groupId') == 0;\n Condition::precondition(!$nameIsUnique, 400, 'Name needs to be unique');\n\n Condition::precondition($group->nameColor && !Value::validateHexColors([$group->nameColor]), 400, 'Invalid Hex Color!');\n $group->nameColor = json_encode([$group->nameColor]);\n\n $group->sitecpPermissions = $this->convertSitecpPermissions($user, $group, null);\n $group->staffPermissions = $this->convertStaffPermissions($user, $group, null);\n $group->options = $this->convertGroupOptions($group);\n\n $group = new Group(\n [\n 'name' => $group->name,\n 'nickname' => Value::objectProperty($group, 'nickname', ''),\n 'nameColor' => Value::objectProperty($group, 'nameColor', ''),\n 'userBarStyling' => Value::objectProperty($group, 'userBarStyling', ''),\n 'immunity' => $group->immunity,\n 'sitecpPermissions' => $group->sitecpPermissions,\n 'staffPermissions' => $group->staffPermissions,\n 'options' => $group->options,\n 'isPublic' => Value::objectProperty($group, 'isPublic', 0),\n 'avatarHeight' => Value::objectProperty($group, 'avatarHeight', 0),\n 'avatarWidth' => Value::objectProperty($group, 'avatarWidth', 0)\n ]\n );\n $group->save();\n\n Logger::sitecp($user->userId, $request->ip(), LogType::CREATED_GROUP, ['group' => $group->name], $group->groupId);\n return $this->getGroup($request, $group->groupId);\n }", "public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }", "function acf_validate_field_group( $field_group ) {\n\t\t\n\t\t// 5.5.6 - changed filter name\n\t\t$field_group = apply_filters('acf/get_valid_field_group', $field_group);\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field_group;\n\t\t\n\t}", "function buildGroup($group_name) {\n return check_plain($group_name);\n }", "function find_group($db, $group_id)\n{\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM groups WHERE id = :group_id;\",\n array(':group_id' => $group_id)\n )->fetchAll();\n if ($records) {\n // groups are unique, there should only be 1 record\n return $records[0];\n }\n return NULL;\n}", "public function group($group);", "function moderator()\r\n {\r\n $group = false;\r\n\r\n if ( $this->ModeratorID > 0 )\r\n {\r\n $group = new eZUserGroup( $this->ModeratorID );\r\n }\r\n\r\n return $group;\r\n }", "function find_by_groupName($val)\n {\n global $db;\n $sql = \"SELECT group_name FROM user_groups WHERE group_name = '{$db->escape($val)}' LIMIT 1 \";\n $result = $db->query($sql);\n return($db->num_rows($result) === 0 ? true : false);\n }", "public function getGroup() {\n $sql = \"SELECT * 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 $result = $resultado->fetch_array();\n return $result;\n }\n }", "public function get($_groupId)\n {\n $this->checkRight('VIEW_ACCOUNTS');\n \n $group = GroupbaseGroup::getInstance()->getGroupById($_groupId);\n\n return $group;\n }", "function &getGroup($name)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "private function _get_group_detail($tag_group_id){\n $param['tag_group_id'] = $tag_group_id;\n $param['delete_flg'] = $this->config->item('not_deleted','common_config');\n $record = $this->Logic_tag->get_group_detail($param);\n if(!empty($record[0])){\n return $record[0];\n }else{\n return false;\n }\n }", "function createAnEvent($group)\n{\n $dataerror = false; //no error\n if ($group != null) {\n //If the required informations exist and if they are valid:\n if (isset($group['name'], $group['password'], $group['visibility']) && chkLength($group['name'], 50) && $group['visibility'] > 0 && $group['visibility'] < 13) {\n if (isset($group['context'])) {\n if (chkLength($group['context'], 200) == false) {\n $dataerror = true;\n }\n }\n if (isset($group['description'])) {\n if (chkLength($group['description'], 200) == false) {\n $dataerror = true;\n }\n }\n $group['restrict_access'] = chkToTinyint($group['restrict_access']);\n\n //Check password for important action\n if (checkUserPassword($_SESSION['user']['id'], $group['password'])) {\n\n unset($group['password']); //unset for not include it in the creation of the group\n $group['status'] = \"Créé le \" . date(\"d M y\");\n $group['creator_id'] = $_SESSION['user']['id'];\n $group['creation_date'] = timeToDT(time());\n\n createGroup($group);\n flshmsg(16); //\"group well created\" msg\n groups(); //back to groups page\n } else {\n flshmsg(15); //password error for action\n $dataerror = false; //unset error to protect the flshmsg of password error\n require_once \"view/createAGroup.php\";\n }\n displaydebug($group);\n } else {\n $dataerror = true;\n }\n if ($dataerror) {\n flshmsg(14);\n require_once \"view/createAGroup.php\";\n }\n displaydebug($dataerror);\n displaydebug($_SESSION);\n } else {\n require_once \"view/createAGroup.php\";\n }\n}", "static function getUserGroups(){\n \n }", "function getGroup() {\n \n return null;\n \n }", "function ValidateIsSubgroup ($parentgroupid, $groupid) {\n $path = REST_PATH . 'groups/' . $groupid . '.xml';\n\n // Call Rest API\n $result = CallRestApi($path);\n\n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n \n $p = $xml->Group->ParentGroupId;\n\n if ($p == $parentgroupid) {\n \treturn 1;\n }\n \n return 0;\n}", "public function getSecGroup($groupId)\n {\n $tmpGroup = $this->_userDao->getSecurityGroup($groupId);\n if (!empty($tmpGroup)) {\n return $tmpGroup[0];\n } else {\n return false;\n } // else\n }", "public function insert(&$group) {\n\t\t/* As of PHP5.3.0, is_a()is no longer deprecated, so there is no reason to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!$group->isDirty()) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!$group->cleanVars()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $group->cleanVars as $k => $v) {\n\t\t\t${$k} = $v;\n\t\t}\n\t\tif ($group->isNew()) {\n\t\t\t$groupid = icms::$xoopsDB->genId('group_groupid_seq');\n\t\t\t$sql = sprintf(\"INSERT INTO %s (groupid, name, description, group_type)\n\t\t\t\tVALUES ('%u', %s, %s, %s)\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\t(int) $groupid,\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type)\n\t\t\t);\n\t\t} else {\n\t\t\t$sql = sprintf(\n\t\t\t\t\"UPDATE %s SET name = %s, description = %s, group_type = %s WHERE groupid = '%u'\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type),\n\t\t\t\t(int) $groupid\n\t\t\t);\n\t\t}\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($groupid)) {\n\t\t\t$groupid = icms::$xoopsDB->getInsertId();\n\t\t}\n\t\t$group->assignVar('groupid', $groupid);\n\t\treturn true;\n\t}", "public function groupAccessLevel(){\n\t\n\t global $db;\n\t \n\t #see if user is guest, if so, they have zero-level access.\n\t\tif($this->user == \"guest\"){\n\t\t $getAccessLevel = 0;\n\t\t return($getAccessLevel);\n\t\t}else{\n\t \t$db->SQL = \"SELECT Level FROM ebb_groups where id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$getAccessLevel = $db->fetchResults();\n\n\t\t\treturn($getAccessLevel['Level']);\n\t\t}\n\t}", "private function getGroupID()\n {\n if (App::auth()->loggedIn() === false)\n {\n return -1;\n }\n \n return (int) App::auth()->user()->groupID;\n }", "public function findByName($group_name);", "public function existsGroup() {\n $sql = \"SELECT * FROM `SM_GROUP` WHERE sm_idGroup = '$this->idGroup'\";\n $result = $this->mysqli->query($sql);\n if ($result->num_rows == 1) {\n return true;\n } else {\n return false;\n }\n }", "public function hasGroup()\n {\n return isset($this->arrConfig['group']);\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 usergroupConditionMatchesSingleGroupId() {}", "public function usergroupConditionMatchesSingleGroupId() {}", "private function getUserGroup()\n {\n if (null !== $token = $this->tokenStorage->getToken()) {\n /** @var \\Ekyna\\Bundle\\UserBundle\\Model\\UserInterface $user */\n if (null !== $user = $token->getUser()) {\n return $user->getGroup();\n }\n }\n return null;\n }", "function _get_user_groups(){\r\n $groups = array();\r\n for($i=0; $i<get_sso_option('rules_number'); $i++){\r\n $rule = _get_rule($i);\r\n if($rule != FALSE){\r\n\t $is_group = _run_rule($rule['var'], $rule['regexp'], $rule['group']);\r\n\t if($is_group === TRUE) $groups[] = $rule['group'];\r\n }\r\n }\r\n return $groups;\r\n}", "function updateGroup() {\n\t\t$groupId = Request::getUserVar('groupId') === null? null : (int) Request::getUserVar('groupId');\n\t\tif ($groupId === null) {\n\t\t\t$this->validate();\n\t\t\t$group = null;\n\t\t} else {\n\t\t\t$this->validate($groupId);\n\t\t\t$group =& $this->group;\n\t\t}\n\t\t$this->setupTemplate($group);\n\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$groupForm = new GroupForm($group);\n\t\t$groupForm->readInputData();\n\n\t\tif ($groupForm->validate()) {\n\t\t\t$groupForm->execute();\n\t\t\tRequest::redirect(null, null, 'groups');\n\t\t} else {\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'manager', 'groups'), 'manager.groups'));\n\n\t\t\t$templateMgr->assign('pageTitle',\n\t\t\t\t$group?\n\t\t\t\t\t'manager.groups.editTitle':\n\t\t\t\t\t'manager.groups.createTitle'\n\t\t\t);\n\n\t\t\t$groupForm->display();\n\t\t}\n\t}", "public function in_group(Group $group) {\r\n\t\tif ($this->user_id && $group->group_id) {\r\n\t\t\t$sql = \"SELECT group_id FROM `group_members` WHERE group_id = '$group->group_id' AND user_id = '$this->user_id\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\tif ($result->num_rows == 1) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}" ]
[ "0.7310521", "0.71962833", "0.67919445", "0.6781873", "0.6781873", "0.6781873", "0.6781873", "0.67534393", "0.67160344", "0.6683104", "0.6668222", "0.6663768", "0.662544", "0.65584636", "0.65584636", "0.65584636", "0.6538821", "0.65213615", "0.65203476", "0.65203476", "0.65203476", "0.65203476", "0.65203476", "0.65203476", "0.6509939", "0.65060437", "0.65046257", "0.64728326", "0.64628774", "0.6450816", "0.6438387", "0.6424865", "0.64172125", "0.64134854", "0.63946766", "0.6387904", "0.6378133", "0.6376916", "0.63710266", "0.6364492", "0.63537025", "0.63455236", "0.63285834", "0.63280255", "0.63188136", "0.6308501", "0.6294299", "0.6285518", "0.6276933", "0.62536085", "0.620891", "0.62038857", "0.6163769", "0.6161498", "0.6159566", "0.615773", "0.6153923", "0.6150168", "0.6137811", "0.6135929", "0.61322045", "0.61249954", "0.61249954", "0.61237425", "0.6107114", "0.6075427", "0.607383", "0.6067911", "0.6065441", "0.60559064", "0.60536134", "0.60485697", "0.6045357", "0.6042923", "0.6034719", "0.60279983", "0.60268795", "0.60256815", "0.6024336", "0.6009022", "0.6003225", "0.60031015", "0.5999058", "0.599574", "0.5988659", "0.5987635", "0.5985562", "0.59748447", "0.5972061", "0.5970436", "0.5969664", "0.5968475", "0.5959098", "0.595779", "0.59561306", "0.5954959", "0.5953187", "0.5945103", "0.5939453", "0.59391296", "0.593905" ]
0.0
-1
We're using the Delegate to consolidate code between this panel and the Vicp_Groups_EditParticipation panel
public function __call($strMethod, $arrArguments) { return call_user_func_array(array($this->objDelegate, $strMethod), $arrArguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function SetupPanel() {\n\t\t\t$this->objGroup = Group::Load($this->strUrlHashArgument);\n\t\t\tif (!$this->objGroup) return $this->ReturnTo('#groups');\n\t\t\tif (!$this->objGroup->IsLoginCanView(QApplication::$Login)) return $this->ReturnTo('#groups');\n\n\t\t\t$this->objDelegate = new EditGroupParticipationDelegate($this, '#groups');\n\t\t}", "abstract public function getPanelGroup();", "public function panels()\n {\n }", "function _add_panels ()\n {\n parent::_add_panels ();\n\n $panel =& $this->panel_at ('folder');\n $panel->rows = 10;\n $panel->columns = 2;\n }", "private function composeControlPanel()\n {\n $this->composeControlPanelSideMenu();\n $this->composeControlPanelImagesBrowser();\n }", "abstract public function getPanelName();", "function clsGrp($pName) {\n $this->name = $pName;\n if (function_exists('before_group_' . $pName)) $this->beforeEvent = true;\n if (function_exists('after_group_' . $pName)) $this->afterEvent = true;\n }", "abstract protected function draggable_item($mform);", "function PostProcessItemDataGroups()\n {\n $this->AddEventQuestDataGroups();\n }", "function ProductGroupEdit()\n {\n // loading the prototypes of form fields\n loadCoreFile('html_form.php');\n\n // getting the list of attributes to show\n $settings = modApiFunc('Settings', 'getParamListByGroup',\n 'PRODUCT_GROUP_EDIT', SETTINGS_WITH_DESCRIPTION);\n $this -> _attrs = array('ID' => 'YES');\n if (is_array($settings))\n foreach($settings as $v)\n {\n if ($v['param_name'] == 'CTL_PGE_TABULATION')\n $this -> _tabbing = $v['param_current_value'];\n elseif ($v['param_current_value'] == 'YES')\n $this -> _attrs[$v['param_name']] = 'YES';\n }\n\n // initializing the template filler\n $this -> mTmplFiller = new TmplFiller();\n\n // filling the headermap\n $this -> _headermap = array(\n 'ID' => 'PRD_ID_NAME',\n 'CTL_PGE_NAME' => 'PRD_NAME_NAME',\n 'CTL_PGE_SALEPRC' => 'PRD_SALEPRC_NAME',\n 'CTL_PGE_LISTPRC' => 'PRD_LISTPRC_NAME',\n 'CTL_PGE_QUINSTOCK' => 'PRD_QUINSTOCK_NAME',\n 'CTL_PGE_LOWLEV' => 'PRD_LOWLEV_NAME',\n 'CTL_PGE_SKU' => 'PRD_SKU_NAME',\n 'CTL_PGE_QUINORDER' => 'PRD_QUINORDER_NAME',\n 'CTL_PGE_AVAIL' => 'PRD_AVAIL_NAME',\n 'CTL_PGE_TAXCLASS' => 'PRD_TAX_CLASS_NAME',\n 'CTL_PGE_MANUFACTURER' => 'PRD_MANUFACTURER_NAME',\n 'CTL_PGE_SHIPPRC' => 'PRD_SHIPPRC_NAME',\n 'CTL_PGE_HANDPRC' => 'PRD_HANDRC_NAME',\n 'CTL_PGE_WEIGHT' => 'PRD_WEIGHT_NAME',\n 'CTL_PGE_FREESHIP' => 'PRD_FREESHIP_NAME',\n 'CTL_PGE_NEEDSHIP' => 'PRD_NEEDSHIP_NAME',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'PRD_CUSTOMER_REVIEWS_NAME'\n );\n\n // filling the attribute map\n $this -> _attrmap = array(\n 'ID' => 'ID',\n 'CTL_PGE_NAME' => 'Name',\n 'CTL_PGE_SALEPRC' => 'SalePrice',\n 'CTL_PGE_LISTPRC' => 'ListPrice',\n 'CTL_PGE_QUINSTOCK' => 'QuantityInStock',\n 'CTL_PGE_LOWLEV' => 'LowStockLevel',\n 'CTL_PGE_SKU' => 'SKU',\n 'CTL_PGE_QUINORDER' => 'MinQuantity',\n 'CTL_PGE_AVAIL' => 'Available',\n 'CTL_PGE_TAXCLASS' => 'TaxClass',\n 'CTL_PGE_MANUFACTURER' => 'Manufacturer',\n 'CTL_PGE_SHIPPRC' => 'PerItemShippingCost',\n 'CTL_PGE_HANDPRC' => 'PerItemHandlingCost',\n 'CTL_PGE_WEIGHT' => 'Weight',\n 'CTL_PGE_FREESHIP' => 'FreeShipping',\n 'CTL_PGE_NEEDSHIP' => 'NeedShipping',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'CustomerReviews'\n );\n }", "public function getPanel()\n {\n \t$this->_timer['postDispatch'] = isset($this->_timer['postDispatch']) ? \n \t\t$this->_timer['postDispatch'] : '';\n \t$this->_timer['preDispatch'] = isset($this->_timer['preDispatch']) ? \n \t\t$this->_timer['preDispatch'] : '';\n \t\t\n \treturn parent::getPanel();\n }", "public function onBeforeEndPanels(&$row)\n {\n echo JHtml::_('sliders.panel', 'Exemple end panel', 'test-end-panel');\n echo '<fieldset class=\"panelform\">' \n . JText::_('PLG_JEA_OWNER_NAME'). ' : <strong>'\n . $row->owner_name . '</strong></fieldset>';\n }", "public function render_panel_templates()\n {\n }", "function addPageEditorSettingsSubtabs()\n\t{\n\t\tglobal $ilCtrl, $ilTabs;\n\n\t\t$ilTabs->addSubTabTarget(\"adve_pe_general\",\n\t\t\t $ilCtrl->getLinkTarget($this, \"showGeneralPageEditorSettings\"),\n\t\t\t array(\"showGeneralPageEditorSettings\", \"\", \"view\")); \n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t$grps = ilPageEditorSettings::getGroups();\n\t\t\n\t\tforeach ($grps as $g => $types)\n\t\t{\n\t\t\t$ilCtrl->setParameter($this, \"grp\", $g);\n\t\t\t$ilTabs->addSubTabTarget(\"adve_grp_\".$g,\n\t\t\t\t $ilCtrl->getLinkTarget($this, \"showPageEditorSettings\"),\n\t\t\t\t array(\"showPageEditorSettings\")); \n\t\t}\n\t\t$ilCtrl->setParameter($this, \"grp\", $_GET[\"grp\"]);\n\t}", "public function buildPanels() {\n return array($this);\n }", "private function showPanels()\r\n {\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" ||\r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n // show the information panel\r\n $newInformationPanel = new InformationPanel($this->keycodeResult, $this->transactionResult);\r\n\r\n // create form form to process a repair claim\r\n //echo \"<form action=\\\"CustomerClaim.php\\\" method=\\\"post\\\" name=\\\"submit-repair-claim\\\">\";\r\n\r\n // create form for repair panel\r\n $newRepairOptionsPanel = new RepairOptionsPanel($this->claimType);\r\n\r\n // create customer details panel object and create the blank fields\r\n $newCustomerDetailsPanel = new CustomerDetailsPanel();\r\n $newCustomerDetailsPanel->createCustomerFields();\r\n\r\n // create repair options panel object and create the blank html fields\r\n $newfinaliseRepairPanel = new FinaliseRepairPanel();\r\n $newfinaliseRepairPanel->createFinaliseRepairFields();\r\n \r\n // object has hidden inputs for keycode and transaction ID so they can be retrieved from \r\n // second form on the page, as the first form contains the first inputs for them\r\n $newHiddenInputsPanel = new HiddenInputsPanel($this->claimType);\r\n\r\n }\r\n \r\n // finanical claim show information panel and set form to finanical claim\r\n else if($this->claimType == \"finanical-warranty\" || $this->claimType == \"finanical-outside-warranty\" || \r\n $this->claimType == \"finanical-no-transaction\")\r\n {\r\n // show the information panel\r\n $newInformationPanel = new InformationPanel($this->keycodeResult, $this->transactionResult);\r\n \r\n // create form to process a finanical claim\r\n //echo \"<form action=\\\"CustomerClaim.php\\\" method=\\\"post\\\" name=\\\"submit-repair-claim\\\">\";\r\n \r\n // object has hidden inputs for keycode and transaction ID so they can be retrieved from \r\n // second form on the page, as the first form contains the first inputs for them\r\n $newHiddenInputsPanel = new HiddenInputsPanel($this->claimType);\r\n \r\n }\r\n \r\n // if product is not claimable but exists show information panel\r\n else if ($this->claimType != \"keycode-not-found\" && $this->keycode != null)\r\n {\r\n // create a form that does nothing - used to make html vaild as </form> is used later\r\n //echo \"<form>\";\r\n \r\n // if vaild product is found show the information about it\r\n $newInformationPanel = new InformationPanel($this->keycodeResult, $this->transactionResult);\r\n }\r\n }", "function new_groups()\n {\n \n }", "function editMemberGroup($msg='', $group_id = null)\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 $clone_id = Request::input('clone_id');\n\n // Incoming from a continue editing button?\n if (empty($group_id)) {\n $group_id = Request::input('group_id');\n }\n\n $id = (!empty($clone_id)) ? $clone_id : $group_id;\n\n // ------------------------------------\n // Fetch the Group's Data\n // ------------------------------------\n\n if (!empty($id)) {\n $group_data = (array) DB::table('member_groups')->where('group_id', $id)->first();\n $preferences = DB::table('member_group_preferences')->where('group_id', $id)->get();\n\n foreach($preferences as $row) {\n $group_data[$row->handle] = $row->value;\n }\n }\n\n if(empty($group_data['is_locked'])) {\n $group_data['is_locked'] = 'y';\n }\n\n // ------------------------------------\n // Group title\n // ------------------------------------\n\n $group_name = ($group_id == '') ? '' : $group_data['group_name'];\n $group_description = ($group_id == '') ? '' : $group_data['group_description'];\n\n if ($msg != '') {\n Cp::$body .= Cp::quickDiv('successMessage', $msg);\n }\n\n Cp::$body_props .= ' onload=\"showHideMenu(\\'group_name\\');\"';\n\n // ------------------------------------\n // Declare form and page heading\n // ------------------------------------\n\n $js = <<<EOT\n<script type=\"text/javascript\">\n var lastShownObj = '';\n var lastShownColor = '';\n function showHideMenu(objValue)\n {\n if (lastShownObj != '') {\n $('#' + lastShownObj+'_pointer a').first().removeAttr('style');\n\n $('#' + lastShownObj + '_on').css('display', 'none');\n }\n\n lastShownObj = objValue;\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color');\n\n $('#' + objValue + '_on').css('display', 'block');\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color', '#000')\n }\n</script>\nEOT;\n\n Cp::$body .= $js;\n\n $r = Cp::formOpen(\n [\n 'action' => 'C=Administration'.AMP.'M=members'.AMP.'P=updateMemberGroup'\n ]\n );\n\n if ($clone_id != '')\n {\n $group_name = '';\n $group_description = '';\n $r .= Cp::input_hidden('clone_id', $clone_id);\n }\n\n $r .= Cp::input_hidden('group_id', $group_id);\n\n // ------------------------------------\n // Group name form field\n // ------------------------------------\n\n $r .= '<div id=\"group_name_on\" style=\"display: none; padding:0; margin: 0;\">'.\n Cp::table('tableBorder', '0', '', '100%').\n '<tr>'.PHP_EOL.\n \"<td class='tableHeadingAlt' colspan='2'>\".\n NBS.__('members.group_name').\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%').\n Cp::quickDiv('defaultBold', __('members.group_name')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_text('group_name', $group_name, '50', '70', 'input', '100%').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%', '', '', 'top').\n Cp::quickDiv('defaultBold', __('members.group_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_textarea('group_description', $group_description, 10).\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n Cp::quickDiv('defaultSmall', '');\n\n // ------------------------------------\n // Top section of page\n // ------------------------------------\n\n if ($group_id == 1)\n {\n $r .= Cp::quickDiv('box', __('members.super_admin_edit_note'));\n }\n else\n {\n $r .= Cp::quickDiv('box', Cp::quickSpan('alert', __('members.warning')).'&nbsp;'.__('members.be_careful_assigning_groups'));\n }\n\n $r .= Cp::quickDiv('defaultSmall', '');\n\n $r .= '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Group lock\n // ------------------------------------\n\n $r .= '<div id=\"group_lock_on\" style=\"display: none; padding:0; margin: 0;\">';\n\n $r .= Cp::table('tableBorder', '0', '', '100%');\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('tableHeadingAlt', '', '2').__('members.group_lock').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL;\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::quickDiv('alert', __('members.enable_lock')).\n Cp::quickDiv('littlePadding', __('members.lock_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n $selected = ($group_data['is_locked'] == 'y') ? true : false;\n\n $r .= __('members.locked').NBS.\n Cp::input_radio('is_locked', 'y', $selected).'&nbsp;';\n\n $selected = ($group_data['is_locked'] == 'n') ? true : false;\n\n $r .= __('members.unlocked').NBS.\n Cp::input_radio('is_locked', 'n', $selected).'&nbsp;';\n\n $r .= '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Fetch the names and IDs of all weblogs\n // ------------------------------------\n\n $blog_names = [];\n $blog_ids = [];\n\n $query = DB::table('weblogs')\n ->orderBy('blog_title')\n ->select('weblog_id', 'site_id', 'blog_title')\n ->get();\n\n if ($id != 1)\n {\n foreach($query as $row)\n {\n $field = 'weblog_id_'.$row->weblog_id;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $blog_names[$field] = $row->blog_title;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all plugins\n // ------------------------------------\n\n $plugins = Plugins::list();\n $plugin_names = [];\n $plugin_ids = [];\n\n if ($id != 1)\n {\n foreach(Plugins::list() as $plugin)\n {\n $name = __(strtolower($plugin->plugin_name . '_plugin_name'));\n $name = str_replace('_', ' ', $name);\n $name = ($name == '' ? $plugin->plugin_name : $name);\n\n $field = 'plugin_name_'.$plugin->plugin_name;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $plugin_names[$field] = $name;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all Sites\n // ------------------------------------\n\n $site_cp_names = [];\n $site_offline_names = [];\n $site_ids = []; // Figure out where I am storing these\n\n if ($id != 1) {\n foreach(Site::sitesList() as $site) {\n\n $field = 'can_access_offline_site_id_'.$site->site_id;\n $site_offline_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n\n $field = 'can_access_cp_site_id_'.$site->site_id;\n $site_cp_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Assign clusters of member groups\n // - The associative value (y/n) is the default setting\n // ------------------------------------\n\n $G = static::$group_preferences;\n\n $G['cp_site_cp_access_privs'] = $site_cp_names;\n $G['cp_site_offline_privs'] = $site_offline_names;\n $G['cp_weblog_post_privs'] = $blog_names;\n $G['cp_plugin_access_privs'] = $plugin_names;\n\n // ------------------------------------\n // Super Admin Group cannot be edited\n // ------------------------------------\n\n if ($group_id == 1) {\n $G = ['mbr_account_privs' => ['include_in_authorlist' => 'n']];\n }\n\n // ------------------------------------\n // Assign items we want to highlight\n // ------------------------------------\n\n $alert = [\n 'can_view_offline_system',\n 'can_access_cp',\n 'can_admin_weblogs',\n 'can_admin_templates',\n 'can_delete_members',\n 'can_admin_mbr_groups',\n 'can_ban_users',\n 'can_admin_members',\n 'can_admin_preferences',\n 'can_admin_plugins',\n 'can_admin_utilities',\n 'can_edit_categories',\n 'can_delete_self'\n ];\n\n // ------------------------------------\n // Items that should be shown in an input box\n // ------------------------------------\n\n $tbox = [\n 'search_flood_control',\n 'mbr_delete_notify_emails'\n ];\n\n // ------------------------------------\n // Render the group matrix\n // ------------------------------------\n\n $special = ['cp_plugin_access_privs', 'cp_site_offline_privs', 'cp_site_cp_access_privs'];\n\n foreach ($G as $g_key => $g_val)\n {\n // ------------------------------------\n // Start the Table\n // ------------------------------------\n\n $r .= '<div id=\"'.$g_key.'_on\" style=\"display: none; padding:0; margin: 0;\">';\n $r .= Cp::table('tableBorder', '0', '', '100%');\n $r .= '<tr>'.PHP_EOL;\n\n $r .= \"<td class='tableHeadingAlt' id='\".$g_key.\"2' colspan='2'>\";\n $r .= NBS.__($g_key);\n $r .= '</tr>'.PHP_EOL;\n\n $i = 0;\n\n foreach($g_val as $key => $val)\n {\n if ( !in_array($g_key, $special) && ! isset($group_data[$key])) {\n $group_data[$key] = $val;\n }\n\n $line = __($key);\n\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_')\n {\n $line = __('members.can_post_in').Cp::quickSpan('alert', $blog_names[$key]);\n }\n\n if (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_')\n {\n\n $line = __('members.can_access_plugin').Cp::quickSpan('alert', $plugin_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_')\n {\n $line = __('members.can_access_offline_site').Cp::quickSpan('alert', $site_offline_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_')\n {\n $line = __('members.can_access_cp').Cp::quickSpan('alert', $site_cp_names[$key]);\n }\n\n $mark = (in_array($key, $alert)) ? Cp::quickSpan('alert', $line) : Cp::quickSpan('defaultBold', $line);\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n $mark;\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n if (in_array($key, $tbox))\n {\n $width = ($key == 'mbr_delete_notify_emails') ? '100%' : '100px';\n $length = ($key == 'mbr_delete_notify_emails') ? '255' : '5';\n $r .= Cp::input_text($key, $group_data[$key], '15', $length, 'input', $width);\n }\n else\n {\n $r .= __('cp.yes').NBS.\n Cp::input_radio($key, 'y', ($group_data[$key] == 'y') ? 1 : '').'&nbsp;';\n\n $r .= __('cp.no').NBS.\n Cp::input_radio($key, 'n', ($group_data[$key] == 'n') ? 1 : '').'&nbsp;';\n }\n\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n\n $r .= '</table>'.PHP_EOL;\n $r .= '</div>'.PHP_EOL;\n }\n\n // ------------------------------------\n // Submit button\n // ------------------------------------\n\n if (empty($group_id))\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('cp.submit'))\n .NBS.\n Cp::input_submit(__('cp.submit_and_return'),'return')\n );\n }\n else\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('members.update')).\n NBS.\n Cp::input_submit(__('members.update_and_return'), 'return')\n );\n }\n\n $r .= '</form>'.PHP_EOL;\n\n // ------------------------------------\n // Create Our All Encompassing Table of Weblog Goodness\n // ------------------------------------\n\n Cp::$body .= Cp::table('', '0', '', '100%');\n\n $menu = '';\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_name_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.group_name'),'onclick=\"showHideMenu(\\'group_name\\');\"').\n '</span>');\n\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_lock_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.security_lock'), 'onclick=\"showHideMenu(\\'group_lock\\');\"').\n '</span>');\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_cp_access_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_site_cp_access_privs'), 'onclick=\"showHideMenu(\\'cp_site_cp_access_privs\\');\"').\n '</span>'\n );\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_offline_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_site_offline_privs'), 'onclick=\"showHideMenu(\\'cp_site_offline_privs\\');\"').\n '</span>'\n );\n }\n\n\n foreach ($G as $g_key => $g_val)\n {\n if (in_array($g_key, $special)) {\n continue;\n }\n\n $menu .= Cp::quickDiv(\n 'navPad',\n ' <span id=\"'.$g_key.'_pointer\">&#8226; '.\n Cp::anchor(\n \"#\",\n __($g_key),\n 'onclick=\"showHideMenu(\\''.$g_key.'\\');\"'\n ).\n '</span>');\n }\n\n // Plugins\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_plugin_access_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_plugin_access_privs'), 'onclick=\"showHideMenu(\\'cp_plugin_access_privs\\');\"').\n '</span>'\n );\n }\n\n // ------------------------------------\n // Compile all of it into output\n // ------------------------------------\n\n $title = (!empty($id)) ? __('members.edit_member_group') : __('members.create_member_group');\n\n $first_text = Cp::div('tableHeadingAlt').\n $title.\n '</div>'.PHP_EOL.\n Cp::div('profileMenuInner', '', 'membersMenu').\n $menu.\n '</div>'.PHP_EOL;\n\n // Create the Table\n $table_row = [\n 'first' => ['valign' => \"top\", 'width' => \"220px\", 'text' => $first_text],\n 'second' => ['class' => \"default\", 'width' => \"8px\"],\n 'third' => ['valign' => \"top\", 'text' => $r]\n ];\n\n Cp::$body .= Cp::tableRow($table_row).\n '</table>'.PHP_EOL;\n\n Cp::$title = $title;\n\n if ($group_id != '')\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=edit_mbr_group'.\n AMP.'group_id='.$group_data['group_id'],\n $title\n )\n ).\n Cp::breadcrumbItem($group_data['group_name']);\n }\n else\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem($title);\n }\n }", "function jqdatag(){\n\n\t\t$grid = $this->defgrid();\n\t\t$grid->setHeight('185');\n\t\t$param['grids'][] = $grid->deploy();\n\n\t\t$grid1 = $this->defgridit();\n\t\t$grid1->setHeight('190');\n\t\t$param['grids'][] = $grid1->deploy();\n\n\t\t// Configura los Paneles\n\t\t$readyLayout = $grid->readyLayout2( 212, 220, $param['grids'][0]['gridname'],$param['grids'][1]['gridname']);\n\n\t\t//Funciones que ejecutan los botones\n\t\t$bodyscript = $this->bodyscript( $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t//Botones Panel Izq\n\t\t$grid->wbotonadd(array('id'=>'imprime', 'img'=>'assets/default/images/print.png','alt' => 'Reimprimir', 'label'=>'Reimprimir Documento'));\n\t\tif($this->datasis->sidapuede('SCON','INCLUIR%' )){\n\t\t\t$grid->wbotonadd(array('id'=>'addscli', 'img'=>'images/agrega4.png' ,'alt' => 'Consignaci&oacute;n a cliente' , 'label'=>'Consignaci&oacute;n a Cliente'));\n\t\t\t$grid->wbotonadd(array('id'=>'addsprv', 'img'=>'images/agrega4.png' ,'alt' => 'Consignaci&oacute;n a proveedor', 'label'=>'Consignaci&oacute;n a Proveedor'));\n\t\t}\n\n\t\t$WestPanel = $grid->deploywestp();\n\n\t\t//Panel Central\n\t\t$centerpanel = $grid->centerpanel( $id = 'radicional', $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t$adic = array(\n\t\t\tarray('id'=>'fedita', 'title'=>'Agregar/Editar Registro'),\n\t\t\tarray('id'=>'fshow' , 'title'=>'Mostrar Registro'),\n\t\t\tarray('id'=>'fborra', 'title'=>'Eliminar Registro')\n\t\t);\n\t\t$SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);\n\n\t\t$param['WestPanel'] = $WestPanel;\n\t\t$param['script'] = '';\n\t\t$param['readyLayout'] = $readyLayout;\n\t\t$param['SouthPanel'] = $SouthPanel;\n\t\t$param['listados'] = $this->datasis->listados('SCON', 'JQ');\n\t\t$param['otros'] = $this->datasis->otros('SCON', 'JQ');\n\t\t$param['centerpanel'] = $centerpanel;\n\t\t$param['temas'] = array('proteo','darkness','anexos1');\n\t\t$param['bodyscript'] = $bodyscript;\n\t\t$param['tabs'] = false;\n\t\t$param['encabeza'] = $this->titp;\n\t\t$param['tamano'] = $this->datasis->getintramenu( substr($this->url,0,-1) );\n\t\t$this->load->view('jqgrid/crud2',$param);\n\n\t}", "function groupmessageboard_init() {\n\n\telgg_extend_view('groups/tool_latest','gmessageboard/group_module',1);\n}", "function groupControl() {\n $arrFunctions = array(\n 'row_up' => '$intKey-1',\n 'row_down' => '$intKey+1',\n 'row_turndown' => 'intGroups',\n 'row_turnup' => '1',\n 'row_remove' => '[$intGroups]',\n 'rule_remove' => \"[$intKey]['rule'][$grplength-1]\",\n );\n foreach($this->arrTableParameters['grps'] as $intGroup => $arrGroup) {\n foreach ($arrGroup['rule'] as $intRule => $arrRule) {\n $arrRule['field'] = stripslashes($arrRule['field']);\n if ($arrRule['field'] == $this->extKey.'_new') {\n if ($intRule==0) {\n unset($this->arrTableParameters['grps'][$intGroup]);\n } else {\n unset($this->arrTableParameters['grps'][$intGroup]['rule'][$intRule]);\n }\n }\n }\n }\n $intGroups = count($this->arrTableParameters['grps']);\n foreach ($arrFunctions as $strKey => $strValue) {\n if (is_array($this->arrTableParameters[$strKey])) {\n $intKey = key($this->arrTableParameters[$strKey]);\n if (is_array($this->arrTableParameters['rule_remove'])) {\n \t$intRule = key($this->arrTableParameters['rule_remove'][$intKey]);\n }\n if ($strKey!='row_turndown') {\n $arrTemp = $this->arrTableParameters['grps'][$intKey];\n } else {\n $arrTemp = $this->arrTableParameters['grps'][1];\n }\n if ($strKey=='row_up') {\n $this->arrTableParameters['grps'][$intKey] = $this->arrTableParameters['grps'][$intKey-1];\n } elseif ($strKey=='row_down') {\n $this->arrTableParameters['grps'][$intKey] = $this->arrTableParameters['grps'][$intKey+1];\n } elseif ($strKey=='row_turndown') {\n for ($intCounter=2;$intCounter<=$intGroups;$intCounter++) {\n $this->arrTableParameters['grps'][$intCounter-1] = $this->arrTableParameters['grps'][$intCounter];\n }\n } elseif ($strKey=='row_turnup') {\n for ($intCounter=$intGroups;$intCounter>1;$intCounter--) {\n $this->arrTableParameters['grps'][$intCounter] = $this->arrTableParameters['grps'][$intCounter-1];\n }\n } elseif ($strKey=='row_remove') {\n for ($intCounter=$intKey;$intCounter<=$intGroups;$intCounter++) {\n $this->arrTableParameters['grps'][$intCounter] = $this->arrTableParameters['grps'][$intCounter+1];\n }\n } elseif ($strKey=='rule_remove') {\n if (count($this->arrTableParameters['grps'][$intKey]['rule'])>1) {\n for ($intCounter=$intRule;$intCounter<count($this->arrTableParameters['grps'][$intKey]['rule']);$intCounter++) {\n $this->arrTableParameters['grps'][$intKey]['rule'][$intCounter] = $this->arrTableParameters['grps'][$intKey]['rule'][$intCounter+1];\n }\n }\n }\n if (in_array($strKey,array('row_up','row_down','row_turndown','row_turnup'))) {\n eval(\"\\$this->arrTableParameters['grps'][\".$strValue.\"] = \\$arrTemp;\");\n } elseif ($strKey=='row_remove') {\n unset($this->arrTableParameters['grps'][$intGroups]);\n } else {\n \tunset($this->arrTableParameters['grps'][$intKey]['rule'][count($this->arrTableParameters['grps'][$intKey]['rule'])-1]);\n }\n }\n }\n }", "function CreateChildControls() {\n }", "final public function addItemGroupSupervisor() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id'] > 0) {\n $this->addForGroup(1, $val->fields['groups_id']);\n }\n }\n }\n }", "public function buildQuickForm() {\n $this->addElement('text', 'newGroupName', ts('Name for new group'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'));\n $this->addElement('text', 'newGroupDesc', ts('Description of new group'));\n $groupTypes = CRM_Core_OptionGroup::values('group_type', TRUE);\n if (!empty($groupTypes)) {\n $this->addCheckBox('newGroupType',\n ts('Group Type'),\n $groupTypes,\n NULL, NULL, NULL, NULL, '&nbsp;&nbsp;&nbsp;'\n );\n }\n\n $groups = CRM_Core_PseudoConstant::nestedGroup();;\n\n if (!empty($groups)) {\n $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, [\n 'multiple' => \"multiple\",\n 'class' => 'crm-select2',\n ]);\n }\n\n //display new tag\n $this->addElement('text', 'newTagName', ts('Tag'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'));\n $this->addElement('text', 'newTagDesc', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description'));\n\n $tag = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', ['onlyActive' => FALSE]);\n if (!empty($tag)) {\n $this->addElement('select', 'tag', ts(' Tag imported records'), $tag, [\n 'multiple' => 'multiple',\n 'class' => 'crm-select2',\n ]);\n }\n\n $this->addFormRule(['CRM_Contact_Import_Form_Preview', 'formRule'], $this);\n\n parent::buildQuickForm();\n }", "protected function formCreate() {\n\t\t$this->pxyLink = new \\QCubed\\Control\\Proxy($this);\n\t\t$this->pxyLink->AddAction(new \\QCubed\\Event\\MouseOver(), new \\QCubed\\Action\\Ajax('mouseOver'));\n\n\t\t// Define the DataGrid\n\t\t$this->tblProjects = new \\QCubed\\Project\\Control\\Table($this);\n\n\t\t// This css class is used to style alternate rows and the header, all in css\n\t\t$this->tblProjects->CssClass = 'simple_table';\n\n\t\t// Define Columns\n\n\t\t// Create a link column that shows the name of the project, and when clicked, calls back to this page with an id\n\t\t// of the item clicked on\n\t\t$this->tblProjects->CreateLinkColumn('Project', '->Name', \\QCubed\\Project\\Application::instance()->context()->scriptName(), ['intId'=>'->Id']);\n\n\t\t// Create a link column using a proxy\n\t\t$col = $this->tblProjects->CreateLinkColumn('Status', '->ProjectStatusType', $this->pxyLink, '->Id');\n\n\t\t$this->tblProjects->SetDataBinder('tblProjects_Bind');\n\n\t\t$this->pnlClick = new \\QCubed\\Control\\Panel($this);\n\n\t\tif (($intId = \\QCubed\\Project\\Application::instance()->context()->queryStringItem('intId')) && ($objProject = Project::Load($intId))) {\n\t\t\t$this->pnlClick->Text = 'You clicked on ' . $objProject->Name;\n\t\t}\n\n\t}", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'groups');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "public function edit_group_details(){\n if( !isset( $_REQUEST['pmstkn'] ) || !wp_verify_nonce( $_REQUEST['pmstkn'], 'pms_gm_edit_group_details_nonce' ) )\n return;\n\n if( empty( $_POST['pms_subscription_id'] ) )\n return;\n\n $subscription = pms_get_member_subscription( sanitize_text_field( $_POST['pms_subscription_id'] ) );\n\n if( !pms_gm_is_group_owner( $subscription->id ) )\n return;\n\n //validate fields\n $group_name = sanitize_text_field( $_POST['group_name'] );\n\n if( empty( $group_name ) )\n pms_errors()->add( 'group_name', esc_html__( 'Group name cannot be empty.', 'paid-member-subscriptions' ) );\n\n if ( count( pms_errors()->get_error_codes() ) > 0 )\n return;\n\n //save fields\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_name', $group_name );\n\n $group_description = sanitize_text_field( $_POST['group_description'] );\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_description', $group_description );\n }", "public function onDisplayAdminGroupEdit($event)\r\n {\r\n $item = $event->getArgument('item');\r\n $tabs = $event->getArgument('tabs');\r\n $content = $event->getArgument('content');\r\n $isNew = $event->getArgument('isNew');\r\n $identifier = $event->getArgument('identifier');\r\n \r\n if (empty($tabs))\r\n {\r\n $tabs = array();\r\n }\r\n \r\n if (empty($content))\r\n {\r\n $content = array();\r\n }\r\n \r\n $view = \\Dsc\\System::instance()->get('theme');\r\n $view->item = $item;\r\n $prefab = new \\Shop\\Models\\Prefabs\\UserGroupDetail();\r\n if (!isset($view->item['shop']))\r\n {\r\n $view->item = $prefab->cast();\r\n }\r\n else\r\n {\r\n $view->item = array_merge($prefab->cast(), $view->item->cast());\r\n }\r\n $shop_content = $view->renderLayout('Shop/Admin/Views::groups/tab_usergroups.php');\r\n \r\n $tabs['shop'] = 'Shop Details';\r\n $content['shop'] = $shop_content;\r\n \r\n $event->setArgument('tabs', $tabs);\r\n $event->setArgument('content', $content);\r\n }", "public function selectiongroupAction(){\n\t\t$societe=$this->societe;\n\t\tif ($societe instanceof Object_Societe ) {\n\t\t\t$this->view->locations = $societe->getLocations();\n\t\t}\n\t\t$this->view->selectedlocationid=$this->getParam('locationid');\n\t\t$this->view->resadate=$this->getParam('resadate');\n\t\t$this->view->partysize=$this->getParam('partysize');\n\t\t$this->view->slot=$this->getParam('slot');\n\t\t$this->disableLayout();\n\n\t}", "function jqdatag(){\n\n\t\t$grid = $this->defgrid();\n\t\t$grid->setHeight('185');\n\t\t$param['grids'][] = $grid->deploy();\n\n\t\t$grid1 = $this->defgridit();\n\t\t$grid1->setHeight('190');\n\t\t$param['grids'][] = $grid1->deploy();\n\n\t\t// Configura los Paneles\n\t\t$readyLayout = $grid->readyLayout2( 212, 220, $param['grids'][0]['gridname'],$param['grids'][1]['gridname']);\n\n\t\t//Funciones que ejecutan los botones\n\t\t$bodyscript = $this->bodyscript( $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t//Botones Panel Izq\n\t\t$grid->wbotonadd(array('id'=>'fimprime', 'img'=>'assets/default/images/print.png','alt'=> 'Imprimir transferencia', 'label'=>'Reimprimir'));\n\t\t$grid->wbotonadd(array(\"id\"=>\"ordene\" , \"img\"=>\"images/engrana.png\", \"alt\" => \"Orden Estimada\", \"label\"=>\"Orden Estimada\"));\n\t\t$grid->wbotonadd(array(\"id\"=>\"descar\", \"img\"=>\"images/engrana.png\", \"alt\" => \"Descargar Ingredientes\", \"label\"=>\"Descargar Ingred.\"));\n\t\t$grid->wbotonadd(array(\"id\"=>\"recibir\", \"img\"=>\"images/engrana.png\", \"alt\" => \"Recibir Produccion\", \"label\"=>\"Recibir Produccion\"));\n\t\t$grid->wbotonadd(array(\"id\"=>\"cerrado\", \"img\"=>\"images/engrana.png\", \"alt\" => \"Cerrar Orden\", \"label\"=>\"Cerrar Orden\"));\n\n\t\t$WestPanel = $grid->deploywestp();\n\n\t\t//Panel Central\n\t\t$centerpanel = $grid->centerpanel( $id = \"radicional\", $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t$adic = array(\n\t\t\tarray('id'=>'fedita', 'title'=>'Agregar/Editar Registro'),\n\t\t\tarray('id'=>'fshow' , 'title'=>'Mostrar Registro'),\n\t\t\tarray('id'=>'fborra', 'title'=>'Eliminar Registro')\n\t\t);\n\t\t$SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);\n\n\t\t$param['WestPanel'] = $WestPanel;\n\t\t//$param['EastPanel'] = $EastPanel;\n\t\t$param['SouthPanel'] = $SouthPanel;\n\t\t$param['listados'] = $this->datasis->listados('PRDO', 'JQ');\n\t\t$param['otros'] = $this->datasis->otros('PRDO', 'JQ');\n\t\t$param['temas'] = array('proteo','darkness','anexos1');\n\t\t$param['bodyscript'] = $bodyscript;\n\t\t$param['tabs'] = false;\n\t\t$param['encabeza'] = $this->titp;\n\t\t$param['tamano'] = $this->datasis->getintramenu( substr($this->url,0,-1) );\n\n\t\t$param['script'] = script('plugins/jquery.ui.autocomplete.autoSelectOne.js');\n\t\t$param['readyLayout'] = $readyLayout;\n\t\t$param['centerpanel'] = $centerpanel;\n\n\t\t$this->load->view('jqgrid/crud2',$param);\n\n\t}", "public function Base_Render_Before($Sender) {\n if(GetValue('Panel',$Sender->Assets) && $Sender->MasterView != 'admin') {\n\t $RecentlyActiveModule = new RecentlyActiveModule($Sender);\n $Sender->AddModule($RecentlyActiveModule);\n\t}\n }", "public function panel_content()\n {\n\n // Check if there is a form created\n if (!$this->form) {\n echo '<div class=\"wpforms-alert wpforms-alert-info\">';\n _e('You need to <a href=\"#\" class=\"wpforms-panel-switch\" data-panel=\"setup\">setup your form</a> before you can manage the settings.', 'wpforms');\n echo '</div>';\n return;\n }\n\n\n\n\n // --------------------------------------------------------------------//\n // Notifications\n // --------------------------------------------------------------------//\n echo '<div class=\"wpforms-panel-content-section wpforms-panel-content-section-custom_content\">';\n echo '<div class=\"wpforms-panel-content-section-title\">';\n _e('Custom content', 'wpforms');\n echo '</div>';\n wpforms_panel_field(\n 'tinymce',\n 'settings',\n 'custom_content_editor',\n $this->form_data,\n __('', 'wpforms'),\n array(\n 'default' => __('', 'wpforms'),\n 'tinymce' => array(\n 'editor_height' => '400',\n 'media_buttons' => true\n ),\n )\n );\n echo '</div>';\n\n // --------------------------------------------------------------------//\n // General\n // --------------------------------------------------------------------//\n echo '<div class=\"wpforms-panel-content-section wpforms-panel-content-section-general\">';\n echo '<div class=\"wpforms-panel-content-section-title\">';\n _e('General', 'wpforms');\n echo '</div>';\n wpforms_panel_field(\n 'select',\n 'settings',\n 'enable_archive',\n $this->form_data,\n __('Enable archives', 'wpforms'),\n array(\n 'default' => '1',\n 'options' => array(\n '1' => __('On', 'wpforms'),\n '0' => __('Off', 'wpforms'),\n ),\n 'tooltip' => __('This options to allow all data of form can be stored in Archives ', 'wpforms'),\n )\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'form_title',\n $this->form_data,\n __('Form Name', 'wpforms'),\n array(\n 'default' => $this->form->post_title,\n )\n );\n wpforms_panel_field(\n 'textarea',\n 'settings',\n 'form_desc',\n $this->form_data,\n __('Form Description', 'wpforms')\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'form_class',\n $this->form_data,\n __('Form CSS Class', 'wpforms'),\n array(\n 'tooltip' => __('Enter CSS class names for the form wrapper. Multiple class names should be separated with spaces.', 'wpforms'),\n )\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'submit_text',\n $this->form_data,\n __('Submit Button Text', 'wpforms'),\n array(\n 'default' => __('Submit', 'wpforms'),\n )\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'submit_text_processing',\n $this->form_data,\n __('Submit Button Processing Text', 'wpforms'),\n array(\n 'tooltip' => __('Enter the submit button text you would like the button display while the form submit is processing.', 'wpforms'),\n )\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'submit_class',\n $this->form_data,\n __('Submit Button CSS Class', 'wpforms'),\n array(\n 'tooltip' => __('Enter CSS class names for the form submit button. Multiple names should be separated with spaces.', 'wpforms'),\n )\n );\n wpforms_panel_field(\n 'checkbox',\n 'settings',\n 'honeypot',\n $this->form_data,\n __('Enable anti-spam honeypot', 'wpforms')\n );\n $recaptcha_key = wpforms_setting('recaptcha-site-key');\n $recaptcha_secret = wpforms_setting('recaptcha-secret-key');\n $recaptcha_type = wpforms_setting('recaptcha-type');\n if (!empty($recaptcha_key) && !empty($recaptcha_secret)) {\n wpforms_panel_field(\n 'checkbox',\n 'settings',\n 'recaptcha',\n $this->form_data,\n 'invisible' === $recaptcha_type ? __('Enable Google invisible reCAPTCHA', 'wpforms') : __('Enable Google reCAPTCHA (v2)', 'wpforms')\n );\n }\n do_action('wpforms_form_settings_general', $this);\n echo '</div>';\n\n // --------------------------------------------------------------------//\n // Notifications\n // --------------------------------------------------------------------//\n echo '<div class=\"wpforms-panel-content-section wpforms-panel-content-section-notifications\">';\n do_action('wpforms_form_settings_notifications', $this);\n echo '</div>';\n\n // --------------------------------------------------------------------//\n // Confirmation\n // --------------------------------------------------------------------//\n echo '<div class=\"wpforms-panel-content-section wpforms-panel-content-section-confirmation\">';\n echo '<div class=\"wpforms-panel-content-section-title\">';\n _e('Confirmation', 'wpforms');\n echo '</div>';\n wpforms_panel_field(\n 'select',\n 'settings',\n 'confirmation_type',\n $this->form_data,\n __('Confirmation Type', 'wpforms'),\n array(\n 'default' => 'message',\n 'options' => array(\n 'message' => __('Message', 'wpforms'),\n 'page' => __('Show Page', 'wpforms'),\n 'redirect' => __('Go to URL (Redirect)', 'wpforms'),\n ),\n )\n );\n wpforms_panel_field(\n 'tinymce',\n 'settings',\n 'confirmation_message',\n $this->form_data,\n __('Confirmation Message', 'wpforms'),\n array(\n 'default' => __('Thanks for contacting us! We will be in touch with you shortly.', 'wpforms'),\n 'tinymce' => array(\n 'editor_height' => '200',\n ),\n )\n );\n wpforms_panel_field(\n 'checkbox',\n 'settings',\n 'confirmation_message_scroll',\n $this->form_data,\n __('Automatically scroll to the confirmation message', 'wpforms')\n );\n $p = array();\n $pages = get_pages();\n foreach ($pages as $page) {\n $depth = count($page->ancestors);\n $p[$page->ID] = str_repeat('-', $depth) . ' ' . $page->post_title;\n }\n wpforms_panel_field(\n 'select',\n 'settings',\n 'confirmation_page',\n $this->form_data,\n __('Confirmation Page', 'wpforms'),\n array(\n 'options' => $p,\n )\n );\n wpforms_panel_field(\n 'text',\n 'settings',\n 'confirmation_redirect',\n $this->form_data,\n __('Confirmation Redirect URL', 'wpforms')\n );\n do_action('wpforms_form_settings_confirmation', $this);\n echo '</div>';\n\n do_action('wpforms_form_settings_panel_content', $this);\n }", "public function onAfterStartPanels(&$row)\n {\n echo JHtml::_('sliders.panel', 'Exemple start panel', 'test-start-panel');\n echo '<fieldset class=\"panelform\">' \n . JText::_('PLG_JEA_OWNER_NAME'). ' : <strong>'\n . $row->owner_name . '</strong></fieldset>';\n }", "function InitChildControls() {\n }", "private function viewPanelSequent($data)\n\t{\n\t\t$this->panel($data,'-sequent');\t\t\n\t}", "public function getRender(){\n /*\n * adiciona os listeners de comportamento padrão do componente\n */\n \n //ação que executa ao clicar sobre algum evento, abre a tela com as informações carregadas\n $sFuncao = \"eventWindow.show(record, el);\";\n $this->addListener(self::EVENTO_CLICK,$sFuncao,\"view, record, el\");\n \n //ação que ocorre ao clicar sobre os grids (dia, semana, mês)\n $sFuncao = \"eventWindow.show({\"\n .\"StartDate: date,\"\n .\"IsAllDay: allDay\"\n .\"}, el);\";\n $this->addListener(self::EVENTO_DAY_CLICK,$sFuncao,\"view, date, allDay, el\");\n \n //ação que ocorre ao redimensionar (aumentar ou reduzir) o tempo de um evento\n $sFuncaoUpdate = \"var calendarEventStore = Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].eventStore;\"\n .\"calendarEventStore.sync({\"\n .\"callback: function(batch, operation){\"\n .\"var result = batch.operations[0].request.scope.reader.jsonData['success'];\"\n .\"if(!result){\"\n .\"calendarEventStore.rejectChanges();\"\n .\"}\"\n .\"}\"\n .\"});\";\n $this->addListener(self::EVENTO_RESIZE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao mover um evento na tela\n $this->addListener(self::EVENTO_MOVE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao iniciar a movimentação dos elementos na tela\n $sFuncao = \"if(eventWindow && eventWindow.isVisible()){\"\n .\"eventWindow.hide();\"\n .\"}\";\n $this->addListener(self::EVENTO_DRAG,$sFuncao,\"view\");\n \n //ação que ocorre após selecionar várias linhas no grid (permite criar novo eventos por intervalos)\n $sFuncao = \"eventWindow.show(dates);\"\n .\"eventWindow.on('hide', onComplete, this, {single:true});\";\n $this->addListener(self::EVENTO_RANGE,$sFuncao,\"window, dates, onComplete\");\n \n /*\n * eventos que podem ser implementados no componente\n */\n //$this->addListener(self::EVENTO_OVER,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_OUT,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_ADD,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_UPDATE,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_DELETE,$sFuncao,\"window, record\");\n //$this->addListener(self::EVENTO_CANCEL,\"\",\"form, record\");\n //$this->addListener(self::EVENTO_VIEW_CHANGE,$sFuncao,\"panel, view, info\");\n \n $aRender = array(\n \"xtype\" => 'calendarpanel',\n \"itemId\" => $this->getId().\"-calendar\",\n \"calendarStore\" => $this->getRenderStoreTipoEvento(),\n \"eventStore\" => $this->getRenderStoreEvento(),\n \"activeItem\" => $this->getPerspectiva(),\n \"showNavBar\" => $this->getMostraBarraPerspectivas(),\n \"showDayView\" => $this->getMostraPerspectivaDia(),\n \"showWeekView\" => $this->getMostraPerspectivaSemana(),\n \"showMonthView\" => $this->getMostraPerspectivaMes(),\n \"showTime\" => $this->getMostraHora(),\n \"monthViewCfg\" => $this->getConfiguracaoMes(),\n \"eventIncrement\" => $this->getDuracaoEvento(),\n \"viewStartHour\" => $this->getHoraInicial(),\n \"viewStartMinute\" => $this->getMinutoInicial(),\n \"viewEndHour\" => $this->getHoraFinal(),\n \"viewEndMinute\" => $this->getMinutoFinal(),\n \"viewConfig\" => $this->getConfiguracao(),\n \"listeners\" => $this->getListeners()\n );\n \n $sRender = \"Ext.create('Ext.panel.Panel', {\"\n .\"layout: 'border',\"\n .\"border: true,\"\n .\"items: [{\"\n .\"xtype: 'panel',\"\n .\"itemId: '\".$this->getId().\"-region-west',\"\n .\"region: 'west',\"\n .\"title: 'Calendário',\"\n .\"collapsible: true,\"\n .\"split: true,\"\n .\"width: 220,\"\n .\"maxWidth: 220,\"\n .\"layoutConfig: {\"\n .\"fill: false,\"\n .\"animate: true\"\n .\"},\"\n .\"padding: '3',\"\n .\"bodyStyle:{\"\n .\"backgroundColor: '#157fcc'\"\n .\"},\"\n .\"items: [{\"\n .\"xtype: 'datepicker',\"\n .\"itemId: '\".$this->getId().\"-picker',\"\n .\"cls: 'ext-cal-nav-picker',\"\n .\"listeners: {\"\n .\"'select': {\"\n .\"fn: function(dp, dt){\"\n .\"Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].setStartDate(dt);\"\n .\"},\"\n .\"scope: this\"\n .\"}\"\n .\"}\"\n .\"},{\"\n .$this->getListaAgenda()\n .\"}]\"\n .\"},{\"\n .\"region: 'center',\"\n .\"itemId: '\".$this->getId().\"-region-center',\"\n .\"style:{\"\n .\"border: '3px solid #5A91D2',\"\n .\"borderLeft: 'none'\"\n .\"},\"\n .Base::getRender($aRender)\n .\"}]\"\n .\"})\";\n \n return Base::addObj($sRender,$this->getRenderTo()).$this->getTelaManutencao();\n }", "function composeL1EditForm_buttonsDiv() {\n\n\n return;\n}", "function showPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilCtrl;\n\t\t\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t$grps = ilPageEditorSettings::getGroups();\n\t\t\n\t\t$this->cgrp = $_GET[\"grp\"];\n\t\tif ($this->cgrp == \"\")\n\t\t{\n\t\t\t$this->cgrp = key($grps);\n\t\t}\n\n\t\t$ilCtrl->setParameter($this, \"grp\", $this->cgrp);\n\t\t$ilTabs->setSubTabActive(\"adve_grp_\".$this->cgrp);\n\t\t\n\t\t$this->initPageEditorForm();\n\t\t$tpl->setContent($this->form->getHtml());\n\t}", "function BeforeShowAdd(&$xt, &$templatefile, &$pageObject)\n{\n\n\t\t$att = $xt->fetchVar(\"Approved_editcontrol\");\n$att = str_replace(\">\",\" DISABLED=DISABLED>\",$att);\n$xt->assign(\"Approved_editcontrol\",$att);\n\n\n$attz = $xt->fetchVar(\"Approvedby_editcontrol\");\n$attz = str_replace(\">\",\" DISABLED=DISABLED>\",$attz);\n$xt->assign(\"Approvedby_editcontrol\",$attz);\n\n$at1 = $xt->fetchVar(\"EmployeeID_editcontrol\");\n$at1 = str_replace(\">\",\" DISABLED=DISABLED>\",$at1);\n$xt->assign(\"EmployeeID_editcontrol\",$at1);\n\n\n$at3 = $xt->fetchVar(\"Locked_editcontrol\");\n$at3 = str_replace(\">\",\" DISABLED=DISABLED>\",$at3);\n$xt->assign(\"Locked_editcontrol\",$at3);\n\n$at4 = $xt->fetchVar(\"Posted_editcontrol\");\n$at4 = str_replace(\">\",\" DISABLED=DISABLED>\",$at4);\n$xt->assign(\"Posted_editcontrol\",$at4);\n\n\n $attr = $xt->fetchVar(\"Superior_editcontrol\");\n $attr = str_replace(\">\",\" READONLY=READONLY>\",$attr);\n $xt->assign(\"Superior_editcontrol\",$attr);\n\n $att5 = $xt->fetchVar(\"Superior2_editcontrol\");\n $att5 = str_replace(\">\",\" READONLY=READONLY>\",$att5);\n $xt->assign(\"Superior2_editcontrol\",$att5);\n\n\n $att6 = $xt->fetchVar(\"1stApproval_editcontrol\");\n $att6 = str_replace(\">\",\" READONLY=READONLY>\",$att6);\n $xt->assign(\"1stApproval_editcontrol\",$att6);\n\n $att7 = $xt->fetchVar(\"2ndApproval_editcontrol\");\n $att7 = str_replace(\">\",\" READONLY=READONLY>\",$att7);\n $xt->assign(\"2ndApproval_editcontrol\",$att7);\n\n\n\n\n\n\n\n;\t\t\n}", "function selectEhsTreatment() {\n\n\t\t\t$replace['patient_id'] = \"\";\n\t\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\n\t\t\t/*if(isset($_SESSION['patient_id']) && $_SESSION['patient_id'] != \"\") {\n \n $title = $this->get_field($_SESSION['patient_id'],user,'name_title');\n $name_first = $this->get_field($_SESSION['patient_id'],user,'name_first');\n $name_last = $this->get_field($_SESSION['patient_id'],user,'name_last');\n $replace['patient_name'] .= '/&nbsp;' . $this->fullName($title,$name_first,$name_last) . '&nbsp;';\n\n\t\t\t $replace['patient_id'] = $_SESSION['patient_id'];\n \t}*/\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\t\t\t$replace['plan_title'] = strtoupper($this->get_field($this->value('plan_id'), $this->config['table']['plan'], \"plan_name\"));\n\t\t\t$replace['type'] = \"\";\n\t\t\tif($_SESSION['type'] == \"finish\"){\n\t\t\t\t$replace['type'] = 'finish';\n\t\t\t}\n\t\t\telseif($_SESSION['type'] == \"treatment_plan\"){\n\t\t\t\t$replace['type'] = 'treatment_plan';\n\t\t\t}\n\n\t\t\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\n\t\t\t\n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_1_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_1_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_2_red_sm.gif\">':'<img src=\"images/stepIcons_2_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_instruction_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_3_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_3_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Build Back button Url\n\n\t\t\t$replace['act'] = \"plan_edit\";\n\n\t\t\t$replace['action'] = \"createNewEhsPlan\";\n\n\t\t\t$backUrl = array('action','plan_id','type','act');\n\n\t\t\t$replace['back_url'] = $this->buildBackUrl($backUrl,$replace);\n\n\t\t\t// End of build Back button Url\n\n\t\t\t// Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TX PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n\t\t\t$LabelTreatmentSearch=$_SESSION['providerLabel']['SEARCH TREATMENT']!=''?$_SESSION['providerLabel']['SEARCH TREATMENT']:\"SEARCH TREATMENT\";\n $LabelTreatmentResult=$_SESSION['providerLabel']['TREATMENT RESULTS']!=''?$_SESSION['providerLabel']['TREATMENT RESULTS']:\"TREATMENT RESULTS\";\n\t\t\t$LabelTreatmentSelected=$_SESSION['providerLabel']['SELECTED TREATMENTS']!=''?$_SESSION['providerLabel']['SELECTED TREATMENTS']:\"SELECTED TREATMENTS\";\n\t\t\t$replace['SEARCH_TREATMENT'] = strtoupper($LabelTreatmentSearch);\n\t\t\t$replace['TREATMENT_RESULTS'] = strtoupper($LabelTreatmentResult);\n\t\t\t$replace['SELECTED_TREATMENTS'] = strtoupper($LabelTreatmentSelected);\n\t\t\t\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"selectTreatment\"),$replace);\n\t\t\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Select Treatment\";\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\t\t\t\n\n\t\t}", "function jqdatag(){\n\n\t\t$grid = $this->defgrid();\n\t\t$param['grids'][] = $grid->deploy();\n\n\t\t$grid1 = $this->defgridit();\n\t\t$param['grids'][] = $grid1->deploy();\n\n\t\t// Configura los Paneles\n\t\t$readyLayout = $grid->readyLayout2( 212, 220, $param['grids'][0]['gridname'],$param['grids'][1]['gridname']);\n\n\t\t//Funciones que ejecutan los botones\n\t\t$bodyscript = $this->bodyscript( $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t//Botones Panel Izq\n\t\t$grid->wbotonadd(array('id'=>'boton1', 'img'=>'assets/default/images/print.png', 'alt' => 'Reimprimir', 'label'=>'Reimprimir'));\n\n\t\tif($this->datasis->sidapuede('SFAC','INCLUIR%' ))\n\t\t\t$grid->wbotonadd(array('id'=>'bffact', 'img'=>'images/RedoGreen.png', 'alt' => 'Facturar', 'label'=>'Facturar'));\n\n\t\tif($this->datasis->sidapuede('SNTE','INCLUIR%' ))\n\t\t\t$grid->wbotonadd(array('id'=>'bsnte', 'img'=>'images/RedoBlue.png', 'alt' => 'Nota de Entrega', 'label'=>'N.Entrega'));\n\n\t\t$grid->wbotonadd(array('id'=>'bcorreo', 'img'=>'assets/default/images/mail_btn.png','alt' => 'Notificacion', 'label'=>'Notificar por email'));\n\t\t$grid->wbotonadd(array('id'=>'bfavori', 'img'=>'images/star.png','alt' => 'Marcar Favorito', 'label'=>'Marcar Favorito'));\n\t\t$grid->wbotonadd(array('id'=>'bgrfavo', 'img'=>'images/star.png','alt' => 'Grupo de Favorito', 'label'=>'Grupo de Favorito'));\n\n\t\t$WestPanel = $grid->deploywestp();\n\n\t\t//Panel Central\n\t\t$centerpanel = $grid->centerpanel( $id = 'radicional', $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t$adic = array(\n\t\t\tarray('id'=>'fedita' , 'title'=>'Agregar/Editar Registro'),\n\t\t\tarray('id'=>'ffact' , 'title'=>'Convertir en factura'),\n\t\t\tarray('id'=>'scliexp', 'title'=>'Ficha de Cliente' ),\n\t\t\tarray('id'=>'fshow' , 'title'=>'Mostrar Registro' ),\n\t\t\tarray('id'=>'fborra' , 'title'=>'Eliminar Registro')\n\t\t);\n\t\t$SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);\n\n\t\t$param['WestPanel'] = $WestPanel;\n\t\t$param['script'] = '';\n\t\t//$param['EastPanel'] = $EastPanel;\n\t\t$param['readyLayout'] = $readyLayout;\n\t\t$param['SouthPanel'] = $SouthPanel;\n\t\t$param['listados'] = $this->datasis->listados('SPRE', 'JQ');\n\t\t$param['otros'] = $this->datasis->otros('SPRE', 'JQ');\n\t\t$param['centerpanel'] = $centerpanel;\n\t\t//$param['funciones'] = $funciones;\n\t\t$param['temas'] = array('proteo','darkness','anexos1');\n\t\t$param['bodyscript'] = $bodyscript;\n\t\t$param['tabs'] = false;\n\t\t$param['encabeza'] = $this->titp;\n\t\t$param['tamano'] = $this->datasis->getintramenu( substr($this->url,0,-1) );\n\t\t$this->load->view('jqgrid/crud2',$param);\n\t}", "public function show_in_panel() {\n\t\treturn false;\n\t}", "public function customize_pane_settings()\n {\n }", "function OnBeforeCreateEditControl(){\n }", "public function getRender(){\n //Adiciona a funcionalidade para definir o campo que deve receber o foco inicial\n if($this->getCampoFoco() != null){\n $sFuncao = View::campoFocus($this->getCampoFoco()->getId());\n $this->addListener(Base::EVENTO_APOS_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que centraliza o formulário na tela\n if($this->getCentraliza()){\n $sFuncao = Base::getFuncaoCentraliza();\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que indica que será possível arrastar o formulário\n if($this->getPermiteArrastar()){\n $sFuncao = Base::getFuncaoLimitaArrasto($this->getId(),$this->getRenderTo());\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n $aRender = array(\n \"animCollapse\" => true,\n \"autoScroll\" => true,\n \"waitMsgTarget\" => true,\n \"bodyPadding\" => 10,\n \"iconCls\" => 'icon-form',\n \"border\" => $this->getAdicionaBorda(),\n //\"glyph\" => 36,\n \"layout\" => $this->getLayout(),\n \"id\" => $this->getId(),\n \"title\" => $this->getTitulo(),\n \"closable\" => $this->getPermiteFechar(),\n \"resizable\" => $this->getPermiteRedimensionar(),\n \"draggable\" => $this->getPermiteArrastar(),\n \"collapsible\" => $this->getPermiteRecolher(),\n \"height\" => $this->getAltura(),\n \"width\" => $this->getLargura(),\n \"html\" => $this->getHtml(),\n \"items\" => $this->getStringItemsLayout(),\n \"buttons\" => $this->getBotoes(),\n \"listeners\" => $this->getListeners(),\n \"reloadPreviousOnClose\" => $this->getReloadPreviousOnClose()\n );\n \n $oForm = \"Ext.create('Ext.panel.Panel', {\".Base::getRender($aRender).\"})\";\n \n return Base::addObj($oForm,$this->getRenderTo());\n }", "public function drawStartOptionsPanel()\r\n {\r\n echo '\r\n <div class=\"panel-body\">\r\n <ul class=\"list-group\">';\r\n }", "function CreateChildControls()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::CreateChildControls();\" . \"<HR>\";\n if ($this->listSettings->GetCount()) {\n if ($this->listSettings->HasItem(\"MAIN\", \"TABLE\")) {\n $this->Table = $this->listSettings->GetItem(\"MAIN\", \"TABLE\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_TABLE_SETTINGS\", array(), true);\n }\n if (! $this->error) {\n\n //parse library file\n \t$this->InitLibraryData();\n \t//reinitilize database columns definitions\n $this->ReInitTableColumns();\n //create validator\n $this->validator = new Validate($this, $this->Storage->columns, $this->library_ID);\n $this->Kernel->ImportClass(\"web.controls.\" . $this->editcontrol, $this->editcontrol);\n $_editControl = new $this->editcontrol(\"ItemsEdit\", \"edit\", $this->Storage);\n $this->AddControl($_editControl);\n }\n } // if\n else {\n $this->AddEditErrorMessage(\"EMPTY_LIBRARY_SETTINGS\", array(), true);\n }\n }", "public function getPanel() {\n $isAdditionalBar = \\TracyDebugger::isAdditionalBar();\n $out = \"<h1>{$this->icon} {$this->label}\" . ($isAdditionalBar ? \" (\".$isAdditionalBar.\")\" : \"\") . \"</h1>\";\n\n $out .= '<span class=\"tracy-icons\"><span class=\"resizeIcons\"><a href=\"#\" title=\"Maximize / Restore\" onclick=\"tracyResizePanel(\\'' . $this->className . '\\')\">+</a></span></span>';\n\n // panel body\n $out .= '<div class=\"tracy-inner\">';\n\n $numOrphanFiles = count($this->orphanFiles);\n\n if($numOrphanFiles > 0) {\n $out .= '\n <form style=\"display:inline\" method=\"post\" action=\"'.\\TracyDebugger::inputUrl(true).'\" onsubmit=\"return confirm(\\'Do you really want to delete all the orange highlighted orphan files?\\');\">\n <input type=\"hidden\" name=\"orphanPaths\" value=\"'.implode('|', $this->orphanFiles).'\" />\n <input type=\"submit\" style=\"color:'.\\TracyDebugger::COLOR_WARN.' !important; color: #FFFFFF\" name=\"deleteOrphanFiles\" value=\"Delete '.$numOrphanFiles.' orphan'._n('', 's', $numOrphanFiles).'\" />\n </form>&nbsp&nbsp;';\n }\n\n if($this->numMissingFiles > 0) {\n $out .= '\n <form style=\"display:inline\" method=\"post\" action=\"'.\\TracyDebugger::inputUrl(true).'\" onsubmit=\"return confirm(\\'Do you really want to delete all the red highlighted missing pagefiles?\\');\">\n <input type=\"hidden\" name=\"missingPaths\" value=\"'.urlencode(json_encode($this->missingFiles)).'\" />\n <input type=\"submit\" style=\"color:'.\\TracyDebugger::COLOR_ALERT.' !important; color: #FFFFFF\" name=\"deleteMissingFiles\" value=\"Delete '.$this->numMissingFiles.' missing pagefile'._n('', 's', $this->numMissingFiles).'\" />\n </form>';\n }\n\n if($numOrphanFiles > 0 || $this->numMissingFiles > 0) {\n $out .= '<br /><br />';\n }\n\n $out .= '<div id=\"tracyPageFilesList\">'.$this->filesListStr.'</div>';\n\n $out .= \\TracyDebugger::generatePanelFooter($this->name, \\Tracy\\Debugger::timer($this->name), strlen($out));\n $out .= '</div>';\n\n return parent::loadResources() . $out;\n }", "public function search_prayer_group($prayer_group_id) \n {\n try\n {\n \n $posted=array();\n $this->data[\"posted\"]=$posted;/*don't change*/ \n $data = $this->data; \n $this->data[\"MAIN_MENU_SELECTED\"] = 6;\n parent::_set_title('::: COGTIME Xtian network :::');\n parent::_set_meta_desc('');\n parent::_set_meta_keywords('');\n \n \n parent::_add_js_arr( array(/* 'js/ddsmoothmenu.js',\n 'js/switch.js','js/animate-collapse.js',\n 'js/lightbox.js',\n 'js/jquery-ui-1.8.2.custom.min.js',\n 'js/stepcarousel.js',\n 'js/tab.js',*/\n 'js/production/prayer_group.js',\n ));\n\n // parent::_add_css_arr( array(//'css/jquery-ui-1.8.13.custom.css'\n // ) );\n\n \n $i_user_id = intval(decrypt($this->session->userdata('user_id')));\n\t\t\t\n\t\t\tob_start();\n\t\t\t$this->groups_ajax_listing($page);\n\t\t\t$content = ob_get_contents();\n\t\t\t$content_obj = json_decode($content);\n\t\t\t$data['group_listing'] = $content_obj->grp_html;\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\t$data['pagination_per_page'] = $this->pagination_per_page;\n\t\t\t$this->session->set_userdata('search_condition','');\n # view file...\n ob_start();\n $content = $this->generate_prayer_group_listing_AJAX();\n $content = ob_get_contents();\n $content_obj = json_decode($content);\n $data['listingContent'] = $content_obj->html; \n $data['no_of_result'] = $content_obj->no_of_result;\n ob_end_clean(); \n \n # view file...\n \n $VIEW = \"logged/holy_place/prayer_group/search-and-join-create-prayer-group.phtml\"; \n parent::_render($data, $VIEW);\n }\n catch(Exception $err_obj)\n {\n \n } \n\n }", "function cchl_directorio_boxes() {\n $directoriobox = new_cmb2_box(\n array(\n 'id' => '_cchl_listadopersonasbox',\n 'title' => 'Personas',\n 'object_types' => array('page', 'filsa-2017'),\n 'show_on' => array('key' => 'page-template', 'value' => array('templates/bs-listado-personas.php', 'templates/template-filsa-2017-invitados.php'))\n )\n );\n\n $directoriobox_id =$directoriobox->add_field(\n array(\n 'id' => '_cchl_listadopersonas',\n 'type' => 'group',\n 'description' => 'Información Persona',\n 'repeatable' => true, // use false if you want non-repeatable group\n 'options' => array(\n 'group_title' => 'Persona', // since version 1.1.4, {#} gets replaced by row number\n 'add_button' => 'Añadir otra persona',\n 'remove_button' => 'Borrar persona',\n 'sortable' => true, // beta\n // 'closed' => true, // true to have the groups closed by default\n )\n )\n );\n\n $directoriobox->add_group_field($directoriobox_id, \n array(\n 'name' => 'Nombre Persona',\n 'id' => 'nombre',\n 'type' => 'text'\n )\n );\n\n $directoriobox->add_group_field($directoriobox_id, \n array(\n 'name' => 'Cargo Persona',\n 'id' => 'cargo',\n 'type' => 'text'\n )\n );\n\n $directoriobox->add_group_field($directoriobox_id, \n array(\n 'name' => 'Descripción',\n 'id' => 'texto',\n 'type' => 'wysiwyg'\n )\n );\n\n if(get_post_meta($post->ID, 'imagen', true)):\n //Legacy support\n $directoriobox->add_group_field($directoriobox_id, \n array(\n 'name' => 'Fotografía persona',\n 'id' => 'imagen',\n 'type' => 'text',\n 'options' => array(\n 'url' => false\n )\n )\n );\n\n endif;\n\n $directoriobox->add_group_field($directoriobox_id, \n array(\n 'name' => 'Fotografía persona',\n 'id' => 'imagen_new',\n 'type' => 'file',\n 'options' => array(\n 'url' => false\n )\n )\n);\n\n}", "public function Base_Render_Before($Sender) {\n if(GetValue('Panel',$Sender->Assets) && $Sender->MasterView != 'admin') {\n $RecentlyActiveModule = new RecentlyActiveModule($Sender);\n $Sender->AddModule($RecentlyActiveModule);\n }\n }", "function edit($id) {\n // Call the parent then override the title\n \n parent::edit($id);\n \n $gm = $this->viewVars['co_group_members'][0];\n \n $this->set('title_for_layout', _txt('op.grm.title', array(_txt('op.edit'),\n $gm['CoGroup']['name'],\n generateCn($gm['CoPerson']['PrimaryName']))));\n }", "function show_panel()\n\t{\n\t\tglobal $template, $errors, $Cl_root_path;\n\t\t\n\t\t$template->assign_files( array(\n\t\t\t'ACP_MoreContent' => 'ACP/MoreContent' . tplEx\n\t\t) );\n\t\t\n\t\t// get the subsubmode\n\t\t$sub = ( isset( $_GET[ 's' ] ) ) ? strval( $_GET[ 's' ] ) : 'add';\n\t\t\n\t\t\t\n\t\tswitch( $sub )\n\t\t{\n\t\t\tcase 'manage':\n\t\t\t\t$this->manage();\n\t\t\t\tbreak;\n\t\t\tcase 'manage2':\n\t\t\t\t$this->manage2();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors->report_error( $this->lang[ 'Wrong_mode' ], CRITICAL_ERROR );\n\t\t\t\tbreak;\n\t\t}\n\t}", "function jqdatag(){\n\n\t\t$grid = $this->defgrid();\n\t\t$grid->setHeight('185');\n\t\t$param['grids'][] = $grid->deploy();\n\n\t\t$grid1 = $this->defgridit();\n\t\t$grid1->setHeight('190');\n\t\t$param['grids'][] = $grid1->deploy();\n\n\t\t// Configura los Paneles\n\t\t$readyLayout = $grid->readyLayout2( 212, 220, $param['grids'][0]['gridname'],$param['grids'][1]['gridname']);\n\n\t\t//Funciones que ejecutan los botones\n\t\t$bodyscript = $this->bodyscript( $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t//Botones Panel Izq\n\t\t$grid->wbotonadd(array('id'=>'imprime', 'img'=>'assets/default/images/print.png','alt' => 'Imprimir', 'label'=>'Imprimir Relacion'));\n\t\t$WestPanel = $grid->deploywestp();\n\n\t\t//Panel Central\n\t\t$centerpanel = $grid->centerpanel( $id = 'radicional', $param['grids'][0]['gridname'], $param['grids'][1]['gridname'] );\n\n\t\t$adic = array(\n\t\t\tarray('id'=>'fedita', 'title'=>'Agregar/Editar Registro'),\n\t\t\tarray('id'=>'fshow' , 'title'=>'Mostrar Registro'),\n\t\t\tarray('id'=>'fborra', 'title'=>'Eliminar Registro')\n\t\t);\n\t\t$SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);\n\n\t\t$param['WestPanel'] = $WestPanel;\n\t\t$param['script'] = '';\n\t\t$param['readyLayout'] = $readyLayout;\n\t\t$param['SouthPanel'] = $SouthPanel;\n\t\t$param['listados'] = $this->datasis->listados('RCOBRO', 'JQ');\n\t\t$param['otros'] = $this->datasis->otros('RCOBRO', 'JQ');\n\t\t$param['centerpanel'] = $centerpanel;\n\t\t$param['temas'] = array('proteo','darkness','anexos1');\n\t\t$param['bodyscript'] = $bodyscript;\n\t\t$param['tabs'] = false;\n\t\t$param['encabeza'] = $this->titp;\n\t\t$param['tamano'] = $this->datasis->getintramenu( substr($this->url,0,-1) );\n\t\t$this->load->view('jqgrid/crud2',$param);\n\n\t}", "function\n\tGalleryStandardDisplay()\n\t{\n $phyType = new Field;\n $phyType->ColName = 'PhyType_tab';\n\n $phyHeight = new Field;\n $phyHeight->ColName = 'PhyHeight_tab';\n\n $phyWidth = new Field;\n $phyWidth->ColName = 'PhyWidth_tab';\n\n $phyDepth = new Field;\n $phyDepth->ColName = 'PhyDepth_tab';\n\n $phyDiameter = new Field;\n $phyDiameter->ColName = 'PhyDiameter_tab';\n\n $phyDimUnits = new Field;\n $phyDimUnits->ColName = 'PhyUnitLength_tab';\n\n $phyWeight = new Field;\n $phyWeight->ColName = 'PhyWeight_tab';\n\n $phyDimWeight = new Field;\n $phyDimWeight->ColName = 'PhyUnitWeight_tab';\n\n $sizeTable = new Table;\n $sizeTable->Name = 'Dimensions';\n $sizeTable->Headings = array('Height', 'Width', 'Depth', 'Diam', 'Unit', 'Type');\n $sizeTable->Columns = array($phyHeight, $phyWidth, $phyDepth, $phyDiameter, $phyDimUnits, $phyType);\n\n\t\t$narratives = new BackReferenceField;\n\t\t$narratives->RefDatabase = \"eevents\";\n\t\t$narratives->RefField = \"ObjAttachedObjectsRef_tab\";\n\t\t$narratives->ColName = \"SummaryData\";\n\t\t$narratives->Label = \"Events\";\n\t\t$narratives->LinksTo = $GLOBALS['DEFAULT_EXHIBITION_PAGE'];\n\n\t\t$creRole = new Field;\n\t\t$creRole->ColName = 'CreRole_tab';\n\t\t$creRole->Italics = 1;\n\t\t\n\t\t$creCreatorRef = new Field;\n\t\t$creCreatorRef->ColName = 'CreCreatorRef_tab->eparties->SummaryData';\n\t\t$creCreatorRef->LinksTo = $GLOBALS['DEFAULT_PARTY_DISPLAY_PAGE'];\n\t\t\n\t\t$creatorTable = new Table;\n\t\t$creatorTable->Name = \"CreCreatorRef_tab\";\n\t\t$creatorTable->Columns = array($creCreatorRef, $creRole);\n\n\t\t$this->Fields = array(\n 'TitMainTitle',\n 'TitAccessionNo',\n\t\t\t\t$creatorTable,\n 'TitMainTitle',\n 'CreDateCreated',\n 'PhyMediaCategory',\n 'PhyMedium',\n\t\t\t\t$sizeTable,\n\n\t\t\t\t'CrePrimaryInscriptions',\n\t\t\t\t'CreSecondaryInscriptions',\n 'AccCreditLineLocal',\n 'LocCurrentLocationRef->elocations->SummaryData',\n\n\t\t\t\t//'TitAccessionNo',\n\t\t\t\t//'TitMainTitle',\n\t\t\t\t//'TitAccessionDate',\n\t\t\t\t//'TitCollectionTitle',\n\t\t\t\t//'CreDateCreated',\n\t\t\t\t//'TitTitleNotes',\n\t\t\t\t//'CreCountry_tab',\n\t\t\t\t//'PhyMedium',\n\t\t\t\t//'PhyTechnique',\n\t\t\t\t//'PhySupport',\n\t\t\t\t//'PhyMediaCategory',\n\t\t\t\t//'LocCurrentLocationRef->elocations->SummaryData',\n\t\t\t\t//'NotNotes',\n\t\t\t\t//'MulMultiMediaRef:1->emultimedia->MulIdentifier',\n\t\t\t\t//'AssRelatedObjectsRef_tab->ecatalogue->SummaryData',\n\t\t\t\t//$AssRef,\n\t\t\t\t);\n\t\t\n\t\t$this->BaseStandardDisplay();\n\t}", "function groups() {\n\t\t$this->validate();\n\t\t$this->setupTemplate();\n\n\t\t$journal =& Request::getJournal();\n\n\t\t$rangeInfo =& $this->getRangeInfo('groups');\n\n\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t$groups =& $groupDao->getGroups(ASSOC_TYPE_JOURNAL, $journal->getId(), null, $rangeInfo);\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.tablednd.js');\n\t\t$templateMgr->addJavaScript('lib/pkp/js/functions/tablednd.js');\n\t\t$templateMgr->assign_by_ref('groups', $groups);\n\t\t$templateMgr->assign('boardEnabled', $journal->getSetting('boardEnabled'));\n\t\t$templateMgr->display('manager/groups/groups.tpl');\n\t}", "abstract protected function _setNewForm();", "public function postProcess(): void {\n $groupsToAddTo = (array) $this->getSubmittedValue('groups');\n $summaryInfo = ['groups' => [], 'tags' => []];\n foreach ($groupsToAddTo as $groupID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which groups were created vs already existed.\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => Group::get(FALSE)\n ->addWhere('id', '=', $groupID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n\n if ($this->getSubmittedValue('newGroupName')) {\n /* Create a new group */\n $groupsToAddTo[] = $groupID = Group::create(FALSE)->setValues([\n 'title' => $this->getSubmittedValue('newGroupName'),\n 'description' => $this->getSubmittedValue('newGroupDesc'),\n 'group_type' => $this->getSubmittedValue('newGroupType') ?? [],\n 'is_active' => TRUE,\n ])->execute()->first()['id'];\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => $this->getSubmittedValue('newGroupName'),\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n $tagsToAdd = (array) $this->getSubmittedValue('tag');\n foreach ($tagsToAdd as $tagID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which tags were created vs already existed.\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => Tag::get(FALSE)\n ->addWhere('id', '=', $tagID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n if ($this->getSubmittedValue('newTagName')) {\n $tagsToAdd[] = $tagID = Tag::create(FALSE)->setValues([\n 'name' => $this->getSubmittedValue('newTagName'),\n 'description' => $this->getSubmittedValue('newTagDesc'),\n 'is_selectable' => TRUE,\n 'used_for' => 'civicrm_contact',\n //NYSS new tags during import should be imported as keywords\n 'parent_id'\t=> 296,\n ])->execute()->first()['id'];\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => $this->getSubmittedValue('newTagName'),\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n // Store the actions to take on each row & the data to present at the end to the userJob.\n $this->updateUserJobMetadata('post_actions', [\n 'group' => $groupsToAddTo,\n 'tag' => $tagsToAdd,\n ]);\n $this->updateUserJobMetadata('summary_info', $summaryInfo);\n\n // If ACL applies to the current user, update cache before running the import.\n if (!CRM_Core_Permission::check('view all contacts')) {\n $userID = CRM_Core_Session::getLoggedInContactID();\n CRM_ACL_BAO_Cache::deleteEntry($userID);\n CRM_ACL_BAO_Cache::deleteContactCacheEntry($userID);\n }\n\n $this->runTheImport();\n }", "function section_template(){\n\n ?>\n <div class=\"pl-show-on-load pl-trigger\">\n <div class=\"pl-row pl-content-area pl-content-area-wide \"> \n<div class=\"pl-row grid-example\" style=\"padding:15px;\">\n<div class=\"pl-col-sm-12 pl-col-lg-12\" style=\"padding-bottom: 15px;\">\n <div class=\"wrap\">\n <h1 class=\"pl-alignment-center\" data-bind=\"pltext: headline\"></h1>\n\t<div class=\"h4 pl-alignment-center\" style=\"padding-left:.5em; padding-right:.5em; padding-bottom:1em;\" data-bind=\"pltext: subtext\"></div>\n\t</div>\n\t</div>\n\t\n\t<div class=\"pl-col-sm-5\"><div class=\"wrap\" ><figure class=\"plc-image-container\">\n <div data-bind=\"style: { 'background-color': caption_background }, plclassname: [image_scheme() ],\">\n <img src=\"\" data-bind=\"plimg: plc_image_after, attr: {'alt': plc_image_after_text }\" alt=\"\" />\n \t<span class=\"plc-image-label\" data-type=\"original\" data-bind=\"pltext: plc_image_after_text\" ></span>\n \t<div class=\"plc-resize-img\">\n <img src=\"\" data-bind=\"plimg: plc_image_before, attr: { 'alt': plc_image_before_text }\" alt=\"\" />\n \t\t<span class=\"plc-image-label\" data-type=\"modified\" data-bind=\"pltext: plc_image_before_text\"></span>\n \t</div>\n\t\t</div>\n \t<span class=\"plc-handle\" data-bind=\"style: { 'background-color': plc_handle_bg }\">\n <i class=\"pl-icon pl-icon-chevron-left\" data-bind=\"style: { 'color': plc_arrows_color }\"></i>\n <i class=\"pl-icon pl-icon-chevron-right\" data-bind=\"style: { 'color': plc_arrows_color }\"></i>\n </span>\n </figure>\n </div>\n </div>\n <div class=\"pl-col-sm-7\">\n <div class=\"wrap\">\n <h3 class=\"\" data-bind=\"pltext: title\"></h3>\n <div data-bind=\"style: { 'background-color': caption_background }, plclassname: [caption_scheme() ],\">\n\t<div class=\"\" data-bind=\"pltext: caption\" style=\"padding-left:10px; padding-right:10px;\">Product Description</div>\n </div>\n <span class=\"pre_price h4\" data-bind=\"pltext: pre_price\">$</span>\n\t\t\t<span class=\"price h1\" data-bind=\"pltext: price\">25</span>\n\t\t\t<span class=\"post_price h5\" data-bind=\"pltext: post_price\">00</span>\n\t\t\t<div class=\"more_price\" data-bind=\"pltext: more_price\">Additional Information Here</div>\n </div>\n <div class=\"pl-btn-wrap\"style=\"padding-bottom:1em;\"><a class=\"pl-btn\" href=\"#\" data-bind=\"plbtn: 'button'\" ></a></div>\n </div>\n \n\t\t</div>\n </div>\n</div>\n\n <?php\n }", "public function afterLoadRegisterControlsUI(){\n\t\t\n\t}", "abstract protected function definition_draggable_items($mform, $itemrepeatsatstart);", "function definition_after_data() {\n global $CFG, $COURSE;\n $mform =& $this->_form;\n\n if ($id = $mform->getElementValue('update')) {\n $modulename = $mform->getElementValue('modulename');\n $instance = $mform->getElementValue('instance');\n\n if ($this->_features->gradecat) {\n $gradecat = false;\n if (!empty($CFG->enableoutcomes) and $this->_features->outcomes) {\n if ($outcomes = grade_outcome::fetch_all_available($COURSE->id)) {\n $gradecat = true;\n }\n }\n if ($items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$modulename,\n 'iteminstance'=>$instance, 'courseid'=>$COURSE->id))) {\n foreach ($items as $item) {\n if (!empty($item->outcomeid)) {\n $elname = 'outcome_'.$item->outcomeid;\n if ($mform->elementExists($elname)) {\n $mform->hardFreeze($elname); // prevent removing of existing outcomes\n }\n }\n }\n foreach ($items as $item) {\n if (is_bool($gradecat)) {\n $gradecat = $item->categoryid;\n continue;\n }\n if ($gradecat != $item->categoryid) {\n //mixed categories\n $gradecat = false;\n break;\n }\n }\n }\n\n if ($gradecat === false) {\n // items and outcomes in different categories - remove the option\n // TODO: it might be better to add a \"Mixed categories\" text instead\n if ($mform->elementExists('gradecat')) {\n $mform->removeElement('gradecat');\n }\n }\n }\n }\n\n if ($COURSE->groupmodeforce) {\n if ($mform->elementExists('groupmode')) {\n $mform->hardFreeze('groupmode'); // groupmode can not be changed if forced from course settings\n }\n }\n\n if ($mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly') and empty($COURSE->groupmodeforce)) {\n $mform->disabledIf('groupingid', 'groupmode', 'eq', NOGROUPS);\n\n } else if (!$mform->elementExists('groupmode') and $mform->elementExists('groupmembersonly')) {\n $mform->disabledIf('groupingid', 'groupmembersonly', 'notchecked');\n\n } else if (!$mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly')) {\n // groupings have no use without groupmode or groupmembersonly\n if ($mform->elementExists('groupingid')) {\n $mform->removeElement('groupingid');\n }\n }\n }", "function class_group_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'class_group_add';\n $page_data['page_title'] = get_phrase('add_class_group');\n $this->load->view('backend/index', $page_data);\n }", "public function &onGroupAreas()\n\t{\n\t\t$area = array(\n\t\t\t'name' => $this->_name,\n\t\t\t'title' => Lang::txt('PLG_GROUPS_ACTIVITY'),\n\t\t\t'default_access' => $this->params->get('plugin_access', 'members'),\n\t\t\t'display_menu_tab' => $this->params->get('display_tab', 1),\n\t\t\t'icon' => 'f056'\n\t\t);\n\t\treturn $area;\n\t}", "function setup_groups() {\n global $CFG;\n\n /// find out current groups mode\n $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);\n $this->currentgroup = groups_get_course_group($this->course);\n\n if ($this->currentgroup) {\n $this->groupsql = \" LEFT JOIN {$CFG->prefix}groups_members gm ON gm.userid = u.id \";\n $this->groupwheresql = \" AND gm.groupid = $this->currentgroup \";\n }\n }", "private function loginPanel() {\n $this->user_panel->processLogin();\n }", "public function panel (\\stdClass $param);", "function Control_Render(&$Owner)\r\n\t{\r\n\t\t$parent = $Owner->OriginalNode->ParentNode();\r\n\t\t\r\n\t\t//insert this node before the parent \r\n\t\t$parent->InsertBefore($this->OriginalNode, $Owner->OriginalNode);\r\n\t\r\n\t\r\n\t\t//call parent render with ourselves as the owner\r\n\t\t$result = parent::Control_Render($this);\r\n\t\t\r\n\t\tif (!$result)\r\n\t\t{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//NOTE: this control allows the use of [= ] inline blocks\r\n\t\tParser::ParseInlineBlocks($this, $this->OriginalNode);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//get all items within the copy\r\n\t\t$holder_items = $this->OriginalNode->GetElementsByTagName(PCNODE_ITEM);\r\n\t\t\r\n\t\t//NOTE:: this relative query doesn't work properly in PHP4\r\n\t\t//$holder_items = $ctx->xpath_eval(\"//\".PCNODE_ITEM.\"[@repeater='\".$this->ID.\"']\", $holder);\r\n\t\t\r\n\t\t\r\n\t\t//replace each item with it's value\r\n\t\tfor ($i = 0; $i < count($holder_items); $i++)\r\n\t\t{\r\n\t\t\t$clone_item = $holder_items[$i];\r\n\t\t\t\r\n\t\t\t//ensure Item has repeater attribute\r\n\t\t\tif ($clone_item->GetAttribute(\"repeater\") == \"\")\r\n\t\t\t{\r\n\t\t\t\ttrigger_error(\"An item has been found within a repeater (id: \".$Owner->ID.\" ) without a valid repeater attribute.\",E_USER_ERROR);\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//goto next item if this one isn't for this repeater\r\n\t\t\tif ($clone_item->GetAttribute(\"repeater\") != $Owner->ID)\r\n\t\t\t{\r\n\t\t\t\tcontinue;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//create a new repeater item\r\n\t\t\t$item = new RepeaterItem($clone_item);\r\n\t\t\t\r\n\t\t\t//get the datafield for this item\r\n\t\t\t$datafield = $item->GetDatafield();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$item->SetData($this->DataRow->Get($datafield));\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t}", "public function addForm()\n {\n $this->getState()->template = 'displaygroup-form-add';\n $this->getState()->setData([\n 'help' => $this->getHelp()->link('DisplayGroup', 'Add')\n ]);\n }", "public function getSubgroup() {}", "function fantacalcio_admin_groups_list() {\n $out = \"\";\n \n $out .= l(\"Aggiungi girone\", \"admin/fantacalcio/groups/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n \n $groups = Group::all();\n $competitions = Competition::all();\n if ($groups) {\n $header = array(\n t(\"Girone\"), \n t(\"Attivo\"), \n t(\"Calendario\"), \n t(\"Classfica\"), \n t(\"Formazioni\"), \n t(\"Newsletter\"));\n foreach ($groups as $g_id => $group) {\n $rows[] = array(\n l($competitions[$group->competition_id]->name . \" - \" . $group->name, \"admin/fantacalcio/groups/\" . $g_id), \n fantacalcio_check_value($group->active), \n \n // \"<img src='\" .base_path() . drupal_get_path(\"module\", \"fantacalcio\") . \"/images/\" . get_image_check($group->active) . \"'>\",\n $group->matches_order, \n $group->standings_order, \n $group->lineups_order, \n $group->newsletters_order);\n }\n $out .= theme(\"table\", (array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table\", \"table-responsive\")), \n \"empty\" => t(\"Nessun gruppo\"))));\n }\n \n return $out;\n}", "function moduleContent()\t{\n\t\t$mod = t3lib_div::makeInstance('tx_groupdelegation');\n\n\t\tif($mod->checkAdminAndSetAdminGroupsSqlString() === false) {\n\t\t\t$this->content .= $GLOBALS['LANG']->getLL('no_permission');\n\t\t} else {\n\t\t\t$mod->setEditableUsers();\n\n\t\t\t\t//build edit user form\n\t\t\tif(t3lib_div::GPvar('user') && !t3lib_div::GPvar('edit')) {\n\t\t\t\t$this->content.=$this->doc->section($GLOBALS['LANG']->getLL('edit_user'),$mod->renderEditUserForm(),0,1);\n\n\t\t\t\t//save and build user overview\n\t\t\t} elseif(t3lib_div::GPvar('user') && t3lib_div::GPvar('edit')) {\n\t\t\t\t$mod->save();\n\t\t\t\t$mod->setEditableUsers();\n\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\n\t\t\t\t\t//build user overview\n\t\t\t} else {\n\t\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\t\t\t}\n\t\t}\n\t}", "public function groups() {\n\t\t//variabel\n\t\t$data['datas'] = $this->PbkGroups_model->get_all();\n\t\t\n\t\t$template_data['title'] = 'SMS Gateway ';\n\t\t$template_data['subtitle'] = 'Kirim SMS';\n $template_data['crumb'] = ['SMS Gateway' => 'smsgateway', 'SMS Groups' => 'smsgateway/kirimsms/groups',];\n\t\t//view\n\t\t$this->layout->set_wrapper('groups_form', $data);\n\t\t$this->layout->auth();\n\t\t$this->layout->render('admin', $template_data);\n\t}", "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 afterRegistry()\n {\n parent::afterRegistry();\n\n if ($this->showForRespondents && is_bool($this->showForRespondents)) {\n $this->showForRespondents = $this->_('Respondents');\n }\n if ($this->showForStaff && is_bool($this->showForStaff)) {\n $this->showForStaff = $this->_('Staff');\n }\n if ($this->showForTracks && is_bool($this->showForTracks)) {\n $this->showForTracks = $this->_('Tracks');\n }\n if ($this->showTitle && is_bool($this->showTitle)) {\n $this->showTitle = $this->_('Add');\n }\n }", "public function panel()\n {\n $panel = new \\Shieldon\\Firewall\\Panel();\n $panel->entry();\n }", "protected function Form_Run() {}", "function _addLayoutGroup($parentLayGrp, $custLayGrp, $ovServer)\n{\n\t// layout group ($parentLayGrp) on the OV server specified ($ovServer). \n\t//\n\t// Inputs:\n\t//\t$parentLayGrp - parent group. null if assigned to root of tree.\n\t//\t$custLayGrp - custom's layout group name.\n\t//\t$ovServer - OV server to add group.\n\t// Output: none\n\t//\n _log(\"addLayoutGroup: Starting.\",\"info\");\n _log(\"addLayoutGroup: adding group $parentLayGrp/$custLayGrp on $ovServer\",\"info\");\n global $opcdir, $output, $opclaygrp_cmd, $gRoshTimeOut;\n\n if ($parentLayGrp == '')\n {\n\t\t$group = $custLayGrp;\n\t}\n\telse\n\t{\n\t\t$group = $parentLayGrp . '/' . $custLayGrp;\n\t}\n\t$cmd = \"/opsw/bin/rosh -W $gRoshTimeOut -n $ovServer -l root '$opclaygrp_cmd \";\n\t$cmd .= \"-add_lay_group lay_group=$group '\";\n \n _log(\"addLayoutGroup: cmd: $cmd\",\"debug\");\n _execCmdWithRetry($cmd);\n _log(\"output is $output\",\"debug\");\n\n _parseOutputForError($output_array,'ERROR','addLayoutGroup');\n _log(\"addLayoutGroup: Exiting.\",\"info\");\n}", "public function definition() {\n\n global $CFG, $DB, $USER, $PAGE;\n\n $mform = $this->_form;\n $instance = $this->_customdata;\n $this->instance = $instance;\n $plugin = enrol_get_plugin('self_parents');\n\n $heading = $plugin->get_instance_name($instance);\n\n $mform->addElement('header', 'selfparentsheader', get_string('enrolmeheader', 'enrol_self_parents'));\n\n // Enrollments are limited to a certain cohort\n // We bypassed the cohort check in the lib/can_self_enrol function so do it here\n if ($instance->customint5) {\n $mustbeincohort = $DB->get_record('cohort', array('id' => $instance->customint5));\n if (!$mustbeincohort) {\n throw new \\Exception(\"The required cohort {$instance->customint5} for self_parents instance {$instance->id} does not exist.\");\n }\n\n // Require cohort functions\n require_once($CFG->dirroot . '/cohort/lib.php');\n } else {\n $mustbeincohort = false;\n }\n\n // TODO: This is not tested with a passworded enrolment. It might not work\n if ($instance->password) {\n // Change the id of self enrolment key input as there can be multiple self enrolment methods.\n $mform->addElement(\n 'passwordunmask',\n 'enrolpassword',\n get_string('password', 'enrol_self_parents'),\n array('id' => 'enrolpassword_'.$instance->id)\n );\n }\n\n /**\n * Can current user self enrol?\n */\n if ($plugin->user_is_enrolled($USER->id, $instance->id)) {\n // Curent user already enrolled\n $mform->addElement(\n 'static',\n 'alreadyenroled',\n '',\n get_string('alreadyenroled', 'enrol_self_parents')\n );\n\n } else if ($mustbeincohort && !cohort_is_member($mustbeincohort->id, $USER->id)) {\n // Current user not in required cohort\n $mform->addElement(\n 'static',\n 'cohortnonmemberinfo',\n '',\n get_string('cohortnonmemberinfo', 'enrol_self_parents', $mustbeincohort->name)\n );\n\n } else {\n // Current user can self enrol\n $mform->addElement(\n 'submit',\n 'enrolmesubmit',\n get_string('enrolmebutton', 'enrol_self_parents')\n );\n\n }\n\n /**\n * Can a parent enrol their child?\n */\n if ($instance->customint8) {\n // Check if they have children\n if ($children = $plugin->get_users_children($USER->id)) {\n $mform->addElement('header', 'enrolchildheader', get_string('enrolchildheader', 'enrol_self_parents'));\n $mform->addElement('html', '<div class=\"helptext\">' . get_string('enrolchilddesc', 'enrol_self_parents') . '</div>');\n\n $options = array();\n foreach ($children as $child) {\n $name = $child->firstname.' '.$child->lastname;\n\n $datacheckbox = '';\n if ($instance->customtext2) {\n // Custom checkbox\n $datacheckbox = '<span style=\"margin-left:50px;\"> ' . $instance->customtext2 . '</i> ';\n // Not selcting a choice by default, so the user has to click, thus confirming the choice.\n $datacheckbox .= '<label>Yes <input type=\"radio\" value=\"1\" name=\"customtext2['. $child->userid . ']\" /></label>';\n $datacheckbox .= '<label>No <input type=\"radio\" value=\"0\" name=\"customtext2['. $child->userid . ']\" /></label>';\n $datacheckbox .= '</span>';\n }\n\n if ($plugin->user_is_enrolled($child->userid, $instance->id)) {\n // Child is already enrolled\n $str = '<span class=\"text-success\">' . get_string('child_is_enroled', 'enrol_self_parents') . '</span>';\n $mform->addElement(\n 'checkbox',\n \"enrolchilduserids[{$child->userid}]\",\n $name,\n $str,\n array(\n 'disabled' => 'disabled',\n 'class' => 'enrolchildcheckbox',\n 'data-userid' => $child->userid\n )\n );\n\n } else if ($mustbeincohort && !cohort_is_member($mustbeincohort->id, $child->userid)) {\n // Child isn't in the required cohort\n $str = '<span class=\"text-danger\">' . get_string('childcohortnonmemberinfo', 'enrol_self_parents') . '</span>';\n $mform->addElement(\n 'checkbox',\n \"enrolchilduserids[{$child->userid}]\",\n $name,\n $str,\n array(\n 'disabled' => 'disabled',\n 'class' => 'enrolchildcheckbox',\n 'data-userid' => $child->userid\n )\n );\n\n } else {\n // Child can be enrolled\n $str = $datacheckbox;\n $mform->addElement(\n 'checkbox',\n \"enrolchilduserids[{$child->userid}]\",\n $name,\n $str,\n array(\n 'class' => 'enrolchildcheckbox',\n 'data-userid' => $child->userid\n )\n );\n\n }\n\n }\n\n // Enrol my child button\n // A .dnet-disabled class instead of the disabled attribute is used so click events can be bound to the button\n $mform->addElement(\n 'submit',\n 'enrolchildsubmit',\n get_string('enrolchildbutton', 'enrol_self_parents'),\n array(\n 'class' => 'dnet-disabled'\n )\n );\n $PAGE->requires->jquery();\n $submitjs = '<script>';\n\n $submitjs .= '\n\n // Disable the submit button until a child is ticked to enrol\n $(document).on(\"change\", \"input.enrolchildcheckbox\", function() {\n var count = $(\"input.enrolchildcheckbox:checked\").length;\n if (count > 0) {\n $(\"#id_enrolchildsubmit\").removeClass(\"dnet-disabled\");\n } else {\n $(\"#id_enrolchildsubmit\").addClass(\"dnet-disabled\");\n }\n });\n\n $(document).on(\"click\", \"#id_enrolchildsubmit\", function(e) {\n if ($(this).hasClass(\"dnet-disabled\")) {\n alert(\"Please tick at least one child to enrol.\");\n return false;\n }';\n\n if ($instance->customtext2) {\n $submitjs .= '\n // Make sure the custom checkbox has been selected for each user being enroled\n $(\".enrolchildcheckbox:checked\").each(function() {\n\n var userID = $(this).attr(\"data-userid\");\n\n if ( $(\\'input[name=\"customtext2[\\'+ userID + \\']\"]:checked\\').length < 1) {\n\n alert(\"' . get_string('childenrolmentquestion_error', 'enrol_self_parents') . '\");\n e.preventDefault();\n }\n });\n ';\n }\n\n $submitjs .= '\n });\n ';\n\n $submitjs .= '</script>';\n $mform->addElement('html', $submitjs);\n\n }\n }\n\n $mform->addElement('hidden', 'id');\n $mform->setType('id', PARAM_INT);\n $mform->setDefault('id', $instance->courseid);\n\n $mform->addElement('hidden', 'instance');\n $mform->setType('instance', PARAM_INT);\n $mform->setDefault('instance', $instance->id);\n }", "function add_group_metabox() {\r\n\r\n\t\tadd_meta_box( 'bp_group_events', _x( 'Group Events', 'group admin edit screen', 'bp-simple-events' ), array( $this, 'show_group_metabox'), get_current_screen()->id, 'side' );\r\n\r\n\t}", "public function getPanelGeneral()\n\t{\n\t\t\n\t\t# variables enviadas a la vista que muestra el Panel General de Administrador\n\t\t$anunciosPorRevisar = $this->getNumeroAnunciosPorRevisar();\n\t\t$anunciosDenunciados = $this->getNumeroAnunciosDenunciados();\n\t\t$anunciosBloqueados = $this->getNumeroAnunciosBloqueados();\n\t\t$usuariosBloqueados = $this->getNumeroUsuariosBloqueados();\n\t\t$usuariosDesactivados = $this->getNumeroUsuariosDesactivados();\n\t\t$comentariosDenunciados = $this->getNumeroComentariosDenunciados();\n\t\t$respuestasDenunciadas = $this->getNumeroRespuestasDenunciadas();\n\t\t\n\t\t\n\t\t// Las Tareas pendientes son las tareas iniciadas por un \n\t\t// administrador y que aún no han sido culminadas\n\t\t\n\t\t$totalTareasPendientes = $this->getNumeroAnunciosPendientes() + \n\t\t\t\t\t\t\t\t $this->getNumeroAnunciosDenunciadosPendientes() +\n\t\t\t\t\t\t\t\t $this->getNumeroComentariosDenunciadosPendientes()+\n\t\t\t\t\t\t\t\t $this->getNumeroRespuestasDenunciadasPendientes();\n\n\t\treturn \\View::make('modulos.administracion.general',compact('anunciosPorRevisar', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'anunciosDenunciados',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'anunciosBloqueados',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'usuariosBloqueados',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'usuariosDesactivados',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'comentariosDenunciados',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'respuestasDenunciadas',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'totalTareasPendientes')\n\t\t\t\t);\n\t}", "private function __construct() {\n\n\t\t// Load plugin text domain\n\t\tadd_action( 'init', array( $this, 'load_plugin_textdomain' ) );\n\n\t\t// Add a meta box to the group's \"admin>settings\" tab.\n\t\t// We're also using BP_Group_Extension's admin_screen method to add this meta box to the WP-admin group edit\n\t\tadd_filter( 'groups_custom_group_fields_editable', array( $this, 'meta_form_markup' ) );\n\t\t// Catch the saving of the meta form, fired when create>settings pane is saved or admin>settings is saved\n\t\tadd_action( 'groups_group_details_edited', array( $this, 'meta_form_save') );\n\t\tadd_action( 'groups_created_group', array( $this, 'meta_form_save' ) );\n\t}", "public function configure()\n {\n if (sfContext::getInstance()->getModuleName() == 'file') {\n unset($this['judge_id'], $this['result'], $this['instruction'], \n $this['user_file_id'], $this['court_note_id'], $this['coordinator_id'],\n $this['barrister_id'], $this['appearing_type_id']/*, $this['appearing_id']*/\n );\n \n $this->widgetSchema['appearing_id']->setOption('method', 'obtainFullName');\n $this->widgetSchema['appearing_id']->setOption('table_method', 'getSolicitorsCB');\n \n $this->widgetSchema['court_id']->setAttribute('style', 'width:200px');\n $this->widgetSchema['listing_id']->setAttribute('style', 'width:150px');\n }\n else {\n //unset($this['coordinator_id']);\n $this->widgetSchema['result']->setAttributes(array('cols' => '70', 'rows' => '12'));\n $this->widgetSchema['user_file_id']->setOption('method', 'getClientName');\n $this->widgetSchema['court_note_id']->setLabel('Note');\n \n $this->widgetSchema['instruction'] = new sfWidgetFormTextarea(array(), array('cols' => '70', 'rows' => '4'));\n \n $this->widgetSchema['judge_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Judge'), \n 'form_module' => 'judge', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getJudgesCB'\n ));\n \n $this->widgetSchema['judge_id']->setLabel('Before');\n $this->validatorSchema['judge_id']->setOption('required', false);\n //$this->widgetSchema['judge_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['judge_id']->setOption('table_method', 'getJudgesCB');\n \n $this->widgetSchema['appearing_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Appearing'), \n 'form_module' => 'user?_frm=MyAccount', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getSolicitorsCB'\n ));\n \n // added by William, 26/05/2013: add barrister\n $this->widgetSchema['barrister_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Barrister'), \n 'form_module' => 'user?_frm=MyAccount', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getBarristersCB'\n ));\n \n //$this->widgetSchema['appearing_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['appearing_id']->setOption('table_method', 'getSolicitorsCB');\n \n // for the add/edit button widget\n if (!sfContext::getInstance()->getRequest()->getParameter('shbx') ) {\n $this->widgetSchema['court_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'Agency', \n 'form_module' => 'agency?code=COU', \n 'add_empty' => true,\n ));\n }\n \n // for the add/edit button widget\n //if (!sfContext::getInstance()->getRequest()->getParameter('shbx') ) {\n $this->widgetSchema['listing_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'Listing', \n 'form_module' => 'listing', \n 'add_empty' => true,\n 'order_by' => array('name', 'asc') \n ));\n \n $this->widgetSchema['court_note_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'CourtNote', \n 'form_module' => 'courtNote', \n 'add_empty' => true,\n 'method' => 'getValue',\n 'order_by' => array('value', 'asc') \n ));\n //}\n \n $this->hideField('user_file_id');\n \n $this->addFee();\n $this->widgetSchema['Fee']->setLabel(false);\n }\n \n // add class to year to validate past dates\n $this->widgetSchema['date']->setAttribute('class', 'validateYear');\n\n // set method to load values to show\n $this->widgetSchema['court_id']->setOption('table_method', 'getCourtsCB');\n \n //$this->widgetSchema['coordinator_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['coordinator_id']->setOption('table_method', 'getCoordinatorsCB');\n \n if (sfContext::getInstance()->getModuleName() == 'file') {\n // remove emptys\n $this->widgetSchema['court_id']->setOption('add_empty', false);\n }\n \n // sort some dropboxes\n $this->widgetSchema['listing_id']->addOption('order_by', array('name', 'asc'));\n \n // adding some extra validators\n //$this->widgetSchema['time'] = new sfWidgetFormTime();\n $this->widgetSchema['time'] = $this->formattedWidgetFormTime();\n $this->validatorSchema['time'] = new sfValidatorTime(array('required' => false));\n $this->validatorSchema['court_id']->setOption('required', true);\n \n /*$this->validatorSchema->setPostValidator(\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialValues')))\n );*/\n $this->validatorSchema->setPostValidator(new sfValidatorAnd(array(\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialValues'))),\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialFeeValues')))\n )));\n \n // adding asterisk for required fields\n $this->setAsteriskForRequiredFields();\n \n // this formatting is applied only if form is called directly, without admin generator templates\n $first = ($this->getOption('first') !== null) ? $this->getOption('first') : false;\n $custom_decorator = new ExtendedFormSchemaFormatter($this->getWidgetSchema(), array('header' => $first));\n $this->widgetSchema->addFormFormatter('Myformatter', $custom_decorator);\n $this->widgetSchema->setFormFormatterName('Myformatter');\n }", "function callbackDeletePopup() {\n if ($this->deleted) {\n return;\n }\n $child = $this->deleteMenuItem->child;\n $name = $this->name;\n if (!$name) { \n $name = 'UNNAMED';\n }\n $child->set_text('Delete Field : '. $name);\n $this->deleteMenuItem->show();\n \n }", "function member_groups_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-groups.php\" );\r\n }", "public function make()\n {\n $this->group('slider_information', clean(trans('slider::sliders.tabs.group.slider_information')))\n ->active()\n ->add($this->slides())\n ->add($this->settings());\n }", "public function init() {\n $this->setMethod('post');\n $this->setAction($this->getView()->url());\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/collapsiblefields.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/toggledetails.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/erga/ypoerga/ypoerga.js', 'text/javascript'));\n\n // Επιστημονικά Υπεύθυνος\n $this->addSubForm(new Application_Form_Subforms_SupervisorSelect($this->_defaultSupervisor, $this->_view), 'subprojectsupervisor');\n $this->getSubForm('subprojectsupervisor')->setLegend('Στοιχεία Επιστημονικά Υπεύθυνου');\n $this->addExpandImg('subprojectsupervisor');\n\n $this->addSubProjectFields();\n\n //$this->addContractFields($dg);\n\n $this->addSubmitFields();\n }", "protected function SetupPanel() {\n\t\t\t$this->mctAddress = AddressMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);\n\n\t\t\t// Dialog Message\n\t\t\t$this->dlgMessage = new MessageDialog($this);\n\t\t\t$this->dlgMessage_Reset();\n\t\t\t$this->btnSave->RemoveAllActions(QClickEvent::EventName);\n\t\t\t$this->btnSave->AddAction(new QClickEvent(), new QShowDialogBox($this->dlgMessage));\n\t\t\t$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));\n\n\t\t\tif (!$this->mctAddress->EditMode) {\n\t\t\t\t// Trying to create a NEW address\n\t\t\t\t$this->mctAddress->Address->Person = $this->objPerson;\n\t\t\t\t$this->btnSave->Text = 'Create';\n\t\t\t} else {\n\t\t\t\t// Ensure the Address object belongs to the person\n\t\t\t\tif ($this->mctAddress->Address->PersonId != $this->objPerson->Id) {\n\t\t\t\t\treturn $this->ReturnTo('#contact');\n\t\t\t\t}\n\t\t\t\t$this->btnSave->Text = 'Update';\n\n\t\t\t\t$this->btnDelete = new QLinkButton($this);\n\t\t\t\t$this->btnDelete->Text = 'Delete';\n\t\t\t\t$this->btnDelete->CssClass = 'delete';\n\t\t\t\t$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to permenantly DELETE this record?'));\n\t\t\t\t$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));\n\t\t\t\t$this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());\n\t\t\t}\n\n\t\t\t// Create Controls\n\t\t\t$this->lstAddressType = $this->mctAddress->lstAddressType_Create();\n\t\t\t$this->calDateUntilWhen = $this->mctAddress->calDateUntilWhen_Create();\n\t\t\t$this->calDateUntilWhen->MinimumYear = 2000;\n\t\t\t$this->calDateUntilWhen->MaximumYear = date('Y') + 10;\n\t\t\t$this->chkCurrentFlag = $this->mctAddress->chkCurrentFlag_Create();\n\n\t\t\t// Fixup \"Address Type\"\n\t\t\t$this->lstAddressType->GetItem(0)->Name = 'Previous Home';\n\t\t\tif (!$this->mctAddress->EditMode) $this->lstAddressType->AddSelectOneOption();\n\n\t\t\t$this->chkInvalidFlag = $this->mctAddress->chkInvalidFlag_Create();\n\t\t\t$this->txtAddress1 = $this->mctAddress->txtAddress1_Create();\n\t\t\t$this->txtAddress2 = $this->mctAddress->txtAddress2_Create();\n\t\t\t$this->txtAddress3 = $this->mctAddress->txtAddress3_Create();\n\t\t\t$this->txtCity = $this->mctAddress->txtCity_Create();\n\t\t\t$this->lstState = $this->mctAddress->lstState_Create();\n\t\t\t$this->txtZipCode = $this->mctAddress->txtZipCode_Create();\n\t\t\t$this->txtCountry = $this->mctAddress->txtCountry_Create();\n\t\t\t$this->txtInternationalState = $this->mctAddress->txtState_Create();\n\t\t\t$this->txtInternationalState->Visible = false;\n\t\t\t$this->chkInternationalFlag = $this->mctAddress->chkInternationalFlag_Create();\n\t\t\t$this->chkInternationalFlag->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'chkInternationalFlag_Click'));\n\t\t\t$this->chkInternationalFlag_Click();\n\t\t\t\n\t\t\t// Add Actions\n\t\t\t$this->lstAddressType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstAddressType_Change'));\n\n\t\t\t// Setup Controls\n\t\t\t$this->lstAddressType_Change();\n\t\t}", "public function onRelationManageAddPivot()\n {\n return $this->onRelationManagePivotForm();\n }", "public function panel() {\n if(Auth::isLoggedIn()) {\n $this->view->render('admin/module/liveEdit/panel', [\n 'nodes' => $this->get($this->route),\n 'user' => $this->user,\n 'route' => $this->route,\n 'template' => $this->template,\n 'languages' => $this->em->all(Language::class),\n 'current_language' => $this->em->findBy(Language::class ,[\n 'code' => $_SESSION['Lampion']['language']\n ])[0],\n 'name' => $this->routeNames[$this->route] ?? null\n ]);\n }\n }", "function popup_elements()\n {\n $this->elements = array(\n\n array(\n \"name\" => __(\"Slides\", 'swedenWp' ),\n \"desc\" => __(\"Add, edit, and remove slides\", 'swedenWp' ),\n \"type\" \t\t\t=> \"modal_group\",\n \"id\" \t\t\t=> \"content\",\n \"modal_title\" \t=> __(\"Edit Form Element\", 'swedenWp' ),\n \"std\"\t\t\t=> array(\n array('title'=>__('Slide 1', 'swedenWp' ), 'tags'=>''),\n array('title'=>__('Slide 2', 'swedenWp' ), 'tags'=>''),\n\n ),\n\n 'subelements' \t=> array(\n\n array(\n \"name\" => __(\"Display Related Articles\", 'swedenWp' ),\n \"desc\" => __(\"Choose \\\"Yes\\\" to display related articles after this slide\", 'swedenWp' ),\n \"id\" => \"is_related\",\n \"type\" => \"select\",\n \"subtype\" => array(\n __('No', 'swedenWp' ) =>'no',\n __('Yes', 'swedenWp' ) =>'yes',\n ),\n \"std\" => \"no\",\n ),\n array(\n \"name\" => __(\"Related Articles Format\", \"swedenWp\"),\n \"desc\" => __(\"Choose format of related articles\"),\n \"id\" => \"show_type\",\n \"type\" => \"select\",\n \"required\" => array('is_related','equals','yes'),\n \"std\" => \"3cols\",\n \"subtype\" => array(\n __('Three Columns', 'swedenWp') =>'3cols',\n //__('Single Column', 'swedenWp') =>'1col',\n )\n ),\n array(\n\t\t\t\t\t\t\t \"name\" \t=> __(\"Related Article - Left\", 'swedenWp' ),\n\t\t\t\t\t\t\t \"desc\" \t=> __(\"Select first related article\", 'swedenWp' ),\n\t\t\t\t\t\t\t \"id\" \t=> \"linka\",\n\t\t\t\t\t\t\t \"type\" \t=> \"linkpickerB\",\n\t\t\t\t\t\t\t \"container_class\" =>\"avia-element-fullwidth\",\n\t\t\t\t\t\t\t \"required\" => array('show_type','equals','3cols'),\n\t\t\t\t\t\t\t \"fetchTMPL\"\t=> true,\n\t\t\t\t\t\t\t \"subtype\" => array(\n\t\t\t\t\t\t\t __('Single Entry', 'swedenWp' ) =>'single',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t \"std\" \t=> \"\"),\n array(\n \"name\" \t=> __(\"Related Article - Center\", 'swedenWp' ),\n\t\t\t\t\t\t\t\t \"desc\" \t=> __(\"Select second related article\", 'swedenWp' ),\n\t\t\t\t\t\t\t\t \"id\" \t=> \"linkb\",\n\t\t\t\t\t\t\t\t \"type\" \t=> \"linkpickerB\",\n\t\t\t\t\t\t\t\t \"container_class\" =>\"avia-element-fullwidth\",\n\t\t\t\t\t\t\t\t \"required\" => array('show_type','equals','3cols'),\n\t\t\t\t\t\t\t\t \"fetchTMPL\"\t=> true,\n\t\t\t\t\t\t\t\t \"subtype\" => array(\n\t\t\t\t\t\t\t\t //__('Set Manually', 'swedenWp' ) =>'manual',\n\t\t\t\t\t\t\t\t __('Single Entry', 'swedenWp' ) =>'single',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t \"std\" \t=> \"\"),\n array(\n \"name\" => __(\"Related Article - Right\", 'swedenWp' ),\n \"desc\" => __(\"Select third related article\", 'swedenWp' ),\n \"id\" => \"linkc\",\n \"type\" => \"linkpickerB\",\n \"container_class\" =>\"avia-element-fullwidth\",\n \"required\" => array('show_type','equals','3cols'),\n \"fetchTMPL\" => true,\n \"subtype\" => array(\n //__('Set Manually', 'swedenWp' ) =>'manual',\n __('Single Entry', 'swedenWp' ) =>'single',\n ),\n \"std\" => \"\"),\n//This stuff isn't being used in any of the current thumbnail carousels, but could be desired later\n/*\n array(\n \"name\" => __(\"Related Article\", 'swedenWp' ),\n \"desc\" => __(\"Select related article\", 'swedenWp' ),\n \"id\" => \"link\",\n \"type\" => \"linkpicker\",\n \"container_class\" =>\"avia-element-fullwidth\",\n \"required\" => array('show_type','equals','1col'),\n \"fetchTMPL\" => true,\n \"subtype\" => array(\n __('Set Manually', 'swedenWp' ) =>'manually',\n //__('Single Entry', 'swedenWp' ) =>'single',\n ),\n \"std\" => \"manually\"),\n*/\n array(\n \"name\" => __(\"Choose Image\",'swedenWp' ),\n \"desc\" => __(\"Upload a new image or choose an existing image from the media library\",'swedenWp' ),\n \"id\" => \"src\",\n \"type\" => \"image\",\n \t\t\"fetch\" => \"id\",\n \"title\" => __(\"Insert Image\",'swedenWp' ),\n \"button\" => __(\"Insert\",'swedenWp' ),\n \"std\" => swedenBuilder::$path['imagesURL'].\"placeholder.jpg\"\n ),\n//This stuff isn't being used in any of the current thumbnail carousels, but could be desired later - ESP\n // array(\n // \"name\" => __(\"Title\", 'swedenWp' ),\n // \"desc\" => __(\"Title\", 'swedenWp' ),\n // \"id\" => \"title\",\n // \"type\" => \"input\",\n // \"std\" => \"\",\n // ),\n // array(\n // \"name\" => __(\"Caption\", 'swedenWp' ),\n // \"desc\" => __(\"Caption of photo (optional)\", 'swedenWp' ),\n // \"id\" => \"content\",\n // \"required\" => array('is_related','equals','no'),\n // \"type\" => \"tiny_mce\",\n // \"std\" => \"\",\n // ),\n\n // array(\n // \"name\" => __(\"Has Video?\", 'swedenWp' ),\n // \"desc\" => __(\"Will this slide be a video?\", 'swedenWp' ),\n // \"id\" => \"is_video\",\n // \"required\" => array('is_related','equals','no'),\n // \"type\" => \"select\",\n // \"subtype\" => array(\n // __('no', 'swedenWp' ) =>'no',\n // __('yes', 'swedenWp' ) =>'yes',\n // ),\n // \"std\" => \"no\",\n // ),\n // array(\n // \"name\" => __(\"Video Type\", 'swedenWp' ),\n // \"desc\" => __(\"Choose if video is scene7 or other\", 'swedenWp' ),\n // \"id\" => \"videotype\",\n // \"type\" => \"select\",\n // \"std\" => \"scene7\",\n // \"required\" => array('is_video','equals','yes'),\n // \"subtype\" => array(\n // __('scene7', 'swedenWp' ) =>'scene7',\n // __('other', 'swedenWp' ) =>'other',\n // )\n // ),\n\n // array(\n // \"name\" => __(\"Choose Video\",'swedenWp' ),\n // \"desc\" => __(\"Either upload a new video, choose an existing video from your media library or link to a video by URL\",'swedenWp' ).\"<br/><br/>\".\n // __(\"A list of all supported Video Services can be found on\",'swedenWp' ).\n // \" <a target='_blank' href='http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F'>WordPress.org</a><br/><br/>\".\n // __(\"Working examples, in case you want to use an external service:\",'swedenWp' ). \"<br/>\".\n // \"<strong>http://vimeo.com/18439821</strong><br/>\".\n // \"<strong>http://www.youtube.com/watch?v=G0k3kHtyoqc</strong><br/>\",\n\n // \"id\" => \"video_src\",\n // \"type\" => \"video\",\n // \"title\" => __(\"Insert Video\",'swedenWp' ),\n // \"button\" => __(\"Insert\",'swedenWp' ),\n // \"std\" => \"\",\n // \"required\" => array('videotype','equals','other')\n // ),\n\n // array(\n // \"name\" => __(\"Scene7 video ID\", 'swedenWp' ),\n // \"desc\" => __(\"Enter Scene7 video ID\", 'swedenWp' ),\n // \"id\" => \"scene7_id\",\n // \"type\" => \"input\",\n // \"std\" => \"\",\n // \"required\" => array('videotype','equals','scene7')\n // ),\n // array(\n // \"name\" => __(\"Video Format\", 'swedenWp' ),\n // \"desc\" => __(\"Choose if you want to display a modern 16:9 or classic 4:3 Video, or use a custom ratio\", 'swedenWp' ),\n // \"id\" => \"format\",\n // \"type\" => \"select\",\n // \"std\" => \"16:9\",\n // \"required\" => array('is_video','equals','yes'),\n // \"subtype\" => array(\n // __('16:9', 'swedenWp' ) =>'16-9',\n // __('4:3', 'swedenWp' ) =>'4-3',\n // __('Custom Ratio', 'swedenWp' ) =>'custom',\n // )\n // ),\n\n // array(\n // \"name\" => __(\"Video width\", 'swedenWp' ),\n // \"desc\" => __(\"Enter a value for the width\", 'swedenWp' ),\n // \"id\" => \"width\",\n // \"type\" => \"input\",\n // \"std\" => \"16\",\n // \"required\" => array('format','equals','custom')\n // ),\n\n // array(\n // \"name\" => __(\"Video height\", 'swedenWp' ),\n // \"desc\" => __(\"Enter a value for the height\", 'swedenWp' ),\n // \"id\" => \"height\",\n // \"type\" => \"input\",\n // \"std\" => \"9\",\n // \"required\" => array('format','equals','custom')\n // )\n\n )\n )\n );\n\n }", "public function viewgroupAction()\n {\n $post_values = $this->getRequest()->getPost();\n if(count($post_values) > 0)\n {\n $appraisal_id = $this->_getParam('appraisal_id',null);\n $manager_id = $this->_getParam('manager_id',null);\n $group_id = $this->_getParam('group_id',null);\n $group_name = $this->_getParam('group_name',null);\n \n try\n {\n if($appraisal_id != '' && $manager_id != '' && $group_id != '')\n {\n $appraisal_id = sapp_Global::_decrypt($appraisal_id);\n $manager_id = sapp_Global::_decrypt($manager_id);\n $group_id = sapp_Global::_decrypt($group_id);\n \n $app_manager_model = new Default_Model_Appraisalmanager();\n $appraisal_init_model = new Default_Model_Appraisalinit();\n $appraisal_qs_model = new Default_Model_Appraisalquestions();\n\n $manager_emp = $app_manager_model->getmanager_emp($appraisal_id, $manager_id,$group_id);\n $appraisaldata = $appraisal_init_model->getConfigData($appraisal_id);\n $appraisaldata = (isset($appraisaldata[0]) && !empty($appraisaldata[0]))?$appraisaldata[0]:array();\n if(!empty($appraisaldata) && !empty($manager_emp))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ques_ids = $manager_emp[0]['manager_qs'];\n\t\t\t\t\t\t$questionsArr = $appraisal_qs_model->getQuestionsByCategory($appraisaldata['category_id'],$ques_ids);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$manager_qs_privileges = json_decode($manager_emp[0]['manager_qs_privileges'],true);\n\t\t\t\t\t\tforeach($manager_qs_privileges as $key => $val)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t$check_array[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$view = $this->view;\n\t\t\t\t\t\t$view->appraisal_id = $appraisal_id;\n\t\t\t\t\t\t$view->manager_id = $manager_id;\n\t\t\t\t\t\t$view->manager_emp = $manager_emp;\n\t\t\t\t\t\t$view->questionsArr = $questionsArr;\n\t\t\t\t\t\t$view->appraisaldata = $appraisaldata;\n\t\t\t\t\t\t$this->view->checkArr = $check_array;\n\t\t\t\t\t\t$view->group_name = sapp_Global::_decrypt($group_name);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->view->ermsg = 'nodata';\n\t\t\t\t\t}\t\t\t\t\t\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $e) \n {\n $this->view->ermsg = 'nodata';\n }\n }\n }", "public function getPanelContent()\n {\n return null;\n }", "public static function editActionListener(): void {\n\t\telgg_register_event_handler('update:after', 'group', self::class . '::acceptMembershipRequests');\n\t}", "public function getFields()\r\n {\r\n $effects = [\r\n \"fadeInUp\"=>\"fadeInUp\",\r\n \"fadeInDown\"=>\"fadeInDown\",\r\n \"fadeInLeft\"=>\"fadeInLeft\",\r\n \"fadeInRight\"=>\"fadeInRight\",\r\n \"lightSpeedIn\"=>\"lightSpeedIn\",\r\n \"slideInUp\"=>\"slideInUp\",\r\n \"slideInDown\"=>\"slideInDown\",\r\n \"slideInLeft\"=>\"slideInLeft\",\r\n \"slideInRight\"=>\"slideInRight\",\r\n \"zoomIn\"=>\"zoomIn\"\r\n ];\r\n \r\n $fields = [\r\n [\r\n 'name' => 'basic_information',\r\n 'type' => 'group',\r\n 'visible' => 'ce',\r\n 'tabs' => [\r\n [\r\n 'name' => 'slide_information',\r\n 'type' => 'tab',\r\n 'visible' => 'ce',\r\n 'fields' => [\r\n [\r\n 'name' => 'id',\r\n 'type' => 'text',\r\n 'visible' => 'io',\r\n ],\r\n [\r\n 'name' => 'slider_id',\r\n 'display' => 'slider',\r\n 'type' => 'relation',\r\n 'relation' => ['slider', 'name'],\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'file',\r\n 'type' => 'image',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'caption_1',\r\n 'type' => 'text',\r\n 'visible' => 'ice',\r\n ],\r\n [\r\n 'name' => 'caption_2',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'caption_3',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'call_to_action_text',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'call_to_action_url',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'open_in_new_window',\r\n 'type' => 'select',\r\n 'data' => ['1' => trans('slider::panel.yes'), '0' => trans('slider::panel.no')],\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'position',\r\n 'type' => 'position',\r\n 'visible' => 'ce',\r\n ]\r\n\r\n ]\r\n ],\r\n [\r\n 'name' => 'options',\r\n 'type' => 'tab',\r\n 'visible' => 'ce',\r\n 'fields' => [\r\n [\r\n 'name' => 'options[caption_1][delay]',\r\n 'display' => 'caption_1_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_1][color]',\r\n 'display' => 'caption_1_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_1][effect]',\r\n 'display' => 'caption_1_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][delay]',\r\n 'display' => 'caption_2_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][color]',\r\n 'display' => 'caption_2_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][effect]',\r\n 'display' => 'caption_2_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][delay]',\r\n 'display' => 'caption_3_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][color]',\r\n 'display' => 'caption_3_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][effect]',\r\n 'display' => 'caption_3_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[call_to_action][delay]',\r\n 'display' => 'call_to_action_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[call_to_action][effect]',\r\n 'display' => 'call_to_action_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n ]\r\n ]\r\n ]\r\n ]\r\n ];\r\n return $fields;\r\n }", "private function viewPanelIndependent($data)\n\t{\n\t\t$this->panel($data,'',true);\n\t}", "public function displayAdminPanel() {}", "private function grouping_group_assigned($event) {\n global $DB;\n $groupid = $event->other['groupid'];\n $members = groups_get_members($groupid, 'userid');\n $group = groups_get_group($groupid, 'courseid');\n $courseid = $group->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n\n $insertcalls = array();\n $deletecalls = array();\n\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n foreach ($members as $member) {\n $gmail = $this->get_google_authenticated_users_gmail($member->userid);\n if (has_capability('moodle/course:view', $coursecontext, $member->userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $member->userid)) {\n // Teacher (enrolled) (active); do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true)) {\n // Student (enrolled) (active); continue checks.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $member->userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available && is_enrolled($coursecontext, $member->userid, '', true)) {\n // Course module and section are visible and available.\n // Insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } else {\n // User cannot access course module; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n // Course is not visible; do nothing.\n }\n // User is not enrolled in course; do nothing.\n }\n }\n }\n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }", "public function finish()\n {\n parent::finish();\n \n $db_participant = $this->get_record()->get_participant();\n\n // create enum arrays\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'participant_id', '=', $db_participant->id );\n $modifier->order( 'rank' );\n $addresses = array();\n $address_class_name = lib::get_class_name( 'database\\address' );\n foreach( $address_class_name::select( $modifier ) as $db_address )\n {\n $db_region = $db_address->get_region();\n $addresses[$db_address->id] = sprintf( '%d. %s, %s, %s',\n $db_address->rank,\n $db_address->city,\n $db_region->name,\n $db_region->country );\n }\n\n $num_phones = $db_participant->get_phone_count();\n $ranks = array();\n for( $rank = 1; $rank <= $num_phones; $rank++ ) $ranks[] = $rank;\n $ranks = array_combine( $ranks, $ranks );\n $phone_class_name = lib::get_class_name( 'database\\phone' );\n $types = $phone_class_name::get_enum_values( 'type' );\n $types = array_combine( $types, $types );\n\n // set the view's items\n $this->set_item( 'address_id', $this->get_record()->address_id, false, $addresses );\n $this->set_item( 'active', $this->get_record()->active, true );\n $this->set_item( 'rank', $this->get_record()->rank, true, $ranks );\n $this->set_item( 'type', $this->get_record()->type, true, $types );\n $this->set_item( 'number', $this->get_record()->number );\n $this->set_item( 'note', $this->get_record()->note );\n\n $this->finish_setting_items();\n }", "function osa_form_alter_webform_client_form_6(&$form, &$form_state) {\r\n\r\n // set the name and id of the student\r\n civicrm_initialize();\r\n $cid = $_GET['cid'];\r\n $contact = _osa_get_contact($cid, FALSE);\r\n $form['submitted']['cid']['#value'] = $cid;\r\n $form['submitted']['display_name']['#markup'] = str_replace('%display_name%', $contact['display_name'], $form['submitted']['display_name']['#markup']);\r\n \r\n // get the list of defined group classes (nodes)\r\n $nodes = &_osa_get_class_nodes($cid);\r\n\r\n // populate the class description, with the event descriptions\r\n $descs = array();\r\n foreach ($nodes as $class) {\r\n $event_id = $class->field_event_master['und'][0]['civicrm_reference_id'];\r\n $results = civicrm_api('event', 'get', array('id' => $event_id, 'version' => 3));\r\n $event = $results['values'][$event_id];\r\n $descs[$event_id] = <<<EOD\r\n<div id=group-class-desc-$event_id class=\"event-info\" >\r\n <h3 class=\"crm-section event_title-section\">{$event['title']}</h3>\r\n <div class=\"crm-section event_summary-section\">{$event['summary']}</div>\r\n <div class=\"crm-section event_description-section summary\">{$event['description']}</div>\r\n</div>\r\nEOD;\r\n }\r\n\r\n // create the javascript to show/hide the class descriptions\r\n $form['submitted']['desc_fieldset']['#attributes']['style'] = 'visibility:hidden;';\r\n $descs_json = drupal_json_encode($descs);\r\n $js = <<<EOD\r\nfunction set_class_description() {\r\n var descs = $descs_json;\r\n var group_type = jQuery(\"#edit-submitted-class-type\").val();\r\n var cbox = \"#edit-submitted-\" + group_type + \"-fieldset-\" + group_type;\r\n var event = jQuery( cbox ).val();\r\n if (descs[event] == undefined) {\r\n jQuery('.webform-component--desc-fieldset').css('visibility', 'hidden');\r\n }\r\n else {\r\n jQuery('.webform-component--desc-fieldset--class-description').html(descs[event]);\r\n jQuery('.webform-component--desc-fieldset').css('visibility', 'visible');\r\n }\r\n}\r\njQuery(document).ready(function() {\r\n jQuery(\"select\").change(function(){\r\n set_class_description();\r\n });\r\n}); \r\nEOD;\r\n\r\n drupal_add_js($js, 'inline');\r\n\r\n // set the default values for the group class lists\r\n $types = osa_options_class_types();\r\n foreach ($types as $type => $label) {\r\n if (is_array($form['submitted'][\"{$type}_fieldset\"][$type]['#options'])) {\r\n reset($form['submitted'][\"{$type}_fieldset\"][$type]['#options']);\r\n $first_option = key($form['submitted'][\"{$type}_fieldset\"][$type]['#options']);\r\n $form['submitted'][\"{$type}_fieldset\"][$type]['#default_value'] = isset($first_option) ? $first_option : '';\r\n }\r\n }\r\n}", "public function group_video_main_screen_function() {\n\t\t// add title and content here - last is to call the members plugin.php template.\n\t\t\\add_action( 'bp_template_content', array( $this, 'group_video_meeting_content_action' ) );\n\t\t\\bp_core_load_template( \\apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t// echo do_shortcode ( '[youzer_groups per_page=\"10\"]' );\n\t}" ]
[ "0.70829606", "0.66916597", "0.60626334", "0.56094754", "0.5523688", "0.53522736", "0.5344771", "0.53378624", "0.5333088", "0.52900857", "0.5268895", "0.5261655", "0.52547413", "0.52358586", "0.52038234", "0.52036244", "0.5135892", "0.5130476", "0.5129452", "0.51293963", "0.5126206", "0.51260257", "0.51235336", "0.5074247", "0.5070432", "0.505486", "0.50447214", "0.50402695", "0.5039512", "0.50370944", "0.50341636", "0.50303036", "0.50268745", "0.5016725", "0.500075", "0.50006545", "0.49977642", "0.4994391", "0.49941897", "0.4989546", "0.49876392", "0.49870542", "0.49860996", "0.4981034", "0.49766934", "0.49750662", "0.49727613", "0.49617833", "0.49477836", "0.49431327", "0.49403974", "0.49320805", "0.49280384", "0.49214596", "0.49080545", "0.4901262", "0.4899985", "0.48957098", "0.48946333", "0.48917726", "0.4891339", "0.48864248", "0.4883249", "0.4881925", "0.48802972", "0.48801056", "0.48794112", "0.48723358", "0.4866676", "0.48526525", "0.4852132", "0.48483485", "0.48450556", "0.48280823", "0.482573", "0.4824998", "0.48219284", "0.48172444", "0.48089105", "0.4807936", "0.48060688", "0.47907585", "0.47867072", "0.4783762", "0.47834978", "0.47834247", "0.47820416", "0.47817641", "0.4779552", "0.4779477", "0.47758415", "0.47753248", "0.47742343", "0.47727624", "0.47716403", "0.47639936", "0.47566777", "0.47566476", "0.47553772", "0.47541785", "0.47485316" ]
0.0
-1
email is sent to admin
public function sendContactMessage(Contact $contact);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }", "function new_user_email_admin_notice()\n {\n }", "function emailToAdmin($params, $admin='[email protected]'){\r\n\r\n \t$this->email->from($params['email'], $params['firstname'].' '.$params['lastname']);\r\n \t$this->email->to($admin);\r\n \t$this->email->cc('[email protected]');\r\n \t$this->email->bcc('[email protected]');\r\n \t$this->email->subject('A new member has registered');\r\n\r\n \t$message = \"Name: \".$params['firstname'].' '.$params['lastname'].\"\\n\";\r\n \t$message .= \"Business Name: \".$params['businessname'].\"\\n\";\r\n \t$message .= \"Email: \".$params['email'].\"\\n\";\r\n \t$message .= \"Zip Code: \".$params['postalcode'].\"\\n\";\r\n \t$message .= \"Link: \".$params['link'].\"\\n\";\r\n \t$message .= \"Info: \".$params['info'].\"\\n\";\r\n \t$message .= \"Role: \".$params['role'].\"\\n\";\r\n\r\n \t$this->email->message($message);\r\n\r\n \t$res = $this->email->send();\r\n }", "private function sendDailyAdminEmail()\n {\n // Message\n $message = (new AdministratorDaily())->onQueue('platform-processing');\n // User Setting\n $settingProvider = (new PlatformSettingProvider());\n Mail::to($settingProvider->setting('admin_notification_email'),$settingProvider->setting('admin_notification_name'))\n ->send($message);\n Log::info(\"Sent Admin Email\");\n }", "public function admin_mail(){\n\n\t\t\t/*load model and get all data from tables*/\n\t\t\t$this->loadModel(\"Support\");\n\t\t\t$this->loadModel(\"MailDest\");\n\t\t\t$support=$this->Support->findById(1);\n\t\t\t$support=$support['Support'];\n\t\t\t$this->Paginator->settings = array(\n\t\t\t\t'MailDest' => array(\n\t\t\t\t'limit' => 30\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->Paginator->settings = $this->paginate;\n\t\t\t$dests = $this->Paginator->paginate('MailDest');\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(compact('support','dests'));\n\t\t\t$this->set(\"title\", \"Configuration\");\n\t\t\t$this->set(\"legend\", \"Support email setting\");\n\t\t\t}", "function alertAdmin($subj,$msg) {\n global $cfg;\n $to=$cfg?$cfg->getAdminEmail():ADMIN_EMAIL;\n $from=$cfg?$cfg->getAlertEmail():ADMIN_EMAIL;\n //Send alert to admin.\n Misc::sendmail($to,$subj,$msg,$from); \n }", "private function mailToevoegenAction()\n {\n $this->model->maakMail();\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> E-mail adres is toegevoed. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Mail toevoegen', 'Gelukt');\n $this->forward('klant', 'admin');\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function indexAction() {\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitecrowdfunding_admin_main', array(), 'sitecrowdfunding_admin_main_reminder_mails');\n $site_title = $_SERVER['HTTP_HOST'];\n $this->view->form = $form = new Sitecrowdfunding_Form_Admin_Email();\n\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n\n if ($values['sitecrowdfunding_reminder_demo'] != 1)\n $values['sitecrowdfunding_admin_mail'] = '';\n\n include APPLICATION_PATH . '/application/modules/Sitecrowdfunding/controllers/license/license2.php';\n if (empty($tempMailsend)) {\n return;\n }\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n\n if ($values['sitecrowdfunding_reminder_demo'] == 1 && !empty($values['sitecrowdfunding_admin_mail'])) {\n $mailId = $values['sitecrowdfunding_admin_mail'];\n $user = Engine_Api::_()->getItemTable('user')->fetchRow(array(\n 'email = ?' => $mailId\n ));\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($user, \"SITECROWDFUNDING_REMINDER_TEST\", array(\n 'member_name' => $user->getTitle()\n ));\n $form->addNotice('Test email has been sent to the email id provided by you.');\n }\n }", "public function emailAction() {\n\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_email');\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Email();\n\n //check if comments should be displayed or not\n $show_comments = Engine_Api::_()->sitestore()->displayCommentInsights();\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n ->from($rtasksName, array('processes', 'timeout'))\n ->where('title = ?', 'Sitestore Insight Mail')\n ->where('plugin = ?', 'Sitestore_Plugin_Task_InsightNotification')\n ->limit(1);\n $prefields = $taskstable->fetchRow($taskstable_result);\n\n //populate form\n// $form->populate(array(\n// 'sitestore_insightemail' => $prefields->processes,\n// ));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n $values = $form->getValues();\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_insightemail', $values['sitestore_insightemail']);\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n if(empty($sitemailtemplates)) {\n\t\t\t\tEngine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_bg_color', $values['sitestore_bg_color']);\n }\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n if ($values['sitestore_demo'] == 1 && $values['sitestore_insightemail'] == 1) {\n\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n $insights_string = '';\n\t\t\t\t$template_header = \"\";\n\t\t\t\t$template_footer = \"\";\n if(!$sitemailtemplates) {\n\t\t\t\t\t$site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.title.color', \"#ffffff\");\n\t\t\t\t\t$site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.header.color', \"#79b4d4\");\n\n\t\t\t\t\t//GET SITE \"Email Body Outer Background\" COLOR\n\t\t\t\t\t$site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.bg.color', \"#f7f7f7\");\n\t\t\t\t\t$insights_string.= \"<table cellpadding='2'><tr><td><table cellpadding='2'><tr><td><span style='font-size: 14px; font-weight: bold;'>\" . $view->translate(\"Sample Store\") . \"</span></td></tr>\";\n\n\t\t\t\t\t$template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n\t\t\t\t\t$template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n }\n\n if ($values['sitestore_insightmail_options'] == 1) {\n $vals['days_string'] = $view->translate('week');\n } elseif ($values['sitestore_insightmail_options'] == 2) {\n $vals['days_string'] = $view->translate('month');\n }\n $path = 'http://' . $_SERVER['HTTP_HOST'] . $view->baseUrl();\n $insight_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Visit your Insights Store') . \"</a>\";\n $update_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Send an update to people who like this') . \"</a>\";\n\n //check if Communityad Plugin is enabled\n $sitestorecommunityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n $adversion = null;\n if ($sitestorecommunityadEnabled) {\n $communityadmodulemodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('communityad');\n $adversion = $communityadmodulemodule->version;\n if ($adversion >= '4.1.5') {\n $promote_Ad_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Promote with %s Ads', $site_title) . \"</a>\";\n }\n }\n\n $insights_string.= \"<table><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $vals['days_string'] . $view->translate(array('ly active user', 'ly active users', 2), 2) . \"</span></td></tr><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('person likes this', 'people like this', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n if (!empty($show_comments)) {\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('comment', 'comments', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n }\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '10' . \"</span>\\t <span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('visit', 'visits', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '5' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr></table><table><tr><td>\" . \"<ul style=' padding-left: 5px;'><li>\" . $insight_link . \"</li><li>\" . $update_link;\n\n //check if Communityad Plugin is enabled\n if ($sitestorecommunityadEnabled && $adversion >= '4.1.5') {\n $insights_string.= \"</li><li>\" . $promote_Ad_link;\n }\n $insights_string.= \"</li></ul></td></tr></table>\";\n $days_string = ucfirst($vals['days_string']);\n $owner_name = Engine_Api::_()->user()->getViewer()->getTitle();\n $email = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['sitestore_admin'], 'SITESTORE_INSIGHTS_EMAIL_NOTIFICATION', array(\n 'recipient_title' => $owner_name,\n 'template_header' => $template_header,\n 'message' => $insights_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'days' => $days_string,\n 'email' => $email,\n 'queue' => true));\n }\n }\n }", "public function doemail() {\r\n \tif (isset($_SESSION['userid'])) {\n \t if (isset($_POST['useremail'])) {\n \t \tif ($this->model->putemail($_SESSION['userid'],$_POST['useremail'])) {\n \t \t $this->view->set('infomessage', \"Adres email został zmieniony.\"); \r\n \t \t $this->view->set('redirectto', \"?v=project&a=show\");\r\n \t \t $this->view->render('info_view');\n \t \t} else {\n \t \t $this->view->set('errormessage', \"Nieudana zmiana adresu email.\");\r\n \t $this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t $this->view->render('error_view');\n \t \t}\n \t } else {\n \t \t$this->view->set('errormessage', \"Błędny adres email.\");\r\n \t \t$this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t$this->view->render('error_view');\n \t }\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "private function __sendNewAdminEmail($data) {\n\t\t$link = Router::Url('/', TRUE) . 'admin';\n\t\t$emailData = array(\n\t\t\t'username' => $data['username'],\n\t\t\t'email' => $data['email'],\n\t\t\t'password' => $data['password'],\n\t\t\t'link' => $link\n\t\t);\n\t\t$templateId = EmailTemplateComponent::NEW_ADMIN_EMAIL_TEMPLATE;\n\t\t$emailManagement = $this->EmailTemplate->getEmailTemplate($templateId, $emailData);\n\n\t\t$mailData = array(\n\t\t\t'subject' => $emailManagement['EmailTemplate']['template_subject'],\n\t\t\t'to_name' => $data['username'],\n\t\t\t'to_email' => $data['email'],\n\t\t\t'content' => json_encode($emailData),\n\t\t\t'module_info' => 'admin',\n\t\t\t'email_template_id' => $templateId\n\t\t);\n\n\t\t$this->EmailQueue->createEmailQueue($mailData);\n\t}", "function sendEmailToAdministrators($subject, $body){\n\t\t$headers = \"From: quota_store\\r\\n\";\n\t\t//$headers .= \"Reply-To: \" . strip_tags($_POST['req-email']) . \"\\r\\n\";\n\t\t//$headers .= \"CC: [email protected]\\r\\n\";\n\t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\t\n\t\t$admin = user_array(eF_executeQuery(\"select * from users where login='admin'\")); //is fixed, the below lines must be removed.\n\n\t\t// This is just a temporary fix.\n\t\t\t$content = '<html>';\n\t\t\t$content .='\t<body>';\n\t\t\t\n\t\t\t$salutation = '<p>Dear '.$admin['name'].' '.$admin['surname'].'</p>';\n\t\t\t\n\t\t\t$footer = '<p><em>This is an automated message by the Quota Store.</em></p>';\n\t\t \t \n\t\t\t$content .= $salutation . $body . $footer;\n\t\t\t\n\t\t\t$content .='\t</body>';\n\t\t\t$content .='</html>';\n\t\n\t\t\t$myEmail = '[email protected]';\n\n /*\n echo \"about to send email to Dr. Sadjadi: \" . $myEmail . PHP_EOL;\n echo \"subject: \" .PHP_EOL;\n var_dump($subject);\n echo \"content: \".PHP_EOL;\n var_dump($content);\n echo \"headers: \".PHP_EOL;\n var_dump($headers);\n\t\t\tmail($myEmail, $subject, $content, $headers);\n\t */\n\n\t\t// TODO This fucntion does not return any admins. It needs to be fixed.\n\t\t$admins = db_getAdministrators_new();\n\t\t\n\t\tforeach ($admins as $admin){\n\t\t\t\n\t\t\t$content = '<html>';\n\t\t\t$content .='\t<body>';\n\t\t\t\n\t\t\t$salutation = '<p>Dear '.$admin['name'].' '.$admin['surname'].'</p>';\n\t\t\t\n\t\t\t$footer = '<p><em>This is an automated message by the Quota Store.</em></p>';\n\t\t \t \n\t\t\t$content .= $salutation . $body . $footer;\n\t\t\t\n\t\t\t$content .='\t</body>';\n\t\t\t$content .='</html>';\n\n /*\n echo \"about to send email to admin: \" . $admin['email'] .PHP_EOL;\n echo \"subject: \" .PHP_EOL;\n var_dump($subject);\n echo \"content: \".PHP_EOL;\n var_dump($content);\n echo \"headers: \".PHP_EOL;\n var_dump($headers);\n */\n\n\t\t\tmail($admin['email'], $subject, $content, $headers);\n\t\t}\n\t\n\t}", "function adminEmail($arr)\n{\n\t$email = $arr['email'];\n\t$module = new sociallogin();\n\t$sub = $module->l('New User Registration', 'sociallogin_functions');\n\t$msg = $module->l('New User Registered to your site<br/> E-mail address: ', 'sociallogin_functions');\n\t$msg .= $email;\n\tif (_PS_VERSION_ >= 1.6)\n\t{\n\t\t$vars = array('{name}' => 'admin', '{message}' => $msg, '{subject}' => $sub);\n\t\t$mail_format = 'lrsociallogin_account';\n\t}\n\telse\n\t{\n\t\t$vars = array('{email}' => $email, '{message}' => $msg);\n\t\t$mail_format = 'contact';\n\t}\n\t$db = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_).'employee WHERE id_profile=1 ');\n\t$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\tforeach ($db as $row)\n\t{\n\t\t$find_email = $row['email'];\n\t\tMail::Send($id_lang, $mail_format, $sub, $vars, $find_email);\n\t}\n}", "private function __sendAdminActivatedEmail($adminUserData) {\n\t\t$adminUser = $adminUserData['User'];\n\t\t$email = $adminUser['email'];\n\t\t$templateData = array(\n\t\t\t'username' => $adminUser['username']\n\t\t);\n\n\t\t$Api = new ApiController();\n\t\t$Api->constructClasses();\n\t\t$templateId = EmailTemplateComponent::ADMIN_ACTIVATED_EMAIL_TEMPLATE;\n\t\t$Api->sendHTMLMail($templateId, $templateData, $email);\n\t}", "private function _sendNewStatusUpdateEmailToAdministrators()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n // Load the category and set the recipient to this category's email address\n\t\t\t// $category = $this->category;\n\t\t\t// $emails = explode(',', $category->email);\n\t\t\t$user = \\JFactory::getUser('admin');\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update ...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$owner = $project['1'];\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query2 = $db->getQuery(true);\n\t\t\t$query2->select('title');\n\t\t\t$query2->from($db->quoteName('#__usergroups'));\n\t\t\t$query2->where($db->quoteName('id').\" = \". $owner);\n\t\t\t$db->setQuery($query2)->loadObject();\n\t\t\t$ownerName = $db->loadResult();\n\t\t\t$ownerName = ltrim($ownerName, \"hsgrp_\");\t\t\n\t\t\t\n\t\t\t$submitter = \\JFactory::getUser();\n\t\t\t$submitterName = $submitter->name;\n\t\t\t\n\t\t\t//$ownerName = ltrim($ownerName, \"hsgrp_\");\n\t\t\t\n\t\t\t$body = \"A new status update for project named: \\\"\" . $project['0'] . \"\\\" has been submitted by \" . $submitterName . \"@\" . $ownerName . \" to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "public function emailAllAdministrators () {\n\t\t\t// Get the authentication model and admin role model\n\t\t\t$admin = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $admin->getUserId () );\n\t\t\t$auth->setId ( $admin->getUserId () );\n\t\t\t$role = Mage::getModel (\"admin/role\");\n\t\t\t// Get the role ID for administrator role\n\t\t\t$roleId = $role;\n\t\t\t$roleId = $roleId->getCollection ();\n\t\t\t$roleId = $roleId->addFieldToFilter ( \"role_name\", array ( \"eq\" => \"Administrators\" ) );\n\t\t\t$roleId = $roleId->getFirstItem ();\n\t\t\t$roleId = $roleId->getId ();\n\t\t\t// Get the users that belong to the administrator role\n\t\t\t$roleUsers = $role;\n\t\t\t$roleUsers = $roleUsers->getCollection ();\n\t\t\t$roleUsers = $roleUsers->addFieldToFilter ( \"parent_id\", array ( \"eq\" => $roleId ) );\n\t\t\t// Loop through all the users belonging to the role\n\t\t\tforeach ( $roleUsers as $roleUser ) {\n\t\t\t\t// Load the data helper class and get user instance\n\t\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t\t$user = Mage::getModel (\"admin/user\")->load ( $roleUser->getUserId () );\n\t\t\t\t// Do not send email if user is inactive\n\t\t\t\tif ( !$user->getIsActive () ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Format timestamp date and time\n\t\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t\t$timestampDate = \"-\";\n\t\t\t\t$timestampTime = \"-\";\n\t\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Construct the user contact's full name\n\t\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t\t// Construct and send out ban notice email to user\n\t\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_admin\");\n\t\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t\t$template->setType (\"html\");\n\t\t\t\t$template->setSenderEmail (\n\t\t\t\t\tMage::getStoreConfig (\"trans_email/ident_general/email\")\n\t\t\t\t);\n\t\t\t\t$template->setTemplateSubject (\n\t\t\t\t\tMage::helper (\"twofactor\")->__(\"2FA ban notice for user \") .\n\t\t\t\t\t$admin->getUsername ()\n\t\t\t\t);\n\t\t\t\t$test = $template->send ( $user->getEmail (), $fullName,\n\t\t\t\t\tarray (\n\t\t\t\t\t\t\"base_admin_url\" => Mage::getUrl (\"adminhtml\"),\n\t\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\t\"last_address\" => $auth->getLastAddress (),\n\t\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\t\"username\" => $admin->getUsername (),\n\t\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function mail()\n\t{\n $this->load->model('mailsjabloon_model');\n $this->load->model('gebruiker_model');\n $data['titel'] = 'Send mails';\n $data['auteur'] = \"<u>Lorenzo M.</u>| Arne V.D.P. | Kim M. | Eloy B. | Sander J.\";\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n $data['link'] = 'admin/index';\n \n $data['sjablonen'] = $this->mailsjabloon_model->getSjablonen();\n \n $partials = array('hoofding' => 'main_header','menu' => 'main_menu', 'inhoud' => 'mails_versturen');\n $this->template->load('main_master', $partials, $data);\n\t}", "private function verzendmailAction()\n {\n $factuur_id = $_POST['Factuur_id'];\n $factuur = $this->model->geefFactuur();\n $this->model->stuurMail($factuur);\n $productenOud = $_SESSION['geselecteerdeProducten'];\n $productenNieuw = $_SESSION['producten'];\n $this->model->wijzigMagazijn($productenNieuw, $productenOud);\n $this->forward('klant', 'admin');\n }", "public function change_email_sent()\n {\n $this->_render();\n }", "public function sendAdminEmail($body)\n\t{\n\t\t// Get the email settings from the store\n\t\t$store_name = Mage::app()->getStore()->getFrontendName();\n\t\t$general_contact_name = Mage::getStoreConfig('trans_email/ident_general/name');\n\t\t$general_contact_email = Mage::getStoreConfig('trans_email/ident_general/email');\n\n\t\t// Set the subject\n\t\t$subject = sprintf('%s: Notification from «%s»', $store_name, $this->app_name);\n\n\t\t// Create the mail object\n\t\t$mail = Mage::getModel('core/email');\n\t\t$mail->setToName($general_contact_name);\n\t\t$mail->setToEmail($general_contact_email);\n\t\t$mail->setBody($body);\n\t\t$mail->setSubject('=?utf-8?B?' . base64_encode($subject) . '?=');\n\t\t$mail->setFromEmail($general_contact_email);\n\t\t$mail->setFromName($this->app_name);\n\t\t$mail->setType('text');\n\n\t\t// Try sending the email\n\t\ttry {\n\t\t $mail->send();\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t Mage::logException($e);\n\t\t $this->log('unable to send email to admin: ' . print_r($e, true));\n\t\t}\n\t}", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "function sendEmail_admin($details, $sitetitle) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\t\t\t\t$sendto = $this->adminemail;\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingorderadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingorderadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingorderadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingorderadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "public function send() {\n $mail = $this->initializeMail();\n $mail->subject = $this->subject; \n $mail->MsgHTML($this->body);\n if($this->is_admin) {\n //send email to the admin\n $mail->setFrom($this->sender->email, $this->sender->name);\n $mail->addAddress(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n }else{\n $mail->addAddress($this->recipient->email, $this->recipient->name);\n $mail->setFrom(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n \n }\n $mail->send();\n return $mail;\n }", "function paid_sendEmail_admin($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$additionaNotes = $details->additionaNotes;\t\t\t\t\n\t\t\t\t$sendto = $this->adminemail;\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function sendmailAction()\r\n\t{\r\n\t\t$email = $this->getRequest()->getParam('email');\r\n\t\t$this->view->email = $email;\r\n\t\t$url = $this->getRequest()->getParam('url');\r\n\t\t$this->view->url = $url;\r\n\t\t$to = $email;\r\n\t\t$subject = \"Bạn của bạn chia sẻ một bài viết rất hay!\";\r\n\t\t$message = \"Bạn của bạn chia sẻ một bài viết rất hay. Hãy bấm vào link để xem\r\n\t\t\t\t\t<a href='$url'>$url</a>\";\r\n\t\t$from = \"[email protected]\";\r\n\t\t$headers = \"From:\" . $from;\r\n\t\tmail($to,$subject,$message,$headers);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\t}", "function offerEmail() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\t$this->set('advertiserList',$this->common->getAdvertiserProfileAll());\n\t}", "public function sendAdminNotification()\n {\n $subject = _t(\n 'SilverShop\\ShopEmail.AdminNotificationSubject',\n 'Order #{OrderNo} notification',\n '',\n ['OrderNo' => $this->order->Reference]\n );\n\n $email = $this->buildEmail('SilverShop/Model/Order_AdminNotificationEmail', $subject)\n ->setTo(Email::config()->admin_email);\n\n if ($this->debugMode) {\n return $this->debug($email);\n } else {\n return $email->send();\n }\n }", "public function sendEmailToAdmin($data, $viewStr = '')\n {\n Mail::queue(new SendContactMailable($data, $viewStr));\n }", "public function sendEmailWithApplyLink(){\n\t}", "public function actionMail() {\n\t\t$content = ModelBase::factory('Setting')->handleMail($this->data);\n\n\t\tif ($content->get('updated')) $this->setAlert('info', 'Email terupdate!');\n\n\t\t// Template configuration\n\t\t$this->layout = 'modules/setting/index.tpl';\n\t\t$data = ModelBase::factory('Template')->getSettingData(compact('content'));\n\n\t\t// Render\n\t\treturn $this->render($data);\n\t}", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "private function notifyAdmin(): void\n {\n if (!$this->cfg->getAdminEmails())\n return;\n\n $ex = new \\Exception;\n $trace = $ex->getTraceAsString();\n\n // format msg\n $msg = \"Trying to send email with subject: \\\"$this->Subject\\\" \"\n . \"triggered a failover.\\r\\n\\r\\n\"\n . \"Server(s) that failed:\\r\\n\";\n foreach ($this->failedServers as $k => $v)\n $msg .= \"- Server $k $v \\r\\n\";\n $msg .= \"\\r\\nTrace:\\r\\n$trace\\r\\n\\r\\n\"\n . \"Successful failover server:\\r\\n$this->Host\\r\\n\\r\\n\"\n . \"--\\r\\n\"\n . 'Sent from ' . __FILE__ . ' using ' . $this->Host;\n\n $this->FromName = $this->cfg->getNotificationFromEmail();\n $this->From = $this->cfg->getNotificationFromEmail();\n $this->clearAllRecipients();\n\n $adminEmails = $this->cfg->getAdminEmails();\n foreach ($adminEmails as $adminEmail)\n $this->addAddress($adminEmail);\n $this->Subject = $this->cfg->getAppName() . ': SMTP server(s) failed';\n\n $this->Body = $msg;\n\n // send using the last set SMTP server\n $this->send();\n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function email($approverid,$days)\n {\n Configure::write('debug',0);\n $approvermail = $this->Common->staff_name($approverid);\n $usernname = $this->Session->read('USERNAME');\n $emailcontent=\"A leave request applied by '\".ucfirst($usernname).\"' for '\".$days.\"'\";\n $to = \"[email protected]\"; \n $email = new CakeEmail('myConfig');\n $email->template('invoice', false);\n $email->emailFormat('html');\n $email->to($to);\n $email->from('[email protected]');\n $email->subject('Leave Apply');\n $email->viewVars(\n array\n (\n 'product'=>$orderproduct\n ));\n $email->send();\n \n\n $to = array('[email protected]','[email protected]');\n foreach($to as $emailto)\n { \n $email = new CakeEmail('smtp');\n $email->template('invoice_admin', false);\n $email->emailFormat('html');\n $email->to($emailto);\n $email->from('[email protected]');\n $email->subject('Payment Detail');\n $email->viewVars(\n array\n (\n 'product'=>$orderproduct\n ));\n $email->send();\n\n } \n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public function sendAction()\n {\n $this->manager = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get($this->admin->getIdParameter());\n $this->email = $this->admin->getObject($id);\n $this->attachments = $this->email->getAttachments();\n $addresses = explode(';', $this->email->getFieldTo());\n $this->isNewsLetter = count($addresses) > 1;\n\n //prevent resending of an email\n if ($this->email->getSent())\n {\n $this->addFlash('sonata_flash_error', \"Message \" . $id . \" déjà envoyé\");\n\n return new RedirectResponse($this->admin->generateUrl('list', $this->admin->getFilterParameters()));\n }\n\n if ($this->isNewsLetter)\n {\n $this->newsLetterSend($addresses);\n } else\n {\n $this->directSend($this->email->getFieldTo());\n }\n\n $this->addFlash('sonata_flash_success', \"Message \" . $id . \" envoyé\");\n\n return new RedirectResponse($this->admin->generateUrl('list', $this->admin->getFilterParameters()));\n }", "function prefix_send_email_to_admin() { \n\n\t\ttry {\n\n\t\t\t$user_id = get_current_user_id();\n\n\n\t\t\tif( $_POST['name'] == \"\" || $_POST['lastname'] == \"\" || $_POST['tel'] = \"\" || $_POST['cpf'] == \"\" ):\n\t\t\t\t$_SESSION['paodigital']['msg'] = \"Confirme se Nome, Sobrenome, Telefone ou CPF estão corretamente preenchidos!\";\n\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\t\t\tendif;\n\n\t\t\t$user_id = wp_update_user( \n\t\t\t\tarray( \n\t\t\t\t\t'ID' \t\t\t=> $user_id,\n\t\t\t\t\t'first_name'\t=> $_POST['name'],\n\t\t\t\t\t'last_name'\t\t=> $_POST['lastname'],\n\t\t\t\t\t'description'\t=> $_POST['notes']\n\t\t\t\t) \n\t\t\t);\n\n\t\t\tif ( get_user_meta($user_id, 'user_telefone' ) ):\n\t\t\t\t$a = update_user_meta( $user_id, 'user_telefone', $_POST['tel_order'] );\n\t\t\telse:\n\t\t\t\t$a = add_user_meta( $user_id, 'user_telefone', $_POST['tel_order'] );\n\t\t\tendif;\n\n\t\t\tif ( get_user_meta($user_id, 'user_cpf', true ) ):\n\t\t\t\tupdate_user_meta( $user_id, 'user_cpf', $_POST['cpf'] );\n\t\t\telse:\n\t\t\t\tadd_user_meta( $user_id, 'user_cpf', $_POST['cpf'] );\n\t\t\tendif;\n\n\n\t\t\t$error = false;\n\t\t\t$entrega = false;\n\t\t\tif( isset($_POST['save-address']) ):\n\t\t\t\t\n\t\t\t\tif( count( $_POST['address'] ) > 0 ):\n\t\t\t\t\tforeach ( $_POST['address'] as $key => $add ):\n\n\n//check address\nif( empty($add['cep']) || empty($add['address']) || empty($add['bairro']) || empty($add['city']) || empty($add['state']) ):\n\t$error = true;\nendif;\n\n\n\t\t\t\t\t\t//check entrega\n\t\t\t\t\t\tif( isset( $add['entrega'] ) ):\n\t\t\t\t\t\t\t$entrega = true;\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t$id = $add['house'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $add['house'] > 0 ):\n\n\t\t\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\t\t'where'\t\t=> \"id = {$id} AND user_id = {$user_id}\", \n\t\t\t\t\t\t\t\t'limit'\t\t=> 1\n\t\t\t\t\t\t\t); \n\t\t\t\t\t\t\t$address = pods( 'usuarioendereco', $params );\n\n\t\t\t\t\t\t\tif( (integer)$address->total_found() > 0 ):\n\t\t\t\t\t\t\t\t$newAddress = pods('usuarioendereco', $address->display('id') );\n\t\t\t\t\t\t\t\t$array = [\n\t\t\t\t\t\t\t\t\t'name' => $add['desc'],\n\t\t\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t\t'modified' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t\t'cep' => $add['cep'],\n\t\t\t\t\t\t\t\t\t'endereco' => $add['address'],\n\t\t\t\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t\t\t\t\t'bairro' => $add['bairro'],\n\t\t\t\t\t\t\t\t\t'cidade' => $add['city'],\n\t\t\t\t\t\t\t\t\t'estado' => $add['state'],\n\t\t\t\t\t\t\t\t\t'entrega' => ( isset( $add['entrega'] ) )? 1 : 0 ,\n\t\t\t\t\t\t\t\t\t'numero' => $add['num'],\n\t\t\t\t\t\t\t\t\t'complemento' => $add['complemento']\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t$newAddress->save($array);\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\telse:\n\n\t\t\t\t\t\t\t$newAddress = pods('usuarioendereco');\n\t\t\t\t\t\t\t$array = [\n\t\t\t\t\t\t\t\t'name' => $add['desc'],\n\t\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t'modified' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t'cep' => $add['cep'],\n\t\t\t\t\t\t\t\t'endereco' => $add['address'],\n\t\t\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t\t\t\t'bairro' => $add['bairro'],\n\t\t\t\t\t\t\t\t'cidade' => $add['city'],\n\t\t\t\t\t\t\t\t'estado' => $add['state'],\n\t\t\t\t\t\t\t\t'entrega' => ( isset( $add['entrega'] ) ) ? 1 : 0 ,\n\t\t\t\t\t\t\t\t'numero' => $add['num'],\n\t\t\t\t\t\t\t\t'complemento' => $add['complemento']\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t$newAddress->save($array);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendforeach;\n\n\t\t\t\tendif;\n\n\t\t\tendif;\n\n\n\n\t\t\t/*\n\t\t\t\tVerificacao quanto ao dados dos endereços\n\t\t\t*/\n\t\t\tif( $error == true ):\n\n\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Preencha corretamente todos os endereços criados\";\n\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t\telse:\n\n\t\t\t\tif( $entrega == false ):\n\n\t\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Escolha um endereço padrão.\";\n\t\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t\t\telse :\n\n\t\t\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Endereço salvo com sucesso!\";\n\t\t\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"success\";\n\t\t\t\t\twp_redirect( get_bloginfo('url') . \"/formas-de-pagamento\" );\n\n\t\t\t\tendif;\n\n\t\t\tendif;\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$_SESSION['paodigital']['msgAddress'] = \"Não Foi Possivel salvar o endereço tente novamente.\";\n\t\t\t$_SESSION['paodigital']['msgAddressType'] = \"danger\";\n\t\t\twp_redirect( get_bloginfo('url') . \"/detalhes-do-seu-pedido/\" );\n\n\t\t}\n\t\t\n\t\t\n\n\t}", "function sendUpdateEmail($email, $registrant)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" registration information updated.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'];\n $mailContent .= \":\\n\\n\";\n $mailContent .= \"Your information for the \" . $name . \" has been updated.\\n\";\n $mailContent .= \"\\nIf you did not edit your registration information, \" .\n \"please write to the administrator:\\n\";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=account%20compromised\\n\";\n $mailContent .= \"\\nright away, or simply reply to this note.\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $headers);\n}", "function get_admin_email() {\n return $this->admin_email;\n }", "public function getAdminEmail();", "function set_admin_email($email) {\n $this->admin_email = $email;\n }", "public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }", "function email($to, $subject, $body) {\n mail($to, $subject, $body, 'From: [email protected]');\n }", "public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }", "private function emailAtLogin() {}", "function ask_admin($querstion_for_admin){\n\t\tif( isset($_POST[$querstion_for_admin]) ){\n\t\t\tglobal $base;\n\n\t\t\t$content = $base->clear_string($_POST[$querstion_for_admin]);\n\n\t\t\t$query = \"SELECT * FROM users WHERE role='master_admin'\";\n $find_id = user::find_this_query($query);\n $master_admin_id='';\n\t foreach ($find_id as $id) {\n\t $master_admin_id = $id->user_id;\n\t\t\t\t}\n\n\t\t\t$user = user::find_this_id( $base->clear_string($_SESSION['user_id']) );\n\n\t\t\t$messages_admin = new messages_admin();\n\t\t\t$messages_admin->admin_id\t= $master_admin_id;\n\t\t\t$messages_admin->client_id \t= $user->user_id;\n\t\t\t$messages_admin->content \t= $content;\n\t\t\t$messages_admin->date \t\t= date('Y-m-d H:i:s');\n\n\t\t\t\n\t\t\t$messages_admin->create();\n\n\t\t\tmail('[email protected]', 'Pitanje Korisnika: '.$user->name, $content, \"From: \".$user->email);\n\n\t\t}\n\t}", "function __emailer($email = '', $vars = array())\n {\n\n //common variables\n $this->data['email_vars']['clients_company_name'] = $this->client['clients_company_name'];\n $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];\n $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];\n $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];\n $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'];\n\n //new client welcom email-------------------------------\n if ($email == 'new_user') {\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('new_user_client');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //specific data\n $this->data['email_vars']['client_users_full_name'] = $this->input->post('client_users_full_name');\n $this->data['email_vars']['client_users_email'] = $this->input->post('client_users_email');\n $this->data['email_vars']['client_users_password'] = $this->input->post('client_users_password');\n\n //parse email\n $email_message = parse_email_template($template['message'], $this->data['email_vars']);\n\n //send email\n email_default_settings(); //defaults (from emailer helper)\n $this->email->to($this->data['email_vars']['client_users_email']);\n $this->email->subject($template['subject']);\n $this->email->message($email_message);\n $this->email->send();\n\n }\n\n //admin notification - new client user-------------------------------\n if ($email == 'admin_notification_new_user') {\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('new_user_admin');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //specific data\n $this->data['email_vars']['client_users_full_name'] = $this->input->post('client_users_full_name');\n $this->data['email_vars']['client_users_email'] = $this->input->post('client_users_email');\n $this->data['email_vars']['clients_company_name'] = $this->client['clients_company_name'];\n\n //parse email\n $email_message = parse_email_template($template['message'], $this->data['email_vars']);\n\n //send email to multiple admins\n foreach ($this->data['vars']['mailinglist_admins'] as $email_address) {\n email_default_settings(); //defaults (from emailer helper)\n $this->email->to($email_address);\n $this->email->subject($template['subject']);\n $this->email->message($email_message);\n $this->email->send();\n }\n\n }\n\n }", "public function sendRestoreEmail();", "public function send_confirm_mail($userDetails = '') {\n //Send email to user\n }", "public function sendAction() {\n __mail::send('[email protected]', '[email protected]', 'title', 'me', 'hello world');\n\n return false;\n }", "static function edit($post_obj){\n\t\t\n\t\tsendMailToSubscribers();\n\n\t}", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "public function resendmailAction() {\n \n $modelPlugin = $this->modelplugin();\n $mailplugin = $this->mailplugin();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $jsonArray = $modelPlugin->jsondynamic();\n $userid = $this->sessionid;\n $dynamicPath = $protocol . $jsonArray['domain']['domain_name'];\n $from = $jsonArray['sendgridaccount']['addfrom'];\n\n $encryptedPassword = base64_encode(\"#$#\" . base64_encode(base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode($userid) . \"###\" . base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode(base64_encode($userid . rand(10, 100)))) . \"#$#\");\n $buttonclick = $dynamicPath . \"/Gallery/galleryview/\" . $encryptedPassword;\n $mail_link = \"<a href='\" . $buttonclick . \"' style='background-color: #04ad6a; border: medium none; border-radius: 19px; padding: 12px; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase;'>Click here</a>\";\n\n if (empty($userid)) {\n $userid = $phpprenevt->stringReplace($_POST['loginId']);\n }\n $publisheridarray = array('publisherId' => $userid);\n $selectid = $modelPlugin->getpublisherTable()->selectEmail($publisheridarray);\n $mail = $selectid[0]['email'];\n $keyArray = array('mailCatagory' => 'R_MAIL');\n $getMailStructure = $modelPlugin->getconfirmMailTable()->fetchall($keyArray);\n $getmailbodyFromTable = $getMailStructure[0]['mailTemplate'];\n\n $activationLinkreplace = str_replace(\"|ACTIVATIONLINK|\", $mail_link, $getmailbodyFromTable);\n $mailBody = str_replace(\"|DYNAMICPATH|\", $dynamicPath, $activationLinkreplace);\n $subject = \"Confirm your email address\";\n $mailfunction = $mailplugin->confirmationmail($mail, $from, $subject, $mailBody);\n $res['response'] = 1;\n echo json_encode($res);\n exit;\n }", "public function sendAdminEmail($template, $user)\r\n {\r\n\t\t$to = User::findAdminEmails();\r\n\t\t// Mail args\r\n\t\t$args = ['user' => $user];\r\n\t\treturn $this->sendEmail('admin', $template, $to, $args);\r\n\t}", "public function mailAction()\n\t{\n\t\t$log = $this->_initLog();\n\t\t\n if (!$log->getId()) {\n $this->_getSession()->addError(Mage::helper('logging')->__('This log no longer exists.'));\n $this->_redirect('*/*/');\n return;\n }\n\t\t$log->sendLogMail();\n\t\t$this->_redirect('*/*/view', array('id' => $this->getRequest()->getParam('id')));\n\t}", "public function sendEmail(): void\n {\n echo 'email sent';\n }", "public function admin_edit_mainmail(){\n\t\t\t$this->loadModel(\"Support\");\n\t\t\t$mail=$this->Support->findById(1);\n\t\t\t\n\t\t\t/*if data sended by form*/\n\t\t\tif ($this->request->is('post')) {\n\n\t\t\t\t/*get new parameters from form*/\n\t\t\t\t$new=array(\t'mail_from'=>$this->data['Module']['adress'],\n\t\t\t\t\t\t\t'host'=>$this->data['Module']['host'],\n\t\t\t\t\t\t\t'password'=>$this->data['Module']['password'],\n\t\t\t\t\t\t\t'port'=>$this->data['Module']['port'],\n\t\t\t\t\t\t\t);\n\n\t\t\t\t/*save new adress to table \"mail_dests\"*/\n\t\t\t\t$this->Support->id=1;\n\t\t\t\t$this->Support->save($new);\n\n\t\t\t\t/*back*/\n\t\t\t\t$this->redirect(array('action'=>'admin_mail'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Configuration\");\n\t\t\t$this->set(\"legend\", \"Edit adress\");\n\t\t\t$this->set(compact('mail'));\n\t\t\t}", "public function email() {\n\t\trequire( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/email.php' );\n\t}", "protected function sendTestMail() {}", "public function setMail_admin($_mail_admin){\n if(!is_string($_mail_admin)){\n //on redirige\n header(\"Location:../vu/formulaire_connexion_admin.php\");\n return;\n }\n //on declare de la variable mail_admin puis on appelle la varibale prive mail_admin\n $this->_mail_admin = $_mail_admin;\n\n }", "function sendMail($recipient, $admin, $data,$content='', $adminContent='',$dataContent='')\t{\n\t\tif ($this->conf['debug'] && !$recipient) echo 'No recepient for email';\n\t\tif ($this->conf['debug']) echo \"<br> Emails : $recipient, $admin, $data : <br/>User : $content=,<br/>Admin : $adminContent,<br/>Data : $dataContent\";\n\t\t//dataEmail\n\t\tif ($data && $dataContent && $dataContent!='NOMAIL')\t{\n\t\t\t$cc=$this->conf['emails']['data']['cc'];\n\t\t\t$bcc=$this->conf['emails']['data']['bcc'];;\n\t\t\tif (!$this->isHTMLContent($dataContent))\t{\n\t\t\t\t$admMail = $this->cObj->sendNotifyEmail($dataContent,\n\t\t\t\t\t\t\t\t\t$data,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($dataContent,\n\t\t\t\t\t\t\t\t\t$data,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t$cc,\n\t\t\t\t\t\t\t\t\t$bcc\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Admin mail:\n\t\tif ($admin && $adminContent && $adminContent!='NOMAIL')\t{\n\t\t\t$cc=$this->conf['emails']['admin']['cc'];\n\t\t\t$bcc=$this->conf['emails']['admin']['bcc'];;\n\t\t\tif (!$this->isHTMLContent($adminContent))\t{\n\t\t\t\t$admMail = $this->cObj->sendNotifyEmail($adminContent,\n\t\t\t\t\t\t\t\t\t$admin,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($adminContent,\n\t\t\t\t\t\t\t\t\t$admin,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t$cc,\n\t\t\t\t\t\t\t\t\t$bcc\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t//user mail:\n\t\tif ($recipient && $content!='NOMAIL') {\n\t\t\t$cc=$this->conf['emails']['user']['cc'];\n\t\t\t$bcc=$this->conf['emails']['user']['bcc'];\n\t\t\tif (!$this->isHTMLContent($content))\t{\n\t\t\t\t$this->cObj->sendNotifyEmail($content,\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t'',\t\t\t// ($admMail ? '' : $admin), \t\t// If the special administration mail was not found and send, the regular is...\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$admin\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($content,\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t'',\t\t\t// ($admMail ? '' : $admin), \t\t// If the special administration mail was not found and send, the regular is...\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$admin\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function sendConfEmail() {\r\n\t\t$to = array($this->email => $this->fname . \" \" . $this->lname);\r\n\t\t$emailObj = new mandrillApi($to, \"Welcome to Tackster.com\");\r\n\t\t$htmlString = <<<EOF\r\n<h3>Welcome to Tackster.com</h3>\r\n<p>You have now registered with <a href=\"http://www.tackster.com\">Tackster.com</a>.\r\nWe figure we should keep the greeting short and get you started right away!</p>\r\nLet's go to the site by <a href=\"http://www.tackster.com\"><b>Visting Tackster.com</b></a>!\r\nEOF;\r\n\t\t$emailObj->createEmail($htmlString);\r\n\t\t$emailObj->sendEmail();\r\n\t}", "function sendmail_to() {\n $data_to_send = array(\n 'email_sub' => $_REQUEST['email_sub'],\n 'nav_id' => $_REQUEST['nav_id'],\n 'send_to' => $_REQUEST['email_type']\n );\n\n //print_r($data_to_send);\n //die();\n $send_mail = $this->guest_post_model->sendmail_to($data_to_send);\n //$this->session->set_userdata('success_msg', 'Mail sent susseccfully.');\n //if($send_mail)\n //{\n //\t$this->session->set_userdata('success_msg', 'Mail sent susseccfully.');\n //}\n //else\n //{\n //\t$this->session->set_userdata('error_msg', 'Something is wrong. Mail cannot be sent.');\n //}\n //redirect('news_letter_cont');\n }", "public static function sendConfirmAdminMail($mdGenericSale) \n {\n sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N','Url', 'Partial'));\n\n $mailBody = get_partial('saleMailing/mail_admin_new', array('mdGenericSale' => $mdGenericSale));\n $subject = get_partial('saleMailing/mail_admin_new_subject', array('mdGenericSale' => $mdGenericSale));\n //var_dump($mailBody);die;\n $mdSaleXMLHandler = new mdSaleXMLHandler();\n $from = (string) $mdSaleXMLHandler->getInformSaleEmail();\n $fromArray = explode(\",\", $from);\n $reciver = (string) $mdSaleXMLHandler->getInformSaleEmail();\n $recivierArray = explode(\",\", $reciver);\n\n $options = array();\n $options['recipients'] = $recivierArray;\n $options['sender'] = array('name' => __('Mail_Admin ventas'), 'email' => $fromArray[0]);\n $options['subject'] = $subject;\n $options['body'] = $mailBody;\n\n mdMailHandler::sendMail($options);\n }", "public function TesEmail()\n\t{\n\t\t// $template = $query_template->row();\n\n\t\t$data = array(\n\t\t\t'judul' => \"EMAIL TELAH TERDAFTAR\",\n\t\t\t'tanggal' => date(\"d-M-Y\"),\n\t\t\t'description' => \"Selamat Email anda telah Terdaftar di Mitrarenov.com\",\n\t\t\t'nama' => \"Fajar Nugraha\",\n\t\t\t'project_id' => '124324ffsd',\n\t\t\t'password' => 'Fajaroentyil', 'email' => '[email protected]',\n\t\t\t'reg_no' => base64_encode(\"@#$@#$\")\n\t\t);\n\t\t$emailData = array(\n\t\t\t'from' => '[email protected]',\n\t\t\t'name' => 'SIMPRO',\n\t\t\t'to' => array('[email protected]'),\n\t\t\t'cc' => \"\",\n\t\t\t'bcc' => \"\",\n\t\t\t'subject' => \"Aktivasi SIMPRO\",\n\t\t\t'template' => $this->load->view('v_email', $data, true),\n\t\t\t'attach' => 'pantotukang/attachment/syarat.pdf'\n\t\t);\t\t\n\t\t\n\t\t// $this->load->view('v_email', $data);\n\t\t\t\t\t\t\t\t\t\n\t\t$this->sendEmailAktifasi($emailData);\n\t\t// print_r($this->sendEmailAktifasi($emailData));\n\t}", "function scheduleEmail() {\n\t\tif(isset($this->data)) {\n\t\t\t$this->Cronemail->save($this->data);\n\t\t\t$this->Session->setFlash('Featured business email has been scheduled successfully.');\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t}", "public function agent_email_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n\n $agent_email = $this->input->post(\"agent_email\",true); //agent email id\n $mail_body = $this->input->post(\"mail_body\",true);\n $from_name = \"Dubai Private Tour\";\n $from_email = \"[email protected]\";\n \n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $mail_body, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Email has been sent to agent successfully!');\n redirect('admin/tour-booking');\n }", "public function sendEmail(){\n\t\t\t$q = DB::table('cms_users')\n\t\t\t->where('company','BERDIKARI, CV')\n\t\t\t->where('id_cms_privileges',4)\n\t\t\t->first(['email','name']);\n\t\t\t$config['to'] = $q->email;\n\t\t\t$config['subject'] = 'Invoice telah di submit oleh supplier.';\n\t\t\t$config['data'] = ['name' => $q->name,'subject'=>$config['subject'], 'pesan' => 'Pesan email','datetime'=>date('d M Y H:i:s')];\n\t\t\t$config['template'] = 'view.email.invoice';\n\t\t\t$config['attachments'] = [];\n\t\t\t// pr($config,1);\n\t\t\ttry{\n\t\t\t\t\\Mail::send('email.invoice', $config['data'], function ($message) use ($config)\n\t\t\t\t{\n\t\t\t\t\t$message->subject($config['subject']);\n\t\t\t\t\t$message->from('[email protected]', 'Portal Berdikari');\n\t\t\t\t\t$message->to($config['to']);\n\t\t\t\t});\n\t\t\t\t// pr('email send',1);\n\t\t\t\t// return back()->with('alert-success','Berhasil Kirim Email');\n\t\t\t\treturn response (['status' => true,'success' => 'Berhasil Kirim Email']);\n\t\t\t}\n\t\t\tcatch (Exception $e){\n\t\t\t\treturn response (['status' => false,'errors' => $e->getMessage()]);\n\t\t\t\t// pr($e->getMessage());\n\t\t\t}\n\t\t}", "public static function send_admin_expiring_notice() {\n\t\tself::maybe_init();\n\n\t\t$email_key = WP_Job_Manager_Email_Admin_Expiring_Job::get_key();\n\t\tif ( ! self::is_email_notification_enabled( $email_key ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$settings = self::get_email_settings( $email_key );\n\t\t$days_notice = WP_Job_Manager_Email_Admin_Expiring_Job::get_notice_period( $settings );\n\t\tself::send_expiring_notice( $email_key, $days_notice );\n\t}", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "function viaggio_deliver_mail() {\n\tif ( isset( $_POST['cf-submitted'] ) ) {\n\n\t\t// sanitize form values\n\t\t$name = sanitize_text_field( $_POST[\"cf-name\"] );\n\t\t$email = sanitize_email( $_POST[\"cf-email\"] );\n\t\t$subject = sanitize_text_field( $_POST[\"cf-subject\"] );\n\t\t$message = esc_textarea( $_POST[\"cf-message\"] );\n\n\t\t// get the blog administrator's email address\n\t\t$to = get_option( 'admin_email' );\n\n\t\t$headers = \"From: $name <$email>\" . \"\\r\\n\";\n\n\t\t// If email has been process for sending, display a success message\n\t\tif ( wp_mail( $to, $subject, $message, $headers ) ) {\n\t\t\techo '<div>';\n\t\t\techo '<p>'.esc_html__('Thanks for contacting me, expect a response soon.' , 'viaggio').'</p>';\n\t\t\techo '</div>';\n\t\t} else {\n\t\t\techo esc_html__('An unexpected error occurred.' , 'viaggio');\n\t\t}\n\t}\n}", "function mailer() {\n\t\tJRequest::checkToken() or die( JText::_( 'Invalid Token' ) );\n\t\t$email = JRequest::getVar('email');\n\t\t$title = JRequest::getVar('title');\n\t\t$from = array($email, $title);\n\t\t// set emailadres from the site\n\t\t$config =&JFactory::getConfig();\n\t\t// Get some variables from the component options\n\t\t$app = JFactory::getApplication('site');\n\t\t$componentParams = $app->getParams('com_mdcontact');\n\t\t$email_to = $componentParams->get('email_to');\n\t\t$subject = $componentParams->get('subject');\n\t\t$to = array($email_to, $email_to );\n\t\t// Set some variables for the email message\n\t\t$copy = JRequest::getVar('copy');;\n\t\t$body = JRequest::getVar('description');;\n\t\n\t\t// Invoke JMail Class\n\t\t$mailer = JFactory::getMailer();\n\t\n\t\t// Set sender array so that my name will show up neatly in your inbox\n\t\t$mailer->setSender($from);\n\t\t$mailer->addRecipient($to);\n\t\t// Set cc if copy is checked\n\t\tif ($copy=='1'){\n\t\t\t$mailer->addCC($from);\n\t\t\t}\n\t\t$mailer->setSubject($subject);\n\t\t$mailer->setBody($body);\n\t\t$send = $mailer->Send();\n\t\t// set the redirect page\n\t\t$redirect = JRoute::_('index.php?option=com_mdcontact&view=contact&task=add');\n\t\tif ( $send !== true ) {\n\t\t\tJFactory::getApplication()->enqueueMessage('Your message is not send, please try again later', 'error');\n\t\t\t$this->setRedirect( $redirect);\n\t\t} else {\n\t\tparent::apply();\n\t}\n\t}", "function admin_get_smtp_config()\n{\n global $app, $globalSettings;\n\n $mail = ['username' => $globalSettings[SMTP_USER],\n 'password' => $globalSettings[SMTP_PASSWORD],\n 'smtpserver' => $globalSettings[SMTP_SERVER],\n 'smtpport' => $globalSettings[SMTP_PORT],\n 'smtpenc' => $globalSettings[SMTP_ENCRYPTION]];\n $app->render('admin_mail.html', [\n 'page' => mkPage(getMessageString('admin_mail'), 0, 2),\n 'mail' => $mail,\n 'encryptions' => mkEncryptions(),\n 'isadmin' => is_admin()]);\n}", "public function emailBasedAction()\n {\n $signoffEmail = $this->em->getRepository('Fisdap\\Entity\\SignoffEmail')->findOneBy(array('email_key' => $this->_getParam('key')));\n \n // Determine what the message should be...\n // We have 4 or so states.\n // State 1 - No signoffEmail was found.\n if ($signoffEmail == null) {\n $message = \"I'm sorry, we could not find a matching shift for the provided code. Please contact customer support.\";\n // State 2 - Email has expired\n } elseif ($signoffEmail->expire_time != null && $signoffEmail->expire_time->format('U') <= time()) {\n $message = \"I'm sorry, the deadline to fill out the form for this shift has passed.\";\n // State 3 - Shift has already been signed off on\n } elseif ($signoffEmail->has_signed_off) {\n $message = \"We're sorry. It looks like someone already signed off on this shift on \" . $signoffEmail->signoff_time->format('F jS, Y \\a\\t Hi') . \".\";\n } else {\n $signoffEmail->has_signed_off = true;\n $signoffEmail->signoff_time = new \\DateTime();\n $signoffEmail->save();\n \n $message = \"Thank you, you have successfully signed off on this shift.\";\n }\n \n $this->view->message = $message;\n }", "function indexs() {\n\t\n\t/**sendmail(\n\t\tarray (\n\t\t\t'subject' => 'Ma premier newsletter',\n\t\t\t'from' => array (\"[email protected]\" => \"WEBINMOVE\"),\n\t\t\t'to' => array (\"[email protected]\"),\n\t\t\t'layout' => 'news'.DS.'news001'\n\t\t\t\n\t\t)\n\t);\n\t**/\n}", "function emailconfirmation(){\n\t\t\trequire( dirname(__FILE__) . '/email-confirmation.php' );\n\t\t}", "private function _sendNewStatusUpdateEmailToUser()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n\t\t\t$user = \\JFactory::getUser();\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$body = \"Thank you for submitting a new status update for project named: \\\"\" . $project['0'] . \"\\\". It has been added to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "public function sendEmailVerificationNotification();", "public function sendMail()\n {\n $config = JFactory::getConfig();\n $mailer = JFactory::getMailer();\n $mailer->setSender($config->get('mailfrom'));\n\n\n\n $recipient = array('[email protected]', '[email protected]');\n $mailer->addRecipient($recipient);\n\n $mailer->setSubject('Registrazione supporting partner '.$config->get('sitename'));\n $mailer->isHTML(true);\n\n $body = '<h2>Dettagli account</h2>';\n $body .=\"Name: \" . $this->_parametri['name'] . \", <br>\";\n $body .=\"Username: \" . $this->_parametri['username'] . \", <br>\";\n $body .=\"Email: '\" . $this->_parametri['email'] . \", \";\n $body .=\"<br><br>\";\n\n $body .=\"<a \n href='http://framework.project-caress.eu/administrator/index.php?option=com_wizard' \n target='_blank'>Accedi al backend per abilitarlo</a>\";\n\n\n\n http://framework.project-caress.eu/administrator/index.php?option=com_wizard\n\n $mailer->setBody($body);\n\n if (!$mailer->Send())\n throw new RuntimeException('Error sending mail', E_USER_ERROR);\n\n }", "abstract protected function _sendMail ( );", "function mail()\n {\n\n\n }", "public function sendWelcomeEmail()\n {\n SendEmailJob::dispatch($this, 'confirm-email', 'Confirm Your Email', [])->onQueue('account-notifications');\n }", "private function getAdminEmail()\n {\n return sfConfig::get('app_rt_registration_admin_email', sfConfig::get('app_rt_admin_email'));\n }", "public function send_expiry_notification() {\n $expired_posts = $this->get_expired_posts();\n\n $subject = 'Posts that need your attention';\n $recipient = \\get_bloginfo('admin_email');\n $content = $this->_generate_expiry_notification_content( $expired_posts );\n\n // Set post to draft\n // bb_log( $content, 'Sending an email to ' . $recipient );\n // Helper\\Email::send_email( $recipient, $subject, $content );\n }", "function admin_change_smtp_config()\n{\n global $app;\n\n $mail_data = $app->request()->put();\n $app->getLog()->debug('admin_change_smtp_configuration: ' . var_export($mail_data, true));\n $mail_config = [SMTP_USER => $mail_data['username'],\n SMTP_PASSWORD => $mail_data['password'],\n SMTP_SERVER => $mail_data['smtpserver'],\n SMTP_PORT => $mail_data['smtpport'],\n SMTP_ENCRYPTION => $mail_data['smtpenc']];\n $app->bbs->saveConfigs($mail_config);\n $resp = $app->response();\n $app->render('admin_mail.html', [\n 'page' => mkPage(getMessageString('admin_smtp'), 0, 2),\n 'mail' => $mail_data,\n 'encryptions' => mkEncryptions(),\n 'isadmin' => is_admin()]);\n}", "function sendmail_to() {\n $data_to_send = array(\n 'email_sub' => $_REQUEST['email_sub'],\n 'nav_id' => $_REQUEST['nav_id'],\n 'send_to' => $_REQUEST['email_type']\n );\n\n //print_r($data_to_send);\n //die();\n $send_mail = $this->news_letter_model->sendmail_to($data_to_send);\n //$this->session->set_userdata('success_msg', 'Mail sent susseccfully.');\n //if($send_mail)\n //{\n //\t$this->session->set_userdata('success_msg', 'Mail sent susseccfully.');\n //}\n //else\n //{\n //\t$this->session->set_userdata('error_msg', 'Something is wrong. Mail cannot be sent.');\n //}\n //redirect('news_letter_cont');\n }", "function sendMailToNewSecondaryAdmin($community_id, $user_id, $admin_status) {\n $memberDetails = NULL;\n $memberDetails = $this->User->getUserDetails($user_id);\n $email = $memberDetails['email'];\n $communityName = $this->Community->find('first', array(\n 'conditions' => array('Community.id' => $community_id),\n 'fields' => array('Community.name')\n ));\n $communityName = $communityName['Community']['name'];\n $link = Router::Url('/', TRUE) . 'community/details/index/' . $community_id;\n $emailData = array(\n 'communityname' => $communityName,\n 'username' => Common::getUsername($memberDetails['user_name'], $memberDetails['first_name'], $memberDetails['last_name']),\n 'link' => $link\n );\n if ($admin_status == CommunityMember::USER_TYPE_MEMBER) {\n $template_id = EmailTemplateComponent::COMMUNITY_REMOVE_FROM_ADMIN_TEMPLATE;\n } elseif ($admin_status == CommunityMember::USER_TYPE_ADMIN) {\n $template_id = EmailTemplateComponent::COMMUNITY_ADD_AS_ADMIN_TEMPLATE;\n }\n $emailManagement = $this->EmailTemplate->getEmailTemplate($template_id, $emailData);\n\n // email queue to be saved\n $mailData = array(\n 'subject' => $emailManagement['EmailTemplate']['template_subject'],\n 'to_name' => $emailData['username'],\n 'to_email' => $email,\n 'content' => json_encode($emailData),\n 'email_template_id' => $template_id,\n 'module_info' => 'Secondary admins',\n 'priority' => Email::DEFAULT_SEND_PRIORITY\n );\n\n $this->EmailQueue->createEmailQueue($mailData);\n }", "function email_instructions( $order, $sent_to_admin ) {\n\n\t\t\tif ( $sent_to_admin ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $order->status !== 'on-hold' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $order->payment_method !== 'esewa' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $description = $this->get_description() ) {\n\t\t\t\techo wpautop( wptexturize( $description ) );\n\t\t\t}\n\t\t}", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function sendMail() {\n $message = \\Yii::$app->mailer->compose('bug-report', ['bugReport' => $this]);\n $message->setFrom($this->email);\n $message->setTo(\\Yii::$app->params['adminEmail'])\n ->setSubject('Bug report')\n ->send();\n }", "public function sendMail()\n {\n $data = ['kibernum' => 'kibernum.com'];\n\n \\Mail::send('mails.email', $data, function ($message) {\n $message->from('[email protected]', 'Admin IMDIS');\n $message->to(Auth::user()->email)->subject('Aviso IMDIS');\n });\n\n // Enviar email a los administradores\n $users_admin = Auth::user()->obtenerAdmin();\n $fecha_envio = date('d/m/Y');\n $name_user = Auth::user()->name;\n $nombre_institucion = Auth::user()->nombreInstitucionUsuario();\n\n foreach ($users_admin AS $user) {\n\n \\Mail::send('mails.emailAdmin', ['name_user' => $name_user,\n 'nombre_institucion' => $nombre_institucion,\n 'fecha_envio' => $fecha_envio\n ], function ($message) use($user) {\n $message->from('[email protected]', 'Admin SENADIS');\n $message->to($user->email)->subject('Encuesta Enviada: ' . Auth::user()->nombreInstitucionUsuario());\n });\n \n }\n //die();\n return redirect('encuesta')->with('success','Send Mail ok!');\n }", "function email_settings()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\tif ($ibforums->member['disable_mail'])\r\n\t\t{\r\n\t\t\t$ibforums->lang['no_mail'] = sprintf($ibforums->lang['no_mail'], $ibforums->member['disable_mail_reason']);\r\n\r\n\t\t\t$this->output .= View::make(\"global.warn_window\", ['message' => $ibforums->lang['no_mail']]);\r\n\t\t} else\r\n\t\t{\r\n\r\n\t\t\t// PM_REMINDER: First byte = Email PM when received new\r\n\t\t\t// \t\t\tSecond byte= Show pop-up when new PM received\r\n\r\n\t\t\t$info = array();\r\n\r\n\t\t\tforeach (array('hide_email', 'allow_admin_mails', 'email_full', 'email_pm', 'auto_track') as $k)\r\n\t\t\t{\r\n\t\t\t\tif (!empty($this->member[$k]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info[$k] = 'checked';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$info['key'] = $this->md5_check;\r\n\r\n\t\t\t$this->output .= View::make(\"ucp.email\", ['Profile' => $info]);\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "public function emailMeAction() {\r\n\r\n //DEFAULT LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewr_id = $viewer->getIdentity();\r\n\r\n //GET PAGE ID AND PAGE OBJECT\r\n $this->view->page_id = $page_id = $this->_getParam('page_id', $this->_getParam('id', null));\r\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\r\n if (empty($sitepage))\r\n return $this->_forwardCustom('notfound', 'error', 'core');\r\n \r\n //AUTHORIZATION CHECK FOR TELL A FRIEND\r\n $isManageAdmin = Engine_Api::_()->sitepage()->isManageAdmin($sitepage, 'tfriend');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitepage_Form_EmailMe();\r\n\r\n if (!empty($viewr_id)) {\r\n $value['sender_email'] = $viewer->email;\r\n $value['sender_name'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n\r\n $values = $form->getValues();\r\n\r\n //EDPLODES EMAIL IDS\r\n $reciver_ids = $sitepage->email; //explode(',', $values['sitepage_reciver_emails']);\r\n $values['sitepage_sender_email'] = $sitepage->email;\r\n if (!empty($values['sitepage_send_me'])) {\r\n $reciver_ids = $values['sitepage_sender_email'];\r\n }\r\n $sender_email = $values['sitepage_sender_email'];\r\n\r\n //CHECK VALID EMAIL ID FORMITE\r\n $validator = new Zend_Validate_EmailAddress();\r\n\r\n if (!$validator->isValid($sender_email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Invalid sender email address value'));\r\n return;\r\n }\r\n// foreach ($reciver_ids as $reciver_id) {\r\n// $reciver_id = trim($reciver_id, ' ');\r\n// if (!$validator->isValid($reciver_id)) {\r\n// $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter correct email address of the receiver(s).'));\r\n// return;\r\n// }\r\n// }\r\n $sender = $values['sitepage_sender_name'];\r\n $message = $values['sitepage_message'];\r\n $heading = ucfirst($sitepage->getTitle());\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($reciver_ids, 'SITEPAGE_EMAILME_EMAIL', array(\r\n 'host' => $_SERVER['HTTP_HOST'],\r\n 'sender_name' => $sender,\r\n 'page_title' => $heading,\r\n 'message' => '<div>' . $message . '</div>',\r\n 'object_link' => 'http://' . $_SERVER['HTTP_HOST'] . Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()),\r\n 'sender_email' => $sender_email,\r\n 'queue' => true\r\n ));\r\n\r\n $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to page owner has been sent successfully.'))\r\n ));\r\n }\r\n }", "public function sendemail( $id_projet , $status);" ]
[ "0.79768485", "0.78177726", "0.7547291", "0.7397904", "0.7310921", "0.72613263", "0.7234099", "0.721391", "0.71484333", "0.71382195", "0.70730114", "0.7068351", "0.70516014", "0.70194685", "0.6992795", "0.69673073", "0.6943321", "0.6937981", "0.6920677", "0.68972725", "0.68894947", "0.6859", "0.68503016", "0.684409", "0.6803996", "0.67972654", "0.6774419", "0.6747773", "0.6746694", "0.6745507", "0.6734417", "0.67173314", "0.6713271", "0.67031026", "0.66959095", "0.66932696", "0.6678062", "0.66599274", "0.66475075", "0.6643011", "0.6638006", "0.6629826", "0.66258645", "0.6616235", "0.65792906", "0.6573945", "0.65733176", "0.6555559", "0.65499246", "0.65365374", "0.6512265", "0.650909", "0.6508033", "0.64992696", "0.6495101", "0.64755815", "0.6474495", "0.6470757", "0.6469115", "0.6465708", "0.64616823", "0.64553535", "0.64456016", "0.64437485", "0.64362156", "0.64341474", "0.6432672", "0.64322793", "0.6430003", "0.64292276", "0.6419675", "0.64129275", "0.640244", "0.6401629", "0.6400903", "0.6389298", "0.63821596", "0.63735205", "0.6363787", "0.6360427", "0.63472563", "0.63453424", "0.63444585", "0.63442165", "0.6342527", "0.6341519", "0.6335544", "0.6335487", "0.63343763", "0.63299847", "0.6324171", "0.63215697", "0.631871", "0.6315716", "0.629938", "0.62962437", "0.62925", "0.6289784", "0.6287515", "0.6285909", "0.62854546" ]
0.0
-1
Sends out the messages in email queue and update the database.
public function process() { $success = true; $items = Queue::find() ->where(['and', ['sent_time' => null], ['<', 'attempts', $this->maxAttempts]]) ->orderBy(['created_at' => SORT_ASC]) ->limit($this->mailsPerRound) ->all(); if (!empty($items)) { $attributes = ['attempts', 'last_attempt_time']; foreach ($items as $item) { try{ /** @var \app\models\Queue $item */ if ($message = $item->toMessage()) { if ($this->sendMessage($message)) { $item->delete(); } else { throw new Exception('An error occurred while sending the message'); } } } catch (Exception $e) { $success = false; $item->attempts++; $item->last_attempt_time = new Expression('NOW()'); $item->updateAttributes($attributes); } } } return $success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emailQueue() {\n\t\t$this->EmailQueue->processQueue(); exit;\n\t}", "public function realSend() {\n\t\tBrightUtils::inBrowser();\n\t\t$sql = 'SELECT id, pageId, `groups` FROM `mailqueue` WHERE issend=0';\n\t\t$mailings = $this -> _conn -> getRows($sql);\n\t\t\n\t\t$user = new User();\n\t\tforeach($mailings as $mailing) {\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=1 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t\t$groups = explode(',', $mailing -> groups);\t\t\t\n\t\t\t$emails = $user -> getUsersInGroups($groups, false, true);\n\t\t\t$this -> _send($mailing -> pageId, $emails);\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=2 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t}\n\t}", "public function send_queue()\n\t{\n\t\t$sql = 'SELECT *\n\t\t\t\tFROM ' . SQL_PREFIX . 'notify\n\t\t\t\tORDER BY notify_time';\n\t\t$result = Fsb::$db->query($sql, 'notify_');\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\t// Suppression des elements directement, afin d'eviter un double envoie\n\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'notify';\n\t\t\tFsb::$db->query($sql);\n\t\t\tFsb::$db->destroy_cache('notify_');\n\n\t\t\t// Envoie du message\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$this->method = (isset($this->ext[$row['notify_method']])) ? $row['notify_method'] : NOTIFY_MAIL;\n\t\t\t\t$this->subject = $row['notify_subject'];\n\t\t\t\t$this->body = $row['notify_body'];\n\t\t\t\t$this->bcc = explode(\"\\n\", $row['notify_bcc']);\n\t\t\t\t$return = $this->send(false);\n\t\t\t\t$this->reset();\n\n\t\t\t\t// En cas d'echec du message on le reinsere dans la base de donnee\n\t\t\t\tif (!$return && $row['notify_try'] < Notify::MAX_TRY)\n\t\t\t\t{\n\t\t\t\t\t$row['notify_try']++;\n\t\t\t\t\tunset($row['notify_id']);\n\t\t\t\t\tforeach ($row AS $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_numeric($k))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($row[$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tFsb::$db->insert('notify', $row, 'INSERT', true);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t\tFsb::$db->query_multi_insert();\n\t\t}\n\t\tFsb::$db->free($result);\n\t}", "public function fireQueue()\n {\n $count = NewsletterEmailQueue::count();\n\n if ($count === 0) {\n $this->info('There are no emails to send');\n return;\n }\n\n if (!$this->confirm(sprintf('There\\'s %d emails in the send queue. Are you sure you want to send them out now? [yes|no]', $count), true)) {\n return;\n }\n\n // Mail\n $transport = Swift_MailTransport::newInstance();\n $email = NewsletterEmail::findOrFail(1);\n\n $html = View::make('emails.dinner_confirmation.html')\n ->with('body', $email->body)\n ->render();\n\n $body = (new \\TijsVerkoyen\\CssToInlineStyles\\CssToInlineStyles($html, file_get_contents(base_path() . '/public/assets/css/email.css')))\n ->convert();\n\n $transport = Swift_MailTransport::newInstance();\n $mailer = Swift_Mailer::newInstance($transport);\n $emails = User::hasStudentGroup()->get()->lists('email');\n\n foreach ($emails as $email)\n {\n $this->info(sprintf('Sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n $message = Swift_Message::newInstance();\n\n $message->setFrom(array('[email protected]' => 'EESoc'));\n $message->setReplyTo('[email protected]');\n $message->setTo($email);\n $message->setSubject('EESoc Dinner Confirmation');\n $message->setBody($html, 'text/html');\n\n if (isset($plaintext))\n $message->addPart($plaintext, 'text/plain');\n\n if ($mailer->send($message)) {\n $this->info(sprintf('Successfully sent email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n\n // Remove from queue\n $queue->delete();\n } else {\n $this->error(sprintf('Something went wrong while sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n }\n }\n }", "public function action_sendmails(){\r\n\t\techo 'Send mails from queue'.\"\\n\";\n\t\t$mails = Model_Mail::getQueuedToSend();\n\t\t$swiftMail = email::connect();\r\n\t\t\t\t\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(array($mail->from));\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->to));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tModel_Mail::setSent($mail->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo 'Sended '.count($mails).' e-mail'.\"\\n\";\r\n\t}", "function exec_queue()\n\t{\n\t\t$vbulletin =& $this->registry;\n\n\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t{\n\t\t\t// Lock mailqueue table so that only one process can\n\t\t\t// send a batch of emails and then delete them\n\t\t\t$vbulletin->db->lock_tables(array('mailqueue' => 'WRITE'));\n\t\t}\n\n\t\t$emails = $vbulletin->db->query_read(\"\n\t\t\tSELECT *\n\t\t\tFROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\tORDER BY mailqueueid\n\t\t\tLIMIT \" . intval($vbulletin->options['emailsendnum'])\n\t\t);\n\n\t\t$mailqueueids = '';\n\t\t$newmail = 0;\n\t\t$emailarray = array();\n\t\twhile ($email = $vbulletin->db->fetch_array($emails))\n\t\t{\n\t\t\t// count up number of mails about to send\n\t\t\t$mailqueueids .= ',' . $email['mailqueueid'];\n\t\t\t$newmail++;\n\t\t\t$emailarray[] = $email;\n\t\t}\n\t\tif (!empty($mailqueueids))\n\t\t{\n\t\t\t// remove mails from queue - to stop duplicates being sent\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tDELETE FROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\tWHERE mailqueueid IN (0 $mailqueueids)\n\t\t\t\");\n\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\tif ($vbulletin->options['use_smtp'])\n\t\t\t{\n\t\t\t\t$prototype =& new vB_SmtpMail($vbulletin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$prototype =& new vB_Mail($vbulletin);\n\t\t\t}\n\n\t\t\tforeach ($emailarray AS $index => $email)\n\t\t\t{\n\t\t\t\t// send those mails\n\t\t\t\t$mail = (phpversion() < '5' ? $prototype : clone($prototype)); // avoid ctor overhead\n\t\t\t\t$mail->quick_set($email['toemail'], $email['subject'], $email['message'], $email['header'], $email['fromemail']);\n\t\t\t\t$mail->send();\n\t\t\t}\n\n\t\t\t$newmail = 'data - ' . intval($newmail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\t$newmail = 0;\n\t\t}\n\n\t\t// update number of mails remaining\n\t\t$vbulletin->db->query_write(\"\n\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\tdata = \" . $newmail . \",\n\t\t\t\tdata = IF(data < 0, 0, data)\n\t\t\tWHERE title = 'mailqueue'\n\t\t\");\n\n\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t// this may not be atomic\n\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t{\n\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\tSELECT data\n\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t}\n\t}", "protected function _sendMail ()\n {\n $this->_lastMessageId = $this->_ses->sendRawEmail(\n $this->header.$this->EOL.$this->body.$this->EOL,\n $this->_mail->getFrom() ? : '', $this->_mail->getRecipients()\n );\n }", "public function action_sendnewsletters()\n\t{\n\t\techo 'Send newsletters from queue'.\"\\n\";\n\t\t$mails = Model_Newsletter::getQueuedToSend();\n\t\t$swiftMail = email::connect();\n\t\t$done_item = array();\n\t\t$done_newsletter = array();\n\t\tif (!count($mails))\n\t\t{\n\t\t\techo 'Nothing to send';\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(Model_Mail::EMAIL_ADMIN);\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->subscriber_email));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tif (!in_array($mail->newsletter_id, $done_newsletter))\n\t\t\t\t{\n\t\t\t\t\tarray_push($done_newsletter, $mail->newsletter_id);\t\n\t\t\t\t}\n\t\t\t\tarray_push($done_item, $mail->newsletter_queue_id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tModel_Newsletters::moveToArchive($done_item);\n\t\tModel_Newsletters::setSent($done_newsletter);\n\t\techo 'Sended '.count($done).' e-mail'.\"\\n\";\n\t}", "function process_mail_queue()\n\t{\n\t\t//-----------------------------------------\n\t\t// SET UP\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->vars['mail_queue_per_blob'] = isset($this->vars['mail_queue_per_blob']) ? $this->vars['mail_queue_per_blob'] : 5;\n\t\t\n\t\t$this->cache['systemvars']['mail_queue'] = isset( $this->cache['systemvars']['mail_queue'] ) ? intval( $this->cache['systemvars']['mail_queue'] ) : 0;\n\t\t\n\t\t$sent_ids = array();\n\t\t\n\t\tif ( $this->cache['systemvars']['mail_queue'] > 0 )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Require the emailer...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\trequire_once( ROOT_PATH . 'sources/classes/class_email.php' );\n\t\t\t$emailer = new emailer(ROOT_PATH);\n\t\t\t$emailer->ipsclass =& $this;\n\t\t\t$emailer->email_init();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get the mail stuck in the queue\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->DB->simple_construct( array( 'select' => '*', 'from' => 'mail_queue', 'order' => 'mail_id', 'limit' => array( 0, $this->vars['mail_queue_per_blob'] ) ) );\n\t\t\t$this->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $r = $this->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$data[] = $r;\n\t\t\t\t$sent_ids[] = $r['mail_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ( count($sent_ids) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Delete sent mails and update count\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = $this->cache['systemvars']['mail_queue'] - count($sent_ids);\n\t\t\t\t\n\t\t\t\t$this->DB->simple_exec_query( array( 'delete' => 'mail_queue', 'where' => 'mail_id IN ('.implode(\",\", $sent_ids).')' ) );\n\t\t\t\n\t\t\t\tforeach( $data as $mail )\n\t\t\t\t{\n\t\t\t\t\tif ( $mail['mail_to'] and $mail['mail_subject'] and $mail['mail_content'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->to = $mail['mail_to'];\n\t\t\t\t\t\t$emailer->from = $mail['mail_from'] ? $mail['mail_from'] : $this->vars['email_out'];\n\t\t\t\t\t\t$emailer->subject = $mail['mail_subject'];\n\t\t\t\t\t\t$emailer->message = $mail['mail_content'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $mail['mail_html_on'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->html_email = 1;\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$emailer->html_email = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emailer->send_mail();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// No mail after all?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Update cache with remaning email count\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );\n\t\t}\n\t}", "public function sendEmail()\n {\n SendEmailMessage::dispatch($this->address, $this->messageString);\n }", "public function send() { \n // Send the mail.\n if (!isset($this->bcc) || $this->bcc == '') $this->bcc = $this->from;\n $headers = \"From: \" . $this->from . \"\\r\\n\"\n . \"Reply-To: \" . $this->from . \"\\r\\n\"\n . \"Bcc: \" . $this->bcc . \"\\r\\n\"\n . \"X-Mailer: PHP\" . phpversion() . \"\\r\\n\"\n . \"X-Apparently-To: \" . $this->to;\n if (self::$TESTING) $mailedData = mail('[email protected]', $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n else $mailedData = mail($this->to, $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n // Update the object and database sent and dateSent fields.\n $this->dateSent = date(\"Y-m-d H:i:s\");\n // TODO - test for this db update\n $updateQuery = 'UPDATE communications set sent=1, dateSent=NOW() where communicationId=' . $this->commId;\n SSFDB::getDB()->saveData($updateQuery);\n // Mark the referenced works in the works table to show that the artist was informed of media receipt.\n $worksAffected = $this->referencedWorks;\n $worksWhereClause = \"\";\n $disjunctionString = \"\";\n // TODO test for this db update\n foreach ($worksAffected as $work) {\n if (self::mediaReceivedFor($work)) {\n $worksWhereClause .= $disjunctionString . \"workId = \" . $work['workId'];\n $disjunctionString = \" or \";\n }\n }\n $query = \"UPDATE works SET artistInformedOfMediaReceipt=1, artistInformedOfMediaReceiptDate=NOW()\"\n . \" WHERE \" . $worksWhereClause;\n SSFDB::getDB()->saveData($query);\n\n }", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function sendNotificationQueue() {\n foreach ($this->_NotificationQueue as $userID => $notifications) {\n if (is_array($notifications)) {\n // Only send out one notification per user.\n $notification = $notifications[0];\n\n /* @var Gdn_Email $Email */\n $email = $notification['Email'];\n\n if (is_object($email) && method_exists($email, 'send')) {\n $this->EventArguments = $notification;\n $this->fireEvent('BeforeSendNotification');\n\n try {\n // Only send if the user is not banned\n $user = Gdn::userModel()->getID($userID);\n if (!val('Banned', $user)) {\n $email->send();\n $emailed = self::SENT_OK;\n } else {\n $emailed = self::SENT_SKIPPED;\n }\n } catch (phpmailerException $pex) {\n if ($pex->getCode() == PHPMailer::STOP_CRITICAL && !$email->PhpMailer->isServerError($pex)) {\n $emailed = self::SENT_FAIL;\n } else {\n $emailed = self::SENT_ERROR;\n }\n } catch (Exception $ex) {\n switch ($ex->getCode()) {\n case Gdn_Email::ERR_SKIPPED:\n $emailed = self::SENT_SKIPPED;\n break;\n default:\n $emailed = self::SENT_FAIL;\n }\n }\n\n try {\n $this->SQL->put('Activity', ['Emailed' => $emailed], ['ActivityID' => $notification['ActivityID']]);\n } catch (Exception $ex) {\n // Ignore an exception in a behind-the-scenes notification.\n }\n }\n }\n }\n\n // Clear out the queue\n unset($this->_NotificationQueue);\n $this->_NotificationQueue = [];\n }", "function send()\n\t{\n\t\tif (!$this->toemail)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$vbulletin =& $this->registry;\n\n\t\t$data = \"\n\t\t\t(\" . TIMENOW . \",\n\t\t\t'\" . $vbulletin->db->escape_string($this->toemail) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->fromemail) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->subject) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->message) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->headers) . \"')\n\t\t\";\n\n\t\tif ($this->bulk)\n\t\t{\n\t\t\tif (!empty($this->mailsql))\n\t\t\t{\n\t\t\t\t$this->mailsql .= ',';\n\t\t\t}\n\n\t\t\t$this->mailsql .= $data;\n\t\t\t$this->mailcounter++;\n\n\t\t\t// current insert exceeds half megabyte, insert it and start over\n\t\t\tif (strlen($this->mailsql) > 524288)\n\t\t\t{\n\t\t\t\t$this->set_bulk(false);\n\t\t\t\t$this->set_bulk(true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*insert query*/\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tINSERT INTO \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\t\t(dateline, toemail, fromemail, subject, message, header)\n\t\t\t\tVALUES\n\t\t\t\t\" . $data\n\t\t\t);\n\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\t\tdata = data + 1\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\n\t\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t\t// this may not be atomic\n\t\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t\t{\n\t\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\t\tSELECT data\n\t\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\t\");\n\t\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "private function redeliverMessages(): void\n {\n if (! isset($this->redeliverMessagesLastExecutedAt)) {\n $this->redeliverMessagesLastExecutedAt = microtime(true);\n } elseif (microtime(true) - $this->redeliverMessagesLastExecutedAt < 1) {\n return;\n }\n\n $this->connection->createQueryBuilder()\n ->update($this->tableName)\n ->set('delivery_id', ':deliveryId')\n ->andWhere('redeliver_after < :now')\n ->andWhere('delivery_id IS NOT NULL')\n ->setParameter('now', new DateTimeImmutable(), Types::DATETIMETZ_IMMUTABLE)\n ->setParameter('deliveryId', null)\n ->executeStatement();\n\n $this->redeliverMessagesLastExecutedAt = microtime(true);\n }", "public function processQueue()\n {\n $gate_arr = config('gates');\n foreach ($gate_arr as $gate_item) {\n $this->sendSmsOne($gate_item['name']);\n }\n }", "public function flushNotificationQueue() {\r\n\t\t// Logfile entries\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Log the message\r\n\t\t\t$this->log($message);\r\n\t\t}\r\n\t\t$sendNotifications = Configure::read('Alert.send');\r\n\t\tif (!$sendNotifications) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Email notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\r\n\t\t\t$this->sendAlertEmail($message);\r\n\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// 1/4 of a second is enough here.\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\t\t// Pushover Notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Send out notifications through Pushover\r\n\r\n\t\t\t$this->sendPushoverAlert($message);\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// We don't want to get ourselves banned from Pushover...\r\n\t\t\t// 1/4 of a second should suffice\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\r\n\t}", "protected function execute($arguments = array(), $options = array())\r\n {\r\n $databaseManager = new sfDatabaseManager($this->configuration);\r\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\r\n\r\n $this->log('mailer on...');\r\n while(true)\r\n {\r\n $this->log('----------------------------------------------------------');\r\n\r\n if($mb_mail_list = MbMailPeer::getPendientes())\r\n {\r\n foreach($mb_mail_list as $mb_mail)\r\n {\r\n MbWorker::setActive($mb_mail->getId());\r\n\r\n $mb_mail->reload();\r\n\r\n if(!$mb_mail->getToken())\r\n {\r\n //$token = uniqid(null, true);\r\n $mb_mail->setToken(sha1(rand(111111,999999) . $mb_mail->getSubject()));\r\n $mb_mail->save();\r\n }\r\n\r\n $this->log('Procesando email: ' . $mb_mail->getSubject() . ' (batch size: ' . $mb_mail->getBatchSize() . ')');\r\n\r\n if($next_recipients = $mb_mail->getNextRecipients())\r\n {\r\n foreach($next_recipients as $i => $mb_mailto)\r\n {\r\n if($i%2 == 0)\r\n $mb_mail->reload();\r\n\r\n MbWorker::setActiveRecipient($mb_mailto->getId());\r\n\r\n if($mb_mail->getState() == 'stop')\r\n {\r\n $this->log('-- !!Correo detenido desde aplicacion');\r\n break;\r\n }\r\n\r\n $this->log('- Enviando a: ' . $mb_mailto->getMailto());\r\n\r\n if(!$mb_mail->send($mb_mailto))\r\n {\r\n $this->log('-- Correo con errores');\r\n break;\r\n }\r\n\r\n sleep(1);\r\n }\r\n MbWorker::setActiveRecipient(0);\r\n }\r\n\r\n if($mb_mail->getState() != 'stop' && !$mb_mail->hasMoreRecipients())\r\n {\r\n $this->log('-- Termino de envio de ' . $mb_mail->getSubject());\r\n\r\n $mb_mail->setState('ok');\r\n $mb_mail->save();\r\n $mb_mail->notifyIfNecessary();\r\n }\r\n MbWorker::setActive(0);\r\n }\r\n\r\n }\r\n else\r\n {\r\n $this->log('No hay mails para enviar');\r\n break;\r\n }\r\n }\r\n $this->log('mailer off...');\r\n }", "public function handle()\r\n {\r\n foreach (AccountModel::all() as $account) {\r\n $client = $this->getClient($account);\r\n $service = new Google_Service_Gmail($client);\r\n $user = 'me';\r\n foreach ($account->replies()->where('message_replies.status', 'NEW')->get() as $reply)\r\n {\r\n $this->info($reply->id);\r\n $from = $account->name;\r\n $fromEmail = $account->account;\r\n $to = $reply->to ? $reply->to : $reply->message->from_name;\r\n $toEmail = $reply->to_email ? $reply->to_email : $reply->message->from;\r\n $subject = $reply->title;\r\n $content = nl2br($reply->content).\"<br/>\".$reply->updatefile;\r\n\r\n $message = new Google_Service_Gmail_Message();\r\n $message->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content));\r\n $result = $service->users_messages->send($user, $message);\r\n $reply->status = $result->id ? 'SENT' : 'FAIL';\r\n $reply->save();\r\n $this->info($result->id . '<' . $account->account . '>' . $reply->title . ' Sent.');\r\n }\r\n\r\n //转发邮件\r\n /*\r\n $message = ForemailModel::find(1);\r\n $from = 'choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $message->to;\r\n $toEmail = $message->to_email;\r\n $subject = $message->title;\r\n $content = nl2br($message->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content)); \r\n $result = $service->users_messages->send($user, $obj);\r\n $this->info($result->id);\r\n exit;\r\n */\r\n\r\n $Foremails = ForemailModel::all();\r\n foreach ($Foremails as $k => $foremail) {\r\n if($foremail->status=='NEW'){\r\n $from ='choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $foremail->to;\r\n $toEmail = $foremail->to_email;\r\n $subject = '客户邮箱->'.$foremail->to_useremail;\r\n $content = nl2br($foremail->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content)); \r\n $result = $service->users_messages->send($user, $obj);\r\n $foremail->status = $result->id ? 'SENT' : 'FAIL';\r\n $foremail->save();\r\n $this->info($foremail->id);\r\n }\r\n }\r\n\r\n $Sendemails = SendemailModel::all();\r\n foreach ($Sendemails as $k => $sendemail) {\r\n if($sendemail->status=='NEW'){\r\n $from ='choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $foremail->to;\r\n $toEmail = $sendemail->to_email;\r\n $subject =$sendemail->title;\r\n $content = nl2br($sendemail->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content));\r\n $result = $service->users_messages->send($user, $obj);\r\n $sendemail->status = $result->id ? 'SENT' : 'FAIL';\r\n $sendemail->save();\r\n $this->info($sendemail->id);\r\n }\r\n }\r\n\r\n }\r\n }", "private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }", "public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }", "public function index(){\n\n $this->socket = new SocketClient;\n\n $rooms = Room::get();\n\n foreach($rooms as $room)\n {\n\n $mails = $this->connect(trim($room->mail_server), trim($room->room_email), trim($room->password), trim($room->port));\n \n rsort($mails);\n if(!$mails) \n {\n die('Mailbox is empty');\n }\n\n $count2 = 0;\n\n for($i = 0; $i< count($mails); $i++)\n {\n \n $mail = $this->mailbox->getMail($mails[$i]);\n $this->saveMail($mail, trim($room->room_email));\n }\n\n if($this->update == true){\n\n $this->socket->message($room->room_email, 'Room Update');\n echo \"Updated <br/>\";\n $this->update = false;\n\n }\n\n }\n\n shell_exec('rm -r '. __DIR__.\"/my_attachments/*\");\n\n }", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n if (! $this->reminder_template) {\n $this->reminder_template = $this->quote->calculateTemplate('quote');\n }\n\n $this->quote->invitations->each(function ($invitation) {\n if ($invitation->contact->send_email && $invitation->contact->email) {\n EmailEntity::dispatchNow($invitation, $invitation->company, $this->reminder_template);\n }\n });\n\n $this->quote->service()->markSent();\n }", "public function send(){\n \t$this->connect();\n \t$this->login();\n \t\n \t$this->sendMail();//send an email\n \t\n \t \n \t$this->quit();\n \t$this->close();\n }", "public function sendEmail(array $data): void\n {\n $message = $this->messages->AddNewMessage($data);\n dispatch(new EmailSenderJob($message, $this->logs,$this->providers));\n }", "public function sendemailmult()\n\t{\n\t\t$counter=DB::table('subscribes')->count('email');\n\t\tif($counter!=0)\n\t\t{\n\t\t\t$users=DB::select(\"select *from subscribes\");\n\tforeach($users as $user)\n\t{\n\t\t$emails[]=$user->email;\n\t\t\n\t\t\n\t}\n\t//print_r($emails) ;\n\t\t\tMail::send('news', [$emails], function($message) use ($emails)\n{ \n $message->to($emails)->subject('Latest news'); \n//this script is like a loop to update every 10 row will be checked and add 10 row\n\t\t\t\n\t\t\t\t\t$updatelatest=DB::update(\"update news_articles set latest=0 where latest=latest ORDER by created_at\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\n\t\t\t\t\n});\n\t\treturn redirect()->back();\nvar_dump( Mail:: failures());\nexit;\n\t\t}\n\t\telse{\n\t\t\treturn redirect()->back();\n\t\t}\n\t\t\n\t\t\n\t\t//start writing a code to check if table does not have subscribers users\n\n\t\t\n\t\t//echo $collection = collect($users['email']);\n\t\t//$emails = ['[email protected]', '[email protected]'];\n\t\t\n\t\n\n\t}", "public function FlushQueue()\n {\n do\n {\n $result = $this->FlushMsg();\n } while ($result);\n }", "public function execute()\n {\n $this->cleanUnsentMessages->execute(self::PUSH_NOTIFICATION_PERSISTENCE);\n }", "public function execute() {\n\t\tset_include_path(get_include_path().PATH_SEPARATOR.LIB_ROOT);\n\t\trequire_once LIB_ROOT.'Zend/Mail.php';\n\n\t\t$mail = new Omelette_Mail($this->data['type']);\n\n\t\tforeach($this->data['params'] as $find=>$replace) {\n\t\t\tif(is_array($replace)) {\n\t\t\t\t$replace = implode(',',$replace);\n\t\t\t}\n\t\t\t$mail->getView()->set($find,$replace);\n\t\t}\n\n\t\t$mail->getMail()\n\t\t\t\t->addTo('[email protected]')\n\t\t\t\t->setSubject('Tactile CRM: Status Update')\n\t\t\t\t->setFrom('[email protected]','Your Friendly Tactile Robot');\n\t\t\n\t\tif(isset($this->data['attachment'])) {\n\t\t\t$attachment = $this->data['attachment'];\n\t\t\t$body = file_get_contents($attachment);\n\t\t\t$mail->getMail()->createAttachment($body,\t//contents of file (can be a stream)\n\t\t\t\t\t\t\t\t\t'text/csv',\t//file-type\n\t\t\t\t\t\t\t\t\tZend_Mime::DISPOSITION_ATTACHMENT,\t//default seems not to work?\n\t\t\t\t\t\t\t\t\tZend_Mime::ENCODING_BASE64,\t\t\t//likewise\n\t\t\t\t\t\t\t\t\t'errors.csv'); //the name of the file\n\t\t}\n\t\t$mail->send();\n\t\t$this->cleanup();\n\t}", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "protected function queueEmailMsg($playbook) {\r\n // $currentTime = time();\r\n $subEmailPlaybook = SubEmailPlaybook::where([\r\n 'playbook_email_id' => $playbook->id,\r\n 'message_level' => $playbook->message_sent_level\r\n ])\r\n // ->where('message_sent_at', '<=', $currentTime)\r\n ->first();\r\n \r\n $messageController = new MessageController();\r\n\r\n if ($subEmailPlaybook && isset($playbook->last_message_sent_at)) {\r\n $smsContact = SmsContact::where(['playbook_id'=> $playbook->id, 'playbook_type' => 'EMAIL'])->first();\r\n \r\n $last_message_sent_at = $playbook->last_message_sent_at;\r\n $format = 'Y-m-d H:i';\r\n // send next message on next schedule days\r\n if ($subEmailPlaybook->sendemailafter) {\r\n $date = date($format, $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.\"+ $subEmailPlaybook->sendemailafter days\");\r\n }\r\n\r\n // skip message on weekend\r\n if($playbook->sendingon_weekdays_only > 0)\r\n {\r\n $addDays = $messageController->isWeekend($last_message_sent_at);\r\n if($addDays > 0){\r\n $date = date($format, $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.\"+ $addDays days\");\r\n }\r\n }\r\n\r\n // set message time \r\n if($playbook->adTime)\r\n { \r\n $date = date('Y-m-d', $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.' '.$playbook->adTime);\r\n }\r\n\r\n // get all contact ids whose created date is less than playbook activated date\r\n // remove these ids from actual contacts ids\r\n // $contact_ids = json_decode($smsContact->contact_ids, true);\r\n // $playbook_activated_at = $playbook->playbook_activated_at;\r\n // $playbook_activated_at = date('Y-m-d H:i:s', $playbook_activated_at);\r\n // $playbookContactDetails = SegmentContactsModel::select('subscriber_invitee_id')\r\n // ->whereIn('subscriber_invitee_id', $contact_ids)\r\n // ->where('created_at', '>=', $playbook_activated_at)\r\n // ->get();\r\n // $new_contact_ids = []; \r\n \r\n // if (count($playbookContactDetails) > 0) {\r\n // // Log::info('segment new contact added '.print_r($playbookContactDetails, true));\r\n // foreach ($playbookContactDetails as $value) {\r\n // // Log::info('value in loop '.$value);\r\n // $new_contact_ids[] = $value->subscriber_invitee_id;\r\n // if (in_array($value->subscriber_invitee_id, $contact_ids)) {\r\n // if (($key = array_search($value->subscriber_invitee_id, $contact_ids)) !== false) {\r\n // unset($contact_ids[$key]);\r\n // }\r\n // $contact_ids = array_values($contact_ids);\r\n // }\r\n // }\r\n // }\r\n\r\n // get all contact details\r\n $contactDetails = $messageController->getContact($contact_ids);\r\n // add message on queue\r\n if ($contactDetails) {\r\n $messageController->addMessageOnQueue($playbook->user_id, $contactDetails, $subEmailPlaybook, $last_message_sent_at);\r\n }\r\n }\r\n \r\n }", "public function UpdateEmail()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$from = trim($_POST['fromemail']);\n\t\t\t$to = trim($_POST['toemail']);\n\n\t\t\t$update = array (\n\t\t\t\t'orders' => array (\n\t\t\t\t\t'ordbillemail',\n\t\t\t\t\t'ordshipemail',\n\t\t\t\t),\n\t\t\t\t'customers' => array (\n\t\t\t\t\t'custconemail',\n\t\t\t\t),\n\t\t\t\t'subscribers' => array (\n\t\t\t\t\t'subemail',\n\t\t\t\t),\n\t\t\t);\n\t\t\t$recordsUpdated = 0;\n\n\t\t\tforeach ($update as $table => $fields) {\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$updateData = array (\n\t\t\t\t\t\t$field => $to\n\t\t\t\t\t);\n\t\t\t\t\t$restriction = $field .\"='\".$GLOBALS['ISC_CLASS_DB']->Quote($from).\"'\";\n\t\t\t\t\t$GLOBALS['ISC_CLASS_DB']->UpdateQuery($table, $updateData, $restriction);\n\t\t\t\t\t$recordsUpdated += $GLOBALS['ISC_CLASS_DB']->NumAffected();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($recordsUpdated > 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedPlural'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} elseif ($recordsUpdated == 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedSingular'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} else {\n\t\t\t\t$message = GetLang('EmailCheckNoneUpdated');\n\t\t\t\t$status = MSG_ERROR;\n\t\t\t}\n\n\t\t\tFlashMessage($message, $status, 'index.php?ToDo=runAddon&addon=addon_emailchange');\n\t\t}", "public function scheduledemails(){\n foreach ($this->framework->getProjectsWithModuleEnabled() as $projectId){\n $_GET['pid'] = $projectId; // might change in future to $this->setProjectId($projectId);\n if($projectId != \"\") {\n $this->deleteOldLogs($projectId);\n if(!$this->isProjectStatusCompleted($projectId)) {\n $this->log(\"scheduledemails PID: \" . $projectId . \" - start\", ['scheduledemails' => 1]);\n $email_queue = $this->getProjectSetting('email-queue', $projectId);\n if ($email_queue != '') {\n $email_sent_total = 0;\n foreach ($email_queue as $index => $queue) {\n if (\n $queue['record'] != '' &&\n $email_sent_total < 100 &&\n !$this->hasQueueExpired($queue, $index, $projectId) &&\n $queue['deactivated'] != 1\n ) {\n if ($this->getProjectSetting(\n 'email-deactivate',\n $projectId\n )[$queue['alert']] != \"1\" &&\n $this->sendToday($queue, $projectId)\n ) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Has queued emails to send today \" .\n date(\"Y-m-d H:i:s\"),\n ['scheduledemails' => 1]\n );\n #SEND EMAIL\n $email_sent = $this->sendQueuedEmail(\n $index,\n $projectId,\n $queue['record'],\n $queue['alert'],\n $queue['instrument'],\n $queue['instance'],\n $queue['isRepeatInstrument'],\n $queue['event_id']\n );\n #If email sent save date and number of times sent and delete queue if needed\n if ($email_sent || $email_sent == \"1\") {\n $email_sent_total++;\n }\n #Check if we need to delete the queue\n $this->stopRepeat($queue, $index, $projectId);\n }\n } else if ($email_sent_total >= 100) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Batch ended at \" .\n date(\"Y-m-d H:i:s\"),\n ['scheduledemails' => 1]\n );\n break;\n }\n }\n }\n }\n }\n }\n }", "public function handle()\n { \n\t\t$scheduledMessage = DB::table(\"fontana_marketing_mail\")->where('status','=','2')->get();\t\t\t\n\t\t\n\t\tforeach($scheduledMessage as $sm){\n\t\t\t$userTimeZone = DashboardService::getUserTimezone($sm->restaurant_id);\n\t\t\tdate_default_timezone_set($userTimeZone);\t\n\t\t\t $currentDate = date('Y-m-d');\n\t\t\t $currentTime = date('H:i').\":00\";\n\t\t\t \n\t\t\t$scheduleDate = date(\"Y-m-d\",strtotime($sm->schedule_date));\n\t\t\t$scheduleTime = date(\"h:i\",strtotime($sm->schedule_time)).\":00\";\n\t\t\t$this->logger->info($sm->restaurant_id.\" \".$scheduleTime.\" \".date(\"h:i:s\"));\n\t\t\t$subject = $sm->subject;\n\t\t\tif($scheduleDate==$currentDate && $scheduleTime==$currentTime){\t\t\t\t\n\t\t\t\t$content = $sm->content;\n\t\t\t\t$recipients = explode(\",\",$sm->email_id);\n\t\t\t\t\n\t\t\t\t$UserSMTP = DB::table(\"users\")->where('id','=',$sm->restaurant_id)->first();\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($UserSMTP->smtp_email!=\"\" && $UserSMTP->smtp_name!=\"\" && $UserSMTP->smtp_password!=\"\"){\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\\Config::set('mail.username', $UserSMTP->smtp_email);\t\n\t\t\t\t\t\\Config::set('mail.host','smtp.gmail.com');\t\t \n\t\t\t\t\t\\Config::set('mail.password', $UserSMTP->smtp_password);\t\t\t\t\t\n\t\t\t\t\t(new \\Illuminate\\Mail\\MailServiceProvider(app()))->register();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\\Mail::send('backend.marketingmail', ['content' => $content], function ($message) use ($recipients,$UserSMTP,$subject)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$message->from($UserSMTP->email, $UserSMTP->name);\n\t\t\t\t\t$message->to($recipients);\n\t\t\t\t\t$message->subject($subject);\n\t\t\t\t});\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\\Mail::send('backend.marketingmail', ['content' => $content], function ($message) use ($recipients)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$message->from('[email protected]', 'Jatin Bhatt');\n\t\t\t\t\t$message->to($recipients);\n\t\t\t\t\t$message->subject(\"Mail from Fontana\"); \t\n\t\t\t\t});\n\t\t\t\t*/\n\t\t\t\t$statusMarketingMail = MarketingMail::find($sm->id);\n\t\t\t\t$statusMarketingMail->status = 0;\n\t\t\t\t$statusMarketingMail->save();\n\t\t\t}\t\t\t\n\t\t}\n }", "public function rewardsSmsQueue()\n {\n $sms_queue = RewardSms::where(\"sent\", 0)->get()->take(5);\n \n foreach ($sms_queue as $key => $queue) {\n \n $this->sendSms($queue->phone, $queue->text);\n \n $sms_obj = RewardSms::where(\"rewards_sms_id\", $queue->rewards_sms_id)->get()->first();\n $sms_obj->sent = 1;\n $sms_obj->save();\n }\n }", "private function sendDailyAdminEmail()\n {\n // Message\n $message = (new AdministratorDaily())->onQueue('platform-processing');\n // User Setting\n $settingProvider = (new PlatformSettingProvider());\n Mail::to($settingProvider->setting('admin_notification_email'),$settingProvider->setting('admin_notification_name'))\n ->send($message);\n Log::info(\"Sent Admin Email\");\n }", "public function queueContact($email) \n {\n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n $query = $db->prepare('INSERT INTO ctct_email_cache VALUES(:email);');\n $query->execute(array('email' => $email));\n }", "public function flush()\n {\n $queueSize = count($this->queue);\n if ($queueSize > 0) {\n $this->logInfo('Flushing queue of size ' . $queueSize);\n $this->getTransport()->send($this->queue);\n $this->queue = array();\n }\n }", "public function run()\n\t{\n\t\tDB::table('messages')->insert([\n\t\t\t[\n\t\t\t\t'job_id' => 1, \n\t\t\t\t'user_id' => 1,\n\t\t\t\t'worker_id' => 4,\n\t\t\t\t'sender' => 'client', \n\t\t\t\t'body' => 'Hola ¿qué tal?'\n\t\t\t],[\n\t\t\t\t'job_id' => 1, \n\t\t\t\t'user_id' => 1,\n\t\t\t\t'worker_id' => 4,\n\t\t\t\t'sender' => 'worker', \n\t\t\t\t'body' => 'Hola. Bien todo ¿cómo está usted?'\n\t\t\t]\n\t\t]);\n\t}", "public function run()\n {\n for($i=0;$i<50;$i++){\n \t$e = new Email;\n\n \t$e->name = \"user-\".$i;\n \t$e->email = \"user-\".$i.\"@gmail.com\";\n \t$e->phone = \"016370192\".$i;\n \t$e->subject = \"Subject-\".$i;\n \t$e->message = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur error soluta quae, expedita, molestias, rerum nihil optio recusandae doloribus maxime libero commodi facilis eveniet? Ullam illum laborum voluptatem, ea laboriosam assumenda, consequuntur facere animi sunt molestias deleniti eveniet expedita. Quos ipsum maxime, quisquam, dolor nulla doloremque ad suscipit impedit quidem voluptate commodi voluptatum consequuntur facilis, dolore id optio itaque culpa et tempore eligendi molestiae rerum dolores eaque harum possimus. Molestias modi labore assumenda tempora totam aliquam delectus harum atque, quae, perspiciatis reprehenderit eligendi dignissimos pariatur, est odit ut animi itaque consequuntur impedit sit! Unde, omnis, fugiat. Facere eius eligendi quidem!\";\n\n \t$e->save();\n\n }\n }", "public function main()\n{\n //get twitter mail data\t\n $results = $this->TwitterMailQueue->find('all');\n \n foreach ( $results as $result ) {\n\t // call twitter function\t\n\t $resp = $this->sendNotification($result['TwitterMailQueue']['twitter_id'], $result['TwitterMailQueue']['mail_data']);\n\t \n\t if ( $resp == 1 ) {\n\t \t//remove the notification from twitter mail queue table\n\t \t$this->removeTwitterQueue($result['TwitterMailQueue']['id']);\n\t\t\n\t\t//create the CSV user data array\n\t \t$csv_data = array('twitter_id'=>$result['TwitterMailQueue']['twitter_id'], 'content'=> $result['TwitterMailQueue']['mail_data']);\n\n\t \t//write the csv\n\t \t$this->writeCsv($csv_data);\n\t } else if ( $resp == 0 ) {\n\t \t$data = array();\n\t \t$data['TwitterMailFailure']['twitter_id'] = $result['TwitterMailQueue']['twitter_id'];\n\t \t$data['TwitterMailFailure']['mail_data'] = $result['TwitterMailQueue']['mail_data'];\n\t \t$this->TwitterMailFailure->create();\n\t \t$this->TwitterMailFailure->save($data); //saving data in failure case in twitter_mail_failure table for further trail \t\n\t } else if ( $resp == 2 ) { //twitter app not authentic case(can be used for future for notification on dashboard)\n\t \t\n\t }\n }\n }", "function __emailer($email = '', $vars = array())\n {\n\n //common variables\n $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];\n $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];\n\n //------------------------------------queue email in database-------------------------------\n /** THIS WIL NOT SEND BUT QUEUE THE EMAILS*/\n if ($email == 'mailqueue_ticket_reply') {\n\n //email vars\n $this->data['email_vars']['email_title'] = $this->data['lang']['lang_support_ticket_reply'];\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('general_notification_admin');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //dynamic email vars - email body\n $this->data['email_vars']['email_message'] = '\n <div style=\" border:#CCCCCC solid 1px; padding:8px;\">\n <span style=\"text-decoration: underline; font-weight:bold;\">\n ' . $this->data['lang']['lang_title'] . '</span><br>\n ' . $this->input->post('tickets_title') . '<br><br>\n <span style=\"text-decoration: underline; font-weight:bold;\">\n ' . $this->data['lang']['lang_message'] . '</span><br>\n ' . $this->input->post('tickets_replies_message') . '\n <p><div style=\"padding:5px; background-color:#fbe9d0;\">'.$this->data['lang']['lang_support_do_not_reply'].'</div></div>';\n\n //dynamic email vars - general\n $this->data['email_vars']['addressed_to'] = $this->data['lang']['lang_hello'];\n $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'].'/ticket/'.$this->input->post('tickets_replies_ticket_id');\n\n //get the email address of staff assigned to this ticket. (email preferences are checked)\n $team_members_email = $this->teamprofile_model->notificationsEmail($this->input->post('tickets_assigned_to_id'));\n $this->data['debug'][] = $this->teamprofile_model->debug_data;\n\n //add to email queue\n if ($team_members_email != '') {\n\n //set sqldata() for database\n $sqldata['email_queue_message'] = parse_email_template($template['message'], $this->data['email_vars']);\n $sqldata['email_queue_subject'] = $this->data['lang']['lang_support_ticket_reply'];\n $sqldata['email_queue_email'] = $team_members_email;\n\n //add to email queue database - excluding uploader (no need to send them an email)\n $this->email_queue_model->addToQueue($sqldata);\n $this->data['debug'][] = $this->email_queue_model->debug_data;\n }\n\n }\n }", "public function send()\n {\n $bulk = [];\n\n $time = date('Y-m-d H:i:s');\n\n //$recipients = $this->recepientsToArray( $this->recipients);\n\n foreach( $this->recipients as $recipient)\n {\n if ( ! in_array( $recipient, $this->exclude) )\n {\n $details = [\n 'recipient' => $recipient,\n 'sender' => Auth::id(),\n 'message' => $this->message,\n 'reply_to' => $this->replyTo,\n 'created_at' => $time,\n 'updated_at' => $time\n ];\n\n $bulk[] = $details;\n }\n }\n\n $message = InAppModel::insert($bulk);\n\n if( ! $message )\n {\n throw new \\Exception(\"error sending message\");\n }\n\n return true;\n\n\n\n }", "public function handle()\r\n {\r\n foreach (AccountModel::all() as $account) {\r\n $client = $this->getClient($account);\r\n $service = new Google_Service_Gmail($client);\r\n $user = 'me';\r\n $i = 0;\r\n $nextPageToken = null;\r\n do {\r\n $i += 1;\r\n $messages = $service->users_messages->listUsersMessages($user,\r\n [\r\n 'labelIds' => ['INBOX', 'UNREAD'],\r\n 'pageToken' => $nextPageToken\r\n ]\r\n );\r\n $nextPageToken = $messages->nextPageToken;\r\n //save list\r\n $messageList = new ListModel;\r\n $messageList->account_id = $account->id;\r\n $messageList->next_page_token = $messages->nextPageToken;\r\n $messageList->result_size_estimate = $messages->resultSizeEstimate;\r\n $messageList->count = count($messages);\r\n $messageList->save();\r\n\r\n foreach ($messages as $message) {\r\n $messageNew = MessageModel::firstOrNew(['message_id' => $message->id]);\r\n if ($messageNew->id == null) {\r\n $messageContent = $service->users_messages->get($user, $message->id);\r\n $messagePayload = $messageContent->getPayload();\r\n $messageHeader = $this->parseMessageHeader($messagePayload->getHeaders());\r\n\r\n $messageLabels = $messageContent->getLabelIds();\r\n $messageNew->account_id = $account->id;\r\n $messageNew->list_id = $messageList->id;\r\n $messageNew->message_id = $messageContent->getId();\r\n $messageNew->labels = serialize($messageLabels);\r\n $messageNew->label = $messageLabels[0];\r\n if (isset($messageHeader['From'])) {\r\n $messageFrom = explode(' <', $messageHeader['From']);\r\n if (count($messageFrom) > 1) {\r\n $messageNew->from = $this->clearEmail(str_replace('>', '', $messageFrom[1]));\r\n $messageNew->from_name = str_replace('\"', '', $messageFrom[0]);\r\n } else {\r\n $messageNew->from = $this->clearEmail($messageHeader['From']);\r\n }\r\n }\r\n if (isset($messageHeader['To'])) {\r\n $messageTo = explode(' <', $messageHeader['To']);\r\n if (count($messageTo) > 1) {\r\n $messageNew->to = $this->clearEmail(str_replace('>', '', $messageTo[1]));\r\n } else {\r\n $messageNew->to = $this->clearEmail($messageHeader['To']);\r\n }\r\n }\r\n $messageNew->date = isset($messageHeader['Date']) ? $messageHeader['Date'] : '';\r\n $messageNew->subject = isset($messageHeader['Subject']) ? $messageHeader['Subject'] : '';\r\n /*\r\n //判断subject 是否有值\r\n if($messageHeader['Subject']){\r\n //截取两个规定字符之间的字符串\r\n preg_match_all(\"|Message from(.*)via|U\", $messageHeader['Subject'], $out,PREG_PATTERN_ORDER);\r\n }\r\n $messageNew->title_email = isset($out[0][0]) ? $out[0][0] : '';\r\n */\r\n $messageNew->save();\r\n $this->saveMessagePayload($service, $message->id, $messageNew->id, $messagePayload);\r\n $k=MessageModel::find($messageNew->id);\r\n //找到最近的历史邮件\r\n //找到这个历史邮件的assigne\r\n //判断如果是 [email protected] 这种类型的邮箱不自动分配\r\n if($k->from !=\"[email protected]\" and $k->from !=\"[email protected]\"){\r\n $userId = $k->last->assign_id;\r\n //因为id为14的这名客服已经离职所以判断历史邮件的时候总会报错\r\n //解决方案改成 把这封邮件手动分配给别人\r\n if($userId==14 || $userId==17){\r\n $userId=10;\r\n }\r\n if($userId){\r\n $data1['assign_id']=$k->assign_id=$userId;\r\n $data1['status']=$k->status=\"PROCESS\";\r\n $data1['content']=strip_tags($k->message_content);\r\n $k->update($data1);\r\n }\r\n }else{\r\n $data1['content']=strip_tags($k->message_content);\r\n $k->update($data1);\r\n }\r\n\r\n\r\n //找到关联订单\r\n //找到from的邮箱,再用这个邮箱去搜索订单列表对应EMAIL的订单\r\n //找到邮件内容,匹配 *********1340 ,用这个订单号去搜索订单列表\r\n /*\r\n if($k->from==\"[email protected]\"){\r\n $body=$k->message_content;\r\n preg_match_all('/ordernum:(.*?)<br>/',$body,$match);\r\n if(count($match[1])){\r\n $orderNums[]=$match[1][0];\r\n $k->setRelatedOrders($orderNums);\r\n }\r\n }\r\n */\r\n\r\n\r\n\r\n /*\r\n $orderNums = $messageNew->guessRelatedOrders($messageNew->from);\r\n if($orderNums){\r\n $messageNew->setRelatedOrders($orderNums);\r\n }else{\r\n //把orderNums转化为只有orderNum的数组\r\n if($messageNew->to==\"[email protected]\"){\r\n $body=$messageNew->message_content;\r\n preg_match_all('/ordernum:(.*?)<br>/',$body,$match);\r\n if(count($match[1])){\r\n $orderNums[]=$match[1][0];\r\n }\r\n }\r\n if(count($orderNums)){\r\n $messageNew->setRelatedOrders($orderNums);\r\n }\r\n }\r\n */\r\n $this->info('Message #' . $messageNew->message_id . ' Received.');\r\n }\r\n }\r\n } while ($nextPageToken != '');\r\n }\r\n }", "function sendAlerts(){\n\t$sql=\"select alertID,alerts.channelID,msisdn,messageContent,messageStatus from alerts inner join subscriptions on subscriptions.channelID = alerts.channelID and messageStatus= 'send'\";\n\t$result = mysql_query($sql);\n\t//logging\n\tif(!$result){\n\t\t$dbErr = \"SQL Error: \".mysql_error().\"SQL CODE: \".$sql;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}\n\twhile($rows = mysql_fetch_array($result)){\n\t\t$destAddr = $rows['msisdn'];\n\t\t$messageContent = $rows['messageContent'];\n\t\t$alertID = $rows['alertID'];\n\t}\n\t\n\t#insert into outbound\n\tfor($x=0;$x<(count($alertID)); $x++){\n\t\t$sql_send=\"insert into outbound(destAddr,sourceAddr,messageType,messageContent,status) values('$destAddr[$x]',default,default,'$messageContent[$x]','send')\";\n\t\t$result = mysql_query($sql_send);\n\t\tif(!$result){\n\t\t\t$dbErr = \"SQL Error: \".mysql_error(). \"SQL CODE: \".$sql_send;\n\t\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}else{\n\t\t\t$subsLogs = \"Successfully inserted alerts template for sending: \".$sql_newAlerts;\n\t\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}\n\t}\n\t\n\t##update sent alerts in alerts tbl\n\tfor($x=0; $x<(count($alertID)); $x++){\n\t\t$sql_update = \"update alerts set messageStatus = 'sent' where alertID = '$alertID[$x]'\";\n\t\t$result = mysql_query($sql_update);\n\t\tif(!$result){\n\t\t\t$dbErr = \"SQL Error: \".mysql_error(). \"SQL CODE: \".$sql_send;\n\t\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}else{\n\t\t\t$subsLogs = \"Successfully updated alerts template for sending: \".$sql_update;\n\t\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}\n\t}\n}", "function EnqueueEmail( $to, $subject, $message )\r\n\t\t{\r\n\t\t\t# Store the email in a new emails table in the db, send it later\r\n\t\t\t$this->CI->load->model('email');\r\n\t\t\t$this->CI->email->Create( $to, $subject, $message );\r\n\t\t}", "public function handle()\n {\n foreach (Subscription::query()\n ->where('active', true)\n ->whereNotNull('email_verified_at')->get() as $sub) {\n $sub->notify((new DailyMailNotification())->onQueue('dailyMail'));\n }\n }", "public function handle()\n {\n $mails = Tracking_mails::all();\n foreach($mails as $mail) {\n \n DB::table('tracking_mails')->where('id',$mail['id'])->update(['status'=> 'Sending']);\n $sendEmailJob = new SendEmail($mail['to'], $mail['id']);\n dispatch($sendEmailJob);//->delay(Carbon::now()->addMinutes(1));\n }\n }", "public function send(){\n\t\t\n\t\t$database = new Database();\n\t\t$query = $database->selectOne('message_queues', array('id',\n\t\t\t\t\t\t\t\t\t 'is_executed','executed_at','message','cellphone'), \n\t\t\t\t\t\t\t\t\t ' is_executed=0 ');\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$record = $database->fetchArray($exec);\n\t\t\t$response = $this->sendMessage($database, $record);\n\n\t\t\treturn json_encode(array('status' => $response['status'], 'message' => $response['message']));\n\t\t}\n\n\t}", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function mandrill_test(){\n\t\t\n\t\t$this->load->library('library_bulk_email', '', 'library_bulk_email');\n\t\t\n\t\t$test_users = array(\n\t\t\t'Casey Flynn' => '[email protected]',\n\t\t\t'Casey Flynn1' => '[email protected]',\n\t\t\t'Casey Flynn2' => '[email protected]',\n\t\t\t'Casey Flynn3' => '[email protected]'\n\t\t);\n\t\t\n\t\t\t\t\n\t\tforeach($test_users as $key => $email){\n\t\t\t\n\t\t\t$this->library_bulk_email->add_queue(array(\n\t\t\t\t'html'\t\t=> '<p>This is a test</p>',\n\t\t\t\t'text'\t\t=> 'This is a test',\n\t\t\t\t'subject'\t=> 'Email test from ClubbingOwl',\n\t\t\t\t'to_email'\t=> $email, \n\t\t\t\t'to_name'\t=> $key,\n\t\t\t));\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t$this->library_bulk_email->flush_queue();\n\t\t\n\t\techo 'complete' . PHP_EOL;\t\t\t\n\t\t\n\t}", "public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "protected function smtpSend(): void\n {\n $account = $this->account;\n\n $this->openSocket($account);\n defer($context, 'fclose', $this->socket);\n\n $this->connect($account);\n\n $this->authenticate($account);\n\n $this->sendCommand('MAIL FROM: <' . $this->from[0] . '>', '250');\n $recipients = array_merge($this->to, $this->cc, $this->bcc);\n foreach ($recipients as $recipient) {\n $this->sendCommand('RCPT TO: <' . $recipient[0] . '>', '250|251');\n }\n\n $this->sendCommand('DATA', '354');\n\n $this->sendCommand($this->message . self::CRLF . self::CRLF . self::CRLF . '.', '250');\n\n $this->sendCommand('QUIT', '221');\n }", "function send_ingame_mail_A($realm_id, $massmails, $return = false)\r{\r global $server, $characters_db, $realm_id, $from_char, $stationary, $sql;\r\r //$mess_str = '';\r $mess = 0;\r $result = '';\r $receivers = array();\r foreach ( $massmails as $mails )\r {\r if ( count($mails[\"att_item\"]) < 1 )\r {\r $mails[\"att_item\"] = array(0);\r $mails[\"att_stack\"] = array(0);\r }\r\r // build insert query\r $query = \"INSERT INTO mailbox_insert_queue (sender_guid, receiver_guid, subject, body, stationary, money, \r item_id, item_stack\";\r\r $att_item = $mails[\"att_item\"];\r $att_stack = $mails[\"att_stack\"];\r\r if ( count($att_item) > 1 )\r {\r for ( $i = 1; $i < count($att_item); $i++ )\r {\r $query .= \", item_id\".($i+1).\", item_stack\".($i+1);\r }\r }\r\r $query .= \"\r )\r VALUES ('\".$from_char.\"', '\".$mails[\"receiver\"].\"', '\".$mails[\"subject\"].\"', '\".$mails[\"body\"].\"', '\".$stationary.\"', '\".$mails[\"att_gold\"].\"', \r '\".$att_item[0].\"', '\".$att_stack[0].\"'\";\r\r if ( count($att_item) > 1 )\r {\r for ( $i = 1; $i < count($att_item); $i++ )\r {\r $query .= \", '\".$att_item[$i].\"', '\".$att_stack[$i].\"'\";\r }\r }\r\r $query .= \"\r )\";\r\r $sql[\"char\"]->query($query);\r\r if ( $sql[\"char\"]->affected_rows() )\r {\r //$mess_str .= \"Successfully sent message sent to \". $mails[\"receiver_name\"].\"<br />\";\r $mess = 0; // success\r $result = \"RESULT\";\r array_push($receivers, $mails[\"receiver_name\"]);\r }\r else\r {\r //$mess_str .= \"Failed to send message to \".$mails[\"receiver_name\"].\"<br />\";\r $mess = -1; // failure\r $result = \"RESULT\";\r }\r }\r\r $receiver_list = '';\r foreach ( $receivers as $receiver )\r {\r $receiver_list .= ', '.$receiver;\r }\r $reveiver_list = substr($receiver_list, 2, strlen($receiver_list)-2);\r\r if ( !$return )\r {\r if ( !isset($_GET[\"redirect\"]) )\r //redirect(\"mail.php?action=result&error=6&mess=$mess_str\");\r redirect(\"mail.php?action=result&error=6&mess=\".$mess.\"&recipient=\".$receiver_list);\r else\r {\r $money_result = $sql[\"char\"]->quote_smart($_GET[\"moneyresult\"]);\r $redirect = $sql[\"char\"]->quote_smart($_GET[\"redirect\"]);\r\r redirect($redirect.\"?moneyresult=\".$money_result.\"&mailresult=1\");\r }\r }\r else\r return $mess;\r\r}", "public function processMessages() {\n while ( ( $execution = array_shift($this->queue) ) ) { \n $execution->event('continue');\n $this->messagesDelivered++;\n }\n }", "function send_Mail($conn) {\n \n $to = \"\";\n $from = \"\";\n $headers = \"\";\n $subject = \"\";\n $msg = \"\";\n $msg_id = \"\";\n $list_id = \"\";\n $tname = \"LIST\";\n $code = \"\";\n $un_conf_url = \"http://DOMAIN/mailing_list.html\";\n \t \n $qMQ = \"SELECT EMAIL, MSG_ID, LFROM FROM MESSAGE_QUEUE;\";\n $rsMQ = mysql_query($qMQ);\n\t\t\n if ( (!$rsMQ) || (!mysql_num_rows($rsMQ)) ) { \n\tmysql_close($conn);\n exit;\t\t \n }\n \n while ($rowMQ = mysql_fetch_array($rsMQ)) {\n \n $to = $rowMQ['EMAIL']; \n\t$msg_id = intval($rowMQ['MSG_ID']);\n\t$from = $rowMQ['LFROM'];\n\t\n\t$q = \"SELECT LIST_ID, MESSAGE, SUBJECT FROM MESSAGES WHERE ID='$msg_id' LIMIT 1;\";\n\t$rs = mysql_query($q);\n\t\n\tif ( (!$rs) || (!mysql_num_rows($rs)) ) {\n\t continue;\t \n }\n\t\n\t$row = mysql_fetch_array($rs);\n\t\n\t$subject = $row['SUBJECT'];\n\t$msg = $row['MESSAGE'];\n\t$list_id = $row['LIST_ID'];\n\t\n\t$tname .= $list_id;\n\t$qL = \"SELECT CODE FROM $tname WHERE EMAIL='$to' LIMIT 1;\";\n\t//$rsL = mysql_query($qL);\n\t\n\t//if ( (!$rsL) || (!mysql_num_rows($rsL)) ) {\n\t// continue;\t \n //}\n\t\n\t//$rowL = mysql_fetch_array($rsL);\n\t\n\t//$code = $rowL['CODE'];\n\t\n\t$headers = \"From:$from\\r\\nMIME-Version: 1.0\\r\\nContent-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\t\n\t$msg = '<span style=\"font-family:Arial; font-size:10pt;\">' . $msg;\n\t$msg .= \"\\r\\n<br /><br />\";\n $msg .= \"To unsubscribe at any time, click <a href=\\\"$un_conf_url\\\">this link</a> or\\n\";\n $msg .= \"cut and paste the following URL into your browser:\\n\\n<br />\";\n $msg .= \"$un_conf_url\\n\\n<br />Thanks!</span>\";\n \n\tif (mail($to, $subject, $msg, $headers)) { \n\t $qD = \"DELETE FROM MESSAGE_QUEUE WHERE EMAIL='$to' AND MSG_ID='$msg_id';\";\n\t $rsD = mysql_query($qD);\n }\t \n \n } // end while cycle\n \n}", "protected function notifyByEmail() {\n\t\t$userlist = array();\n\n\t\t// find all the users with this server listed\n\t\t$users = $this->db->select(\n\t\t\tSM_DB_PREFIX . 'users',\n\t\t\t'FIND_IN_SET(\\''.$this->server['server_id'].'\\', `server_id`) AND `email` != \\'\\'',\n\t\t\tarray('user_id', 'name', 'email')\n\t\t);\n\n\t\tif (empty($users)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build mail object with some default values\n\t\t$mail = new phpmailer();\n\n\t\t$mail->From\t\t= sm_get_conf('email_from_email');\n\t\t$mail->FromName\t= sm_get_conf('email_from_name');\n\t\t$mail->Subject\t= sm_parse_msg($this->status_new, 'email_subject', $this->server);\n\t\t$mail->Priority\t= 1;\n\n\t\t$body = sm_parse_msg($this->status_new, 'email_body', $this->server);\n\t\t$mail->Body\t\t= $body;\n\t\t$mail->AltBody\t= str_replace('<br/>', \"\\n\", $body);\n\n\t\t// go through empl\n\t foreach ($users as $user) {\n\t \t// we sent a seperate email to every single user.\n\t \t$userlist[] = $user['user_id'];\n\t \t$mail->AddAddress($user['email'], $user['name']);\n\t \t$mail->Send();\n\t \t$mail->ClearAddresses();\n\t }\n\n\t if(sm_get_conf('log_email')) {\n\t \t// save to log\n\t \tsm_add_log($this->server['server_id'], 'email', $body, implode(',', $userlist));\n\t }\n\t}", "public function handle()\n {\n //Delete the yesterday email\n Email::where('received_date','>',Carbon::yesterday())->delete();\n \n //retrieve gmail inbox and insert into DB\n $oClient = Client::account();\n $afolder=$oClient->getFolder('INBOX');\n //$aMessage=$afolder->messages()->get();\n $aMessage=$afolder->query()->since(Carbon::now()->subDays(1))->get();\n \n foreach($aMessage as $oMessage){\n try{\n $email=new Email();\n $email->subject=$oMessage->getSubject();\n $email->body=$oMessage->getHTMLBody();\n $email->from=$oMessage->getFrom()[0]->personal;\n $email->received_date=$oMessage->getDate();\n $email->attachment=$oMessage->getAttachments()->count() > 0 ? 1 : 0;\n $email->from_email=$oMessage->getFrom()[0]->mail;\n $aAttachment = $oMessage->getAttachments();\n //Fetching attachments\n $aAttachment->each(function ($oAttachment) {\n $oAttachment->save();\n });\n $email->save();\n }\n catch (\\Exception $e) {\n Log::error('Error in inbox cronjob.'.$e);\n }\n }\n\n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "private function send(){\n\t\t\n\t\tif(empty($this->email)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 87;\n\t\t\t$errorLog->errorMsg = 'Missing email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->subject)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 88;\n\t\t\t$errorLog->errorMsg = 'Missing subject';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->plainText)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 89;\n\t\t\t$errorLog->errorMsg = 'Missing plain text of email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->htmlBody)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber =90;\n\t\t\t$errorLog->errorMsg = 'Missing HTML of body';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\t// Validate Email\n\t\t$this->validateEmail($this->email);\n\t\t\n\t\tif(!$this->error){\n\t\t\t// Required Files\n\t\t\tinclude 'Mail.php';\n\t\t\tinclude 'Mail/mime.php';\n\n\t\t\t/* ---\n\t\t\tPEAR Mail Factory\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.factory.php\n\t\t\t--- */\n\t\t\t$host = \"smtp-relay.gmail.com\";\n\t\t\t$port = 587;\n\t\t\t$smtp = Mail::factory('smtp', array('host'=>$host, 'port'=>$port));\n\n\t\t\t/* ---\n\t\t\tPEAR MIME\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail-mime.mail-mime.php\n\t\t\t--- */\n\t\t\t$crlf = \"\\n\";\n\t\t\t$mime = new Mail_mime(array('eol' => $crlf));\n\n\t\t\t// Headers\n\t\t\t$from = 'Catalog.beer <[email protected]>';\n\t\t\t$replyto = '[email protected]';\n\t\t\t$headers = array('From'=>$from, 'To'=>$this->email, 'Subject'=>$this->subject, 'Reply-To'=>$replyto);\n\n\t\t\t// Plain Text\n\t\t\t$mime->setTXTBody($this->plainText);\n\n\t\t\t// HTML\n\t\t\t$mime->setHTMLBody($this->htmlBody);\n\n\t\t\t$body = $mime->get();\n\t\t\t$headers = $mime->headers($headers);\n\n\t\t\t$smtp = Mail::factory('smtp',\n\t\t\t\tarray ('host' => 'smtp-relay.gmail.com',\n\t\t\t\t\t\t\t 'port' => 587,\n\t\t\t\t\t\t\t 'auth' => true,\n\t\t\t\t\t\t\t 'username' => '',\n\t\t\t\t\t\t\t 'password' => '',\n\t\t\t\t\t\t\t 'debug' => false));\n\n\t\t\t/* ---\n\t\t\tPEAR Send Mail\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.send.php\n\t\t\t--- */\n\t\t\t$mail = $smtp->send($this->email, $headers, $body);\n\n\t\t\t// Process Errors\n\t\t\tif(PEAR::isError($mail)){\n\t\t\t\t// Error Sending Email\n\t\t\t\t$this->error = true;\n\t\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\n\t\t\t\t// Log Error\n\t\t\t\t$errorLog = new LogError();\n\t\t\t\t$errorLog->errorNumber = 91;\n\t\t\t\t$errorLog->errorMsg = 'Error sending email';\n\t\t\t\t$errorLog->badData = $mail->getMessage();\n\t\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t\t$errorLog->write();\n\t\t\t}\n\t\t}\n\t}", "protected function _sendEmail($info)\n {\n EmailQueue::enqueue($info['to'], $info['viewVars'], $info);\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "function processSendUpdates($application_id, $contents, $subject, $msg_type, $send_by, $send_as, $priority, $curdate, $send_to, $orgId) {\n if (!empty($application_id)) {\n $time = time();\n $fieldArray['hold_contacted'] = $time;\n $tableName = 'applications';\n $condition = \"application_id='$application_id'\";\n\n $this->Update($tableName, $fieldArray, $condition);\n }\n\n #------------insert into messages---------------\n\n $fieldArray = '';\n $fieldArray['message'] = addslashes($contents);\n $fieldArray['subject'] = addslashes($subject);\n $fieldArray['msg_type'] = $msg_type;\n $fieldArray['sent_by'] = $send_by;\n $fieldArray['sent_as'] = $send_as;\n $fieldArray['priority'] = $priority;\n $fieldArray['msg_sent_dt'] = $curdate;\n $tableName = 'messaging';\n $this->Insert($tableName, $fieldArray);\n\n\n $query = \"select max(msg_id) as msgid from messaging where sent_as='$send_as'\";\n $value = $this->getDBRecords($query);\n $msg_id = $value[0]['msgid'];\n\n $fieldArray = '';\n $fieldArray['parent_msgid'] = $msg_id;\n $tableName = 'messaging';\n $condition = \"msg_id='$msg_id'\";\n $this->Update($tableName, $fieldArray, $condition);\n\n\n\n if ($send_to == 'ALL') {\n $query = \"select concat(u.name,' ',u.surname) name,u.user_id from users u where u.active='Y' and access_level = 'company1'\";\n $res = $this->getDBRecords($query);\n for ($i = 0; $i < count($res); $i++) {\n $fieldArray = '';\n $fieldArray['msg_id'] = $msg_id;\n $fieldArray['user_id'] = $res[$i]['user_id'];\n $fieldArray['received_as'] = addslashes($res[$i]['name']);\n $tableName = 'msg_sent_to';\n $this->Insert($tableName, $fieldArray);\n }\n } else {\n $res = \"select concat(u.name,' ',u.surname) name from users u where u.user_id='$send_to'\";\n $qryres = $this->getDBRecords($res);\n $received_as = $qryres[0]['name'];\n\n $fieldArray = '';\n $fieldArray['msg_id'] = $msg_id;\n $fieldArray['user_id'] = $send_to;\n $fieldArray['received_as'] = $received_as;\n $tableName = 'msg_sent_to';\n $this->Insert($tableName, $fieldArray);\n }\n #Link application to messages\n\n $fieldArray = '';\n $fieldArray['msg_id'] = $msg_id;\n $fieldArray['application_id'] = $application_id;\n $tableName = 'application_messages';\n $this->Insert($tableName, $fieldArray);\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public function step_5( )\n\t{\n\t\t$DbSubcriber \t= \\tify_db_get( 'emailing_subscriber' );\n\t\t$DbMailQueue \t= \\tify_db_get( 'emailing_queue' );\n\n\t\t$defaults = array(\n\t\t\t'test_email' \t=> wp_get_current_user()->user_email,\n\t\t);\n\t\t$this->item->campaign_send_options = wp_parse_args( $this->item->campaign_send_options, $defaults );\n\n\t\t$total = 0;\n\t\tif( isset( $this->item->campaign_recipients['wystify_subscriber'] ) )\n\t\t\tforeach( $this->item->campaign_recipients['wystify_subscriber'] as $subscriber_id )\n\t\t\t\tif( $DbSubcriber->select()->cell_by_id( $subscriber_id, 'status' ) === 'registred' )\n\t\t\t\t\t$total++;\n\t\tif( isset( $this->item->campaign_recipients['wystify_mailing_list'] ) )\n\t\t\tforeach( $this->item->campaign_recipients['wystify_mailing_list'] as $list_id )\n\t\t\t\t$total += $DbSubcriber->select()->count( array( 'list_id' => $list_id, 'status' => 'registred' ) );\n\t\t\t\n\t\t$set_send_active = $DbMailQueue->select()->has( 'campaign_id', $this->item->campaign_id );\t\n\t?>\n\t\t<div class=\"tifybox\">\n\t\t\t<h3><?php _e( 'Tester la campagne', 'tify' );?></h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<div id=\"send-test\">\t\t\n\t\t\t\t\t<div id=\"send-test-submit\">\n\t\t\t\t\t\t<span id=\"send-test-ok\"></span>\n\t\t\t\t\t\t<input type=\"text\" id=\"send-test-email\" name=\"campaign_send_options[test_email]\" value=\"<?php echo $this->item->campaign_send_options['test_email'];?>\" size=\"80\" autocomplete=\"off\"/>\n\t\t\t\t\t\t<button class=\"button-secondary\"><i class=\"fa fa-paper-plane\"></i><div class=\"tify_spinner\"></div></button>\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<em style=\"margin-top:5px;display:block;color:#999;font-size:0.9em;\"><?php _e( 'La visualisation en ligne et le lien de désinscription resteront actifs pendant 60 minutes après l\\'expédition de ce mail.<br />La désinscription n\\'affectera pas les abonnements relatifs à l\\'email d\\'expédition de test, le système procède à une désinscription pour un compte de service fictif.', 'tify');?></em>\n\t\t\t\t</div>\t\n\t\t\t</div>\t\n\t\t</div>\n\t\t\n\t\t<div id=\"prepare\" class=\"tifybox\">\n\t\t\t<h3><?php _e( 'Préparation de la campagne', 'tify' );?></h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<div id=\"logs\">\n\t\t\t\t \t<div class=\"duplicates\">\n\t\t\t\t\t\t<h5><?php _e( 'Doublons supprimés', 'tify' );?> (<span class=\"total\"></span>)</h5>\n\t\t\t\t\t\t<ul></ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"invalids\">\n\t\t\t\t\t\t<h5><?php _e( 'Emails invalides', 'tify' );?> (<span class=\"total\"></span>)</h5>\n\t\t\t\t\t\t<ul></ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"not_found\">\n\t\t\t\t\t\t<h5><?php _e( 'Correspondances introuvables', 'tify' );?> (<span class=\"total\"></span>)</h5>\n\t\t\t\t\t\t<ul></ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t<div id=\"actions\">\t\t\n\t\t\t\t\t<a href=\"#\" id=\"campaign-prepare\"><?php _e( 'Préparer la campagne', 'tify' );?></a>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div id=\"totals\">\n\t\t\t\t\t<h5><?php _e( 'Totaux', 'tify' );?> : </h5>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"expected\"><?php _e( 'Attendus', 'tify' );?> : <span class=\"value\"><?php echo $total;?></span></li>\n\t\t\t\t\t\t<li class=\"processed\"><?php _e( 'Mis en file', 'tify' );?> : <span class=\"value\"><?php echo $DbMailQueue->select()->count( array( 'campaign_id' => $this->item->campaign_id ) );?></span></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div> \n\t\t\t</div>\t\n\t\t</div>\t\t\n\t\t\t\t\t\n\t\t<?php \n\t\t\t\\tify_control_progress( \n\t\t\t\tarray(\n\t\t\t\t\t'id'\t\t=> 'CampaignPrepareProgress'\n\t\t\t\t)\n\t\t\t);\n\t\t?>\n\t<?php\t\n\t}", "public function handle()\n {\n $sendInvite = Invitation::where('status', 0)->get();\n foreach ($sendInvite as $invite) {\n \\Mail::to($invite)->send(new InvitationMail($invite));\n $invite->status = 1;\n $invite->update();\n }\n return \"Message sent!\";\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function handle()\n {\n //One hour is added to compensate for PHP being one hour faster \n $now = date(\"Y-m-d H:i\", strtotime(Carbon::now()->addHour()));\n logger($now);\n\n $messages = Message::get();\n if($messages !== null){\n //Get all messages that their dispatch date is due\n $messages->where('date_string', $now)->each(function($message) {\n if($message->delivered == 'NO')\n {\n $users = User::all();\n foreach($users as $user) {\n dispatch(new SendMailJob(\n $user->email, \n new NewArrivals($user, $message))\n );\n }\n $message->delivered = 'YES';\n $message->save(); \n }\n });\n }\n }", "public function handle()\n {\n // better way: queue up instead of send\n // One of the benefits: this job fails, it will going to a fail job table as long as we set that up\n // for example, 7 of 2000 failed, we will get the 7 failed ones in the table somewhere and\n // we can retry these ones easily.\n $this->attendeeMessage->withChunkedRecipients(20, function ($recipients) {\n $recipients->each(function ($recipient) {\n Mail::to($recipient)->queue(new AttendeeMessageEmail($this->attendeeMessage));\n });\n });\n }", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "public function run()\n {\n foreach (self::$emails as $chave => $valor) {\n DB::table('emails')->insert([\n 'nome' => $valor[0],\n 'email' => $valor[1],\n 'bolo_id' => $valor[2],\n 'created_at' => NOW(),\n 'updated_at' => NOW(),\n ]);\n }\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "private function notifyAdmin(): void\n {\n if (!$this->cfg->getAdminEmails())\n return;\n\n $ex = new \\Exception;\n $trace = $ex->getTraceAsString();\n\n // format msg\n $msg = \"Trying to send email with subject: \\\"$this->Subject\\\" \"\n . \"triggered a failover.\\r\\n\\r\\n\"\n . \"Server(s) that failed:\\r\\n\";\n foreach ($this->failedServers as $k => $v)\n $msg .= \"- Server $k $v \\r\\n\";\n $msg .= \"\\r\\nTrace:\\r\\n$trace\\r\\n\\r\\n\"\n . \"Successful failover server:\\r\\n$this->Host\\r\\n\\r\\n\"\n . \"--\\r\\n\"\n . 'Sent from ' . __FILE__ . ' using ' . $this->Host;\n\n $this->FromName = $this->cfg->getNotificationFromEmail();\n $this->From = $this->cfg->getNotificationFromEmail();\n $this->clearAllRecipients();\n\n $adminEmails = $this->cfg->getAdminEmails();\n foreach ($adminEmails as $adminEmail)\n $this->addAddress($adminEmail);\n $this->Subject = $this->cfg->getAppName() . ': SMTP server(s) failed';\n\n $this->Body = $msg;\n\n // send using the last set SMTP server\n $this->send();\n }", "public static function bidPlaced(Request $request)\n {\n //For the purpose of our new clients, We also send the clients an email for the bids placed\n //We wil design a new email template for clients\n\n $notification = new Notification;\n $notification->user_id = $request->user_id;\n $notification->order_id = $request->order_id;\n $notification->type = 'admin_order_bidPlaced';\n $notification->message ='New Bid Placed';\n\n $notification->save();\n\n //We send an email to the Client.\n\n $order= Order::findorfail($request->order_id);\n $writer = User::findorfail($request->user_id);\n $client = User::findorfail($order->client_ID);\n\n if ($client->domain == 1) {\n $domain = \"writemyclassessay.com\";\n }elseif ($client->domain == 2) {\n $domain = \"writemyacademicessay.com\";\n }elseif ($client->domain == 3) {\n $domain = \"writemyschoolessay.com\";\n }\n\n Mail::queue('emails.clientBid',['writer'=>$writer, 'order'=>$order, 'domain'=>$domain,'client'=>$client], \n function($m)use ($writer, $order, $domain,$client)\n {\n $m->from('support@'.$domain, \"Academic Paper writing Platform\");\n\n $m->to($client->email, $client->first_name)->subject('Writer '.$writer->name.' is ready to start working on your order '.$order->order_no);\n\n });\n //We send an email to admin on the new bid too.\n $admins = User::where('ni_admin', 1)->get();\n foreach ($admins as $admin) {\n $admin_email = $admin->email;\n $admin_name = $admin->first_name;\n\n // We send each a text and email below\n $txt = 'New bid on '.$order->order_no.' check the bid to confirm the bid message.';\n $send_sms =self::sendSMSnotice($admin,$txt);\n\n Mail::queue('emails.admin_new_bid',['order'=>$order],function ($m) use ($admin_email, $admin_name,$order)\n {\n $m->from('[email protected]','ARA');\n\n $m->to($admin_email, $admin_name)->subject('New Bid on '.$order->order_no);\n });\n }\n\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function test_queue_mail()\n {\n $user = User::factory()->create();\n $brand = new Brand();\n\n Mail::fake();\n Mail::to($user->email)->send(new ConfirmBrandDelete($brand));\n Mail::assertSent(ConfirmBrandDelete::class);\n }", "public function execute() {\n $sql = \"SELECT gcj_id_job\n FROM gems__comm_jobs\n WHERE gcj_active = 1\n ORDER BY gcj_id_order, \n CASE WHEN gcj_id_survey IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_round_description IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_track IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_organization IS NULL THEN 1 ELSE 0 END\";\n\n $jobs = $this->db->fetchAll($sql);\n\n if ($jobs) {\n $batch = $this->getBatch();\n foreach ($jobs as $job) {\n $batch->addTask('Mail\\\\ExecuteMailJobTask', $job['gcj_id_job']);\n }\n } else {\n $this->getBatch()->addMessage($this->_('Nothing to do, please create a mail job first.'));\n }\n }", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function queue($properties)\n {\n if (is_array($properties[0])) {\n foreach ($properties as $email) {\n $this->queue($email);\n }\n }\n\n if (!is_file(__DIR__ . \"/templates/{$properties['folder']}/{$properties['file']}.volt\")) {\n throw new \\Exception(\"That view file does not exist.\");\n }\n\n $content = $this->render($properties['folder'], $properties['file'], $properties['variables']);\n\n $properties['from_email'] .= $this->config->application->domain;\n $properties['html'] = $content->html;\n $properties['text'] = $content->text;\n\n if (empty($properties['from_name'])) {\n $properties['from_name'] = $this->config->application->name;\n }\n\n unset($properties['folder'], $properties['file'], $properties['variables']);\n\n $this->queue->addJob(function ($that) use ($properties) {\n $that->mandrill->messages_send($properties);\n });\n }", "abstract protected function _sendMail ( );", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "public function send_expiry_notification() {\n $expired_posts = $this->get_expired_posts();\n\n $subject = 'Posts that need your attention';\n $recipient = \\get_bloginfo('admin_email');\n $content = $this->_generate_expiry_notification_content( $expired_posts );\n\n // Set post to draft\n // bb_log( $content, 'Sending an email to ' . $recipient );\n // Helper\\Email::send_email( $recipient, $subject, $content );\n }", "public function send() {\r\n \r\n // Update the database...\r\n $update = $this->db->update(\"invoices\",$this->id,[\"status_id\"=>2]);\r\n $_SESSION['message'] = 'Invoice sent.';\r\n return $update;\r\n }", "public function send($userId) { \n // Save the communique.\n $this->save($userId);\n // Send the mail.\n if (!isset($this->bcc) || $this->bcc == '') $this->bcc = $this->from;\n $headers = \"From: \" . $this->from . \"\\r\\n\"\n . \"Reply-To: \" . $this->from . \"\\r\\n\"\n . \"Bcc: \" . $this->bcc . \"\\r\\n\"\n . \"X-Mailer: PHP\" . phpversion() . \"\\r\\n\"\n . \"X-Apparently-To: \" . $this->to;\n if (self::$TESTING) $mailedData = mail('[email protected]', $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n else $mailedData = mail($this->to, $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n // Update the object and database sent and dateSent fields.\n $updateQuery = 'UPDATE communications set sent=1, dateSent=NOW() where communicationId=' . $this->commId;\n SSFDB::getDB()->saveData($updateQuery);\n //SSFDB::debugNextQuery();\n $getDateQuery = 'SELECT dateSent from communications where communicationId=' . $this->commId;\n $dateResult = SSFDB::getDB()->getArrayFromQuery($getDateQuery); \n self::$debugger->belch('send() dateResult', $dateResult, -1);\n $this->dateSent = (count($dateResult) > 0) ? $dateResult[0]['dateSent'] : date(\"Y-m-d H:i:s\");\n/* The fields works.artistInformedOfMediaReceipt and works.artistInformedOfMediaReceiptDate are no longer used.\n // Mark the referenced works in the works table to show that the artist was informed of media receipt.\n// $worksAffected = $this->referencedWorks; $worksWhereClause = \"\"; $disjunctionString = \"\";\n// foreach ($worksAffected as $work) { if (self::mediaReceivedFor($work)) { $worksWhereClause .= $disjunctionString . \"workId = \" . $work['workId']; $disjunctionString = \" or \"; }}\n// $query = \"UPDATE works SET artistInformedOfMediaReceipt=1, artistInformedOfMediaReceiptDate=NOW()\" . \" WHERE \" . $worksWhereClause;\n// SSFDB::getDB()->saveData($query);\n*/\n }", "public function execute()\n {\n\n $undeliveredRecipients = array();\n $recipientsCount = 0;\n\n while (count($this->recipients) >= 1) {\n\n //send the command and read the response\n parent::execute();\n\n $recipient = array_pop($this->recipients);\n\n switch ($this->response->getCode()) {\n\n case '250':\n case '251':\n if (isset($recipient['original_email'])) {\n //we finally delivered mail to a user that provided a \n //forward-address\n $key = array_search($recipient['original_email'],\n $undeliveredRecipients);\n\n if ($key !== FALSE)\n unset($undeliveredRecipients[$key]);\n }\n\n $recipientsCount++;\n break;\n\n case '450':\n case '451':\n //add the recipient to the begginning of the queue to try again\n //later\n if ($recipient['retries'] > 0) {\n $recipient['retries']--;\n array_unshift($this->recipients, $recipient);\n }\n break;\n\n /* Handle too much recipients by splitting the message to chunks\n *\n * RFC 821 [30] incorrectly listed the error where an SMTP server\n * exhausts its implementation limit on the number of RCPT commands\n * (\"too many recipients\") as having reply code 552. The correct \n * reply code for this condition is 452. Clients SHOULD treat a \n * 552 code in this case as a temporary, rather than permanent, \n * failure so the logic below works. \n */\n case '452':\n case '552':\n array_push($this->recipients, $recipient);\n\n $result['undelivered'] = $undeliveredRecipients;\n //this causes the client to append a new mail sending sequence \n //for the rest of recipients\n $result['toDeliver'] = $this->recipients;\n $result['recipientsCount'] = $recipientsCount;\n\n return $result;\n break; //unreachable\n\n case '550':\n case '553':\n $undeliveredRecipients[] = $recipient['email'];\n break;\n\n case '551':\n if (preg_match('/<\\([^>]*\\)>/', $this->response, $matches)) {\n\n $forward = array();\n $forward['email'] = $matches[1];\n $forward['retries'] = 2;\n if (isset($recipient['original_email'])) {\n $forward['original_email'] = \n $recipient['original_email'];\n } else {\n $forward['original_email'] = $recipient['email'];\n $undeliveredRecipients[] = $recipient['email'];\n }\n\n $this->recipients[] = $forward;\n }\n break;\n }\n\n }\n\n return array(\n 'undelivered' => $undeliveredRecipients, \n 'recipientsCount' => $recipientsCount,\n );\n }", "public function actionSend(): void\n {\n $prizes = UserPrize::find()->alias('user_prize')->JoinWith(['prize','user'])\n ->where([\n 'user_prize.status' => UserPrize::STATUS_RECEIVED,\n 'prize_type' => Prize::TYPE_MONEY,\n ])\n ->limit(self::DEFAULT_NUMBER)\n ->all();\n\n if ($prizes) {\n $this->stdout(\\Yii::t('app', 'Sending {prizes} prize(s)...' . PHP_EOL,\n ['prizes' => count($prizes)]), Console::FG_GREEN);\n } else {\n $this->stdout(\\Yii::t('app', 'Nothing to send!' . PHP_EOL), Console::FG_YELLOW);\n }\n\n foreach ($prizes as $prize) {\n\n $prize->status = UserPrize::STATUS_SENT;\n $prize->save(false);\n\n $this->stdout(\\Yii::t('app', 'Sending {money} money to user {user}...', [\n 'money' =>$prize->quantity,\n 'user' => $prize->user->email\n ]));\n\n\n $this->stdout(\\Yii::t('app', ' [SENT]' . PHP_EOL), Console::FG_GREEN);\n }\n }", "public function execute()\n {\n foreach ($this->queue->pull(1000) as $message) {\n $this->process($message)->delete();\n }\n }", "function scheduleEmail() {\n\t\tif(isset($this->data)) {\n\t\t\t$this->Cronemail->save($this->data);\n\t\t\t$this->Session->setFlash('Featured business email has been scheduled successfully.');\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t}", "public function getMessagesAndFlush() {}", "public function processEventQueue()\n {\n if (!$this->googleClient)\n {\n try \n {\n $this->googleClient = $this->createGoogleConnection(); \n } \n catch (\\Exception $e) \n {\n $this->syncProblemNotification($e->getMessage());\n die($e->getMessage());\n }\n \n }\n\n $db = \\JFactory::getDbo();\n\n $query = $db->getQuery(true);\n $query->select('*')->from('#__pbbooking_sync')->where('status is null')->order('id ASC');\n $events = $db->setQuery($query)->loadObjectList();\n\n foreach ($events as $event)\n {\n $success = false;\n switch ($event->action)\n {\n case 'create':\n $success = $this->sendEvent($event);\n break;\n case 'delete':\n $success = $this->deleteEvent($event);\n break;\n }\n\n //update the error flag so that it can be reported on in the admin console.\n $event->status = ($success) ? 'success' : 'error';\n if ($success)\n echo '<br/>Event '.$event->action.' success';\n else\n echo '<br/>Event '.$event->action.' failed';\n \n $db->updateObject('#__pbbooking_sync',$event,'id');\n }\n }", "public function put()\n\t{\n\t\t$this->parse_body();\n\t\tFsb::$db->insert('notify', array(\n\t\t\t'notify_method' =>\t$this->method,\n\t\t\t'notify_time' =>\tCURRENT_TIME,\n\t\t\t'notify_subject' =>\t$this->subject,\n\t\t\t'notify_body' =>\t$this->body,\n\t\t\t'notify_bcc' =>\t\timplode(\"\\n\", $this->bcc),\n\t\t\t'notify_try' =>\t\t0,\n\t\t));\n\t\tFsb::$db->destroy_cache('notify_');\n\t}", "public function actionCromjobsend() {\n \n $setting = Mailsetting::find()->select(['setting_value'])->all();\n \n set_time_limit ( 300 );//default 5 minutes\n\n\n $datas = MailStore::find()->where(['status'=>'Queue'])->limit(1)->all();\n\n\n /*Starting configuration for smtp or other type*/\n \n Yii::$app->email->setMailType($setting[2]['setting_value']);\n\n //Passing arguement for Host setting\n Yii::$app->email->setHost($setting[3]['setting_value']);\n\n //Passing arguement for Username setting\n Yii::$app->email->setUname($setting[4]['setting_value']);\n\n //Passing arguement for Password setting\n Yii::$app->email->setPassd($setting[5]['setting_value']);\n\n //Passing arguement for Encryption Type setting\n Yii::$app->email->setEncType($setting[6]['setting_value']);\n\n \n //Passing arguement for Port setting\n Yii::$app->email->setServerPort($setting[7]['setting_value']);\n\n /*Ending configuration for smtp or other type*/\n Yii::$app->email->configSet();//note that email setting is completed only when execute this function\n \n /*Starting configuration for php mail*/\n \n //Passing arguement to set from\n Yii::$app->email->setFrom($setting[8]['setting_value']);\n\n //Passing arguement to set Reply To\n Yii::$app->email->setReplyTo($setting[9]['setting_value']);\n\n //Passing arguement to set Return Path\n Yii::$app->email->setReturnPath($setting[10]['setting_value']);\n \n $result = 0;\n if(isset($datas[0]['subject'])){\n \n $result = Yii::$app->email->SendMail($datas[0]['from'],$datas[0]['to'],$datas[0]['subject'],$datas[0]['message_body'],$datas[0]['cc'],$datas[0]['bcc'], unserialize($datas[0]['attachments']));\n if ($result){\n $model = MailStore::findOne($datas[0]['mail_id']);\n $model->status = 'Sent';\n\n $model->save();\n }\n //now deleting saved attachment created while email create\n //fetching the attachment in queue\n $datas_in_queue = MailStore::find()->select(['attachments'])->where(['status'=>'Queue'])->andWhere(['attachments'=>$datas[0]['attachments']])->all();\n if(!isset($datas_in_queue[0]['attachments'])){\n Yii::$app->email->DeleteAttach(unserialize($datas[0]['attachments']));\n }\n\n return $result;\n }\n else {\n return $result;\n }\n \n }", "public function handle()\n {\n// $transport = Swift_SmtpTransport::newInstance('mail.shineway-enterprise.com', 587, 'tls')\n// ->setUsername('[email protected]')\n// ->setPassword('abcd1234');\n//\n// $mailer = Swift_Mailer::newInstance($transport);\n//\n// $message = Swift_Message::newInstance()\n// ->setTo('[email protected]')\n// ->setFrom('[email protected]')\n// ->setSubject('Test Raw Email');\n// //->setBody(\"Test Body\");\n//\n// $mime = Swift_MimePart::newInstance(\"body of the original message\\r\\n> Quota Test\");\n// $mime->setEncoder(new Swift_Mime_ContentEncoder_RawContentEncoder);\n// $message->attach($mime);\n// $mailer->send($message);\n\n\n //return;\n\n if (!Storage::exists('email-attachment'))\n Storage::makeDirectory('email-attachment');\n\n $temp_dir = storage_path('app/email-attachment');\n\n $mailbox = new Mailbox(\"{\" . env(\"MAIL_HOST\") .\":143/imap/novalidate-cert}INBOX\", env(\"MAIL_USERNAME\"), env(\"MAIL_PASSWORD\"), $temp_dir);\n $mail_ids = $mailbox->searchMailbox('UNSEEN');\n\n $this->info(\"Unread Message: \" . sizeof($mail_ids));\n\n foreach ($mail_ids as $mail_id)\n {\n try {\n $mail = $mailbox->getMail($mail_id);\n //$mailbox->markMailAsUnread($mail_id);\n\n // Ignore SPAM\n if (starts_with($mail->subject, \"***Spam***\"))\n continue;\n\n preg_match(\"/\\[Order (GLC-\\d*-\\d*)\\]/\", $mail->subject, $re);\n if (sizeof($re) == 2)\n $order = Order::find($re[1]);\n else\n $order = null;\n\n\n if ($order)\n {\n \\App::setLocale($order->{Order::COLUMN_LANGUAGE});\n\n $isFromGuest = stripos($mail->subject, \"Enquire from Guest\") === false;\n\n $content = \\EmailReplyParser\\EmailReplyParser::parseReply($mail->textPlain);\n\n $order_message = new OrderMessage();\n $order_message->{OrderMessage::COLUMN_ORDER_ID} = $order->{Order::COLUMN_ID};\n $order_message->{OrderMessage::COLUMN_CONTACT_VIA} = OrderMessage::CONTACT_VIA_EMAIL;\n $order_message->{OrderMessage::COLUMN_TYPE} = $isFromGuest ? OrderMessage::TYPE_ENQUIRE : OrderMessage::TYPE_REPLY;\n $order_message->{OrderMessage::COLUMN_MESSAGE} = $content;\n $order_message->{OrderMessage::COLUMN_FROM_ADDRESS} = $mail->fromAddress;\n\n if (!$isFromGuest)\n {\n $user = User::where('email', $mail->fromAddress)->first();\n if ($user)\n $order_message->{OrderMessage::COLUMN_REPLY_BY} = $user->id;\n }\n\n $order_message->save();\n\n $order_message = $order_message->fresh();\n\n // Save attachments\n $attachments = [];\n foreach ($mail->getAttachments() as $incoming)\n {\n $attachment = new OrderMessageAttachment();\n $attachment->{OrderMessageAttachment::COLUMN_ORDER_MESSAGE_ID} = $order_message->{OrderMessage::COLUMN_ID};\n $attachment->{OrderMessageAttachment::COLUMN_NAME} = $incoming->name;\n $attachment->save();\n\n // Get the attachment id and then move file to storage\n $attachment = $attachment->fresh();\n\n $attachment_dir = storage_path(OrderMessageAttachment::STORAGE_FOLDER);\n if (!file_exists($attachment_dir))\n mkdir($attachment_dir, 0777, true);\n\n $attachment_filename = $attachment->{OrderMessageAttachment::COLUMN_ID} . '.' . pathinfo($incoming->name, PATHINFO_EXTENSION);\n\n rename($incoming->filePath, $attachment_dir . '/' . $attachment_filename);\n\n // Upload the db record\n $attachment->{OrderMessageAttachment::COLUMN_PATH} = $attachment_filename;\n $attachment->save();\n\n $attachments[] = $attachment;\n\n }\n\n // Send email\n if ($isFromGuest)\n {\n if ($order->notification_users->count() > 0)\n $addresses = $order->notification_users->pluck('email')->unique();\n else {\n $emailset = Emailset::where('type', Emailset::TYPE_DEFAULT_ORDER_NOTIFICATION)->first();\n if ($emailset)\n $addresses = $emailset->MailAddress->pluck('mail_address');\n else\n $addresses = [];\n }\n $view = \"admin.orders.emails.enquire\";\n $subject = \"[Order $order->id] Enquire from Guest\";\n }\n else\n {\n $addresses = $order->products()->pluck(OrderProduct::COLUMN_EMAIL)->unique();\n $view = \"admin.orders.emails.reply\";\n $subject = \"[Order $order->id] \" . trans('email.reply-subject');\n }\n\n foreach ($addresses as $address)\n {\n \\Mail::send($view, compact('order', 'order_message'), function ($m) use ($address, $order, $subject, $attachments) {\n foreach ($attachments as $attachment)\n {\n $m->attach($attachment->getStoragePath(), ['as' => $attachment->{OrderMessageAttachment::COLUMN_NAME}]);\n }\n\n $m->to($address)->subject($subject);\n });\n }\n\n }\n else\n {\n // Unclassified message\n $emailset = Emailset::where('type', Emailset::TYPE_DEFAULT_ORDER_NOTIFICATION)->first();\n if ($emailset)\n $addresses = $emailset->MailAddress->pluck('mail_address');\n else\n $addresses = [];\n\n foreach ($addresses as $address)\n {\n \\Mail::send('admin.orders.emails.forward', ['original' => $mail], function ($message) use ($mail, $address) {\n $message->to($address);\n $message->subject(\"FWD: \" . $mail->subject);\n });\n }\n }\n\n\n }\n catch(\\Exception $e)\n {\n $this->error($e->getMessage());\n }\n\n\n// \\Mail::send('admin.email.auto-reply', ['original' => $mail], function ($message) use ($mail) {\n// $message->to($mail->fromAddress);\n// $message->subject(\"Re: \" . $mail->subject);\n//\n//// $headers = $message->getSwiftMessage()->getHeaders();\n//// $headers->addTextHeader('References', $mail->messageId);\n//// $headers->addTextHeader('In-Reply-To', $mail->messageId);\n//\n//// dd($message->getSwiftMessage());\n////\n//// if ($mail->textHtml)\n//// $message->getSwiftMessage()->addPart($mail->textHtml, 'text/html');\n//// else if ($mail->textPlain)\n//// $message->getSwiftMessage()->addPart($mail->textPlain, 'text/plain');\n// });\n }\n\n }", "public function flush()\n {\n $user_id = $this->getUserId();\n\n $this->userUnreadNotification->markAllAsRead($user_id);\n $this->response->redirect($this->helper->url->to('DashboardController', 'notifications', array('user_id' => $user_id)));\n }", "function edd_pup_clear_queue() {\n\n\tif ( ! wp_verify_nonce( $_REQUEST['nonce'], 'clear-queue-'.$_REQUEST['email'] ) ) {\n\t\techo 'noncefail';\n\t\texit;\n\t}\n\n\tglobal $wpdb;\n\n\t// Clear queue\n\tif ( $_POST['email'] == 'all' ) {\n\n\t\t// Build array of queued emails before clearing table\n\t\t$queueemails = edd_pup_queue_emails();\n\n\t\t// Build array of sent email data before clearing table\n\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t$recipients[$id] = edd_pup_check_queue( $id );\n\t\t}\n\n\t\t// Clear the database table\n\t\t$qr = $wpdb->query( \"TRUNCATE TABLE $wpdb->edd_pup_queue\" );\n\n\t} else {\n\n\t\t$recipients = edd_pup_check_queue( $_POST['email'] );\n\n\t\t// Delete the rows WHERE the specified email_id matches\n\t\t$qr = $wpdb->delete( \"$wpdb->edd_pup_queue\", array( 'email_id' => $_POST['email'] ), array( '%d' ) );\n\n\t}\n\n\t// If clear queue fails, bail out of function with error message, otherwise change post statuses\n\tif ( false === $qr ) {\n\t\twp_die( __( 'Error: could not complete database query.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\n\t} else {\n\n\t\tif ( !empty( $queueemails ) ) {\n\n\t\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t\t$post[] = wp_update_post( array( 'ID' => $id, 'post_status' => 'abandoned' ) );\n\t\t\t\tupdate_post_meta ( $id, '_edd_pup_recipients', $recipients[$id] );\n\t\t\t}\n\n\t\t} else if ( absint( $_POST['email'] ) != 0 ) {\n\n\t\t\t$post = wp_update_post( array( 'ID' => $_POST['email'], 'post_status' => 'abandoned' ) );\n\t\t\tupdate_post_meta ( $post, '_edd_pup_recipients', $recipients );\n\n\t\t} else {\n\n\t\t\twp_die( __( 'Error: Valid email ID not supplied.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\t\t}\n\t}\n\n\tdie();\n}", "private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }", "public function batchSend()\n\t{\n\t\treturn $this->mailer->batchSend($this->message);\n\t}", "function SendMail($email_title,$email_body,$reboot)\n{\n\tif($email_title == \"\" || $email_body == \"\" || $email_title == null || $email_body == null)\n\t{\n\t\tfile_put_contents(\"result.txt\",\"email body or title is null\\n\",FILE_APPEND);\n\t\texit(\"email内容为空或者email标题为空\\n\");\t\t\n\t}\n\n\t//load basic class: SMTPMailer\n\trequire(\"SMTPMailer.php\");\n\n\tif($reboot == \"start\"){//说明第一次启动程序\n\t\tfile_put_contents(\"result.txt\",\"\");\t\t\n\t\t//链接到数据库并获得要发送的邮件地址\n\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t$query = \"SELECT distinct email_addr FROM if_donor_email WHERE priority >= 0 and deleted = 0 ORDER BY id\"; \n\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t//写下本次要发送的邮件地址到emaillist\n\t\tfile_put_contents(\"emaillist.txt\",\"\");\n\t\t$i = 0;\n\t\twhile($email = mysql_fetch_row($result)){\n\t\t\tfile_put_contents(\"emaillist.txt\",$i.\" \".$email[0].\"\\n\",FILE_APPEND);\t\n\t\t\t$i ++;\n\t\t}\n\t\t//计算本次要发送的邮件数目\n\t\t$email_num = mysql_num_rows($result);\n\t\tif($i !== $email_num) die (\"出错:email数目和写入emaillist文件的email数不一致\"); \n\t\t//关闭数据库链接\n\t\tmysql_close($connection);\n\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif($email_num !== count($emaillist)) die (\"出错:email数目和emaillist文件总行数不一致\"); \n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = 0; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录行号id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\n\telse if($reboot == \"restart\"){//说明属于重启\n\t\t$file= \"currpos.txt\";\n\t\t$currpos=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif(count($currpos) === 0) exit(\"在重启模式下,currpos.txt不能为空\\n\");\n\t\t$from = intval($currpos[0])+1; //重启后应该从第几个email开始发送\n\t\tif($from < 1) exit(\"$from 值不对\");\n\t\t\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist =file($file,FILE_IGNORE_NEW_LINES);\n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = $from; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\t\n\t}else{//既不属于第一次启动,也不属于重启,说明有问题\n\t\texit(\"出错:/既不属于第一次启动,也不属于重启,说明有问题\"); \t\n\t}\t\n}" ]
[ "0.75918436", "0.7152977", "0.7109437", "0.7084767", "0.70763344", "0.68010944", "0.668699", "0.66032696", "0.66011274", "0.65626645", "0.64831907", "0.6476948", "0.64262736", "0.6357344", "0.63184124", "0.6288891", "0.6281742", "0.62460405", "0.62283725", "0.61965936", "0.6192158", "0.6190054", "0.609191", "0.6070226", "0.60699326", "0.60622334", "0.6054335", "0.60453314", "0.6019638", "0.6017224", "0.59938747", "0.5987711", "0.5976845", "0.59679383", "0.5964129", "0.59535015", "0.59431446", "0.5937103", "0.5927972", "0.59263605", "0.5898235", "0.5892687", "0.58879906", "0.5883335", "0.5875764", "0.58594227", "0.5848117", "0.5846414", "0.5845801", "0.5845102", "0.5836518", "0.58352214", "0.583258", "0.5828649", "0.5827472", "0.58045465", "0.57894206", "0.5785287", "0.5775642", "0.57610226", "0.57525295", "0.57417595", "0.57369477", "0.572707", "0.57251555", "0.57208544", "0.57190543", "0.57179403", "0.5716883", "0.57137394", "0.57058597", "0.5705723", "0.56915987", "0.56908715", "0.56792086", "0.5676863", "0.56750816", "0.5674857", "0.5673065", "0.564866", "0.564628", "0.5645739", "0.5644441", "0.5636438", "0.5635888", "0.56293", "0.562917", "0.56286395", "0.5628192", "0.56215715", "0.5620434", "0.5610767", "0.56051266", "0.5603823", "0.5602573", "0.56024796", "0.5589604", "0.55868405", "0.55850804", "0.5584511" ]
0.5690062
74
When we load the object, we fill the "network" field with the correct address/netmask values
function post_getFromDB () { // Be sure to remove addresses, otherwise reusing will provide old objects for getAddress, ... unset($this->address); unset($this->netmask); unset($this->gateway); if (isset($this->fields["address"]) && isset($this->fields["netmask"])) { if ($this->fields["version"] == 4) { $this->fields["network"] = sprintf(__('%1$s / %2$s'), $this->fields["address"], $this->fields["netmask"]); } else { // IPv6 $this->fields["network"] = sprintf(__('%1$s / %2$s'), $this->fields["address"], $this->fields["netmask"]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public function testSetNet()\n\t{\n\t\t$net = new PNPetrinet('test');\n\t\t$this->object->setNet($net);\n\t\t$this->assertEquals($net, TestReflection::getValue($this->object, 'net'));\n\t}", "private function _network()\n {\n if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {\n $lines = preg_split(\"/\\n/\", $netstat, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($lines as $line) {\n $ar_buf = preg_split(\"/\\s+/\", $line);\n if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) {\n $dev = new NetDevice();\n $dev->setName($ar_buf[0]);\n $dev->setRxBytes($ar_buf[4]);\n $dev->setTxBytes($ar_buf[6]);\n $dev->setErrors($ar_buf[5] + $ar_buf[7]);\n //$dev->setDrops($ar_buf[8]);\n $this->sys->setNetDevices($dev);\n }\n }\n }\n }", "public function __validate_acl_network() {\n if (isset($this->initial_data['acl_network'])) {\n # Check if this is an IPv4 or IPv6 address\n if (is_ipaddr($this->initial_data[\"acl_network\"])) {\n $this->ip_version = intval(is_ipaddr($this->initial_data[\"acl_network\"]));\n $this->validated_data[\"acl_network\"] = $this->initial_data['acl_network'];\n } else {\n $this->errors[] = APIResponse\\get(2069);\n }\n } else {\n $this->errors[] = APIResponse\\get(2068);\n }\n }", "public function __construct($network)\n {\n }", "public function testHasNet()\n\t{\n\t\t$this->assertFalse($this->object->hasNet());\n\n\t\tTestReflection::setValue($this->object, 'net', new PNPetrinet('test'));\n\n\t\t$this->assertTrue($this->object->hasNet());\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n\n if (array_key_exists(\"OldIpExpiredTime\",$param) and $param[\"OldIpExpiredTime\"] !== null) {\n $this->OldIpExpiredTime = $param[\"OldIpExpiredTime\"];\n }\n\n if (array_key_exists(\"NewUniqVpcId\",$param) and $param[\"NewUniqVpcId\"] !== null) {\n $this->NewUniqVpcId = $param[\"NewUniqVpcId\"];\n }\n\n if (array_key_exists(\"NewUniqSubnetId\",$param) and $param[\"NewUniqSubnetId\"] !== null) {\n $this->NewUniqSubnetId = $param[\"NewUniqSubnetId\"];\n }\n\n if (array_key_exists(\"NetworkAddresses\",$param) and $param[\"NetworkAddresses\"] !== null) {\n $this->NetworkAddresses = [];\n foreach ($param[\"NetworkAddresses\"] as $key => $value){\n $obj = new ModifyNetworkAddress();\n $obj->deserialize($value);\n array_push($this->NetworkAddresses, $obj);\n }\n }\n }", "public function __construct() {\n\t\t$this->addresses = array();\n\t}", "public function save_network_options()\n\t{\n\t\t\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"AddressId\",$param) and $param[\"AddressId\"] !== null) {\n $this->AddressId = $param[\"AddressId\"];\n }\n\n if (array_key_exists(\"AddressName\",$param) and $param[\"AddressName\"] !== null) {\n $this->AddressName = $param[\"AddressName\"];\n }\n\n if (array_key_exists(\"AddressStatus\",$param) and $param[\"AddressStatus\"] !== null) {\n $this->AddressStatus = $param[\"AddressStatus\"];\n }\n\n if (array_key_exists(\"AddressIp\",$param) and $param[\"AddressIp\"] !== null) {\n $this->AddressIp = $param[\"AddressIp\"];\n }\n\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n\n if (array_key_exists(\"CreatedTime\",$param) and $param[\"CreatedTime\"] !== null) {\n $this->CreatedTime = $param[\"CreatedTime\"];\n }\n\n if (array_key_exists(\"NetworkInterfaceId\",$param) and $param[\"NetworkInterfaceId\"] !== null) {\n $this->NetworkInterfaceId = $param[\"NetworkInterfaceId\"];\n }\n\n if (array_key_exists(\"PrivateAddressIp\",$param) and $param[\"PrivateAddressIp\"] !== null) {\n $this->PrivateAddressIp = $param[\"PrivateAddressIp\"];\n }\n\n if (array_key_exists(\"IsArrears\",$param) and $param[\"IsArrears\"] !== null) {\n $this->IsArrears = $param[\"IsArrears\"];\n }\n\n if (array_key_exists(\"IsBlocked\",$param) and $param[\"IsBlocked\"] !== null) {\n $this->IsBlocked = $param[\"IsBlocked\"];\n }\n\n if (array_key_exists(\"IsEipDirectConnection\",$param) and $param[\"IsEipDirectConnection\"] !== null) {\n $this->IsEipDirectConnection = $param[\"IsEipDirectConnection\"];\n }\n\n if (array_key_exists(\"AddressType\",$param) and $param[\"AddressType\"] !== null) {\n $this->AddressType = $param[\"AddressType\"];\n }\n\n if (array_key_exists(\"CascadeRelease\",$param) and $param[\"CascadeRelease\"] !== null) {\n $this->CascadeRelease = $param[\"CascadeRelease\"];\n }\n\n if (array_key_exists(\"EipAlgType\",$param) and $param[\"EipAlgType\"] !== null) {\n $this->EipAlgType = new AlgType();\n $this->EipAlgType->deserialize($param[\"EipAlgType\"]);\n }\n\n if (array_key_exists(\"InternetServiceProvider\",$param) and $param[\"InternetServiceProvider\"] !== null) {\n $this->InternetServiceProvider = $param[\"InternetServiceProvider\"];\n }\n\n if (array_key_exists(\"LocalBgp\",$param) and $param[\"LocalBgp\"] !== null) {\n $this->LocalBgp = $param[\"LocalBgp\"];\n }\n\n if (array_key_exists(\"Bandwidth\",$param) and $param[\"Bandwidth\"] !== null) {\n $this->Bandwidth = $param[\"Bandwidth\"];\n }\n\n if (array_key_exists(\"InternetChargeType\",$param) and $param[\"InternetChargeType\"] !== null) {\n $this->InternetChargeType = $param[\"InternetChargeType\"];\n }\n\n if (array_key_exists(\"TagSet\",$param) and $param[\"TagSet\"] !== null) {\n $this->TagSet = [];\n foreach ($param[\"TagSet\"] as $key => $value){\n $obj = new Tag();\n $obj->deserialize($value);\n array_push($this->TagSet, $obj);\n }\n }\n\n if (array_key_exists(\"DeadlineDate\",$param) and $param[\"DeadlineDate\"] !== null) {\n $this->DeadlineDate = $param[\"DeadlineDate\"];\n }\n\n if (array_key_exists(\"InstanceType\",$param) and $param[\"InstanceType\"] !== null) {\n $this->InstanceType = $param[\"InstanceType\"];\n }\n\n if (array_key_exists(\"AntiDDoSPackageId\",$param) and $param[\"AntiDDoSPackageId\"] !== null) {\n $this->AntiDDoSPackageId = $param[\"AntiDDoSPackageId\"];\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"NatGatewayId\",$param) and $param[\"NatGatewayId\"] !== null) {\n $this->NatGatewayId = $param[\"NatGatewayId\"];\n }\n\n if (array_key_exists(\"NatGatewayName\",$param) and $param[\"NatGatewayName\"] !== null) {\n $this->NatGatewayName = $param[\"NatGatewayName\"];\n }\n\n if (array_key_exists(\"CreatedTime\",$param) and $param[\"CreatedTime\"] !== null) {\n $this->CreatedTime = $param[\"CreatedTime\"];\n }\n\n if (array_key_exists(\"State\",$param) and $param[\"State\"] !== null) {\n $this->State = $param[\"State\"];\n }\n\n if (array_key_exists(\"InternetMaxBandwidthOut\",$param) and $param[\"InternetMaxBandwidthOut\"] !== null) {\n $this->InternetMaxBandwidthOut = $param[\"InternetMaxBandwidthOut\"];\n }\n\n if (array_key_exists(\"MaxConcurrentConnection\",$param) and $param[\"MaxConcurrentConnection\"] !== null) {\n $this->MaxConcurrentConnection = $param[\"MaxConcurrentConnection\"];\n }\n\n if (array_key_exists(\"PublicIpAddressSet\",$param) and $param[\"PublicIpAddressSet\"] !== null) {\n $this->PublicIpAddressSet = [];\n foreach ($param[\"PublicIpAddressSet\"] as $key => $value){\n $obj = new NatGatewayAddress();\n $obj->deserialize($value);\n array_push($this->PublicIpAddressSet, $obj);\n }\n }\n\n if (array_key_exists(\"NetworkState\",$param) and $param[\"NetworkState\"] !== null) {\n $this->NetworkState = $param[\"NetworkState\"];\n }\n\n if (array_key_exists(\"DestinationIpPortTranslationNatRuleSet\",$param) and $param[\"DestinationIpPortTranslationNatRuleSet\"] !== null) {\n $this->DestinationIpPortTranslationNatRuleSet = [];\n foreach ($param[\"DestinationIpPortTranslationNatRuleSet\"] as $key => $value){\n $obj = new DestinationIpPortTranslationNatRule();\n $obj->deserialize($value);\n array_push($this->DestinationIpPortTranslationNatRuleSet, $obj);\n }\n }\n\n if (array_key_exists(\"VpcId\",$param) and $param[\"VpcId\"] !== null) {\n $this->VpcId = $param[\"VpcId\"];\n }\n\n if (array_key_exists(\"Zone\",$param) and $param[\"Zone\"] !== null) {\n $this->Zone = $param[\"Zone\"];\n }\n\n if (array_key_exists(\"DirectConnectGatewayIds\",$param) and $param[\"DirectConnectGatewayIds\"] !== null) {\n $this->DirectConnectGatewayIds = $param[\"DirectConnectGatewayIds\"];\n }\n\n if (array_key_exists(\"SubnetId\",$param) and $param[\"SubnetId\"] !== null) {\n $this->SubnetId = $param[\"SubnetId\"];\n }\n\n if (array_key_exists(\"TagSet\",$param) and $param[\"TagSet\"] !== null) {\n $this->TagSet = [];\n foreach ($param[\"TagSet\"] as $key => $value){\n $obj = new Tag();\n $obj->deserialize($value);\n array_push($this->TagSet, $obj);\n }\n }\n\n if (array_key_exists(\"SecurityGroupSet\",$param) and $param[\"SecurityGroupSet\"] !== null) {\n $this->SecurityGroupSet = $param[\"SecurityGroupSet\"];\n }\n\n if (array_key_exists(\"SourceIpTranslationNatRuleSet\",$param) and $param[\"SourceIpTranslationNatRuleSet\"] !== null) {\n $this->SourceIpTranslationNatRuleSet = [];\n foreach ($param[\"SourceIpTranslationNatRuleSet\"] as $key => $value){\n $obj = new SourceIpTranslationNatRule();\n $obj->deserialize($value);\n array_push($this->SourceIpTranslationNatRuleSet, $obj);\n }\n }\n\n if (array_key_exists(\"IsExclusive\",$param) and $param[\"IsExclusive\"] !== null) {\n $this->IsExclusive = $param[\"IsExclusive\"];\n }\n\n if (array_key_exists(\"ExclusiveGatewayBandwidth\",$param) and $param[\"ExclusiveGatewayBandwidth\"] !== null) {\n $this->ExclusiveGatewayBandwidth = $param[\"ExclusiveGatewayBandwidth\"];\n }\n\n if (array_key_exists(\"RestrictState\",$param) and $param[\"RestrictState\"] !== null) {\n $this->RestrictState = $param[\"RestrictState\"];\n }\n\n if (array_key_exists(\"NatProductVersion\",$param) and $param[\"NatProductVersion\"] !== null) {\n $this->NatProductVersion = $param[\"NatProductVersion\"];\n }\n }", "private function updateNetworks()\n {\n foreach ($this->networks as $net_key => $net_value) {\n $url = $net_value['template'];\n\n foreach ($this->args as $arg_key => $arg_value) {\n $url = str_replace('{' . $arg_key . '}', $arg_value, $url);\n }\n\n $this->networks[$net_key]['url'] = $url;\n }\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "function wponion_network_settings( $instance_id_or_args = array(), $fields = array() ) {\n\t\tif ( is_string( $instance_id_or_args ) && empty( $fields ) ) {\n\t\t\treturn wponion_settings_registry( $instance_id_or_args );\n\t\t}\n\t\treturn new Network( $instance_id_or_args, $fields );\n\t}", "public function getNetworkAddress()\n\t{\n\t\treturn $this->first_ip;\n\t}", "public function __construct($networkAddress = null, $networkMask = null)\n {\n if (!is_null($networkAddress)) {\n $this->setNetworkAddress($networkAddress);\n }\n\n if (!is_null($networkMask)) {\n $this->setNetworkMask($networkMask);\n }\n }", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "function get_netmask($netmask) {\n $_netmask = $netmask;\n if(is_numeric($netmask)) {\n $num_arr_netmask = array();\n $str_arr_netmask = str_split(str_pad(str_pad('', $netmask, '1'), 32, '0'), 8);\n foreach($str_arr_netmask as $s) {\n $num_arr_netmask[] = bindec($s);\n }\n $_netmask = join($num_arr_netmask, '.');\n }\n\n return $_netmask;\n}", "public function getNetwork() {\n return $this->getValue('network');\n }", "private function setIPv6( $addr, $mask )\n\t{\n\t\t$this->net_addr = @inet_pton($addr);\n\t\tif( $this->net_addr == false )\n\t\t{\n\t\t\tthrow new \\Exception( \"invalid ip address {$addr}\" );\n\t\t} \n\t\t$this->valid = true;\n\t\t$this->net_addr_long = $this->inet_ntogmp( $this->net_addr );\n\t\t//$this->inet_gmpton( $this->net_addr_long );\n\t\t\t\n\t\t// set the netmask\n\t\tif( preg_match( '/^[0-9]+$/', $mask ))\n\t\t{\n\t\t\t$this->net_mask_bits = intval( $mask );\n\t\t\tif( $this->ipv4 && $this->net_mask_bits != 0 ){\n\t\t\t\t$this->net_mask_bits += 96;\n\t\t\t}\n\t\t\t$this->net_mask_long = \\gmp_mul( \\gmp_sub( gmp_pow( 2, $this->net_mask_bits ), 1 ), \\gmp_pow( 2, 128-$this->net_mask_bits ));\n\t\t\t//\t\t\techo gmp_strval( $this->net_mask_long, 2 ).\"<br />\\n\";\n\t\t\t$this->net_mask = $this->inet_gmpton($this->net_mask_long);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->net_mask = inet_pton($mask);\n\t\t\t$this->net_mask_long = $this->inet_ntogmp($this->netmask);\n\t\t\t$this->net_mask_bits = \\gmp_scan0( $this->net_mask_long, 0 );\n\t\t}\n\t\t\t\n\t\t// normalize it...\n\t\t$this->net_addr_long = \\gmp_and( $this->net_addr_long, $this->net_mask_long );\n\t\t$this->net_addr = $this->inet_gmpton( $this->net_addr_long );\n\t\t$this->net_broadcast_long = \\gmp_or( $this->net_addr_long, \\gmp_sub( \\gmp_pow( 2, 128-$this->net_mask_bits ), 1 ));\n\t\t$this->net_broadcast = $this->inet_gmpton($this->net_broadcast_long );\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"NetworkType\",$param) and $param[\"NetworkType\"] !== null) {\n $this->NetworkType = $param[\"NetworkType\"];\n }\n }", "function networkAdd($ipvar, $subnet){\n\t\t# $octetbit array is used in computing on how many '1' bits are in a specific octet of the IP address\n\t\t$octetbit = [128, 64, 32, 16, 8, 4, 2, 1];\n\n\t\t#To check which octet is the subnet mask located(in terms of count of 8),\n \t#which will help in computing for the network address of the IP address\n\t\t$octetindex = floor((int)$subnet/8);\n\n\t #To check the bits that overflowed from the biggest 8 count from the previous variable\n\t #i.e. if the subnet is /25, 3 octets from the left are all 1s and in the 4th octet,\n\t #the first bit from the left is set to 1 while the rest are set to 0 \n\t\t$octetrem = (int)$subnet%8;\n\n\t\tif ($octetindex == 4)\n\t\t\treturn (implode(\".\", $ipvar));\n\n\t #modresult is to maintain count for which bits will be set to '1' to get the value\n\t #i.e. if the value is 3, then the 2nd bit from the right will be set to '1' and a value of\n\t #1 will remain, making the 1st bit from the right, be set to '1' as well for a total value of 3\n\t\t$modresult = (int)$ipvar[$octetindex];\n\t\t$netconstant = 0;\n\t\t$i = 0;\n\n\t\tif ($octetrem == 0)\n\t\t\tfor ($i = $octetindex; $i < 4; $i++ )\n\t\t\t\t$ipvar[$i] = \"0\";\n\n\t\telse if ($octetrem > 0){\n\t\t\twhile ($i < $octetrem){\n\t\t\t\tif ($modresult >= $octetbit[$i]){\n\t\t\t\t\t$netconstant += $octetbit[$i];\n\t\t\t\t\t$modresult = $modresult % $octetbit[$i];\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$ipvar[$octetindex] = (string)$netconstant;\n\n\t\t\tfor($j = $octetindex+1; $j < 4; $j++)\n\t\t\t\t$ipvar[$j] = \"0\";\n\t\t}\n\n\t\t$netadd = implode(\".\", $ipvar);\n\n\t\treturn $netadd;\n\n\t}", "public function __validate_mask() {\n if (isset($this->initial_data['mask'])) {\n # Check that our mask is within range (between 0-32) for IPv4 network.\n if ($this->ip_version === 4 and $this->initial_data[\"mask\"] >= 0 and $this->initial_data[\"mask\"] <= 32) {\n $this->validated_data[\"mask\"] = $this->initial_data['mask'];\n }\n elseif ($this->ip_version === 6 and $this->initial_data[\"mask\"] >= 0 and $this->initial_data[\"mask\"] <= 128) {\n $this->validated_data[\"mask\"] = $this->initial_data['mask'];\n }\n else {\n $this->errors[] = APIResponse\\get(2070);\n }\n } else {\n $this->errors[] = APIResponse\\get(2071);\n }\n }", "function getBridgeNetmask() {\n return $this->bridgeNetmask;\n }", "public function __construct( $addr )\n\t{\n\t\t$this->valid = false;\n\t\t// check for netmask\n\t\t$cx = strpos($addr, '/');\n\t\tif( $cx )\n\t\t{\n\t\t\t$mask = trim(substr($addr, $cx+1));\n\t\t\t$addr = trim( substr($addr, 0, $cx));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mask = null;\n\t\t}\n\t\t$this->ipv4 = $this->isIPv4( $addr );\n\t\tif( $this->ipv4 ) \n\t\t{\n\t\t\t$addr = '::'.$addr;\n\t\t\tif( $mask != null )\n\t\t\t{\n\t\t\t\tif( $this->isIPv4( $mask ))\n\t\t\t\t{\n\t\t\t\t\t$mask = '::'.$mask;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $mask == null )\n\t\t{\n\t\t\t$mask = 128; \n\t\t}\n\t\t$this->setIPv6($addr, $mask);\n\t}", "static function computeNetworkRangeFromAdressAndNetmask($address, $netmask, &$firstAddress,\n &$lastAddress = null,\n $excludeBroadcastAndNetwork = false) {\n if ($address instanceof IPAddress) {\n $address = $address->getBinary();\n }\n if ($netmask instanceof IPNetmask) {\n $netmask = $netmask->getBinary();\n }\n $start = [];\n $end = [];\n for ($i = 0; $i < 4; ++$i) {\n $start[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] & $netmask[$i]);\n $end[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] | ~$netmask[$i]);\n }\n\n if ($excludeBroadcastAndNetwork) {\n IPAddress::addValueToAddress($start, 1);\n IPAddress::addValueToAddress($end, -1);\n }\n\n if ($firstAddress instanceof IPAddress) {\n $firstAddress->setAddressFromBinary($start);\n } else {\n $firstAddress = $start;\n }\n\n if ($lastAddress instanceof IPAddress) {\n $lastAddress->setAddressFromBinary($end);\n } else {\n $lastAddress = $end;\n }\n }", "public function testGetNet()\n\t{\n\t\t$this->assertNull($this->object->getNet());\n\n\t\tTestReflection::setValue($this->object, 'net', true);\n\n\t\t$this->assertTrue($this->object->getNet());\n\t}", "function network_admin_load()\n {\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork( $full = false )\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( !$full ) \n\t\t{\n\t\t\treturn inet_ntop( $this->net_addr );\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $this->inet_gmptofull( $this->net_addr_long );\n\t\t}\n\t}", "function populate_network_meta($network_id, array $meta = array())\n {\n }", "protected function _initBillingAddress($shouldIgnoreBillingValidation = null)\n {\n /**\n *\n * @note Check if it is necessary to validate billing address information\n *\n */\n if (!$shouldIgnoreBillingValidation) {\n /**\n *\n * @note Import customer default billing address\n *\n */\n $this->getQuote()->getBillingAddress()->importCustomerAddressData(\n $this->getCustomerSession()->getCustomer()->getDefaultBillingAddress()->getDataModel()\n );\n }\n else {\n /**\n *\n * @note Skip billing address validation\n *\n */\n $this->getQuote()->getBillingAddress()->setData('should_ignore_validation', true);\n\n /**\n *\n * @note Add customer generic data to billing address\n * @note For some reason, if this generic customer data is not set to the quote billing address, the order billing information breaks when someone tries to watch it on frontend/backend\n *\n */\n $customerSession = $this->getCustomerSession();\n $customer = $customerSession->getCustomerDataObject();\n if ($customer->getId()) {\n $this->getQuote()->getBillingAddress()->setCustomerId($customer->getId());\n $this->getQuote()->getBillingAddress()->setEmail($customer->getEmail());\n $this->getQuote()->getBillingAddress()->setFirstname($customer->getFirstname());\n $this->getQuote()->getBillingAddress()->setLastname($customer->getLastname());\n }\n }\n }", "static function recreateTree() {\n global $DB;\n\n // Reset the tree\n $DB->update(\n 'glpi_ipnetworks', [\n 'ipnetworks_id' => 0,\n 'level' => 1,\n 'completename' => new \\QueryExpression($DB->quoteName('name'))\n ], [true]\n );\n\n // Foreach IPNetwork ...\n $iterator = $DB->request([\n 'SELECT' => 'id',\n 'FROM' => self::getTable()\n ]);\n\n $network = new self();\n\n while ($network_entry = $iterator->next()) {\n if ($network->getFromDB($network_entry['id'])) {\n $input = $network->fields;\n // ... update it by its own entries\n $network->update($input);\n }\n }\n }", "function get_network()\n{\n return new \\Podlove\\Modules\\Networks\\Template\\Network();\n}", "protected function update_network_to_1_3_0() {\n\n\t\t$this->update_points_type_settings_to_1_3_0();\n\t}", "public function getNetworkAddress()\n {\n return $this->_networkAddress;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"AddressInfoSet\",$param) and $param[\"AddressInfoSet\"] !== null) {\n $this->AddressInfoSet = [];\n foreach ($param[\"AddressInfoSet\"] as $key => $value){\n $obj = new AddressInfo();\n $obj->deserialize($value);\n array_push($this->AddressInfoSet, $obj);\n }\n }\n\n if (array_key_exists(\"NetworkInterfaceId\",$param) and $param[\"NetworkInterfaceId\"] !== null) {\n $this->NetworkInterfaceId = $param[\"NetworkInterfaceId\"];\n }\n\n if (array_key_exists(\"NetworkInterfaceName\",$param) and $param[\"NetworkInterfaceName\"] !== null) {\n $this->NetworkInterfaceName = $param[\"NetworkInterfaceName\"];\n }\n\n if (array_key_exists(\"Primary\",$param) and $param[\"Primary\"] !== null) {\n $this->Primary = $param[\"Primary\"];\n }\n }", "public function getNetwork() {\n return $this->_network;\n }", "public function get_networks()\n {\n }", "public function getNetworkMask()\n {\n return $this->_networkMask;\n }", "public function getAddress() {}", "public function Persona (){ \n\n $this->ip=$this->getIP();\n }", "public function getAddress();", "public function getAddress();", "private function resolveAddressData()\n {\n /** @var \\Magento\\Quote\\Model\\Quote $quote */\n $quote = $this->checkoutSession->getQuote();\n /** @var \\Magento\\Quote\\Model\\Quote\\Address $shippingAddress */\n $shippingAddress = $quote->getShippingAddress();\n\n $customerData = $this->geoIp->getCurrentLocation();\n if ($customerData->getCode() && $this->helper->isCountryAllowed($customerData->getCode())) {\n /** @var \\Magento\\Directory\\Model\\Country $currentCountry */\n $currentCountry = $shippingAddress\n ->getCountryModel()\n ->loadByCode($customerData->getCode());\n\n if (!$currentCountry) {\n return;\n }\n\n $shippingAddress->setCountryId($currentCountry->getId());\n $shippingAddress->setRegion($customerData->getRegion());\n $shippingAddress->setRegionCode($customerData->getRegionCode());\n $shippingAddress->setCity($customerData->getCity());\n $shippingAddress->setPostcode($customerData->getPosttalCode());\n\n $regionModel = $this->regionFactory->create();\n if ($customerData->getRegionCode() && $currentCountry->getId()) {\n $regionModel->loadByCode($customerData->getRegionCode(), $currentCountry->getId());\n $regionId = $regionModel->getRegionId();\n $shippingAddress->setRegionId($regionId);\n }\n }\n }", "public function load_field( $field ) {\n\n//\t\tvar_dump($field);\n//\t\tdie;\n\t\t// detect old fields\n\t\tif ( array_key_exists( 'address_components', $field ) ) {\n\n\t\t\t$field['address_layout'] = $this->transform_layout( $field['address_layout'] );\n\t\t\t$field['address_options'] = $this->transform_options( $field['address_components'] );\n\t\t\tunset( $field['address_components'] );\n\t\t}\n\n if ( is_array( $field['address_layout'] ) ) {\n $field['address_layout'] = $this->jsonEncode( $field['address_layout'] );\n }\n if ( is_object( $field['address_options'] ) ) {\n $field['address_options'] = $this->jsonEncode( $field['address_options'] );\n }\n\n\t\treturn $field;\n\n\t}", "function save()\n {\n $baseobject = $this->getBaseObject();\n $this->dn = \"cn=$baseobject->cn,\".get_ou('phoneRDN').$baseobject->base;\n $baseobject->dn = $this->dn;\n\n foreach ($this->by_object as $key => $obj) {\n $this->by_object[$key]->dn = $this->dn;\n }\n\n parent::save();\n }", "public function setAddress($val)\n {\n $this->_propDict[\"address\"] = $val;\n return $this;\n }", "public static function registerNetwork($config)\n {\n if (!$config instanceof tx_t3socials_models_NetworkConfig) {\n $config = (string) $config;\n if (!tx_rnbase::load($config)) {\n throw new Exception('Could not load network configuration: '.$config);\n }\n $config = tx_rnbase::makeInstance($config, $config);\n if (!$config instanceof tx_t3socials_models_NetworkConfig) {\n throw new Exception('The network configuration \"'.get_class($config).'\" has to implement the interface \"tx_t3socials_models_NetworkConfig\".');\n }\n }\n\n $id = $config->getProviderId();\n self::$networks[$id] = $config;\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n $request = DRequest::load();\n $this->setFieldValue(self::FIELD_IP_ADDRESS, $request->getIpAddress());\n $this->setFieldValue(self::FIELD_URL, self::getRequestUrl());\n }", "public static function add_network_settings() {\n\t\tadd_settings_section(\n\t\t\t'cjur-network-settings-section',\n\t\t\t__( 'CSS JS URL Rewriter', 'css-js-url-rewriter' ),\n\t\t\t'__return_false',\n\t\t\t'cjur-network-settings-page'\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'css_js_url_rewriter_cdn_url',\n\t\t\t__( 'CDN URL', 'css-js-url-rewriter' ),\n\t\t\t[ __CLASS__, 'render_field' ],\n\t\t\t'cjur-network-settings-page',\n\t\t\t'cjur-network-settings-section'\n\t\t);\n\t}", "public function setRawAddressAttribute($value)\n {\n $this->attributes['raw_address'] = $value;\n\n if($data = Geo::geocodeAddress($value))\n foreach($data as $key => $val)\n $this->attributes[$key] = $val;\n }", "private function check_missing_net_params($p_typeID, $p_address, $p_netmask, &$p_cidr_suffix, &$p_from, &$p_to)\n {\n if ($p_typeID == C__CATS_NET_TYPE__IPV4)\n {\n if (empty($p_cidr_suffix) && $p_netmask != '')\n {\n $p_cidr_suffix = Ip::calc_cidr_suffix($p_netmask);\n } // if\n\n if (empty($p_from) || empty($p_to))\n {\n $l_range = Ip::calc_ip_range($p_address, $p_netmask);\n $p_from = $l_range['from'];\n $p_to = $l_range['to'];\n } // if\n }\n elseif ($p_typeID == C__CATS_NET_TYPE__IPV6)\n {\n if (empty($p_cidr_suffix) && $p_netmask != '')\n {\n $p_cidr_suffix = Ip::calc_cidr_suffix_ipv6($p_netmask);\n } // if\n\n if (empty($p_from) || empty($p_to))\n {\n $l_range = Ip::calc_ip_range_ipv6($p_address, $p_cidr_suffix);\n $p_from = $l_range['from'];\n $p_to = $l_range['to'];\n } // if\n } // if\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"SubnetId\",$param) and $param[\"SubnetId\"] !== null) {\n $this->SubnetId = $param[\"SubnetId\"];\n }\n\n if (array_key_exists(\"SubnetName\",$param) and $param[\"SubnetName\"] !== null) {\n $this->SubnetName = $param[\"SubnetName\"];\n }\n\n if (array_key_exists(\"EnableBroadcast\",$param) and $param[\"EnableBroadcast\"] !== null) {\n $this->EnableBroadcast = $param[\"EnableBroadcast\"];\n }\n }", "public function getNetworkInfo(): \\stdClass\n {\n return $this->get('net_info');\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"BlockNetworkCount\",$param) and $param[\"BlockNetworkCount\"] !== null) {\n $this->BlockNetworkCount = $param[\"BlockNetworkCount\"];\n }\n\n if (array_key_exists(\"BlockNetworkName\",$param) and $param[\"BlockNetworkName\"] !== null) {\n $this->BlockNetworkName = $param[\"BlockNetworkName\"];\n }\n\n if (array_key_exists(\"BlockHeight\",$param) and $param[\"BlockHeight\"] !== null) {\n $this->BlockHeight = $param[\"BlockHeight\"];\n }\n\n if (array_key_exists(\"BlockNetworkType\",$param) and $param[\"BlockNetworkType\"] !== null) {\n $this->BlockNetworkType = $param[\"BlockNetworkType\"];\n }\n\n if (array_key_exists(\"DidCount\",$param) and $param[\"DidCount\"] !== null) {\n $this->DidCount = $param[\"DidCount\"];\n }\n\n if (array_key_exists(\"CptCount\",$param) and $param[\"CptCount\"] !== null) {\n $this->CptCount = $param[\"CptCount\"];\n }\n\n if (array_key_exists(\"CertificatedAuthCount\",$param) and $param[\"CertificatedAuthCount\"] !== null) {\n $this->CertificatedAuthCount = $param[\"CertificatedAuthCount\"];\n }\n\n if (array_key_exists(\"IssueCptCount\",$param) and $param[\"IssueCptCount\"] !== null) {\n $this->IssueCptCount = $param[\"IssueCptCount\"];\n }\n\n if (array_key_exists(\"NewDidCount\",$param) and $param[\"NewDidCount\"] !== null) {\n $this->NewDidCount = $param[\"NewDidCount\"];\n }\n\n if (array_key_exists(\"BcosCount\",$param) and $param[\"BcosCount\"] !== null) {\n $this->BcosCount = $param[\"BcosCount\"];\n }\n\n if (array_key_exists(\"FabricCount\",$param) and $param[\"FabricCount\"] !== null) {\n $this->FabricCount = $param[\"FabricCount\"];\n }\n\n if (array_key_exists(\"ChainMakerCount\",$param) and $param[\"ChainMakerCount\"] !== null) {\n $this->ChainMakerCount = $param[\"ChainMakerCount\"];\n }\n\n if (array_key_exists(\"RequestId\",$param) and $param[\"RequestId\"] !== null) {\n $this->RequestId = $param[\"RequestId\"];\n }\n }", "public function setNetworkType($network) {\n if ($network != self::NETWORK_TYPE_1xRTT && $network != self::NETWORK_TYPE_CDMA &&\n $network != self::NETWORK_TYPE_EDGE && $network != self::NETWORK_TYPE_EHRPD &&\n $network != self::NETWORK_TYPE_EVDO_0 && $network != self::NETWORK_TYPE_EVDO_A &&\n $network != self::NETWORK_TYPE_EVDO_B && $network != self::NETWORK_TYPE_GPRS &&\n $network != self::NETWORK_TYPE_HSDPA && $network != self::NETWORK_TYPE_HSPA &&\n $network != self::NETWORK_TYPE_HSPAP && $network != self::NETWORK_TYPE_HSUPA &&\n $network != self::NETWORK_TYPE_IDEN && $network != self::NETWORK_TYPE_LTE &&\n $network != self::NETWORK_TYPE_UMTS && $network != self::NETWORK_TYPE_UNKNOWN) {\n throw new InvalidArgumentException(\"\\\"network\\\" is no valid character\");\n }\n $this->network = $network;\n }", "public function convertAddress(array $data, $type = 'billing')\n {\n $address = Mage::getModel('customer/address');\n $address->setId(null);\n $address->setIsDefaultBilling(true);\n $address->setIsDefaultShipping(false);\n if ($type == 'shipping') {\n $address->setIsDefaultBilling(false);\n $address->setIsDefaultShipping(true);\n }\n Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data,\n $address);\n if ($type == 'shipping') {\n $type = 'delivery';\n }\n $address_1 = $data[$type . '_address'];\n $address_2 = $data[$type . '_address_2'];\n // Fix address 1\n if (empty($address_1) && !empty($address_2)) {\n $address_1 = $address_2;\n $address_2 = null;\n }\n // Fix address 2\n if (!empty($address_2)) {\n $address_1 = $address_1 . \"\\n\" . $address_2;\n }\n $address_3 = $data[$type . '_address_complement'];\n if (!empty($address_3)) {\n $address_1 = $address_1 . \"\\n\" . $address_3;\n }\n // adding relay to address\n if (isset($data['tracking_relay'])) {\n $address_1 .= ' - Relay : ' . $data['tracking_relay'];\n }\n $address->setStreet($address_1);\n $tel_1 = $data[$type . '_phone_office'];\n $tel_2 = $data[$type . '_phone_mobile'];\n // Fix tel\n $tel_1 = empty($tel_1) ? $tel_2 : $tel_1;\n\n if (!empty($tel_1)) {\n $this->setTelephone($tel_1);\n }\n if (!empty($tel_1)) {\n $address->setFax($tel_1);\n } else {\n if (!empty($tel_2)) {\n $address->setFax($tel_2);\n }\n }\n $codeRegion = (integer)substr(str_pad($address->getPostcode(), 5, '0', STR_PAD_LEFT), 0, 2);\n $id_region = Mage::getModel('directory/region')->getCollection()\n ->addRegionCodeFilter($codeRegion)\n ->addCountryFilter($address->getCountry())\n ->getFirstItem()\n ->getId();\n $address->setRegionId($id_region);\n $address->setCustomer($this);\n return $address;\n }", "public function boot($graph): NetworkInterface;", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ForwardMode\",$param) and $param[\"ForwardMode\"] !== null) {\n $this->ForwardMode = $param[\"ForwardMode\"];\n }\n\n if (array_key_exists(\"VpcId\",$param) and $param[\"VpcId\"] !== null) {\n $this->VpcId = $param[\"VpcId\"];\n }\n\n if (array_key_exists(\"NatName\",$param) and $param[\"NatName\"] !== null) {\n $this->NatName = $param[\"NatName\"];\n }\n\n if (array_key_exists(\"MaxConcurrent\",$param) and $param[\"MaxConcurrent\"] !== null) {\n $this->MaxConcurrent = $param[\"MaxConcurrent\"];\n }\n\n if (array_key_exists(\"SubnetIds\",$param) and $param[\"SubnetIds\"] !== null) {\n $this->SubnetIds = $param[\"SubnetIds\"];\n }\n\n if (array_key_exists(\"IpInfoSet\",$param) and $param[\"IpInfoSet\"] !== null) {\n $this->IpInfoSet = [];\n foreach ($param[\"IpInfoSet\"] as $key => $value){\n $obj = new IpInfo();\n $obj->deserialize($value);\n array_push($this->IpInfoSet, $obj);\n }\n }\n\n if (array_key_exists(\"AssignedEips\",$param) and $param[\"AssignedEips\"] !== null) {\n $this->AssignedEips = $param[\"AssignedEips\"];\n }\n\n if (array_key_exists(\"AutoAllocEipNum\",$param) and $param[\"AutoAllocEipNum\"] !== null) {\n $this->AutoAllocEipNum = $param[\"AutoAllocEipNum\"];\n }\n\n if (array_key_exists(\"Exclusive\",$param) and $param[\"Exclusive\"] !== null) {\n $this->Exclusive = $param[\"Exclusive\"];\n }\n }", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "private function _isNetworkSpecified()\n {\n return ($this->getNetworkAddress() && $this->getNetworkMask());\n }", "function upgrade_network()\n {\n }", "protected function _initShippingAddress()\n {\n /**\n *\n * @note Import customer default shipping address\n *\n */\n $this->getQuote()->getShippingAddress()->importCustomerAddressData(\n $this->getCustomerSession()->getCustomer()->getDefaultShippingAddress()->getDataModel()\n );\n }", "public function address(): MorphOne\n {\n return $this->morphOne(Address::getProxiedClass(), 'addressable')->withDefault();\n }", "public function set_address($new) {\n\t\t$this->CI->api->dns->modify->zone_address($this->zone, $this->address, 'address', $new);\n\t\t$this->hostname = $new;\n\t}", "function load($p_id='') {\n global $DB;\n\n parent::load($p_id);\n $this->ifaddrs = $this->getIfaddrsDB();\n $this->ports = $this->getPortsDB();\n\n $query = \"SELECT `ID`\n FROM `glpi_plugin_fusioninventory_networking`\n WHERE `FK_networking` = '\".$this->getValue('ID').\"';\";\n if ($result = $DB->query($query)) {\n if ($DB->numrows($result) != 0) {\n $fusioninventory = $DB->fetch_assoc($result);\n $this->oFusionInventory_networking->load($fusioninventory['ID']);\n $this->ptcdLinkedObjects[]=$this->oFusionInventory_networking;\n }\n }\n }", "public function configure() {\r\n\t\t$this->logger->info ( 'Setting up WAN interface: ' . ( string ) $this->data->if );\r\n\t\t$this->stop ();\r\n\t\t\r\n\t\t//\t\tSet MTU\n\t\tif (( string ) $this->data->mtu != '') {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . ( string ) $this->data->if . \" mtu \" . ( string ) $this->data->mtu );\r\n\t\t}\r\n\t\t\r\n\t\t//\t\tSpoof mac address\n\t\tif (Functions::isMacAddress ( ( string ) $this->data->mac )) {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . escapeshellarg ( $this->data->if ) . \" link \" . escapeshellarg ( $this->data->mac ) );\r\n\t\t} else {\r\n\t\t\t$mac = $this->getMacAddress ();\r\n\t\t\tif ($mac == \"ff:ff:ff:ff:ff:ff\") {\r\n\t\t\t\t/* this is not a valid mac address. */\r\n\t\t\t\t$this->logger->info ( \"Generating new MAC address for WAN interface.\" );\r\n\t\t\t\t$random_mac = $this->generateMacAddress ();\r\n\t\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . escapeshellarg ( $this->data->if ) . \" link \" . escapeshellarg ( $random_mac ) );\r\n\t\t\t\t$this->data->mac = $random_mac;\r\n\t\t\t\t\r\n\t\t\t\t$this->config->saveConfig ();\r\n\t\t\t\t$this->logger->info ( \"The invalid MAC(ff:ff:ff:ff:ff:ff) on interface \" . ( string ) $this->data->if . \" has been replaced with \" . $random_mac );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//\t\tSet IP address\n\t\tif (( string ) $this->data->ipaddr == 'dhcp') {\r\n\t\t\t$this->configureDHCP ();\r\n\t\t} elseif (Functions::is_ipAddr ( ( string ) $this->data->ipaddr )) {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . ( string ) $this->data->if . \" \" . ( string ) $this->data->ipaddr . \"/\" . Functions::mask2prefix(( string ) $this->data->subnet) );\r\n\t\t\t//\t\tDefault gateway\n\t\t\tif ($this->data->gateway != '') {\r\n\t\t\t\tif (Functions::is_ipAddr ( ( string ) $this->data->gateway )) {\r\n\t\t\t\t\t$return = Functions::shellCommand ( \"/sbin/route add default \" . escapeshellarg ( $this->data->gateway ) );\r\n\t\t\t\t\tif ($return != \"\") {\r\n\t\t\t\t\t\t$this->logger->error ( 'Could not add default gateway, route returned the following message: {' . $return . '}' );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->logger->info ( 'Could not add default gateway from WAN (' . ( string ) $this->data->ipaddr . ') invalid address' );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function getModelsDhcpValueForSubnet(){\n\t\treturn $this->hasMany(DhcpValue::className(), ['subnet' => 'id'])->select('option, value, weight')->asArray()->all();\n\t}", "public function setIpAddress($val)\n {\n $this->_propDict[\"ipAddress\"] = $val;\n return $this;\n }", "public static function fromByteString(string $bytes, $netmaskLengthOrNetmask = null): NetAddress\n {\n if (strlen($bytes) > 4 && !self::ipv6Support()) {\n throw new NotImplementedException('PHP must be compiled with IPv6 support');\n }\n\n $addrStr = @inet_ntop($bytes);\n if ($addrStr === false) {\n throw new \\InvalidArgumentException('$bytes');\n }\n\n return new NetAddress($addrStr, $netmaskLengthOrNetmask);\n }", "private function setup_site_network() {\n\n\t\t$this->level = 2;\n\n\t\ttry {\n\t\t\tif ( $this->docker::create_network( $this->site_name ) ) {\n\t\t\t\tEE::success( 'Network started.' );\n\t\t\t} else {\n\t\t\t\tthrow new Exception( 'There was some error in starting the network.' );\n\t\t\t}\n\t\t\t$this->level = 3;\n\n\t\t\t$this->docker::connect_site_network_to( $this->site_name, $this->proxy_type );\n\t\t}\n\t\tcatch ( Exception $e ) {\n\t\t\t$this->catch_clean( $e );\n\t\t}\n\t}", "function broadcast(){\n return (long2ip(ip2long($this->network())\n | (~(ip2long($this->netmask())))));\n }", "public function boot()\n {\n Gateway::$registerAddress = config('socket.register_address', '127.0.0.1:1236');\n }", "public function setNetblock($val)\n {\n $this->_propDict[\"netblock\"] = $val;\n return $this;\n }", "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"AddressId\",$param) and $param[\"AddressId\"] !== null) {\n $this->AddressId = $param[\"AddressId\"];\n }\n\n if (array_key_exists(\"InternetChargeType\",$param) and $param[\"InternetChargeType\"] !== null) {\n $this->InternetChargeType = $param[\"InternetChargeType\"];\n }\n\n if (array_key_exists(\"InternetMaxBandwidthOut\",$param) and $param[\"InternetMaxBandwidthOut\"] !== null) {\n $this->InternetMaxBandwidthOut = $param[\"InternetMaxBandwidthOut\"];\n }\n\n if (array_key_exists(\"AddressChargePrepaid\",$param) and $param[\"AddressChargePrepaid\"] !== null) {\n $this->AddressChargePrepaid = new AddressChargePrepaid();\n $this->AddressChargePrepaid->deserialize($param[\"AddressChargePrepaid\"]);\n }\n }", "function wp_get_network($network)\n {\n }", "public static function fromString(string $addr, $netmaskLengthOrNetmask = null): NetAddress\n {\n if (strpos($addr, '/') !== false) {\n if ($netmaskLengthOrNetmask !== null) {\n trigger_error('Ignoring the netmask-related argument - a CIDR notation detected', E_USER_WARNING);\n }\n return self::fromCidrString($addr);\n }\n\n if (filter_var($addr, FILTER_VALIDATE_IP) === false) {\n throw new \\InvalidArgumentException('Invalid IP address');\n }\n\n return new NetAddress($addr, $netmaskLengthOrNetmask);\n }", "public function addNetworks(\\obiba\\mica\\NetworkDto $value) {\n return $this->_add(4, $value);\n }", "public function create($p_objID, $p_newRecStatus, $p_title, $p_typeID, $p_address, $p_netmask, $p_gateway, $p_dhcp, $p_from, $p_to, $p_dnsID, $p_domainID, $p_description, $p_cidr_suffix, $p_dns_server_selected = null, $p_dns_domain_selected = null, $p_reverse_dns = 0, $p_layer_2_assignment = null)\n {\n $this->check_missing_net_params($p_typeID, $p_address, $p_netmask, $p_cidr_suffix, $p_from, $p_to);\n\n $l_ip_from_long = Ip::ip2long($p_from);\n $l_ip_to_long = Ip::ip2long($p_to);\n\n if ($l_ip_from_long > $l_ip_to_long)\n {\n $l_temp = $l_ip_from_long;\n $l_ip_from_long = $l_ip_to_long;\n $l_ip_to_long = $l_temp;\n\n $l_temp = $p_from;\n $p_from = $p_to;\n $p_to = $l_temp;\n } // if\n\n $l_strSql = \"INSERT IGNORE INTO isys_cats_net_list SET \" . \"isys_cats_net_list__description = \" . $this->convert_sql_text(\n $p_description\n ) . \", \" . \"isys_cats_net_list__title = \" . $this->convert_sql_text($p_title) . \", \" . \"isys_cats_net_list__address = \" . $this->convert_sql_text(\n $p_address\n ) . \", \" . \"isys_cats_net_list__mask = \" . $this->convert_sql_text($p_netmask) . \", \" . \"isys_cats_net_list__address_range_from = \" . $this->convert_sql_text(\n $p_from\n ) . \", \" . \"isys_cats_net_list__address_range_to = \" . $this->convert_sql_text($p_to) . \", \" . \"isys_cats_net_list__isys_net_type__id = \" . $this->convert_sql_id(\n $p_typeID\n ) . \", \" . \"isys_cats_net_list__isys_net_dns_server__id = \" . $this->convert_sql_id(\n $p_dnsID\n ) . \", \" . \"isys_cats_net_list__isys_net_dns_domain__id = \" . $this->convert_sql_id($p_domainID) . \", \" . \"isys_cats_net_list__status = \" . $this->convert_sql_id(\n $p_newRecStatus\n ) . \", \" . \"isys_cats_net_list__isys_obj__id = '\" . $p_objID . \"', \" . \"isys_cats_net_list__cidr_suffix = \" . $this->convert_sql_int(\n $p_cidr_suffix\n ) . \", \" . \"isys_cats_net_list__isys_catg_ip_list__id = \" . $this->convert_sql_id($p_gateway) . \", \" . \"isys_cats_net_list__address_long = '\" . Ip::ip2long(\n $p_address\n ) . \"', \" . \"isys_cats_net_list__mask_long = '\" . Ip::ip2long(\n $p_netmask\n ) . \"', \" . \"isys_cats_net_list__address_range_from_long = '\" . $l_ip_from_long . \"', \" . \"isys_cats_net_list__address_range_to_long = '\" . $l_ip_to_long . \"', \" . \"isys_cats_net_list__reverse_dns = \" . $this->convert_sql_text(\n $p_reverse_dns\n ) . \";\";\n\n if ($this->update($l_strSql) && $this->apply_update())\n {\n $l_last_id = $this->get_last_insert_id();\n\n if (!empty($p_dns_server_selected))\n {\n if (is_string($p_dns_server_selected) || is_array($p_dns_server_selected))\n {\n\n if (!is_array($p_dns_server_selected))\n {\n $l_dns_server_arr = explode(\",\", $p_dns_server_selected);\n }\n else\n {\n $l_dns_server_arr = $p_dns_server_selected;\n }\n\n if (count($l_dns_server_arr) > 0)\n {\n foreach ($l_dns_server_arr AS $l_dns_server_id)\n {\n $this->attach_dns_server($l_last_id, $l_dns_server_id);\n }\n }\n }\n }\n\n if (!empty($p_dns_domain_selected))\n {\n if (is_string($p_dns_domain_selected) || is_array($p_dns_domain_selected))\n {\n\n if (!is_array($p_dns_domain_selected)) $l_dns_domain_arr = explode(\",\", $p_dns_domain_selected);\n else $l_dns_domain_arr = $p_dns_domain_selected;\n\n if (count($l_dns_domain_arr) > 0)\n {\n foreach ($l_dns_domain_arr AS $l_dns_domain_id)\n {\n $this->attach_dns_domain($l_last_id, $l_dns_domain_id);\n }\n }\n }\n }\n\n $l_layer2_ids = $this->get_layer_2_id_by_obj_id($p_layer_2_assignment);\n\n if (is_array($l_layer2_ids) && count($l_layer2_ids) > 0)\n {\n $this->add_layer2_assignment($l_layer2_ids, $p_objID);\n } // if\n\n return $l_last_id;\n }\n else\n return false;\n }", "protected function setUp () : void {\n $this->range = IPRange::from(\"216.66.0.0/18\");\n }", "private function buildAddressFields()\n {\n /**\n * Check if WooCommerce is active\n */\n if (!Local::hasWooCommerce()) {\n return;\n }\n //====================================================================//\n // Customer Full Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company_safe\")\n ->name(\"Customer Fullname\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Company\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company\")\n ->name(__(\"Company\"))\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 1\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_1\")\n ->name(__(\"Address line 1\"))\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 2\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_2\")\n ->name(__(\"Address line 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postOfficeBoxNumber\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address Full\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_full\")\n ->name(__(\"Address line 1 & 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"alternateName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"postcode\")\n ->name(__(\"Postcode / ZIP\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(__(\"City\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country\")\n ->name(__(\"Country\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"state\")\n ->name(__(\"State / County\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Phone Pro\n $this->fieldsFactory()->create(SPL_T_PHONE)\n ->identifier(\"phone\")\n ->name(__(\"Phone\"))\n ->microData(\"http://schema.org/Person\", \"telephone\")\n ->isIndexed()\n ->isReadOnly()\n ;\n }", "public function testFromString(): void\n {\n $this->expectNotToPerformAssertions();\n\n InternetAddress::fromString('1.1.1.1:1');\n }", "public function __construct()\n {\n parent::__construct();\n $this->_dataSourceModel = Danslo_ApiImport_Model_Import::getDataSourceModel();\n $this->_addressEntity = Mage::getModel('api_import/import_entity_customer_address', $this);\n }", "public function __construct()\n\t{\n\t\t$this->registry = ipsRegistry::instance();\n\t\t$this->settings =& $this->registry->fetchSettings();\n\t\t$this->memberData =& $this->registry->member()->fetchMemberData();\n\t}", "public function __construct($data = '')\n {\n parent::__construct($data);\n $this->set('ip', self::$remoteaddr);\n }", "function add_network_option($network_id, $option, $value)\n {\n }", "public function getAddress() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Domain Object\n\t\t\t$address = new \\Network\\IPAddress();\n\t\t\tif (! isset($_REQUEST['address'])) $this->error(\"address required\");\n\t\n\t\t\t$address->get($_REQUEST['address']);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($address->error()) $this->error($address->error());\n\t\t\telseif ($address->id) {\n\t\t\t\t$response->address = $address;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Address not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "function common_get_network_config($net){\r\n\t$file = '/etc/network/interfaces';\r\n\t$curr = file_get_contents($file);\r\n\tif($net == 'ip'){\t\t\r\n\t\t$curr_ip = explode('#ip',$curr);\r\n\t\t$curr_ip = $curr_ip[1];\r\n\t\t$curr_ip = explode(' ', $curr_ip);\r\n\t\t$curr_ip = trim($curr_ip[1]);\r\n\t\t\r\n\t\treturn $curr_ip;\r\n\t}\r\n\telse if($net == 'subnet'){\r\n\t\t$curr_subnet = explode('#subnet',$curr);\r\n\t\t$curr_subnet = $curr_subnet[1];\r\n\t\t$curr_subnet= explode(' ', $curr_subnet);\r\n\t\t$curr_subnet = trim($curr_subnet[1]);\r\n\t\t\r\n\t\treturn $curr_subnet;\r\n\t}\r\n\telse if($net == 'gw'){\r\n\t\t$curr_gw = explode('#gw',$curr);\r\n\t\t$curr_gw = $curr_gw[1];\r\n\t\t$curr_gw= explode(' ', $curr_gw);\r\n\t\t$curr_gw = trim($curr_gw[1]);\r\n\t\t\r\n\t\treturn $curr_gw;\r\n\t}\r\n\telse if($net == 'dns'){\r\n\t\t$curr_dns = explode('#dns',$curr);\r\n\t\t$curr_dns = $curr_dns[1];\r\n\t\t$curr_dns= explode(' ', $curr_dns);\r\n\t\t$curr_dns = trim($curr_dns[1]);\r\n\t\t\r\n\t\treturn $curr_dns;\r\n\t}\t\r\n\t\r\n\treturn null;\r\n}", "public function __construct($addr) {\n $this->addr = $addr;\n }", "private function merge_posted_ip_data($p_net_type)\n {\n $l_subnet = $l_gw = $l_from = $l_to = $l_net = \"\";\n\n switch ($p_net_type)\n {\n case 1001:\n case C__CATS_NET_TYPE__IPV4:\n $l_subnet = $_POST['C__CATS__NET__MASK_V4'];\n $l_from = $_POST['C__CATS__NET__ADDRESS_RANGE_FROM_V4'];\n $l_to = $_POST['C__CATS__NET__ADDRESS_RANGE_TO_V4'];\n $l_net = $_POST['C__CATS__NET__NET_V4'];\n break;\n\n case C__CATS_NET_TYPE__IPV6:\n $l_gw = $_POST['C__CATS__NET__DEF_GW_V6'];\n $l_subnet = $_POST['C__CATS__NET__MASK_V6'];\n $l_from = $_POST['C__CATS__NET__ADDRESS_RANGE_FROM'];\n $l_to = $_POST['C__CATS__NET__ADDRESS_RANGE_TO'];\n $l_net = $_POST['C__CATS__NET__NET_V6'];\n break;\n } // switch\n\n return [\n C__IP__SUBNET => $l_subnet,\n C__IP__GATEWAY => $l_gw,\n C__IP__NET => $l_net,\n \"ADDRESS_FROM\" => $l_from,\n \"ADDRESS_TO\" => $l_to\n ];\n }", "function findBroad($sn,$net) {\n\n $ob = \"\";\n $ip = \"\";\n\n $oct = explode('.',$net);\n\n foreach($oct as $o) {\n \n for($i=0; $i < strlen($o); $i++) {\n\n if($sn > 0) {\n $ob[$i]= $o[$i]; // ottetto broadcast in copia\n $sn--;\n }\n else {\n $ob[$i]= \"1\";\n }\n }\n $ip.= $ob.\".\";\n }\n\n $ip = rtrim($ip, \".\");\n\n return $ip;\n\n}", "function network_code( $network ){\n $network = trim(strtolower( $network ) );\n switch ($network) {\n case 'mtn':\n case 'dstv':\n return '01';\n break;\n case 'glo':\n case 'gotv':\n return '02';\n break;\n case '9mobile':\n case 'etisalat':\n case 'startimes':\n return '03';\n break;\n default :\n // airtel\n return '04';\n }\n}", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getGivenIpWithNetmask()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->getMask();\n\t}", "function check_subnet($ip, $network, $netmask) {\n\t$network_long = ip2long($network);\n\t$mask_long = ip2long($netmask);\n\t$ip_long = ip2long($ip);\n\n\t// Remove the host part of the addresses.\n\t$network_net_long = $network_long & $mask_long;\n\t$ip_net_long = $ip_long & $mask_long;\n\n\t// If the network parts are equal, return true.\n\treturn ($network_net_long === $ip_net_long);\n}" ]
[ "0.5923377", "0.562638", "0.5612385", "0.5344884", "0.5304455", "0.5275863", "0.527355", "0.5211428", "0.5167758", "0.5141536", "0.51387995", "0.5067981", "0.5019945", "0.5019945", "0.5019258", "0.49916288", "0.49655846", "0.49605107", "0.494762", "0.4945442", "0.49398205", "0.49355704", "0.49182597", "0.48984936", "0.487905", "0.48733053", "0.4866125", "0.48632064", "0.48478636", "0.48371488", "0.48297384", "0.48297384", "0.48167863", "0.4792145", "0.47818142", "0.47789055", "0.47644764", "0.47566676", "0.47519204", "0.4717967", "0.47066417", "0.4705347", "0.46907702", "0.46471322", "0.46329695", "0.46246195", "0.46246195", "0.46244222", "0.46237528", "0.4622516", "0.46157947", "0.4613807", "0.4609059", "0.4607637", "0.46013784", "0.4592729", "0.4586125", "0.45856285", "0.45852512", "0.457483", "0.45746645", "0.45727625", "0.4562909", "0.45552096", "0.45444557", "0.45261538", "0.4519458", "0.45128152", "0.45083374", "0.4501861", "0.44962412", "0.44799405", "0.44649237", "0.4456284", "0.44498944", "0.4444374", "0.44405738", "0.44337595", "0.44318086", "0.44315353", "0.44221532", "0.4416997", "0.44100538", "0.44085172", "0.44033", "0.4398819", "0.43985832", "0.43971658", "0.4395876", "0.4389332", "0.43839958", "0.43781278", "0.4377045", "0.4375054", "0.43726316", "0.43506268", "0.43470728", "0.434505", "0.43422523", "0.43419203" ]
0.6879694
0
\brief Search any networks that contains the given IP \ref ipAddressToNetwork
static function searchNetworksContainingIP($IP, $entityID = -1, $recursive = true, $fields = "", $where = "") { return self::searchNetworks('contains', ['address' => $IP, 'netmask' => [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff], 'fields' => $fields, 'where' => $where], $entityID, $recursive); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inNetwork($networks = [], $ip = \"\") {\n $network_group = [];\n $netmask_group = [];\n\n foreach($networks as $network) {\n list($subnet, $cidr) = explode('/', $network);\n $netmask = (1 << 32) - (1 << (32 - $cidr));\n $network_group[ip2long($subnet)] = $network;\n\n if(!in_array($netmask, $netmask_group)) $netmask_group[] = $netmask;\n }\n\n // sort netmask in desc order - important to work properly\n rsort($netmask_group);\n\n foreach($netmask_group as $netmask) {\n // get network from ip address and netmask\n $network = ip2long($ip) & $netmask;\n\n if(array_key_exists($network, $network_group)) return $network_group[$network];\n }\n\n }", "public function get_matching_net_by_ipv4_address($p_ip_address)\n {\n if ($p_ip_address)\n {\n return $this->retrieve(\n 'SELECT isys_cats_net_list__isys_obj__id AS netID, isys_cats_net_list__address_range_from AS rangeFrom, isys_cats_net_list__address_range_to AS rangeTo ' . 'FROM isys_cats_net_list ' . 'WHERE (' . Ip::ip2long(\n $p_ip_address\n ) . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long)' . ' AND (isys_cats_net_list__isys_obj__id != ' . (int) C__OBJ__NET_GLOBAL_IPV4 . ') ' . // Order by the smallest possible range (which should be the most exact one)\n 'ORDER BY (isys_cats_net_list__address_range_to_long - isys_cats_net_list__address_range_from_long) ASC ' . 'LIMIT 1'\n )\n ->get_row();\n }\n\n return [\n 'netID' => null,\n 'rangeFrom' => '',\n 'rangeTo' => ''\n ];\n }", "function listNetworkAdd($searchadd){\n #sends the deconstructed IP to the networkAdd function\n\n\t\t$iplist = explode(\".\", $searchadd);\n\n\t\t$networkList = [];\n\n\t\tfor($i = 8; $i < 33; $i++){\n\t\t\t$ipvar = explode(\".\", $searchadd);\n\t\t\t$temp = networkAdd($ipvar, $i);\n\t\t\t$networkList[] = $temp;\n\t\t}\n\n\t\t#echo\"All network addresses</br>\";\n\n\t\treturn $networkList;\n\t}", "public static function checkIPSubnet( $ipAddress ){\n\t\t\tglobal $wpdb;\n\n\t\t\t/*\n\t\t\t\tGrabs allowed subnets from the \n\t\t\t\tcurrent blog.\n\t\t\t*/\n\t\t\tif( is_multisite() ){\n\t\t\t\t$currentBlogID = get_current_blog_id();\n\n\t\t\t\tglobal $switched;\n\t\t\t\tswitch_to_blog(1);\n\n\t\t\t\t$subnets = $wpdb->get_results( $wpdb->prepare(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM \".$wpdb->prefix.\"wps_subnets\n\t\t\t\t\t WHERE blog_id = '%d'\",\n\t\t\t\t\t $currentBlogID\n\t\t\t\t), ARRAY_A );\n\n\t\t\t\trestore_current_blog();\n\t\t\t}else{\n\t\t\t\t$subnets = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.\"wps_subnets\", ARRAY_A );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tIterates through subnets and checks to see\n\t\t\t\tif the IP address is within the range.\n\t\t\t*/\n\t\t\tforeach( $subnets as $subnet ){\n\t\t\t\t$subnetParts \t= explode( '.', $subnet['start_ip'] );\n\n\t\t\t\t$firstOctet \t= $subnetParts[0];\n\t\t\t\t$secondOctet \t= $subnetParts[1];\n\t\t\t\t$thirdOctet \t= $subnetParts[2];\n\t\t\t\t$fourthOctet \t= $subnetParts[3];\n\n\t\t\t\t$newFirstOctet \t= '';\n\t\t\t\t$newSecondOctet\t= '';\n\t\t\t\t$newThirdOctet \t= '';\n\t\t\t\t$newFourthOctet = '';\n\n\t\t\t\t/*\n\t\t\t\t\tChecks from the largest networks\n\t\t\t\t\tfirst down to the smallest.\n\t\t\t\t*/\n\t\t\t\tif( $subnet['subnet'] <= 8 ){\n\t\t\t\t\tif( ( $firstOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFirstOctet = 255;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min \t= ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max \t= ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress );\n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 8 ) && ( $subnet['subnet'] <= 16 ) ){\n\t\t\t\t\tif( ( $secondOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newScondOctet = ( $secondOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress ); \n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 16 ) && ( $subnet['subnet'] <= 24 ) ){\n\t\t\t\t\tif( ( $thirdOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newThirdOctet \t= ( $thirdOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + 1;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}else if( $subnet['subnet'] > 24 ){\n\t\t\t\t\tif( ( $fourthOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFourthOctet = ( $fourthOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + 1;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFourthOctet = $fourthOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tOnly reachable if nothing was returned\n\t\t\t\tmeaning that the IP is NOT in the subnet.\n\t\t\t*/\n\t\t\treturn false;\n\t\t}", "static function searchNetworks($relation, $condition, $entityID = -1, $recursive = true,\n $version = 0) {\n global $DB;\n\n if (empty($relation)) {\n return false;\n }\n\n if (empty($condition[\"fields\"])) {\n $fields = 'id';\n } else {\n $fields = $condition[\"fields\"];\n }\n\n if (!is_array($fields)) {\n $fields = [$fields];\n }\n\n $startIndex = (($version == 4) ? 3 : 1);\n\n $addressDB = ['address_0', 'address_1', 'address_2', 'address_3'];\n $netmaskDB = ['netmask_0', 'netmask_1', 'netmask_2', 'netmask_3'];\n\n $WHERE = [];\n if (isset($condition[\"address\"])\n && isset($condition[\"netmask\"])) {\n $addressPa = new IPAddress($condition[\"address\"]);\n\n // Check version equality ...\n if ($version != $addressPa->getVersion()) {\n if ($version != 0) {\n return false;\n }\n $version = $addressPa->getVersion();\n }\n\n $netmaskPa = new IPNetmask($condition[\"netmask\"], $version);\n\n // Get the array of the adresses\n $addressPa = $addressPa->getBinary();\n $netmaskPa = $netmaskPa->getBinary();\n\n // Check the binary is valid\n if (!is_array($addressPa) || (count($addressPa) != 4)) {\n return false;\n }\n if (!is_array($netmaskPa) || (count($netmaskPa) != 4)) {\n return false;\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n\n if ($relation == \"equals\") {\n for ($i = $startIndex; $i < 4; ++$i) {\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]) . \" & \" . $DB->quoteValue($netmaskPa[$i]) . \") = (\".$DB->quoteValue($addressPa[$i]).\" & \".$DB->quoteValue($netmaskPa[$i]).\")\"),\n $netmaskDB[$i] => $netmaskPa[$i]\n ];\n }\n } else {\n for ($i = $startIndex; $i < 4; ++$i) {\n if ($relation == \"is contained by\") {\n $globalNetmask = $DB->quoteValue($netmaskPa[$i]);\n } else {\n $globalNetmask = $DB->quoteName($netmaskDB[$i]);\n }\n\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]).\" & $globalNetmask) = (\".$DB->quoteValue($addressPa[$i]).\" & $globalNetmask)\"),\n new \\QueryExpression(\"(\".$DB->quoteValue($netmaskPa[$i]).\" & \".$DB->quoteName($netmaskDB[$i]).\")=$globalNetmask\")\n ];\n }\n }\n }\n\n if ($entityID < 0) {\n $entityID = $_SESSION['glpiactive_entity'];\n }\n $entitiesID = [];\n switch ($relation) {\n case \"is contained by\" :\n $ORDER_ORIENTATION = 'ASC';\n if ($recursive) {\n $entitiesID = getSonsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"contains\" :\n $ORDER_ORIENTATION = 'DESC';\n if ($recursive) {\n $entitiesID = getAncestorsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"equals\" :\n $ORDER_ORIENTATION = '';\n if ($recursive) {\n $entitiesID = getSonsAndAncestorsOf('glpi_entities', $entityID);\n }\n break;\n }\n\n $entitiesID[] = $entityID;\n $WHERE['entities_id'] = $entitiesID;\n $WHERE['version'] = $version;\n\n if (!empty($condition[\"exclude IDs\"])) {\n if (is_array($condition[\"exclude IDs\"])) {\n if (count($condition[\"exclude IDs\"]) > 1) {\n $WHERE['NOT'] = ['id' => $condition['exclude IDs']];\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs'][0]];\n }\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs']];\n }\n }\n\n $ORDER = [];\n // By ordering on the netmask, we ensure that the first element is the nearest one (ie:\n // the last should be 0.0.0.0/0.0.0.0 of x.y.z.a/255.255.255.255 regarding the interested\n // element)\n for ($i = $startIndex; $i < 4; ++$i) {\n $ORDER[] = new \\QueryExpression(\"BIT_COUNT(\".$DB->quoteName($netmaskDB[$i]).\") $ORDER_ORIENTATION\");\n }\n\n if (!empty($condition[\"where\"])) {\n $WHERE .= \" AND \" . $condition[\"where\"];\n }\n\n $iterator = $DB->request([\n 'SELECT' => $fields,\n 'FROM' => self::getTable(),\n 'WHERE' => $WHERE,\n 'ORDER' => $ORDER\n ]);\n\n $returnValues = [];\n while ($data = $iterator->next()) {\n if (count($fields) > 1) {\n $returnValue = [];\n foreach ($fields as $field) {\n $returnValue[$field] = $data[$field];\n }\n } else {\n $returnValue = $data[$fields[0]];\n }\n $returnValues[] = $returnValue;\n }\n return $returnValues;\n }", "function findNet($ip,$sm) {\n\n $res = \"\";\n\n // divido gli ottetti\n $exip = explode('.',$ip);\n $exsm = explode('.',$sm);\n\n for($i=0; $i<4; $i++) {\n\n $subip=$exip[$i]; // ottetto del IP\n $subsm=$exsm[$i]; // ottetto della SM\n\n for($k=0; $k<8; $k++) {\n \n if($subip[$k] & $subsm[$k]) {\n $res.=\"1\";\n }\n else {\n $res.=\"0\";\n }\n }\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $res.=\".\";\n }\n \n }\n\n return $res;\n}", "static function checkIPFromNetwork($address, $networkAddress, $networkNetmask, $version = 0) {\n\n $IPNetmask = [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff];\n $relativity = self::checkNetworkRelativity($address, $IPNetmask, $networkAddress,\n $networkNetmask, $version);\n\n return ($relativity == \"equals\") || ($relativity == \"second contains first\");\n }", "function ip_in_subnet($ip, $subnet)\n{\n // Converts a human-readable IP address into its binary representation\n $binary_ip = inet_pton($ip);\n\n // Converts the binary IP into a string of bits.\n // We can't convert the IP to an int (using, for example ip2long()) because php only\n // natively supports unsigned 32 bit ints, while an ipv6 address is 128 bits.\n // If we want, we could make use of some php libraries (e.g. BC Math or GMP) to create a 128\n // bit int, but this is not necessary because we don't need to perform any math operations\n // on this int anyway.\n // Instead, we just convert the IP to a string which is sufficient because we only need to\n // use it for a single string comparison later.\n $ip_bits = inet_to_bits($binary_ip);\n\n // Get the bit string for the subnet address, as well as the length of the subnet mask (in bits)\n list($range, $netmask_len) = explode('/', $subnet, 2); //$netmask_len is aka. the CIDR prefix\n $binary_range = inet_pton($range);\n $range_bits = inet_to_bits($binary_range);\n\n // Get the network bits of the given IP address and the subnet address\n $ip_net_bits = substr($ip_bits, 0, $netmask_len);\n $range_net_bits = substr($range_bits, 0, $netmask_len);\n\n // If the network bits are identical, then this IP is part of the subnet\n return ($ip_net_bits == $range_net_bits);\n}", "public function ip_in_range($network,$netmask,$ip)\n {\n $wildcard_mask = pow( 2, ( 32 - $netmask ) ) - 1;\n $mask = ~ $wildcard_mask;\n return ( ( $ip & $mask ) == ( $network & $mask ) );\n }", "function ip_in_range($ip, $range) {\n if ( is_string($range) ) $ranges = explode(',',$range);\n else $ranges = $range;\n if (strpos($ip,':') !== false) {\n return in_array($ip,$ranges);\n } else {\n $in = false;\n foreach($ranges as $range) {\n if ($in) return $in;\n if (strpos($range,':') !== false) continue;\n # If IP has the 4 blocks is a host, but we need the prefix, so put it\n if (strpos($range,'/') === false && strpos($range,'-') === false && strpos($range,'*') === false) $range .= '/32';\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n $in = (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n $in = ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n }\n }\n return $in;\n }\n}", "public function searchableIPs() {\n\t\treturn false;\n\t}", "public function locate($ip);", "function get_entity_ids_ip_by_network($entity_type, $network, $add_where = '')\n{\n\n // Recursive query for array of networks\n if (is_array($network))\n {\n $ids = array();\n foreach ($network as $entry)\n {\n if ($entry_ids = get_entity_ids_ip_by_network($entity_type, $entry, $add_where))\n {\n $ids = array_merge($ids, $entry_ids);\n }\n }\n\n return $ids;\n }\n\n // Parse for valid network string\n $network_array = parse_network($network);\n //print_vars($network_array);\n if (!$network_array)\n {\n // Incorrect network/address string passed\n return FALSE;\n }\n\n $query = 'SELECT ';\n $join = '';\n $where = ' WHERE 1 ';\n switch ($entity_type)\n {\n case 'ipv4':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv4';\n $query .= ' `ipv4_address_id`';\n break;\n case 'ipv6':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv6';\n $query .= ' `ipv6_address_id`';\n break;\n case 'ip':\n $query .= ($network_array['ip_version'] == 4) ? ' `ipv4_address_id`' : ' `ipv6_address_id`';\n break;\n\n case 'device':\n case 'devices':\n $query .= ' DISTINCT `device_id`';\n break;\n\n case 'port':\n case 'ports':\n $query .= ' DISTINCT `port_id`';\n break;\n }\n\n switch ($network_array['ip_type'])\n {\n case 'ipv4':\n $query .= ' FROM `ipv4_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv4_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv4_binary` >= ? AND `ipv4_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= generate_query_values($network_array['address'], 'ipv4_address', $network_array['query_type']);\n }\n break;\n case 'ipv6':\n $query .= ' FROM `ipv6_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv6_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv6_binary` >= ? AND `ipv6_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= ' AND (' . generate_query_values($network_array['address'], 'ipv6_address', $network_array['query_type'], FALSE) .\n ' OR ' . generate_query_values($network_array['address'], 'ipv6_compressed', $network_array['query_type'], FALSE) . ')';\n }\n break;\n }\n\n if (FALSE)\n {\n // Ignore disabled/deleted/ignored\n $where .= ' AND `device_id` NOT IN (SELECT `device_id` FROM `devices` WHERE `disabled` = \"1\" OR `ignore` = \"1\")';\n $where .= ' AND `port_id` NOT IN (SELECT `port_id` FROM `ports` WHERE `deleted` = \"1\" OR `ignore` = \"1\")';\n } else {\n // Always ignore deleted ports\n $join = ' LEFT JOIN `ports` USING (`device_id`, `port_id`) ';\n // IS NULL allow to search addresses without associated port\n $where .= ' AND (`ports`.`deleted` != \"1\" OR `ports`.`deleted` IS NULL)';\n }\n $query .= $join;\n $where .= $add_where; // Additional query, ie limit by device_id or port_id\n\n $ids = dbFetchColumn($query . $where, $param);\n //$ids = dbFetchColumn($query . $where, $param);\n //print_vars($ids);\n\n return $ids;\n}", "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "function ip_in_subnet($addr,$subnet) {\n\tlist($ip, $mask) = explode('/', $subnet);\n\t$mask = 0xffffffff << (32 - $mask);\n\treturn ((ip2long($addr) & $mask) == (ip2long($ip) & $mask));\n}", "Function ip_in_range($ip, $range) {\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n\n //echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\n return false;\n }\n\n}", "Function ip_in_range($ip, $range) {\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2long($netmask);\r\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n list($a,$b,$c,$d) = $x;\r\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range_dec = ip2long($range);\r\n $ip_dec = ip2long($ip);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n\r\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\r\n }\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\r\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\r\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n\r\n}", "function ipextract ($str, $remote_ip='')\r\n{\r\n global $ip_private_arr;\r\n\r\n if (empty($ip_private_arr) || !is_array($ip_private_arr)) {\r\n $ip_private_arr = array();\r\n $ip_private_arr[] = array('from' => '0.0.0.0', 'to' => '9.255.255.255');\r\n $ip_private_arr[] = array('from' => '10.0.0.0', 'to' => '10.255.255.255');\r\n $ip_private_arr[] = array('from' => '97.160.0.0', 'to' => '97.255.255.255');\r\n $ip_private_arr[] = array('from' => '100.0.0.0', 'to' => '111.255.255.255');\r\n $ip_private_arr[] = array('from' => '127.0.0.0', 'to' => '127.255.255.255');\r\n $ip_private_arr[] = array('from' => '145.0.0.0', 'to' => '145.0.255.255');\r\n $ip_private_arr[] = array('from' => '163.0.0.0', 'to' => '163.0.255.255');\r\n $ip_private_arr[] = array('from' => '169.254.0.0', 'to' => '169.254.255.255');\r\n $ip_private_arr[] = array('from' => '172.0.0.0', 'to' => '172.127.255.255');\r\n $ip_private_arr[] = array('from' => '175.0.0.0', 'to' => '185.255.255.255');\r\n $ip_private_arr[] = array('from' => '191.0.0.0', 'to' => '192.0.255.255');\r\n $ip_private_arr[] = array('from' => '192.88.0.0', 'to' => '192.88.255.255');\r\n $ip_private_arr[] = array('from' => '192.101.0.0', 'to' => '192.114.255.255');\r\n $ip_private_arr[] = array('from' => '192.140.0.0', 'to' => '192.145.255.255');\r\n $ip_private_arr[] = array('from' => '192.168.0.0', 'to' => '192.178.255.255');\r\n $ip_private_arr[] = array('from' => '194.55.0.0', 'to' => '194.55.255.255');\r\n $ip_private_arr[] = array('from' => '198.17.0.0', 'to' => '198.20.255.255');\r\n $ip_private_arr[] = array('from' => '224.0.0.0', 'to' => '239.255.255.255');\r\n }\r\n\r\n $iplong = ip2long(trim($remote_ip));\r\n $valarr = empty($str) ? array() : preg_split('/[,\\s]+/', trim($str));\r\n foreach ($valarr as $ipval) {\r\n if (preg_match('%(\\d{1,3}(?:[.]\\d{1,3}){3})%', $ipval, $matches)) {\r\n $iptest = ip2long($matches[1]);\r\n if ($iptest) {\r\n if (empty($iplong)) $iplong = $iptest;\r\n if (!empty($ip_private_arr)) {\r\n foreach ($ip_private_arr as $ip_range) {\r\n $ipfrom = ip2long(trim($ip_range['from']));\r\n $ipto = ip2long(trim($ip_range['to']));\r\n if ($ipfrom<=$iptest && $iptest<=$ipto) {\r\n $iptest = 0;\r\n break;\r\n }\r\n }\r\n if ($iptest) $iplong = $iptest;\r\n }\r\n }\r\n }\r\n }\r\n return (!$iplong || $iplong==-1) ? FALSE : long2ip($iplong);\r\n}", "function geoCheckIP($ip)\n{\n\t if(!filter_var($ip, FILTER_VALIDATE_IP))\n\t {\n\t\t\t throw new InvalidArgumentException(\"IP is not valid\");\n\t }\n\n\t //contact ip-server\n\t \n\t //$response=@file_get_contents('http://www.netip.de/search?query='.$ip);\n\t $response=@file_get_contents('http://api.hostip.info/country.php?ip='.$ip);\n\t \n\t if (empty($response))\n\t {\n\t\t\t throw new InvalidArgumentException(\"Error contacting Geo-IP-Server\");\n\t }\n\n\t /*\n\t //Array containing all regex-patterns necessary to extract ip-geoinfo from page\n\t $patterns=array();\n\t $patterns[\"domain\"] = '#Domain: (.*?)&nbsp;#i';\n\t $patterns[\"country\"] = '#Country: (.*?)&nbsp;#i';\n\t $patterns[\"state\"] = '#State/Region: (.*?)<br#i';\n\t $patterns[\"town\"] = '#City: (.*?)<br#i';\n\n\t //Array where results will be stored\n\t $ipInfo=array();\n\n\t //check response from ipserver for above patterns\n\t foreach ($patterns as $key => $pattern)\n\t {\n\t\t\t //store the result in array\n\t\t\t $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';\n\t }\n\n\t return $ipInfo;\n\t */\n\t return $response;\n}", "function cidr_match($ip, $range){\n list ($subnet, $bits) = explode('/', $range);\n $ip = ip2long($ip);\n $subnet = ip2long($subnet);\n $mask = -1 << (32 - $bits);\n $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned\n return ($ip & $mask) == $subnet;\n}", "function ipBlockSearch(){\n if($this->session->userdata('Logged_In')){\n if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']))\n {\n redirect('records/customer_records');\n }\n else{\n $search = $this->input->post('search');\n $this->records_model->setIpSearch($search);\n $result = $this->records_model->searchNodeIP();\n $result1 = $this->records_model->searchCategoryIP();\n $result2=$this->records_model->searchPrivateIP();\n\n\n echo '<div class=\"result\">';\n echo '<ul class=\"search-results\">';\n foreach($result as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p style=\"display: none\">';\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>Node IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n\n foreach($result1 as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p>';\n\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).' /'.$row->subnet.'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>'.$row->ssid.' IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n\n foreach($result2 as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p>';\n\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).' /'.$row->subnet.'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>Private IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n echo '</ul>';\n echo '</div>';\n }\n }\n else $this->load->view('login/login');\n }", "function is_ip_banned($ip, $banned_ips)\n {\n foreach($banned_ips as $banned_ip) // go through every $banned_ip\n {\n if(strpos($banned_ip,'*')!==false) // $banned_ip contains \"*\" = > IP range\n {\n $ip_range = substr($banned_ip, 0, strpos($banned_ip, '*')); // fetch part before \"*\"\n if(strpos($ip, $ip_range)===0) // check if IP begins with part before \"*\"\n {\n return true;\n }\n }\n elseif(strpos($banned_ip,'/')!==false && preg_match(\"/(([0-9]{1,3}\\.){3}[0-9]{1,3})\\/([0-9]{1,2})/\", $banned_ip, $regs)) // $banned_ip contains \"/\" => CIDR notation (the regular expression is only used if $banned_ip contains \"/\")\n {\n // convert IP into bit pattern:\n $n_user_leiste = '00000000000000000000000000000000'; // 32 bits\n $n_user_ip = explode('.',trim($ip));\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_user_ip[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_user_ip[$i] = $n_user_ip[$i] - pow(2, 7-$n_j);\n $n_user_leiste[$n_j + $i*8] = '1';\n }\n }\n }\n // analyze prefix length:\n $n_byte_array = explode('.',trim($regs[1])); // IP -> 4 Byte\n $n_cidr_bereich = $regs[3]; // prefix length\n // bit pattern:\n $n_bitleiste = '00000000000000000000000000000000';\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n if ($n_byte_array[$i] > 255) // invalid\n {\n $n_cidr_bereich = 0;\n }\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_byte_array[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_byte_array[$i] = $n_byte_array[$i] - pow(2, 7-$n_j);\n $n_bitleiste[$n_j + $i*8] = '1';\n }\n }\n }\n // check if bit patterns match on the first n chracters:\n if (strncmp($n_bitleiste, $n_user_leiste, $n_cidr_bereich) == 0 && $n_cidr_bereich > 0)\n {\n return true;\n }\n }\n else // neither \"*\" nor \"/\" => simple comparison:\n {\n if($ip == $banned_ip)\n {\n return true;\n }\n }\n }\n return false;\n }", "function check_subnet($ip, $network, $netmask) {\n\t$network_long = ip2long($network);\n\t$mask_long = ip2long($netmask);\n\t$ip_long = ip2long($ip);\n\n\t// Remove the host part of the addresses.\n\t$network_net_long = $network_long & $mask_long;\n\t$ip_net_long = $ip_long & $mask_long;\n\n\t// If the network parts are equal, return true.\n\treturn ($network_net_long === $ip_net_long);\n}", "function searchIP()\t{\n \t$position = mt_rand(1, $this->rnd_ips_number);\n $query = \"select ip from \".self::RNDIPSC_NAME.\" where id=\".$position;\n if ($result = $this->db_conn->query($query)) {\n $row = $result->fetch_assoc();\n return $row[\"ip\"];\n }\n else {\n die (\"Error sending the query '\".$query.\"' to MySQL\");\n }\n\t}", "function listNetworkIp($net,$broadcast,$sn) {\n\n $lista=[]; // lista da ritornare \n\n $no = explode('.', $net); // array con gli ottetti dell'indirizzo NET\n $bo = explode('.', $broadcast); // array con gli ottetti dell'indirizzo NET\n\n $nbit = 32-$sn; // numero di bit assegnati agli host\n \n $nhost = pow(2,$nbit); // numero totale degli host\n\n $start = (int) $no[3]+1;\n $end = (int) $bo[3]-1;\n $roots = $no[0].\".\".$no[1].\".\".$no[2].\".\";\n $roote = $bo[0].\".\".$bo[1].\".\".$bo[2].\".\";\n $primo = $roots.$start;\n $ultimo = $roote.$end;\n $hosts = [];\n\n //echo $start.\" - \".$end.\"<br>\";\n\n // verifica che gli IP disponibili non superino le 5000 unità -> stila la lista\n if($nhost > 35000) {\n $lista[0] = $primo;\n $lista[1] = $ultimo;\n }\n else {\n for($i=ip2long($primo); $i<=ip2long($ultimo); $i++) {\n\n $ip2conv = $i;\n $ip2write = long2ip($ip2conv);\n $lista[] = $ip2write;\n \n $host=gethostbyaddr($ip2write); // prelevo il nome del host (se disponibile)\n //echo $host.\" | \";\n\n // se il nome host NON è uguale all'IP -> salvo il nome Host in una lista\n if(!filter_var($host, FILTER_VALIDATE_IP)) {\n $hosts[] = \"IP: $ip2write ==> Nome Host:<b> $host </b><br>\";\n }\n\n }\n }\n\n $ret['hostnames'] = $hosts;\n $ret['primo'] = $primo;\n $ret['ultimo'] = $ultimo;\n $ret['lista'] = $lista;\n $ret['nhost'] = $nhost; \n\n return $ret;\n}", "private function get_country_city_from_ip($ip) {\n if (!filter_var($ip, FILTER_VALIDATE_IP)) {\n throw new InvalidArgumentException(\"IP is not valid\");\n }\n\n//contact ip-server\n $response = @file_get_contents('http://www.netip.de/search?query=' . $ip);\n if (empty($response)) {\n return \"error\";\n }\n\n $patterns = array();\n $patterns[\"domain\"] = '#Name: (.*?)&nbsp;#i';\n $patterns[\"country\"] = '#Country: (.*?)&nbsp;#i';\n $patterns[\"state\"] = '#State/Region: (.*?)<br#i';\n $patterns[\"town\"] = '#City: (.*?)<br#i';\n\n $ipInfo = array();\n\n foreach ($patterns as $key => $pattern) {\n $ipInfo[$key] = preg_match($pattern, $response, $value) && !empty($value[1]) ? $value[1] : 'not found';\n }\n\n return $ipInfo;\n }", "function networkAdd($ipvar, $subnet){\n\t\t# $octetbit array is used in computing on how many '1' bits are in a specific octet of the IP address\n\t\t$octetbit = [128, 64, 32, 16, 8, 4, 2, 1];\n\n\t\t#To check which octet is the subnet mask located(in terms of count of 8),\n \t#which will help in computing for the network address of the IP address\n\t\t$octetindex = floor((int)$subnet/8);\n\n\t #To check the bits that overflowed from the biggest 8 count from the previous variable\n\t #i.e. if the subnet is /25, 3 octets from the left are all 1s and in the 4th octet,\n\t #the first bit from the left is set to 1 while the rest are set to 0 \n\t\t$octetrem = (int)$subnet%8;\n\n\t\tif ($octetindex == 4)\n\t\t\treturn (implode(\".\", $ipvar));\n\n\t #modresult is to maintain count for which bits will be set to '1' to get the value\n\t #i.e. if the value is 3, then the 2nd bit from the right will be set to '1' and a value of\n\t #1 will remain, making the 1st bit from the right, be set to '1' as well for a total value of 3\n\t\t$modresult = (int)$ipvar[$octetindex];\n\t\t$netconstant = 0;\n\t\t$i = 0;\n\n\t\tif ($octetrem == 0)\n\t\t\tfor ($i = $octetindex; $i < 4; $i++ )\n\t\t\t\t$ipvar[$i] = \"0\";\n\n\t\telse if ($octetrem > 0){\n\t\t\twhile ($i < $octetrem){\n\t\t\t\tif ($modresult >= $octetbit[$i]){\n\t\t\t\t\t$netconstant += $octetbit[$i];\n\t\t\t\t\t$modresult = $modresult % $octetbit[$i];\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$ipvar[$octetindex] = (string)$netconstant;\n\n\t\t\tfor($j = $octetindex+1; $j < 4; $j++)\n\t\t\t\t$ipvar[$j] = \"0\";\n\t\t}\n\n\t\t$netadd = implode(\".\", $ipvar);\n\n\t\treturn $netadd;\n\n\t}", "function ip_address_banned($ipaddress = '')\n\t{\n\t\tglobal $ilconfig;\n\t\t$isblocked = false;\n\t\tif (!empty($ilconfig['globalfilters_blockips']))\n\t\t{\n\t\t\t$addresses = array ();\n\t\t\t$user_ipaddress = $ipaddress . '.';\n\t\t\tif (strrchr($ilconfig['globalfilters_blockips'], ', '))\n\t\t\t{\n\t\t\t\t$addresses = explode(', ', $ilconfig['globalfilters_blockips']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$addresses = preg_split('#\\s+#', $ilconfig['globalfilters_blockips'], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\t}\n\t\t\tif (count($addresses) > 0)\n\t\t\t{\n\t\t\t\tforeach ($addresses AS $banned_ip)\n\t\t\t\t{\n\t\t\t\t\tif (strpos($banned_ip, '*') === false AND $banned_ip{strlen($banned_ip) - 1} != '.')\n\t\t\t\t\t{\n\t\t\t\t\t\t$banned_ip .= '.';\n\t\t\t\t\t}\n\t\t\t\t\t$banned_ip_regex = str_replace('\\*', '(.*)', preg_quote($banned_ip, '#'));\n\t\t\t\t\tif (preg_match('#^' . $banned_ip_regex . '#U', $user_ipaddress))\n\t\t\t\t\t{\n\t\t\t\t\t\t$isblocked = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $isblocked;\n\t}", "private static function ip2addr($intIp) {\n $arrUnknown = array(\n \"region\" => \"(unknown)\",\n \"address\" => \"(unknown)\"\n );\n $fileIp = fopen(__DIR__ . self::IPFILE, \"rb\");\n if (!$fileIp) return 1;\n $strBuf = fread($fileIp, 4);\n $intFirstRecord = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 4);\n $intLastRecord = self::bin2dec($strBuf);\n $intCount = floor(($intLastRecord - $intFirstRecord) / 7);\n if ($intCount < 1) return 2;\n $intStart = 0;\n $intEnd = $intCount;\n while ($intStart < $intEnd - 1) {\n $intMid = floor(($intStart + $intEnd) / 2);\n $intOffset = $intFirstRecord + $intMid * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intMidStartIp = self::bin2dec($strBuf);\n if ($intIp == $intMidStartIp) {\n $intStart = $intMid;\n break;\n }\n if ($intIp > $intMidStartIp) $intStart = $intMid;\n else $intEnd = $intMid;\n }\n $intOffset = $intFirstRecord + $intStart * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intStartIp = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intEndIp = self::bin2dec($strBuf);\n if ($intIp < $intStartIp || $intIp > $intEndIp) return $arrUnknown;\n $intOffset += 4;\n while (($intFlag = ord(fgetc($fileIp))) == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n switch ($intFlag) {\n case 0:\n return $arrUnknown;\n break;\n case 2:\n $intOffsetAddr = $intOffset + 4;\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) return $arrUnknown;\n $arrAddr = array(\n \"region\" => chr($intFlag)\n );\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n fseek($fileIp, $intOffsetAddr);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n break;\n default:\n $arrAddr = array(\"region\" => chr($intFlag));\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n }\n }", "public function getIpToCountry($ip_address)\r\n {\r\n $url_to_exch_code = \"https://ipinfo.io/\" . $ip_address . \"/country\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $code_string = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n //Leave only letters in query result\r\n $code_string = preg_replace(\"/[^A-Z]+/\", \"\", $code_string);\r\n\r\n //Check also an amount of letters - should be only two\r\n if(!empty($code_string) && strlen($code_string) == 2) {\r\n\r\n if(is_file(APPPATH . 'libraries/ipstate_src/countries_names.json')){\r\n\r\n $json_names = file_get_contents(APPPATH . 'libraries/ipstate_src/countries_names.json');\r\n\r\n $names_array = json_decode($json_names, true);\r\n\r\n if(array_key_exists($code_string, $names_array)){\r\n\r\n $country_name = $names_array[$code_string];\r\n $country_name = $this->checkIpResult($country_name);\r\n return $country_name;\r\n\r\n }else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }", "function findNetwork($id, $networks) {\n\tforeach ($networks as $network) {\n\t\tif($id == $network->id)\n\t\t\treturn $network;\n\t}\n}", "function getCountry($ip_address){\n $url = \"http://ip-to-country.webhosting.info/node/view/36\";\n $inici = \"src=/flag/?type=2&cc2=\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST,\"POST\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"ip_address=$ip_address\"); \n \n ob_start();\n \n curl_exec($ch);\n curl_close($ch);\n $cache = ob_get_contents();\n ob_end_clean();\n \n $resto = strstr($cache,$inici);\n $pais = substr($resto,strlen($inici),2);\n \n return $pais;\n }", "public static function ipLookup($ip) {\r\n\t\t$query = self::$db->query('SELECT iscollege, description FROM l_subnet WHERE subnet >> $1 ORDER BY description ASC', array($ip));\r\n\r\n\t\t$location = array();\r\n\r\n\t\tif (($query === null) or (pg_num_rows($query) == 0)) {\r\n\t\t\t$geoip = geoip_record_by_name($ip);\r\n\t\t\t$location[0] = ($geoip === FALSE) ? 'Unknown' : empty($geoip['city']) ? \"{$geoip['country_name']}\" : utf8_encode($geoip['city']).\", {$geoip['country_name']}\";\r\n\t\t\treturn $location;\r\n\t\t}\r\n\t\t$q = self::$db->fetch_all($query);\r\n\t\tforeach ($q as $k) {\r\n\t\t\t$location[] = $k['description'];\r\n\t\t\t$location[] = ($k['iscollege'] == 't') ? 'College Bedroom' : 'Study Room / Labs / Wifi';\r\n\t\t}\r\n\t\treturn $location;\r\n\t}", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "function _checkIP($ip)\n{\n _log(\"checkIP: Starting.\",\"info\");\n global $caasnode;\n _log(\"checkIP: IP address is $ip.\",\"info\");\n $cIP = ip2long($ip);\n $fIP = long2ip($cIP);\n if($fIP=='0.0.0.0')\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): IPaddress is not valid.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: IPaddress is not valid.\");\n\t\t_exit1(\"Exiting at checkIP: Invalid ip address, aborting \\n\\n\\n\");\n\t}\n _log(\"checkIP: $ip is a valid ip address.\",\"info\");\n _log(\"checkIP: Exiting.\",\"info\");\n}", "function checkCIDRBlacklist($ip)\n{\n $us_backlist = array(\n //'23','24','50','63','64','65','66','67','68','69','70','71','72','73','74','75','76','96','97',\n //'98','99','100','104','107','108','142','162','163','172','173','174','184','192','198','199','204','205','206','207','208','209','216'\n );\n $cidr = substr($ip, 0, strpos($ip, '.')); // xxx\n if(!empty($us_backlist) && in_array($cidr, $us_backlist))\n return true;\n\n $blacklist = array(\n //'27.67',\n //'27.74',\n //'171.253',\n //'171.249',\n //'59.153',\n //'113.185',\n //'113.161',\n //'115.84',\n //'115.73',\n //'117.0',\n //'117.1',\n //'117.2',\n //'117.3',\n //'117.4',\n //'117.5',\n //'125.212',\n //'123.31',\n //'123.24',\n //'101.99',\n //'58.187', // FPT\n //'183.80', // FPT\n //'183.81', // FPT\n //'42.112', // FPT\n //'42.117', // FPT\n //'1.52', // FPT\n //'1.53', // FPT\n );\n //$cidr = substr($ip, 0, strrpos($ip, '.')); // xxx.xxx.xxx\n $cidr = substr($ip, 0, strpos($ip, '.', strpos($ip, '.') + 1)); // xxx.xxx\n if(!empty($blacklist) && in_array($cidr, $blacklist))\n return true;\n else\n return false;\n}", "protected function memorySearch($ip)\n {\n //check and load the binary string for the first time\n if (null == $this->dbBinStr) {\n $this->dbBinStr = file_get_contents($this->dbFile);\n if (false == $this->dbBinStr) {\n throw new Exception(\"Fail to open the db file {$this->dbFile}\");\n }\n\n $this->firstIndexPtr = self::getLong($this->dbBinStr, 0);\n $this->lastIndexPtr = self::getLong($this->dbBinStr, 4);\n $this->totalBlocks = ($this->lastIndexPtr - $this->firstIndexPtr) / INDEX_BLOCK_LENGTH + 1;\n }\n\n if (is_string($ip)) {\n $ip = self::safeIp2long($ip);\n }\n\n //binary search to define the data\n $l = 0;\n $h = $this->totalBlocks;\n $dataPtr = 0;\n while ($l <= $h) {\n $m = (($l + $h) >> 1);\n $p = $this->firstIndexPtr + $m * INDEX_BLOCK_LENGTH;\n $sip = self::getLong($this->dbBinStr, $p);\n if ($ip < $sip) {\n $h = $m - 1;\n } else {\n $eip = self::getLong($this->dbBinStr, $p + 4);\n if ($ip > $eip) {\n $l = $m + 1;\n } else {\n $dataPtr = self::getLong($this->dbBinStr, $p + 8);\n break;\n }\n }\n }\n\n //not matched just stop it here\n if (0 == $dataPtr) {\n return null;\n }\n\n //get the data\n $dataLen = (($dataPtr >> 24) & 0xFF);\n $dataPtr = ($dataPtr & 0x00FFFFFF);\n\n return [\n 'city_id' => self::getLong($this->dbBinStr, $dataPtr),\n 'region' => substr($this->dbBinStr, $dataPtr + 4, $dataLen - 4),\n ];\n }", "function where_is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\t$where_configured = array();\n\n\t$pos = strpos($ignore_if, '_virtualip');\n\tif ($pos !== false) {\n\t\t$ignore_vip_id = substr($ignore_if, $pos+10);\n\t\t$ignore_vip_if = substr($ignore_if, 0, $pos);\n\t} else {\n\t\t$ignore_vip_id = -1;\n\t\t$ignore_vip_if = $ignore_if;\n\t}\n\n\t$isipv6 = is_ipaddrv6($ipaddr);\n\n\tif ($isipv6) {\n\t\t$ipaddr = text_to_compressed_ip6($ipaddr);\n\t}\n\n\tif ($check_subnets) {\n\t\t$cidrprefix = intval($cidrprefix);\n\t\tif ($isipv6) {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 128)) {\n\t\t\t\t$cidrprefix = 128;\n\t\t\t}\n\t\t} else {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 32)) {\n\t\t\t\t$cidrprefix = 32;\n\t\t\t}\n\t\t}\n\t\t$iflist = get_configured_interface_list();\n\t\tforeach ($iflist as $if => $ifname) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($isipv6) {\n\t\t\t\t$if_ipv6 = get_interface_ipv6($if);\n\t\t\t\t$if_snbitsv6 = get_interface_subnetv6($if);\n\t\t\t\t/* do not check subnet overlapping on 6rd interfaces,\n\t\t\t\t * see https://redmine.pfsense.org/issues/12371 */ \n\t\t\t\tif ($if_ipv6 && $if_snbitsv6 &&\n\t\t\t\t ((config_get_path(\"interfaces/{$if}/ipaddrv6\") != '6rd') || ($cidrprefix > $if_snbitsv6)) &&\n\t\t\t\t check_subnetsv6_overlap($ipaddr, $cidrprefix, $if_ipv6, $if_snbitsv6)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ipv6($if) . \"/\" . get_interface_subnetv6($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$if_ipv4 = get_interface_ip($if);\n\t\t\t\t$if_snbitsv4 = get_interface_subnet($if);\n\t\t\t\tif ($if_ipv4 && $if_snbitsv4 && check_subnets_overlap($ipaddr, $cidrprefix, $if_ipv4, $if_snbitsv4)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ip($if) . \"/\" . get_interface_subnet($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($isipv6) {\n\t\t\t$interface_list_ips = get_configured_ipv6_addresses();\n\t\t} else {\n\t\t\t$interface_list_ips = get_configured_ip_addresses();\n\t\t}\n\n\t\tforeach ($interface_list_ips as $if => $ilips) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (strcasecmp($ipaddr, $ilips) == 0) {\n\t\t\t\t$where_entry = array();\n\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t$where_entry['ip_or_subnet'] = $ilips;\n\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($check_localip) {\n\t\tif (strcasecmp($ipaddr, text_to_compressed_ip6(config_get_path('l2tp/localip', \"\"))) == 0) {\n\t\t\t$where_entry = array();\n\t\t\t$where_entry['if'] = 'l2tp';\n\t\t\t$where_entry['ip_or_subnet'] = config_get_path('l2tp/localip');\n\t\t\t$where_configured[] = $where_entry;\n\t\t}\n\t}\n\n\treturn $where_configured;\n}", "public static function subnetContainsIP($subnet, $ip) {\n\t\tlist($network, $prefix) = array_pad(explode('/', $subnet, 2), 2, null);\n\t\t\n\t\tif (filter_var($network, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n\t\t\t// If no prefix was supplied, 32 is implied for IPv4\n\t\t\tif ($prefix === null) {\n\t\t\t\t$prefix = 32;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the IPv4 network prefix\n\t\t\tif ($prefix < 0 || $prefix > 32) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Increase the IPv4 network prefix to work in the IPv6 address space\n\t\t\t$prefix += 96;\n\t\t} else {\n\t\t\t// If no prefix was supplied, 128 is implied for IPv6\n\t\t\tif ($prefix === null) {\n\t\t\t\t$prefix = 128;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the IPv6 network prefix\n\t\t\tif ($prefix < 1 || $prefix > 128) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$bin_network = wfWAFUtils::substr(self::inet_pton($network), 0, ceil($prefix / 8));\n\t\t$bin_ip = wfWAFUtils::substr(self::inet_pton($ip), 0, ceil($prefix / 8));\n\t\tif ($prefix % 8 != 0) { //Adjust the last relevant character to fit the mask length since the character's bits are split over it\n\t\t\t$pos = intval($prefix / 8);\n\t\t\t$adjustment = chr(((0xff << (8 - ($prefix % 8))) & 0xff));\n\t\t\t$bin_network[$pos] = ($bin_network[$pos] & $adjustment);\n\t\t\t$bin_ip[$pos] = ($bin_ip[$pos] & $adjustment);\n\t\t}\n\t\t\n\t\treturn ($bin_network === $bin_ip);\n\t}", "function countryCityFromIP($ipAddr)\n{\n //Developed by Roshan Bhattarai \n //Visit http://roshanbh.com.np for this script and more.\n \n //verify the IP address for the \n ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? trigger_error(\"Invalid IP\", E_USER_ERROR) : \"\";\n // This notice MUST stay intact for legal use\n $ipDetail=array(); //initialize a blank array\n //get the XML result from hostip.info\n $xml = file_get_contents(\"http://api.hostip.info/?ip=\".$ipAddr);\n //get the city name inside the node <gml:name> and </gml:name>\n preg_match(\"@<Hostip>(\\s)*<gml:name>(.*?)</gml:name>@si\",$xml,$match);\n //assing the city name to the array\n $ipDetail['city']=$match[2]; \n //get the country name inside the node <countryName> and </countryName>\n preg_match(\"@<countryName>(.*?)</countryName>@si\",$xml,$matches);\n //assign the country name to the $ipDetail array \n $ipDetail['country']=$matches[1];\n //get the country name inside the node <countryName> and </countryName>\n preg_match(\"@<countryAbbrev>(.*?)</countryAbbrev>@si\",$xml,$cc_match);\n $ipDetail['country_code']=$cc_match[1]; //assing the country code to array\n //return the array containing city, country and country code\n return $ipDetail;\n}", "private static function findDomisili($user_id){\n // $res = $client->request('GET', 'http://172.17.0.38/list.php', [\n // 'headers' => [\n // 'Content-type' => 'application/json'\n // ]]);\n\n \n // $bodyResp = $res->getBody();\n // $array = json_decode($bodyResp, true);\n\n // for($i = 0; $i < 8 ; $i++){\n // $ip = $array[$i]['ip'];\n // $npm = $array[$i]['npm'];\n // if($npm == $user_id){\n // return $ip;\n // }else{\n // //if no ip correspondent with user_id\n // return 0;\n // }\n // }\n\n $array = array(\n array(\n \"ip\" => \"172.17.0.51\",\n \"npm\" => \"1406543694\"\n ),\n array(\n \"ip\" => \"172.17.0.38\",\n \"npm\" => \"1406559036\"\n ),\n \n array(\n \"ip\" => \"172.17.0.18\",\n \"npm\" => \"1406578278\"\n ),\n array(\n \"ip\" => \"172.17.0.19\",\n \"npm\" => \"1406577386\"\n ),\n array(\n \"ip\" => \"172.17.0.50\",\n \"npm\" => \"1406543712\"\n ),\n );\n\n for($i = 0; $i < count($array) ; $i++){\n $activeIP = $array[$i]['ip'];\n $npm = $array[$i]['npm'];\n if($npm == $user_id){\n return $ip;\n }else{\n //if no ip correspondent with user_id\n return 0;\n }\n }\n }", "function subnet ($ip=NULL, $subnet=NULL)\n\t{\n\n\t\t// assign defaults\n\t\tif (is_null($ip))\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\n\t\t// default to REMOTE_ADDR\n\t\tif (!is_null($subnet))\n\t\t{\n\t\t\t$explodeip = explode('.', $ip);\n\t\t\t$subnetip = explode('.', substr($subnet, 0, strpos($subnet, '/')));\n\t\t\t$subnetmask = substr($subnet, strpos($subnet, '/') + 1);\n\t\t\tif ($subnetmask == 32)\n\t\t\t{\n\t\t\t\tif (substr($subnet, 0, strpos($subnet, '/')) == $ip)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif ($subnetmask < 32 && $subnetmask >= 24)\n\t\t\t{\n\t\t\t\t$start = $subnetip[3];\n\t\t\t\t$check = 32;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[3];\n\t\t\t} elseif ($subnetmask < 24 && $subnetmask >= 16)\n\t\t\t{\n\t\t\t\t$start = $subnetip[2];\n\t\t\t\t$check = 24;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[2];\n\t\t\t} elseif ($subnetmask < 16 && $subnetmask >= 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[1];\n\t\t\t\t$check = 16;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[1];\n\t\t\t} elseif ($subnetmask < 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[0];\n\t\t\t\t$check = 8;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[0];\n\t\t\t}\n\t\t\t$end = $start + pow(2, ($check - $subnetmask));\n\t\t\tif ($end > $top) $end = $top;\n\t\t\tif ($checkip >= $start && $checkip <= $end)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t\t\n\t\t} else {\t\t\t\t\n\t\t\t\t\n\t\t\t// wow hard\n\t\t\t$subnet = substr($ip, 0, strrpos($ip, '.')).\".0/24\";\n\t\n\t\t\treturn $subnet;\n\t\t}\n\t}", "function findBroad($sn,$net) {\n\n $ob = \"\";\n $ip = \"\";\n\n $oct = explode('.',$net);\n\n foreach($oct as $o) {\n \n for($i=0; $i < strlen($o); $i++) {\n\n if($sn > 0) {\n $ob[$i]= $o[$i]; // ottetto broadcast in copia\n $sn--;\n }\n else {\n $ob[$i]= \"1\";\n }\n }\n $ip.= $ob.\".\";\n }\n\n $ip = rtrim($ip, \".\");\n\n return $ip;\n\n}", "function ip_in_whitelist($whitelist)\n{\n $ip = get_ip();\n\n // Check if the IP is in our defined whitelist\n foreach ($whitelist as $subnet) {\n if (ip_in_subnet($ip, $subnet) == true) {\n return true;\n }\n }\n\n return false;\n}", "abstract public function getIpLocation($ip);", "public function contains( $ip )\n\t{\n\t\tif( !$this->valid ) return false;\n\t\tif( $this->isIPv4( $ip ))\n\t\t{\n\t\t\t$ip = '::'.$ip;\n\t\t}\n\t\t$addr = @inet_pton( $ip );\n\t\tif( $addr === false ) return false;\n\t\t$gmp = $this->inet_ntogmp( $addr );\n\t\treturn( \\gmp_cmp( $this->net_addr_long, $gmp ) <= 0 && \\gmp_cmp( $gmp, $this->net_broadcast_long ) <= 0 );\t\t\n\t}", "function find($ip, $url, $limit);", "public function findAddresses() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! isset($_REQUEST[\"stylesheet\"])) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Address List\n\t\t\t$addressList = new \\Network\\AddressList();\n\t\n\t\t\t# Find Matching Addresses\n\t\t\t$parameters = array();\n\t\t\tif (preg_match('/^([\\w\\-]+)\\.(.*)$/',$_REQUEST['host_name'],$matches)) {\n\t\t\t\t$_REQUEST['host_name'] = $matches[1];\n\t\t\t\t$_REQUEST['domain_name'] = $matches[2];\n\t\t\t}\n\t\t\tif (isset($_REQUEST['domain_name']) && strlen($_REQUEST['domain_name']) > 0) {\n\t\t\t\t$domain = new \\Network\\Domain();\n\t\t\t\t$domain->get($_REQUEST['domain_name']);\n\t\t\t\tif ($domain->id) {\n\t\t\t\t\t$parameters['domain_id'] = $domain->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"domain not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['host_name']) && strlen($_REQUEST['host_name']) > 0) {\n\t\t\t\t$host = new \\Network\\Host();\n\t\t\t\t$host->get($domain->id,$_REQUEST['host_name']);\n\t\t\t\tif ($host->id) {\n\t\t\t\t\t$parameters['host_id'] = $host->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"host not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['adapter_name']) && strlen($_REQUEST['adapter_name']) > 0) {\n\t\t\t\t$adapter = new \\Network\\Adapter();\n\t\t\t\t$adapter->get($host->id,$_REQUEST['adapter_name']);\n\t\t\t\tif ($adapter->id) {\n\t\t\t\t\t$parameters['adapter_id'] = $adapter->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"adapter '\".$_REQUEST['adapter_name'].\"' for host '\".$host->name.\"' not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['type'])) $parameters['type'] = $_REQUEST['type'];\n\t\t\t$addresses = $addressList->find($parameters);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($addressList->error()) $this->error($addressList->error());\n\t\t\telse{\n\t\t\t\t$response->address = $addresses;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "function get_networks($args = array())\n {\n }", "function nslookup($ip) {\r\n\t$dns='';\r\n\t// execute nslookup command\r\n\texec('nslookup '.$ip, $op);\r\n\r\n\t// php is running on windows machine\r\n\tif (substr(php_uname(), 0, 7) == \"Windows\") {\r\n\t\t$dns= substr($op[3], 6);\r\n\t}\r\n\telse {\r\n\t\t// on linux nslookup returns 2 diffrent line depending on\r\n\t\t// ip or hostname given for nslookup\r\n\t\tif (strpos($op[4], 'name = ') > 0)\r\n\t\t$dns = substr($op[4], strpos($op[4], 'name =') + 7, -1);\r\n\t\telse\r\n\t\t$dns = substr($op[4], strpos($op[4], 'Name:') + 6);\r\n\t}\r\n\r\n\treturn trim($dns);\r\n}", "function convert_ip_to_network_format($ip, $subnet) {\n\t$ipsplit = explode('.', $ip);\n\t$string = $ipsplit[0] . \".\" . $ipsplit[1] . \".\" . $ipsplit[2] . \".0/\" . $subnet;\n\treturn $string;\n}", "private function cidr_includes($ip, $cidr) {\n list ($net, $mask) = explode (\"/\", $cidr);\n $ip_net = ip2long ($net);\n $ip_mask = ~((1 << (32 - $mask)) - 1);\n $ip_ip = ip2long ($ip);\n $ip_ip_net = $ip_ip & $ip_mask;\n return ($ip_ip_net == $ip_net);\n }", "function geoCheckIP ($ip) {\r\n\tif (!filter_var($ip, FILTER_VALIDATE_IP)) throw new InvalidArgumentException(\"IP is not valid\");\r\n\t//contact ip-server\r\n\t$response=file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip);\r\n\tif (empty($response)) throw new InvalidArgumentException(\"Error contacting Geo-IP-Server\");\r\n\t$sregex = \"/s\\:\\d\\:/i\";\r\n\t$ipInfos = explode(';', str_replace('\"', '', preg_replace('/s\\:(\\d{1,2})\\:/i', '', substr($response, 0, -2))));\r\n\tunset($ipInfos[0]);\r\n\t$ipInfo = array();\r\n\tif ($ipInfos[10] == 'geoplugin_areaCode') {\r\n\t\t$ipInfo['country'] = $ipInfos[17];\r\n\t\t$ipInfo['town'] = $ipInfos[9];\r\n\t\t$ipInfo['lat'] = $ipInfos[21];\r\n\t\t$ipInfo['long'] = $ipInfos[23];\r\n\t} else {\r\n\t\t$ipInfo['country'] = $ipInfos[18];\r\n\t\t$ipInfo['town'] = $ipInfos[9].$ipInfos[10];\r\n\t\t$ipInfo['lat'] = $ipInfos[22];\r\n\t\t$ipInfo['long'] = $ipInfos[24];\r\n\t}\r\n\t//Array containing all regex-patterns necessary to extract ip-geoinfo from page\r\n/*\t$patterns = array();\r\n\t$patterns[\"domain\"] = '#geoplugin_city#i';\r\n\t$patterns[\"country\"] = '#Country: (.*?)&nbsp;#i';\r\n\t$patterns[\"state\"] = '#State/Region: (.*?)<br#i';\r\n\t$patterns[\"town\"] = '#City: (.*?)<br#i';\r\n\t//Array where results will be stored\r\n\t$ipInfo=array();\r\n\t//check response from ipserver for above patterns\r\n\tforeach ($patterns as $key => $pattern) {\r\n\t\t//store the result in array\r\n\t\t$ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';\r\n\t}\r\n\treturn $ipInfo*/\r\n\treturn $ipInfo;\r\n}", "public function find_net_collision($p_from, $p_to, $p_net_type = C__CATS_NET_TYPE__IPV4, $p_obj_id = null)\n {\n $l_obj_id = null;\n $l_from = $this->convert_sql_text(Ip::ip2long($p_from));\n $l_to = $this->convert_sql_text(Ip::ip2long($p_to));\n\n if ($p_obj_id !== null && $this->convert_sql_id($p_obj_id) !== 'NULL')\n {\n $l_obj_id = $this->convert_sql_id($p_obj_id);\n } // if\n\n $l_condition = 'AND isys_obj__isys_obj_type__id = ' . $this->convert_sql_id(C__OBJTYPE__LAYER3_NET) . '\n\t\t\tAND (\n\t\t\t\t((' . $l_from . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long) OR (' . $l_to . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long))\n\t\t\t\tOR\n\t\t\t\t(' . $l_from . ' <= isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long <= ' . $l_to . ')\n\t\t\t\tOR\n\t\t\t\t(isys_cats_net_list__address_range_from_long <= ' . $l_from . ' AND ' . $l_to . ' <= isys_cats_net_list__address_range_to_long)\n\t\t\t)\n\t\t\tAND isys_cats_net_list__isys_net_type__id = ' . $this->convert_sql_id($p_net_type) . '\n\t\t\tAND isys_obj__id ' . $this->prepare_in_condition(\n [\n C__OBJ__NET_GLOBAL_IPV4,\n C__OBJ__NET_GLOBAL_IPV6,\n $l_obj_id\n ],\n true\n );\n\n return $this->get_data(null, null, $l_condition, null, C__RECORD_STATUS__NORMAL);\n }", "public function getGivenIpWithNetmask()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->getMask();\n\t}", "function rest_is_ip_address($ip)\n {\n }", "function ipMatch($ip, $cidrs, &$match = null) {\n\tforeach((array) $cidrs as $cidr) {\n\t\tlist($subnet, $mask) = explode('/', $cidr);\n\t\tif(((ip2long($ip) & ($mask = ~ ((1 << (32 - $mask)) - 1))) == (ip2long($subnet) & $mask))) {\n\t\t\t$match = $cidr;\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function search_own_router($all_nodes, $own_nodes)\n{\n # Deklariere Array\n $own_router_index = array();\n $i = 0;\n foreach ($all_nodes as $node) {\n $node_id = $node['node_id'];\n foreach ($own_nodes as $own_id) {\n if ($own_id == $node_id) {\n array_push($own_router_index, $i);\n }\n }\n $i = $i + 1;\n }\n return $own_router_index;\n}", "function getEachIpInRange($cidr) {\n $ips = array();\n $range = array();\n\n $cidr = explode('/', $cidr);\n $range['firstIP'] = (ip2long($cidr[0])) & ((-1 << (32 - (int)$cidr[1])));\n $range['lastIP'] = (ip2long($cidr[0])) + pow(2, (32 - (int)$cidr[1])) - 1;\n\n for ($ip = $range['firstIP']; $ip <= $range['lastIP']; $ip++) {\n $ips[] = long2ip($ip);\n }\n return $ips;\n}", "private function ipArraySearch($ip, $ips)\n {\n foreach ($ips as $key => $value) {\n if (\n (isset($value['ip_address']) && $value['ip_address'] == $ip) ||\n (strval($key) == $ip) ||\n ($value == $ip)\n ) {\n return $value;\n }\n }\n }", "public static function query($ip = NULL) {\r\n $ip = trim($ip);\r\n if (empty($ip)) {\r\n //$ip = \\Drupal::request()->getClientIp();\r\n\t $ip = self::getUserIP();\r\n }\r\n // Use a static cache if this function is called more often\r\n // for the same ip on the same page.\r\n $results = &drupal_static(__FUNCTION__);\r\n if (isset($results[$ip])) {\r\n return $results[$ip];\r\n }\r\n /** @var \\Drupal\\smart_ip\\GetLocationEvent $event */\r\n $event = \\Drupal::service('smart_ip.get_location_event');\r\n $location = $event->getLocation();\r\n $location->set('source', SmartIpLocationInterface::SMART_IP)\r\n ->set('ipAddress', $ip)\r\n ->set('ipVersion', self::ipAddressVersion($ip))\r\n ->set('timestamp', REQUEST_TIME);\r\n // Allow Smart IP source module populate the variable\r\n \\Drupal::service('event_dispatcher')->dispatch(SmartIpEvents::QUERY_IP, $event);\r\n $result = $location->getData();\r\n if (isset($result['latitude']) && isset($result['longitude'])) {\r\n // If coordinates are (0, 0) there was no match\r\n if ($result['latitude'] === 0 && $result['longitude'] === 0) {\r\n $result['latitude'] = NULL;\r\n $result['longitude'] = NULL;\r\n }\r\n }\r\n // Make sure external data in UTF-8.\r\n foreach ($result as &$item) {\r\n if (is_string($item) && !mb_detect_encoding($item, 'UTF-8', TRUE)) {\r\n $item = mb_convert_encoding($item, 'UTF-8', 'ISO-8859-1');\r\n }\r\n }\r\n $location->setData($result);\r\n // Allow other modules to modify the result via Symfony Event Dispatcher\r\n \\Drupal::service('event_dispatcher')->dispatch(SmartIpEvents::DATA_ACQUIRED, $event);\r\n $result = $location->getData();\r\n\t$result['ipAddress'] = $ip;\r\n $results[$ip] = $result;\r\n return $result;\r\n }", "public function getALLfromIP($addr) {\n $db = $this->db;\n $ipnum = sprintf(\"%u\", ip2long($addr));\n $query = \"SELECT cc, cn FROM ip NATURAL JOIN cc WHERE ${ipnum} BETWEEN start AND end\";\n $result = $db->fetchRow($query);\n \n return $result;\n }", "function return_ns_ip($domain) {\n\tglobal $dns_ip_list_c;\n\tif (!@file_exists(\"/usr/bin/dig\")) return;\n\t$msg=array();\n\t//echo $domain.\"\\n\";\n\tfor ($i=0;$i<sizeof($dns_ip_list_c);$i++) {\n\t\t//echo sizeof($dns_ip_list_c[$i]).\"\\n\";\n\t\tfor ($j=0;$j<sizeof($dns_ip_list_c[$i]);$j++) {\n\t\t\t$nip=$dns_ip_list_c[$i][$j][1];\n\t\t\t//echo $nip.\"\\n\";\n\t\t\texec(\"dig @$nip +short +time=1 +tries=1 +retry=1 $domain\",$str,$re);\n\t\t\t//$msg[$nip]=$str[0];\n\t\t\t$msg[]=$str[0];\n\t\t\t$str=\"\";\n\t\t\t//print_r($str);\n\t\t\t//$msg[]=$\n\t\t\t//echo $dns_ip_list_c[$i][$j][1].\"\\n\";\n\t\t}\n\t}\n\t//print_r($msg);\n\treturn $msg;\n}", "static public function WhoIs($ip)\n\t{\n\t\t$farm = Zend_Registry::get('config')->farm;\n\t\tif(!$farm instanceof Zend_Config) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach($farm as $node) {\n\t\t\tif($node->addr == $ip) {\n\t\t\t\treturn $node->name;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function ip_in_pfb_localsub($subnet) {\n\tglobal $pfb_localsub;\n\n\tif (!empty($pfb_localsub)) {\n\t\tforeach ($pfb_localsub as $line) {\n\t\t\tif (ip_in_subnet($subnet, $line)) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "public function search($fields, $options)\n {\n $searcher = SearchBase::getInstance('tx_t3socials_search_Network');\n\n return $searcher->search($fields, $options);\n }", "public static function ipaddress_or_cidr(string $input): bool {\r\n return preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(\\d|[1-2]\\d|3[0-2]))?$/', $input) === 1;\r\n }", "function ip_is_local($ip){\r\n\t\r\n\t $ipv4array = explode('.',$ip); $ipv6array = explode(':',$ip);\r\n\t $lenipv4 = count($ipv4array) ; $lenipv6 = count($ipv6array); \r\n\t $ipint = array(); \r\n\t if($lenipv4 > 0 ){//We have an ipv4 address\r\n\t\t for ($i = 0 ; $i<$lenipv4 ; $i++){\r\n\t\t\t $ipint[$i] = intval($ipv4array[$i]) ; //Generating integera values for the ips\r\n\t\t }\r\n\t\t \r\n\t\t\t//Let's see if our IP is riv ate\r\n\t\t\tif ($ipint[0] == 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 172 && $ipint[1] > 15 && $ipint[1] < 32) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 192 && $ipint[1] == 168) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else return false ;\r\n\t }else{\r\n\t //Either something went wrong, or we are in IPV6 format.\t \r\n\t\t \r\n\t\t if( $lenipv6 > 0){//We are having a big IPV6 address here !\r\n\t\t\t //We are in IPV4. Haven't implemented IPV6 yet\r\n\t\t\t \r\n\t\t }\r\n\t\t return false ;\r\n\t }\r\n\t \r\n\t \r\n\t return false;\r\n}", "public function isIPAddressInNetwork($ipAddress)\n {\n $first = $this->_getSubnetFirstUsableHost($this->getNetworkAddress(),\n $this->getNetworkMask());\n\n $last = $this->_getSubnetLastUsableHost($this->getNetworkAddress(),\n $this->getNetworkMask());\n \n $long = ip2long($ipAddress);\n \n return (ip2long($first) <= $long\n && $long <= ip2long($last));\n }", "public function checkSecondaryLists($ip_address)\n {\n foreach ($this->all() as $range) {\n if ($this->ipAddress()->hostToIp($range->ip_address) == $ip_address || $this->ipAddress()->validRange($ip_address, $range)) {\n return $range;\n }\n }\n\n return false;\n }", "public function get_networks()\n {\n }", "function access_control_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//get the access control allowed nodes\n\t\t$sql = \"select access_control_node_uuid, access_control_uuid, node_cidr, node_description \";\n\t\t$sql .= \"from v_access_control_nodes \";\n\t\t$sql .= \"where node_type = 'allow' \";\n\t\t$sql .= \"and length(node_cidr) > 0 \";\n\t\t$parameters = null;\n\t\t$database = new database;\n\t\t$allowed_nodes = $database->select($sql, $parameters, 'all');\n\t\tunset($database);\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif (is_array($allowed_nodes)) {\n\t\t\tforeach($allowed_nodes as $row) {\n\t\t\t\tif (check_cidr($row['node_cidr'], $ip_address)) {\n\t\t\t\t\t//debug info\n\t\t\t\t\t//if ($debug) {\n\t\t\t\t\t//\tprint_r($row);\n\t\t\t\t\t//\techo $ip_address.\"\\n\";\n\t\t\t\t\t//}\n\n\t\t\t\t\t//set the allowed to true\n\t\t\t\t\t$allowed = true;\n\n\t\t\t\t\t//exit the loop\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "function validIP($ip){\r\n if(preg_match(\"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}^\", $ip))\r\n return true;\r\n else\r\n return false;\r\n}", "public function get_networks( $user_id, $type, $start, $limit, $key = NULL ) {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(array(\n 'user_id' => $user_id,\n 'type' => $type\n ));\n \n // If $key exists means will displayed ad accounts by search\n if ( $key ) {\n \n // This method allows to escape special characters for LIKE conditions\n $key = $this->db->escape_like_str($key);\n \n // Gets ad accounts which contains the $key\n $this->db->like('user_name', $key);\n \n }\n \n $this->db->order_by('network_id', 'desc');\n \n // Verify if $limit is not null\n if ( $limit ) {\n $this->db->limit($limit, $start);\n }\n \n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n \n // Verify if $limit is not null\n if ( $limit ) {\n \n // Get results\n $results = $query->result();\n\n return $results;\n \n } else {\n return $query->num_rows();\n }\n \n } else {\n \n return false;\n \n }\n \n }", "public function testInRange()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.0.44', '127.0.0.0/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.250.44', '127.0.250.250/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.1.44', '127.0.0.0/24');\n $this->assertEquals(false, $t);\n\n // Single Ip\n $t = $ipComponent->inRange('127.0.0.1', '127.0.0.1');\n $this->assertEquals(true, $t);\n\n // Test 2. Check IP is if in C class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.33.33', '127.0.0.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.33.33', '127.0.250.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.1.33.33', '127.0.0.0/16');\n $this->assertEquals(false, $t);\n\n // Test 3. Check IP is if in B class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.33.250.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.33.33.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('128.33.250.33', '127.0.0.0/8');\n $this->assertEquals(false, $t);\n\n // Test 4. Check IPv6\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::/32');\n $this->assertEquals(true, $t);\n\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::0/32');\n $this->assertEquals(false, $t);\n\n // Test 5. Check Invalid IP\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.333.33', '127.0.250.0/16');\n $this->assertEquals(false, $t);\n }", "public function byIp($ipAddress)\n {\n $this->whereClause .= ' AND (ip LIKE ? OR forwardedip LIKE ?)';\n $this->parameterList[] = $ipAddress;\n $this->parameterList[] = '%' . trim($ipAddress, '%') . '%';\n\n return $this;\n }", "function withRange($ip){\n\n\t\t$ipadd = explode(\".\", $ip);\n\t\t$withRange = false;\n\n\t\tfor ($i = 0; $i < sizeof($ipadd); $i++){\n\t\t\tif((strpos(($ipadd[$i]), \"-\") == true) || (strpos($ipadd[$i], \"~\") == true))\n\t\t\t\t$withRange = true; \n\t\t}\n\t\t\n\n\t\treturn $withRange;\n\n\t}", "function current_ip_in_network() {\r\n return ip_in_network(current_user_ip());\r\n}", "public function checkForAddrMatchIpv4($ip, $network)\n {\n // See also ip2long PHP online manual: Kenneth Shaw\n // coded a network matching function called net_match.\n // We use here his way of doing bit-by-bit network comparison\n\n // Start applying the discovering of the network mask\n $ip_arr = explode('/', $network);\n\n $network_long = ip2long($ip_arr[0]);\n $ip_long = ip2long($ip);\n\n if (!isset($ip_arr[1])) {\n // $network seems to be a simple ip address, instead of a network address\n $matched = ($network_long == $ip_long);\n } else {\n // $network seems to be a real network address\n $x = ip2long($ip_arr[1]);\n // Evaluate the netmask: <Network Mask> or <CIDR>\n $mask = ( long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]));\n $matched = ( ($ip_long & $mask) == ($network_long & $mask) );\n }\n\n return $matched;\n }", "function isValidIP($ip_addr){\n //first of all the format of the ip address is matched\n if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) {\n //now all the intger values are separated\n $parts=explode(\".\",$ip_addr);\n //now we need to check each part can range from 0-255\n foreach($parts as $ip_parts) {\n if(intval($ip_parts)>255 || intval($ip_parts)<0)\n return false; //if number is not within range of 0-255\n }\n return true;\n }\n else\n return false; //if format of ip address doesn't matches\n}", "public function checkForAddrMatchIpv4($ip, $network)\n {\n // See also ip2long PHP online manual: Kenneth Shaw\n // coded a network matching function called net_match.\n // We use here his way of doing bit-by-bit network comparison\n\n // Start applying the discovering of the network mask\n $ip_arr = explode('/', $network);\n\n $network_long = ip2long($ip_arr[0]);\n $ip_long = ip2long($ip);\n\n if (!isset($ip_arr[1])) {\n // $network seems to be a simple ip address, instead of a network address\n $matched = ($network_long == $ip_long);\n } else {\n // $network seems to be a real network address\n $x = ip2long($ip_arr[1]);\n // Evaluate the netmask: <Network Mask> or <CIDR>\n $mask = (long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]));\n $matched = (($ip_long & $mask) == ($network_long & $mask));\n }\n\n return $matched;\n }", "function ipValid($ip) {\n $matches = [];\n $pattern =\"/([1-9]\\.|[1-9]\\d\\.|1\\d\\d\\.|25[0-5]\\.|2[0-4][0-9]\\.)(\\.\\d|[1-9]\\d|1\\d\\d|25[0-5]|2[0-4][0-9]){3}/\";\n preg_match($pattern, $ip, $matches);\n return $matches[0];\n}", "function checkPTRZone($ip, $domain_id) {\n\tglobal $fmdb, $__FM_CONFIG;\n\n\t$octet = explode('.', $ip);\n\t$zone = \"'{$octet[2]}.{$octet[1]}.{$octet[0]}.in-addr.arpa', '{$octet[1]}.{$octet[0]}.in-addr.arpa', '{$octet[0]}.in-addr.arpa'\";\n\n\tbasicGet('fm_' . $__FM_CONFIG['fmDNS']['prefix'] . 'domains', $zone, 'domain_', 'domain_name', \"OR domain_name IN ($zone) AND domain_status!='deleted'\");\n\tif ($fmdb->num_rows) {\n\t\t$result = $fmdb->last_result;\n\t\treturn array($result[0]->domain_id, null);\n\t} else {\n\t\tbasicGetList('fm_' . $__FM_CONFIG['fmDNS']['prefix'] . 'domains', 'domain_name', 'domain_', \"AND domain_mapping='reverse' AND domain_name LIKE '%-%-%'\");\n\t\tif ($fmdb->num_rows) {\n\t\t\tfor ($i=0; $i<$fmdb->num_rows; $i++) {\n\t\t\t\t$domain_name = $fmdb->last_result[$i]->domain_name;\n\t\t\t\t$range = array();\n\t\t\t\tforeach (array_reverse(explode('.', $domain_name)) as $key => $tmp_octect) {\n\t\t\t\t\tif (in_array($key, array(0, 1))) continue;\n\t\t\t\t\t\n\t\t\t\t\tif (strpos($tmp_octect, '-') !== false) {\n\t\t\t\t\t\tlist($start, $end) = explode('-', $tmp_octect);\n\t\t\t\t\t\t$range['start'][] = $start;\n\t\t\t\t\t\t$range['end'][] = $end;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$range['start'][] = $tmp_octect;\n\t\t\t\t\t\t$range['end'][] = $tmp_octect;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$range['start'] = array_pad($range['start'], 4, 0);\n\t\t\t\t$range['end'] = array_pad($range['end'], 4, 255);\n\n\t\t\t\tif (ip2long(join('.', $range['start'])) <= ip2long($ip) && ip2long(join('.', $range['end'])) >= ip2long($ip)) {\n\t\t\t\t\treturn array($fmdb->last_result[$i]->domain_id, null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/** No match so auto create if allowed */\n\tif (getOption('auto_create_ptr_zones', $_SESSION['user']['account_id'], $_SESSION['module']) == 'yes') {\n\t\treturn autoCreatePTRZone($zone, $domain_id);\n\t}\n\treturn array(null, __('Reverse zone does not exist.'));\n}", "function get_networks( $args = array() ) {\n\t$query = new WP_Network_Query();\n\n\treturn $query->query( $args );\n}", "function is_private_ip($iptocheck) {\n\t$isprivate = false;\n\t$ip_private_list = array(\n\t\t\"10.0.0.0/8\",\n\t\t\"100.64.0.0/10\",\n\t\t\"172.16.0.0/12\",\n\t\t\"192.168.0.0/16\",\n\t);\n\tforeach ($ip_private_list as $private) {\n\t\tif (ip_in_subnet($iptocheck, $private) == true) {\n\t\t\t$isprivate = true;\n\t\t}\n\t}\n\treturn $isprivate;\n}", "function ip($ip){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT ip FROM relais_mail WHERE ip = :ip\");\n\t\t$req->execute(array(\"ip\"=>$ip));\n\n\t\t$exist = $req->rowCount();\n\t\t$req->closeCursor();\n\n\t\treturn $exist;\n\t}", "public function filter($value)\n {\n\n\n\n $ip = long2ip(hexdec($value));\n\n return $ip;\n $validate = new Zend_Validate_Ip();\n if ($validate->isValid($ip)) {\n return $ip;\n }\n return false;\n }", "function PMA_ipMaskTest($testRange, $ipToTest)\n{\n $result = true;\n\n if (preg_match('|([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)/([0-9]+)|', $testRange, $regs)) {\n // performs a mask match\n $ipl = ip2long($ipToTest);\n $rangel = ip2long($regs[1] . '.' . $regs[2] . '.' . $regs[3] . '.' . $regs[4]);\n\n $maskl = 0;\n\n for ($i = 0; $i < 31; $i++) {\n if ($i < $regs[5] - 1) {\n $maskl = $maskl + PMA_pow(2, (30 - $i));\n } // end if\n } // end for\n\n if (($maskl & $rangel) == ($maskl & $ipl)) {\n return true;\n } else {\n return false;\n }\n } else {\n // range based\n $maskocts = explode('.', $testRange);\n $ipocts = explode('.', $ipToTest);\n\n // perform a range match\n for ($i = 0; $i < 4; $i++) {\n if (preg_match('|\\[([0-9]+)\\-([0-9]+)\\]|', $maskocts[$i], $regs)) {\n if (($ipocts[$i] > $regs[2])\n || ($ipocts[$i] < $regs[1])) {\n $result = false;\n } // end if\n } else {\n if ($maskocts[$i] <> $ipocts[$i]) {\n $result = false;\n } // end if\n } // end if/else\n } //end for\n } //end if/else\n\n return $result;\n}", "function is_blocked($ip_address) {\n\t\t//define the global variables\n\t\tglobal $firewall_path, $firewall_name;\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//determine whether to return true or false\n\t\tif ($firewall_name == 'iptables') {\n\t\t\t//check to see if the address is blocked\n\t\t\t$command = $firewall_path.'/./iptables -L -n --line-numbers | grep '.$ip_address;\n\t\t\t$result = shell($command);\n\t\t\tif (strlen($result) > 3) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telseif ($firewall_name == 'pf') {\n\t\t\t//check to see if the address is blocked\n\t\t\t$command = $firewall_path.'/pfctl -t \".$filter.\" -Ts | grep '.$ip_address;\n\t\t\t$result = shell($command);\n\t\t\tif (strlen($result) > 3) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getCountryByIP($ipAddress)\n {\n // Check IP validity\n $validate = new Zend_Validate_Ip(array('allowipv6' => false));\n if (!$validate->isValid($ipAddress)) {\n return false;\n }\n\n $adapter = $this->getReadConnection();\n $numValue = ip2long($ipAddress);\n $query = $adapter->select()\n ->from($this->getMainTable(), array('range_to', 'country_id'))\n ->where('range_from <= ?', $numValue)\n ->order('range_from ' . Zend_Db_Select::SQL_DESC)\n ->limit(1);\n $row = $adapter->fetchRow($query);\n if ($row && $row['range_to'] >= $numValue) {\n return $row['country_id'];\n }\n\n return false;\n }", "public static function fromIp($ip)\n {\n if (starts_with($ip, '192.168.')) {\n return '192.168.0.0/16';\n }\n\n if (starts_with($ip, '10.')) {\n return '10.0.0.0/8';\n }\n\n if (preg_match('/^172\\.(1[6-9]|2[0-9]|3[01])\\./', $ip)) {\n return '172.16.0.0/12';\n }\n\n return 'Internet';\n }", "function domaintoip($host, $timeout = 1) {\n $query = `nslookup -timeout=$timeout -retry=1 $host`;\n if(preg_match('/\\nAddress: (.*)\\n/', $query, $matches))\n return trim($matches[1]);\n}", "function ipRange($ip){\n\n $ipArray = [];\n\n $ipadd = explode(\".\", $ip);\n\n #For loop that traverses the closely matching objects in the db\n #to check if it is composed of a range (specified with a \"-\" or a \"~\")\n for ($i = 0; $i < sizeof($ipadd); $i++){\n \tif(strpos(($ipadd[$i]), \"-\") == true){\n \t$octet = $i;\n $iprange = explode(\"-\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n \telse if(strpos(($ipadd[$i]), \"~\") == true){\n \t$octet = $i;\n $iprange = explode(\"~\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n\n }\n\n\n for($i = $min; $i <= $max; $i++){\n $ipadd[$octet] = $i;\n \n for ($j = 0; $j < sizeof($ipadd); $j++){\n\n $address = implode(\".\", $ipadd);\n }\n \n $ipArray[] = $address;\n \n }\n\n #Return the list of all IP addresses in the range\n return $ipArray;\n\n }", "public function listAddressGroupings();", "static public function ip__mask_match($ip, $cidr, $ip_type = 'v4', $xtet_count = 0)\n\t{\n\n\t\tif(is_array($cidr)){\n\t\t\tforeach($cidr as $curr_mask){\n\t\t\t\tif(self::ip__mask_match($ip, $curr_mask, $ip_type)){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($curr_mask);\n\t\t\treturn false;\n\t\t}\n\n if( ! self::ip__validate( $ip ) || ! self::cidr__validate( $cidr ) ){\n return false;\n }\n\t\t\n\t\t$xtet_base = ($ip_type == 'v4') ? 8 : 16;\n\t\t\n\t\t// Calculate mask\n\t\t$exploded = explode('/', $cidr);\n\t\t$net_ip = $exploded[0];\n\t\t$mask = $exploded[1];\n\t\t\n\t\t// Exit condition\n\t\t$xtet_end = ceil($mask / $xtet_base);\n\t\tif($xtet_count == $xtet_end)\n\t\t\treturn true;\n\t\t\n\t\t// Lenght of bits for comparsion\n\t\t$mask = $mask - $xtet_base * $xtet_count >= $xtet_base ? $xtet_base : $mask - $xtet_base * $xtet_count;\n\t\t\n\t\t// Explode by octets/hextets from IP and Net\n\t\t$net_ip_xtets = explode($ip_type == 'v4' ? '.' : ':', $net_ip);\n\t\t$ip_xtets = explode($ip_type == 'v4' ? '.' : ':', $ip);\n\t\t\n\t\t// Standartizing. Getting current octets/hextets. Adding leading zeros.\n\t\t$net_xtet = str_pad(decbin($ip_type == 'v4' ? $net_ip_xtets[$xtet_count] : @hexdec($net_ip_xtets[$xtet_count])), $xtet_base, 0, STR_PAD_LEFT);\n\t\t$ip_xtet = str_pad(decbin($ip_type == 'v4' ? $ip_xtets[$xtet_count] : @hexdec($ip_xtets[$xtet_count])), $xtet_base, 0, STR_PAD_LEFT);\n\t\t\n\t\t// Comparing bit by bit\n\t\tfor($i = 0, $result = true; $mask != 0; $mask--, $i++){\n\t\t\tif($ip_xtet[$i] != $net_xtet[$i]){\n\t\t\t\t$result = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Recursing. Moving to next octet/hextet.\n\t\tif($result)\n\t\t\t$result = self::ip__mask_match($ip, $cidr, $ip_type, $xtet_count + 1);\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "function is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\tif (count(where_is_ipaddr_configured($ipaddr, $ignore_if, $check_localip, $check_subnets, $cidrprefix))) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function getCountryFromDb($ip_address)\r\n {\r\n //Check the IP version\r\n if (filter_var($ip_address,FILTER_VALIDATE_IP)) {\r\n\r\n $dbname = \"ip2location_db1\";\r\n\r\n //Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer\r\n $ip_address = ip2long($ip_address);\r\n\r\n } elseif(filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\r\n\r\n $dbname = \"ip2location_db1_ipv6\";\r\n\r\n //Convert IP address to its corresponding 32–bit decimal number\r\n $ip_address = $this->ipAddressToIpNumber($ip_address);\r\n\r\n } else {\r\n return false;\r\n }\r\n \r\n $CI =&get_instance();\r\n\r\n $CI->db->where('ip_from <=', $ip_address);\r\n $CI->db->where('ip_to >=', $ip_address);\r\n $res = $CI->db->get($dbname);\r\n\r\n if ($res && $res->num_rows() > 0) {\r\n $row = $res->row();\r\n if ($row->country_name && $row->country_name !== '-') {\r\n $country_name = $row->country_name;\r\n $country_name = $this->checkIpResult($country_name);\r\n return $country_name;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }", "public function checkLockToIP() {}", "public function findAllSimilarAddressesForAddress($address)\n {\n $countryName = $address['country'];\n if (!empty($address['country_id'])) {\n $countryObj = new Country();\n $countryName = $countryObj->getNameById($address['lang_id'], $address['country_id']);\n\n $address['country'] = $countryName;\n }\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n if ($address['region_id']) {\n $regionName = State::getNameById($address['region_id']);\n $address['region'] = $regionName;\n }\n if(empty($address['region'])){\n $regions = $this->getSearchPostcodeModel()->identifyRegionByCity($address['city']);\n if($regions && count($regions)==1) {\n $address['region'] = array_pop($regions);\n }\n }\n\n $foundAddresses = $this->getSearchPostcodeModel()->searchSimilarAddresses($address);\n\n return $foundAddresses;\n }\n\n return false;\n }" ]
[ "0.6037175", "0.56094664", "0.5587358", "0.5546537", "0.5509736", "0.54801583", "0.5437882", "0.5405502", "0.5386704", "0.53839344", "0.536664", "0.5359493", "0.53077847", "0.5274202", "0.51569414", "0.5145615", "0.51427865", "0.5111185", "0.5110938", "0.50981545", "0.5045506", "0.50342023", "0.49828252", "0.49824995", "0.4979725", "0.4974035", "0.49689546", "0.4965489", "0.4949781", "0.49385148", "0.4930352", "0.49091047", "0.48824513", "0.48582277", "0.4841475", "0.48350343", "0.4834173", "0.48336616", "0.48111448", "0.47967607", "0.47754878", "0.47702485", "0.4766156", "0.47560576", "0.47369868", "0.47023082", "0.47020435", "0.46976727", "0.4680564", "0.46755746", "0.46693963", "0.46525908", "0.4637636", "0.46342322", "0.46279517", "0.45914516", "0.45803648", "0.45488712", "0.45456296", "0.4531395", "0.4530603", "0.45207816", "0.449219", "0.4489379", "0.44859144", "0.44610927", "0.4451415", "0.44339028", "0.4426975", "0.4424728", "0.4419951", "0.44199476", "0.4417456", "0.441154", "0.44030765", "0.43999407", "0.43978283", "0.43863738", "0.4386331", "0.43834004", "0.43713212", "0.436507", "0.4349355", "0.43454438", "0.4344594", "0.43430287", "0.43421426", "0.43393588", "0.4337556", "0.43345279", "0.43322688", "0.43258485", "0.4316536", "0.43150055", "0.43072698", "0.4304819", "0.42981046", "0.4297314", "0.42951304", "0.42927423" ]
0.63321114
0
Search networks relative to a given network
static function searchNetworks($relation, $condition, $entityID = -1, $recursive = true, $version = 0) { global $DB; if (empty($relation)) { return false; } if (empty($condition["fields"])) { $fields = 'id'; } else { $fields = $condition["fields"]; } if (!is_array($fields)) { $fields = [$fields]; } $startIndex = (($version == 4) ? 3 : 1); $addressDB = ['address_0', 'address_1', 'address_2', 'address_3']; $netmaskDB = ['netmask_0', 'netmask_1', 'netmask_2', 'netmask_3']; $WHERE = []; if (isset($condition["address"]) && isset($condition["netmask"])) { $addressPa = new IPAddress($condition["address"]); // Check version equality ... if ($version != $addressPa->getVersion()) { if ($version != 0) { return false; } $version = $addressPa->getVersion(); } $netmaskPa = new IPNetmask($condition["netmask"], $version); // Get the array of the adresses $addressPa = $addressPa->getBinary(); $netmaskPa = $netmaskPa->getBinary(); // Check the binary is valid if (!is_array($addressPa) || (count($addressPa) != 4)) { return false; } if (!is_array($netmaskPa) || (count($netmaskPa) != 4)) { return false; } $startIndex = (($version == 4) ? 3 : 0); if ($relation == "equals") { for ($i = $startIndex; $i < 4; ++$i) { $WHERE = [ new \QueryExpression("(".$DB->quoteName($addressDB[$i]) . " & " . $DB->quoteValue($netmaskPa[$i]) . ") = (".$DB->quoteValue($addressPa[$i])." & ".$DB->quoteValue($netmaskPa[$i]).")"), $netmaskDB[$i] => $netmaskPa[$i] ]; } } else { for ($i = $startIndex; $i < 4; ++$i) { if ($relation == "is contained by") { $globalNetmask = $DB->quoteValue($netmaskPa[$i]); } else { $globalNetmask = $DB->quoteName($netmaskDB[$i]); } $WHERE = [ new \QueryExpression("(".$DB->quoteName($addressDB[$i])." & $globalNetmask) = (".$DB->quoteValue($addressPa[$i])." & $globalNetmask)"), new \QueryExpression("(".$DB->quoteValue($netmaskPa[$i])." & ".$DB->quoteName($netmaskDB[$i]).")=$globalNetmask") ]; } } } if ($entityID < 0) { $entityID = $_SESSION['glpiactive_entity']; } $entitiesID = []; switch ($relation) { case "is contained by" : $ORDER_ORIENTATION = 'ASC'; if ($recursive) { $entitiesID = getSonsOf('glpi_entities', $entityID); } break; case "contains" : $ORDER_ORIENTATION = 'DESC'; if ($recursive) { $entitiesID = getAncestorsOf('glpi_entities', $entityID); } break; case "equals" : $ORDER_ORIENTATION = ''; if ($recursive) { $entitiesID = getSonsAndAncestorsOf('glpi_entities', $entityID); } break; } $entitiesID[] = $entityID; $WHERE['entities_id'] = $entitiesID; $WHERE['version'] = $version; if (!empty($condition["exclude IDs"])) { if (is_array($condition["exclude IDs"])) { if (count($condition["exclude IDs"]) > 1) { $WHERE['NOT'] = ['id' => $condition['exclude IDs']]; } else { $WHERE['id'] = ['<>', $condition['exclude IDs'][0]]; } } else { $WHERE['id'] = ['<>', $condition['exclude IDs']]; } } $ORDER = []; // By ordering on the netmask, we ensure that the first element is the nearest one (ie: // the last should be 0.0.0.0/0.0.0.0 of x.y.z.a/255.255.255.255 regarding the interested // element) for ($i = $startIndex; $i < 4; ++$i) { $ORDER[] = new \QueryExpression("BIT_COUNT(".$DB->quoteName($netmaskDB[$i]).") $ORDER_ORIENTATION"); } if (!empty($condition["where"])) { $WHERE .= " AND " . $condition["where"]; } $iterator = $DB->request([ 'SELECT' => $fields, 'FROM' => self::getTable(), 'WHERE' => $WHERE, 'ORDER' => $ORDER ]); $returnValues = []; while ($data = $iterator->next()) { if (count($fields) > 1) { $returnValue = []; foreach ($fields as $field) { $returnValue[$field] = $data[$field]; } } else { $returnValue = $data[$fields[0]]; } $returnValues[] = $returnValue; } return $returnValues; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inNetwork($networks = [], $ip = \"\") {\n $network_group = [];\n $netmask_group = [];\n\n foreach($networks as $network) {\n list($subnet, $cidr) = explode('/', $network);\n $netmask = (1 << 32) - (1 << (32 - $cidr));\n $network_group[ip2long($subnet)] = $network;\n\n if(!in_array($netmask, $netmask_group)) $netmask_group[] = $netmask;\n }\n\n // sort netmask in desc order - important to work properly\n rsort($netmask_group);\n\n foreach($netmask_group as $netmask) {\n // get network from ip address and netmask\n $network = ip2long($ip) & $netmask;\n\n if(array_key_exists($network, $network_group)) return $network_group[$network];\n }\n\n }", "function findNetwork($id, $networks) {\n\tforeach ($networks as $network) {\n\t\tif($id == $network->id)\n\t\t\treturn $network;\n\t}\n}", "function get_networks($args = array())\n {\n }", "public function get_networks()\n {\n }", "function get_networks( $args = array() ) {\n\t$query = new WP_Network_Query();\n\n\treturn $query->query( $args );\n}", "function get_entity_ids_ip_by_network($entity_type, $network, $add_where = '')\n{\n\n // Recursive query for array of networks\n if (is_array($network))\n {\n $ids = array();\n foreach ($network as $entry)\n {\n if ($entry_ids = get_entity_ids_ip_by_network($entity_type, $entry, $add_where))\n {\n $ids = array_merge($ids, $entry_ids);\n }\n }\n\n return $ids;\n }\n\n // Parse for valid network string\n $network_array = parse_network($network);\n //print_vars($network_array);\n if (!$network_array)\n {\n // Incorrect network/address string passed\n return FALSE;\n }\n\n $query = 'SELECT ';\n $join = '';\n $where = ' WHERE 1 ';\n switch ($entity_type)\n {\n case 'ipv4':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv4';\n $query .= ' `ipv4_address_id`';\n break;\n case 'ipv6':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv6';\n $query .= ' `ipv6_address_id`';\n break;\n case 'ip':\n $query .= ($network_array['ip_version'] == 4) ? ' `ipv4_address_id`' : ' `ipv6_address_id`';\n break;\n\n case 'device':\n case 'devices':\n $query .= ' DISTINCT `device_id`';\n break;\n\n case 'port':\n case 'ports':\n $query .= ' DISTINCT `port_id`';\n break;\n }\n\n switch ($network_array['ip_type'])\n {\n case 'ipv4':\n $query .= ' FROM `ipv4_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv4_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv4_binary` >= ? AND `ipv4_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= generate_query_values($network_array['address'], 'ipv4_address', $network_array['query_type']);\n }\n break;\n case 'ipv6':\n $query .= ' FROM `ipv6_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv6_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv6_binary` >= ? AND `ipv6_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= ' AND (' . generate_query_values($network_array['address'], 'ipv6_address', $network_array['query_type'], FALSE) .\n ' OR ' . generate_query_values($network_array['address'], 'ipv6_compressed', $network_array['query_type'], FALSE) . ')';\n }\n break;\n }\n\n if (FALSE)\n {\n // Ignore disabled/deleted/ignored\n $where .= ' AND `device_id` NOT IN (SELECT `device_id` FROM `devices` WHERE `disabled` = \"1\" OR `ignore` = \"1\")';\n $where .= ' AND `port_id` NOT IN (SELECT `port_id` FROM `ports` WHERE `deleted` = \"1\" OR `ignore` = \"1\")';\n } else {\n // Always ignore deleted ports\n $join = ' LEFT JOIN `ports` USING (`device_id`, `port_id`) ';\n // IS NULL allow to search addresses without associated port\n $where .= ' AND (`ports`.`deleted` != \"1\" OR `ports`.`deleted` IS NULL)';\n }\n $query .= $join;\n $where .= $add_where; // Additional query, ie limit by device_id or port_id\n\n $ids = dbFetchColumn($query . $where, $param);\n //$ids = dbFetchColumn($query . $where, $param);\n //print_vars($ids);\n\n return $ids;\n}", "function search_own_router($all_nodes, $own_nodes)\n{\n # Deklariere Array\n $own_router_index = array();\n $i = 0;\n foreach ($all_nodes as $node) {\n $node_id = $node['node_id'];\n foreach ($own_nodes as $own_id) {\n if ($own_id == $node_id) {\n array_push($own_router_index, $i);\n }\n }\n $i = $i + 1;\n }\n return $own_router_index;\n}", "function listNetworkAdd($searchadd){\n #sends the deconstructed IP to the networkAdd function\n\n\t\t$iplist = explode(\".\", $searchadd);\n\n\t\t$networkList = [];\n\n\t\tfor($i = 8; $i < 33; $i++){\n\t\t\t$ipvar = explode(\".\", $searchadd);\n\t\t\t$temp = networkAdd($ipvar, $i);\n\t\t\t$networkList[] = $temp;\n\t\t}\n\n\t\t#echo\"All network addresses</br>\";\n\n\t\treturn $networkList;\n\t}", "function findNet($ip,$sm) {\n\n $res = \"\";\n\n // divido gli ottetti\n $exip = explode('.',$ip);\n $exsm = explode('.',$sm);\n\n for($i=0; $i<4; $i++) {\n\n $subip=$exip[$i]; // ottetto del IP\n $subsm=$exsm[$i]; // ottetto della SM\n\n for($k=0; $k<8; $k++) {\n \n if($subip[$k] & $subsm[$k]) {\n $res.=\"1\";\n }\n else {\n $res.=\"0\";\n }\n }\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $res.=\".\";\n }\n \n }\n\n return $res;\n}", "public function networks()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/networks');\n }", "function Search($nodes, $rq) {\n $nds = array();\n Find($nodes, $nds, $rq->fid, -1, $rq->fnd);\n $rlt = array();\n $a = array_keys($nds);\n foreach ($nds as $id => $nde) {\n if (!$nde[0]) {\n for ($i = 0; $i < count($a); $i++) {\n if ($nds[$a[$i]][1] == $id && $nds[$a[$i]][0]) {\n $nde[0] = true;\n }\n }\n }\n if ($nde[0]) {\n $rlt[] = $rq->pfx . $id;\n }\n }\n return $rlt;\n}", "public function get() {\n\n\t\t$args = func_get_args();\n\n\t\tif( empty( $args ) ) {\n\n\t\t\t$networks = $this->_networks;\n\n\t\t} else {\n\t\t\t$networks = array();\n\n\t\t\tforeach ( $args as $network ) {\n\n\t\t\t\tif( in_array( $network, $this->_networks) ) {\n\t\t\t\t\t$networks[] = $network;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$urls = array();\n\n\t\tforeach ( $networks as $network ) {\n\t\t\t$url = call_user_func( array( $this, str_replace( '-', '_', $network ) ) );\n\n\t\t\tif( $url ) {\n\t\t\t\t$urls[ $network ] = $url;\n\t\t\t}\n\t\t}\n\n\t\treturn $urls;\n\t}", "protected function get_network_ids()\n {\n }", "public function get_networks( $user_id, $type, $start, $limit, $key = NULL ) {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(array(\n 'user_id' => $user_id,\n 'type' => $type\n ));\n \n // If $key exists means will displayed ad accounts by search\n if ( $key ) {\n \n // This method allows to escape special characters for LIKE conditions\n $key = $this->db->escape_like_str($key);\n \n // Gets ad accounts which contains the $key\n $this->db->like('user_name', $key);\n \n }\n \n $this->db->order_by('network_id', 'desc');\n \n // Verify if $limit is not null\n if ( $limit ) {\n $this->db->limit($limit, $start);\n }\n \n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n \n // Verify if $limit is not null\n if ( $limit ) {\n \n // Get results\n $results = $query->result();\n\n return $results;\n \n } else {\n return $query->num_rows();\n }\n \n } else {\n \n return false;\n \n }\n \n }", "function multipleLayerNeurons($start) {\n\t\tfor($i = 0; $i < 10; $i++) \n\t\t\t$this->layerNeurons( $start + $i , 0 );\n\t}", "public function search_accounts($network, $search = null) {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,0);\n \n $limit = 10;\n \n $page = 0;\n \n $search = str_replace('-', '/', $search);\n \n $search = $this->security->xss_clean(base64_decode($search));\n \n $total = $this->networks->count_all_accounts($this->user_id, $network, $search);\n \n $get_accounts = ($search) ? $this->networks->get_accounts($this->user_id, $network, 0, $search) : $this->networks->get_accounts($this->user_id, $network);\n \n if ( $get_accounts ) {\n \n $data = ['total' => $total, 'accounts' => $get_accounts];\n echo json_encode($data);\n \n }\n \n }", "public function search($params, $unuse=false)\n {\n $con_str = \"\";\n if($unuse) {\n $q = DcmdServicePoolNode::find()->asArray()->all();\n $con_str = \" ip not in(0\";\n foreach($q as $item) $con_str .=\",'\".$item['ip'].\"'\";\n $con_str .=\")\";\n \n }\n if(Yii::$app->user->getIdentity()->sa != 1)\n {\n $gid = \"select gid from dcmd_user_group where uid =\".Yii::$app->user->getId();\n $gid = \"select gid from dcmd_user_group where uid =\".Yii::$app->user->getId();\n// $sql = \"select ngroup_id from dcmd_node_group where ngroup_id in(select ngroup_id from dcmd_app_node_group where app_id in (select app_id from dcmd_app where sa_gid in (\".$gid.\") or svr_gid in (\".$gid.\"))) order by ngroup_name\";\n $sql = \"select ngroup_id from dcmd_node_group where gid in(select gid from dcmd_user_group where uid =\".Yii::$app->user->getId().\") order by ngroup_name\";\n $ngroup = DcmdNodeGroup::findBySql($sql)->asArray()->all();\n if(!$unuse) {\n $con_str = \"dcmd_node.ngroup_id in(0\";\n foreach($ngroup as $item) $con_str .=\",'\".$item['ngroup_id'].\"'\";\n $con_str .=\")\";\n }\n }\n $query = DcmdNode::find()->where($con_str)->orderBy('ip');\n $query->joinWith(['dcmd_node_group']);\n $dataProvider = new ActiveDataProvider([\n /* 'ngroup_name' => [\n 'asc' => ['dcmd_node_group.ngroup_name' => SORT_ASC],\n 'desc' => ['dcmd_node_group.ngroup_name' => SORT_DESC],\n 'label' => 'Ngroup Name'\n ],*/\n 'query' => $query,\n 'pagination' => [ 'pagesize' => '20',]\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n $query->andFilterWhere([\n 'nid' => $this->nid,\n 'dcmd_node.ngroup_id' => $this->ngroup_id,\n 'utime' => $this->utime,\n 'ctime' => $this->ctime,\n 'opr_uid' => $this->opr_uid,\n ]);\n\n $query->andFilterWhere(['like', 'ip', $this->ip])\n ->andFilterWhere(['like', 'host', $this->host])\n ->andFilterWhere(['like', 'sid', $this->sid])\n ->andFilterWhere(['like', 'did', $this->did])\n ->andFilterWhere(['like', 'bend_ip', $this->bend_ip])\n ->andFilterWhere(['like', 'dcmd_node_group.ngroup_name', $this->ngroup_name])\n ->andFilterWhere(['like', 'public_ip', $this->public_ip]);\n \n return $dataProvider;\n }", "function update_network_cache($networks)\n {\n }", "private function layeredSearch(): void\n {\n $this->setLimitAndOffset();\n $needles = $this->getNeedlesForPage();\n foreach ($this->layers as $Layer) {\n $Layer->quick_search = $this->config->quick_search;\n $Layer->resetNeedles();\n $Layer->searchAllNeedles($needles, $this->search_key);\n $needles = $Layer->getNeedles();\n }\n $this->saveNeedlesForPage($needles);\n }", "public function get_most_trusted_routes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $iface_manager = new Iface_Manager();\n\n $local_networks = $iface_manager->get_most_trusted_networks();\n $extra_networks = $this->get_extra_lans();\n\n // Harmonize format for /network (/24 versus /255.255.255.0)\n $raw_networks = array_merge($local_networks, $extra_networks);\n $networks = array();\n\n foreach ($raw_networks as $network) {\n list($ip, $netmask_or_prefix) = preg_split('/\\//', $network);\n\n if (Network_Utils::is_valid_netmask($netmask_or_prefix))\n $prefix = Network_Utils::get_prefix($netmask_or_prefix);\n else\n $prefix = $netmask_or_prefix;\n\n $networks[] = \"$ip/$prefix\";\n }\n\n return $networks;\n }", "public function searchGrupo($grupo/*Request $request*/){\n\n \n $em = $this->getDoctrine()->getManager();\n $query2= $em->getRepository('SytemSGBundle:ServidorLdap')->findAll();\n if($query2/*file_exists($file3*/){\n // $row1=file($file3); \n foreach ($query2 as $key => $value) {\n $ipservidor=$value->getIpLdap();//trim($row1[0]);\n $complemento=$value->getComplemento();//trim($row1[1]);\n $login=$value->getUsername();//trim($row1[2]);\n $senha=$value->getPassword();//trim($row1[3]);\n } \n $ldapconn = @ldap_connect($ipservidor/*\"200.239.152.140\"*/);\n if($ldapconn){\n $bind = @ldap_bind($ldapconn, $login,$senha/*\"cn=arp,dc=ufop,dc=br\",\"th0123\"*/); \n if($bind){\n $filter2 = \"(gidNumber=\".$grupo.\")\";\n $gindnumber=$grupo;\n $justthese2 = array(\"cn\"); //the attributes to pull, which is much more efficient than pulling all attributes if you don't do this\n $sr2 = ldap_search($ldapconn,\"ou=Grupos,\".$complemento/*\"dc=ufop,dc=br\"*/, $filter2, $justthese2);\n $entry = ldap_get_entries($ldapconn, $sr2); \n if($entry['count']>0){\n \n $namegrupo=$entry[0]['cn'][0];\n \n return TRUE; \n }\n else{\n return FALSE; \n }\n }\n @ldap_close($ldapconn);\n }else{\n return FALSE; \n }\n }else{\n return FALSE; \n }\n \n }", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public function findOnline() {}", "function search() {}", "private function updateNetworks()\n {\n foreach ($this->networks as $net_key => $net_value) {\n $url = $net_value['template'];\n\n foreach ($this->args as $arg_key => $arg_value) {\n $url = str_replace('{' . $arg_key . '}', $arg_value, $url);\n }\n\n $this->networks[$net_key]['url'] = $url;\n }\n }", "function layerNeurons($start, $layer) {\n\t\t$width = $layer - $start;\n\t\tif(!$layer) $layer = $width;\n\n\t\t//Connect each layer to next layer\n\t\tfor($i = $start; $i < $width + $start; $i++) for($j = 0; $j < $width; $j++) {\n\t\t\t$this->nodes[$i]->addNode($width + $start + $j, $this->synapse_weight);\n\t\t\t$this->nodes[$width + $start + $j]->addNode($i, $this->synapse_weight);\n\t\t}\n\t}", "public function search($params)\n {\n $query = NetworkElement::find();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n $query->orFilterWhere([\n 'log_date' => $this->search,\n ]);\n\n $query->orFilterWhere(['like', 'network_element_id', $this->search])\n ->orFilterWhere(['like', 'gt_address', $this->search])\n ->orFilterWhere(['like', 'location', $this->search])\n ->orFilterWhere(['like', 'provinsi', $this->search])\n ->orFilterWhere(['like', 'vendor', $this->search])\n ->orFilterWhere(['like', 'gtt', $this->search])\n ->orFilterWhere(['like', 'status', $this->search]);\n // ->orFilterWhere(['like', 'remark', $this->search]);\n\n return $dataProvider;\n }", "public static function get_net_where_intersect($nets = array()) \n {\n if (count($nets) > 0) \n {\n // Merge\n return (self::get_net_where()) ? self::get_net_where().\" AND asset_id IN (UNHEX('\".implode(\"'), UNHEX('\",$nets).\"'))\" : \"UNHEX('\".implode(\"'), UNHEX('\",$nets).\"')\";\n } \n else \n {\n // Only allowed\n return self::get_net_where();\n }\n }", "private function _network()\n {\n if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {\n $lines = preg_split(\"/\\n/\", $netstat, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($lines as $line) {\n $ar_buf = preg_split(\"/\\s+/\", $line);\n if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) {\n $dev = new NetDevice();\n $dev->setName($ar_buf[0]);\n $dev->setRxBytes($ar_buf[4]);\n $dev->setTxBytes($ar_buf[6]);\n $dev->setErrors($ar_buf[5] + $ar_buf[7]);\n //$dev->setDrops($ar_buf[8]);\n $this->sys->setNetDevices($dev);\n }\n }\n }\n }", "function update_network_cache( $networks ) {\n\tforeach ( (array) $networks as $network ) {\n\t\twp_cache_add( $network->id, $network, 'networks' );\n\t}\n}", "function catch_information($nodes, $index_own_nodes, $status)\n{\n $own_nodes_list = array();\n foreach ($index_own_nodes as $index) {\n $push = false;\n $node = $nodes[$index];\n $lastseen = format_date($node['lastseen']); # WICHTIG\n\n $hostname = $node['hostname']; # WICHTIG\n $node_id = $node['node_id']; # WICHTIG\n $addresses = $node['addresses'];\n\n $base = $node['firmware']['base'];\n # lösche folgende substrings in base\n $hw = array(\"gluon-\",);\n $base = str_replace($hw, '', $base);\n $release = $node['firmware']['release'];\n\n $model = $node['model'];\n # lösche folgende substrings in model\n $hw = array(\"TP-Link\", \"TP-LINK\", \"ALFA NETWORK\", \"N/ND\");\n $model = str_replace($hw, '', $model);\n\n $gateway = $node['gateway'];\n $gateway_nexthop = $node['gateway_nexthop'];\n # Uplink (Workaround, da Uplink direkt nicht mehr in der JSON steht)\n $uplink = ($gateway == $gateway_nexthop); # WICHTIG\n\n # Richtige IP wählen\n if (startsWith($addresses['0'], \"fe80:\")) {\n $ipv6 = $addresses['1']; # WICHTIG\n } else {\n $ipv6 = $addresses['0']; # WICHTIG\n }\n # Flags\n $online = $node['is_online']; # WICHTIG\n # $uplink = $flags['uplink']; # WICHTIG (kaputt)\n\n # Speichere Werter zur Übergabe\n $inf_node = array(\n \"lastseen\" => $lastseen,\n \"hostname\" => $hostname,\n \"node_id\" => $node_id,\n \"ipv6\" => $ipv6,\n \"online\" => $online,\n \"uplink\" => $uplink,\n \"release\" => $release,\n \"base\" => $base,\n \"model\" => $model,);\n\n # Hier Entscheide, ob offline, uplink oder online\n if ($status == \"offline\") {\n if (!$online) {\n $push = true;\n }\n } else {\n if ($status == \"uplink\") {\n if ($uplink and $online) {\n $push = true;\n }\n } else {\n if ($status == \"online\") {\n if ($online and !$uplink) {\n $push = true;\n }\n }\n }\n }\n if ($push) {\n array_push($own_nodes_list, $inf_node);\n }\n }\n return $own_nodes_list;\n}", "function fann_get_network_type($ann)\n{\n}", "public function getNetworks() {\n\n //GET NETWORK TABLE\n $tableNetwork = Engine_Api::_()->getDbtable('networks', 'network');\n\n //MAKE QUERY\n $select = $tableNetwork->select()\n ->from($tableNetwork->info('name'), array('network_id', 'title'))\n ->order('title');\n $result = $tableNetwork->fetchAll($select);\n\n $everyone = Zend_Registry::get('Zend_Translate')->_('Everyone');\n\n //MAKE DATA ARRAY\n $networksOptions = array('0' => $everyone);\n foreach ($result as $value) {\n $networksOptions[$value->network_id] = $value->title;\n }\n\n //RETURN\n return $networksOptions;\n }", "public function hasNetworks() {\n return $this->_has(5);\n }", "public function hasNetworks() {\n return $this->_has(1);\n }", "public function get_locations($nodes);", "public function intersects(self $network)\n {\n return $this->comparator->intersects($network);\n }", "function findBroad($sn,$net) {\n\n $ob = \"\";\n $ip = \"\";\n\n $oct = explode('.',$net);\n\n foreach($oct as $o) {\n \n for($i=0; $i < strlen($o); $i++) {\n\n if($sn > 0) {\n $ob[$i]= $o[$i]; // ottetto broadcast in copia\n $sn--;\n }\n else {\n $ob[$i]= \"1\";\n }\n }\n $ip.= $ob.\".\";\n }\n\n $ip = rtrim($ip, \".\");\n\n return $ip;\n\n}", "function computeNetworkRange(&$start, &$end = null, $excludeBroadcastAndNetwork = '') {\n\n if (!is_bool($excludeBroadcastAndNetwork)) {\n if (isset($this->fields['addressable'])) {\n $excludeBroadcastAndNetwork = ($this->fields['addressable'] == 1);\n } else {\n $excludeBroadcastAndNetwork = false;\n }\n }\n\n self::computeNetworkRangeFromAdressAndNetmask($this->getAddress(), $this->getNetmask(),\n $start, $end, $excludeBroadcastAndNetwork);\n }", "function wp_get_network($network)\n {\n }", "public function getSearchClass()\n {\n return 'tx_t3socials_search_Network';\n }", "function is_main_network($network_id = \\null)\n {\n }", "public function search();", "public function search();", "function find_closest_stations ($lat, $lng, $stations, $num, $recalc = FALSE) {\r\n\tstatic $R = 6371;\r\n\tstatic $distances = array();\r\n\t$closest = -1;\r\n\treset($distances);\r\n\t//if (count(array_diff($stations_cache,$stations)) > 0) {\r\n\t//\t$stations_cache = $stations;\r\n\t// \t$recalc = TRUE;\r\n\t//}\r\n\tif (count($distances) == 0 || $recalc) {\r\n\t\t$station_ids = array_keys( $stations );\r\n\t\tfor ( $i = 0 ; $i < count( $station_ids ) ; $i++ ) {\r\n\t\t\tif ( !isset( $stations[$station_ids[$i]] ) ) { continue; }\r\n\t\t\t// check for a duplicate station using an alternate ID, e.g. 999999XXXXX or XXXXXX99999\r\n\t\t\tif ( isset( $stations[$station_ids[$i]] ) && $stations[$station_ids[$i]]['usafid'] != '999999' && $stations[$station_ids[$i]]['wban'] != '99999' ) {\r\n\t\t\t\t$i_usafid_only = $stations[$station_ids[$i]]['usafid'] . '99999';\r\n\t\t\t\tif ( isset( $stations[$i_usafid_only] ) ) {\r\n\t\t\t\t\tunset( $stations[$i_usafid_only] );\r\n\t\t\t\t\tif ( isset( $distances[$i_usafid_only] ) ) {\r\n\t\t\t\t\t\tunset( $distances[$i_usafid_only] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$i_wban_only = '999999' . $stations[$station_ids[$i]]['wban'];\r\n\t\t\t\tif ( isset( $stations[$i_wban_only] ) ) {\r\n\t\t\t\t\tunset( $stations[$i_wban_only] );\r\n\t\t\t\t\tif ( isset( $distances[$i_wban_only] ) ) {\r\n\t\t\t\t\t\tunset( $distances[$i_wban_only] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$mlat = $stations[$station_ids[$i]]['lat'];\r\n\t\t\t$mlng = $stations[$station_ids[$i]]['lng'];\r\n\t\t\t$dLat = rad($mlat - $lat);\r\n\t\t\t$dLng = rad($mlng - $lng);\r\n\t\t\t$a = sin($dLat/2) * sin($dLat/2) +\r\n\t\t\t\tcos(rad($lat)) * cos(rad($lat)) * sin($dLng/2) * sin($dLng/2);\r\n\t\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\r\n\t\t\t$d = $R * $c;\r\n\t\t\t/* If the distance calculation results in is_nan($d), do not add it to the distances array. \r\n\t\t\tThese values will always be pushed to the top of the array, resulting in a poor \r\n\t\t\t\"closest station\" calculation. */\r\n\t\t\tif (!is_nan($d)) {\r\n\t\t\t\t$distances[$station_ids[$i]] = $d;\r\n\t\t\t}\r\n\t\t}\r\n\t\tasort($distances);\r\n\t} else {\r\n\t\tunset($distances[key($distances)]);\r\n\t}\r\n\treturn array_slice($distances,0,$num,TRUE);\r\n}", "public function hasNetworks() {\n return $this->_has(4);\n }", "public function search($fields, $options)\n {\n $searcher = SearchBase::getInstance('tx_t3socials_search_Network');\n\n return $searcher->search($fields, $options);\n }", "static function searchNetworksContainingIP($IP, $entityID = -1, $recursive = true,\n $fields = \"\", $where = \"\") {\n\n return self::searchNetworks('contains', ['address' => $IP,\n 'netmask' => [0xffffffff, 0xffffffff,\n 0xffffffff, 0xffffffff],\n 'fields' => $fields,\n 'where' => $where],\n $entityID, $recursive);\n }", "function common_get_network_config($net){\r\n\t$file = '/etc/network/interfaces';\r\n\t$curr = file_get_contents($file);\r\n\tif($net == 'ip'){\t\t\r\n\t\t$curr_ip = explode('#ip',$curr);\r\n\t\t$curr_ip = $curr_ip[1];\r\n\t\t$curr_ip = explode(' ', $curr_ip);\r\n\t\t$curr_ip = trim($curr_ip[1]);\r\n\t\t\r\n\t\treturn $curr_ip;\r\n\t}\r\n\telse if($net == 'subnet'){\r\n\t\t$curr_subnet = explode('#subnet',$curr);\r\n\t\t$curr_subnet = $curr_subnet[1];\r\n\t\t$curr_subnet= explode(' ', $curr_subnet);\r\n\t\t$curr_subnet = trim($curr_subnet[1]);\r\n\t\t\r\n\t\treturn $curr_subnet;\r\n\t}\r\n\telse if($net == 'gw'){\r\n\t\t$curr_gw = explode('#gw',$curr);\r\n\t\t$curr_gw = $curr_gw[1];\r\n\t\t$curr_gw= explode(' ', $curr_gw);\r\n\t\t$curr_gw = trim($curr_gw[1]);\r\n\t\t\r\n\t\treturn $curr_gw;\r\n\t}\r\n\telse if($net == 'dns'){\r\n\t\t$curr_dns = explode('#dns',$curr);\r\n\t\t$curr_dns = $curr_dns[1];\r\n\t\t$curr_dns= explode(' ', $curr_dns);\r\n\t\t$curr_dns = trim($curr_dns[1]);\r\n\t\t\r\n\t\treturn $curr_dns;\r\n\t}\t\r\n\t\r\n\treturn null;\r\n}", "public function searchGateways(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Searched for a Specific Gateway';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n if (!$request->q) {\n abort(400, \"Invalid search query\");\n }\n\n return $this->createGetResponse($request,\n Gateway::where('GATEWAY_NAME', 'like', '%' . $request->q . '%'));\n }", "public function findGroups() {\n\t\t\n\t}", "function fetch_full_network($dbc)\t{\n\t//fetch nodes\n\t//$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path` FROM `artist_profile` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n//$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path`, `artist_living_status`, `artist_dob`, `artist_dod`,`artist_genre`,`artist_ethnicity`,`artist_gender`,`artist_residence_country` FROM `artist_profile` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path`, `artist_living_status`, `artist_dob`, `artist_dod`,`artist_genre`,`artist_ethnicity`,`artist_gender`,`artist_residence_country` FROM `artist_profile` WHERE `artist_profile_id`\";\n\t$artist_id_name_result = mysqli_query($dbc,$artist_id_name_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_id_name_result);\n\tif($count>0){\n\t\t$nodes = Array();\n\t\t$node_border_array = Array();\n\t\twhile($row = mysqli_fetch_array($artist_id_name_result)){\n\t\t\t$image = $row['artist_photo_path'];\n\t\t\tif($row['artist_photo_path'] == \"\") {\n\t\t\t\t$image = \"upload/photo_upload_data/missing_image.jpg\";\n\t\t\t}\n\t\t\t$nodes[] = array('id' => $row['artist_profile_id'], 'title' => $row['artist_first_name'].\" \".$row['artist_last_name'], 'label' => $row['artist_first_name'].\" \".$row['artist_last_name'], 'shape'=>\"circularImage\", 'image' => $image, 'size' => 20,'isLiving' => $row['artist_living_status'],'dob' => $row['artist_dob'],'dod' => $row['artist_dod'],'genre' => $row['artist_genre'],'ethnicity' => $row['artist_ethnicity'],'gender' => $row['artist_gender'],'country' => $row['artist_residence_country']);\n\t\t\tif($row['is_user_artist'] == \"artist\") {\n\t\t\t\t$node_border_array[] = array('id' => $row['artist_profile_id'], 'border_color' => '#da0067');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$node_border_array[] = array('id' => $row['artist_profile_id'], 'border_color' => '#025457');\n\t\t\t}\n\t\t}\n\t}\n\t//fetch edges\n\t$artist_id_relation_query = \"SELECT `artist_profile_id_1`, `artist_profile_id_2`, `artist_relation`, `duration_years`, `duration_months` FROM `artist_relation`\";\n\t$artist_id_relation_result = mysqli_query($dbc,$artist_id_relation_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_id_relation_result);\n\tif($count>0){\n\t\t$edges = Array();\n\t\t$edge_id = 0;\n\t\twhile($row = mysqli_fetch_array($artist_id_relation_result)){\n\t\t\tif($row['artist_relation'] == \"Influenced By\"){\n $duration = 1;\n $edges[] = array('id' => $edge_id, 'from' => $row['artist_profile_id_1'], 'to' => $row['artist_profile_id_2'], 'width' => $duration, 'label' => $row['artist_relation']);\n $edge_id++;\n\t\t\t}else{\n $duration = ($row['duration_years'] * 12 + $row['duration_months'])/3;\n if($row['duration_years'] == 0){\n \tif($row['duration_months'] == 1){\n $title = $row['duration_months'].\" month\";\n\t\t\t\t\t}else {\n $title = $row['duration_months'] . \" months\";\n }\n\t\t\t\t}else if($row['duration_years'] == 1){\n if($row['duration_months'] == 0){\n $title = $row['duration_years'].\" year \";\n }else if($row['duration_months'] == 1){\n $title = $row['duration_years'].\" year \".$row['duration_months'].\" month\";\n }else {\n $title = $row['duration_years'].\" year \".$row['duration_months'].\" months\";\n }\n }else{\n if($row['duration_months'] == 0){\n $title = $row['duration_years'].\" years \";\n }else if($row['duration_months'] == 1){\n $title = $row['duration_years'].\" years \".$row['duration_months'].\" month\";\n }else {\n $title = $row['duration_years'].\" years \".$row['duration_months'].\" months\";\n }\n\t\t\t\t}\n $edges[] = array('id' => $edge_id, 'from' => $row['artist_profile_id_1'], 'to' => $row['artist_profile_id_2'], 'width' => $duration, 'label' => $row['artist_relation'], 'title' => $title);\n $edge_id++;\n\t\t\t}\n\t\t}\n\t}\n//fetch education nodes\n\t//$artist_education_query = \"SELECT `artist_profile_id`, `education_type`, `institution_name`, `major`, `degree` FROM `artist_education` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n\t$artist_education_query = \"SELECT `artist_profile_id`, `education_type`, `institution_name`, `major`, `degree` FROM `artist_education` WHERE `education_type` = 'main'\";\n\t$artist_education_result = mysqli_query($dbc,$artist_education_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_education_result);\n\t$education_nodes = Array();\n\tif($count>0){\n\t\twhile($row = mysqli_fetch_array($artist_education_result)){\n\t\t\t$education_nodes[] = array('id' => $row['artist_profile_id'], 'education_type' => $row['education_type'], 'institution_name' => $row['institution_name'], 'major' => $row['major'],'degree' => $row['degree']);\n\t\t}\n\t}\n\n\t//fetches artist details\n\t$artist_details_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name` ,`artist_living_status`, `artist_gender`, `artist_residence_state`, `artist_residence_country` FROM `artist_profile`\";\n\t$artist_details_result = mysqli_query($dbc,$artist_details_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_details_result);\n\t$artist_details = Array();\n\tif($count>0){\n\t\twhile($row = mysqli_fetch_array($artist_details_result)){\n\t\t\t$artist_details[] = array('id' => $row['artist_profile_id'], 'artist_first_name' => $row['artist_first_name'], 'artist_last_name' => $row['artist_last_name'], 'artist_living_status' => $row['artist_living_status'],'artist_gender' => $row['artist_gender'],'artist_residence_state' => $row['artist_residence_state'],'artist_residence_country' => $row['artist_residence_country']);\n\t\t}\n\t}\n\n\t$profile_details = Array();\n\t$profile_details = $artist_details+$education_nodes;\n\t// $education_nodes.forEach(function(element){\n\t// \t$profile_details.push({\n\t// \tid:element.id,\n\t// \tdate:element.date,\n\t// \tname:(arrayB.find(e=>e.id===element.id)).name\n\t// \t}); \n\t// });\n\t \n\t// console.log(arrayC);\n\t \n\t//$education_nodes.push(artist_details);\n\n\t//fetch number of connections for each node\n\t$updated_nodes = Array();\n\tforeach($nodes as $node) {\n\t\t$id = $node['id'];\n\t\t$artist_id_connections_query = \"SELECT COUNT(`artist_profile_id_1`) AS `num_connections` FROM artist_relation WHERE artist_profile_id_1 = $id OR artist_profile_id_2 = $id\";\n\t\t// echo $artist_id_connections_query;\n\t\t$artist_id_connections_result = mysqli_query($dbc,$artist_id_connections_query)\n\t\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t\t$row = mysqli_fetch_array($artist_id_connections_result);\n\t\t$node['size'] = $node['size'] + ($row['num_connections'] * 10);\n\t\t$updated_nodes[] = $node;\n\t}\n\t$nodes = $updated_nodes;\n\n\treturn array(\"nodes\" => $nodes, \"edges\" => $edges, \"node_borders\" => $node_border_array,\n\t \"education_nodes\" => $education_nodes, \"artist_details\" =>$artist_details,\n\t \"profile_details\" =>$profile_details);\n}", "public function networkList($filter = array())\n {\n return $this->collection('OpenCloud\\Compute\\Resource\\Network');\n }", "public function getNetworksList() {\n return $this->_get(1);\n }", "function _tsuiseki_tracking_get_network_names() {\n return array(\n 'site',\n );\n}", "public function index_from_all_networks( $args, $assoc_args ) {\n\t\t$ep_cli = new ElasticPress_CLI_Command;\n\n\t\t// $network_index_name must be defined outside the filter closure to avoid an infinite loop\n\t\t$network_index_name = ep_get_index_name();\n\n\t\t// ensure index name is constant while we loop through all networks for posts\n\t\t$filter_network_index_name = function() use ( $network_index_name ) {\n\t\t\treturn $network_index_name;\n\t\t};\n\n\t\t// index posts on all networks using the filtered index name\n\t\t// this way all posts across all networks get indexed once on every network\n\t\tforeach ( get_networks() as $query_network ) {\n\t\t\tswitch_to_blog( get_main_site_for_network( $query_network ) );\n\t\t\tadd_filter( 'ep_index_name', $filter_network_index_name );\n\t\t\t$ep_cli->index( $args, $assoc_args );\n\t\t\tremove_filter( 'ep_index_name', $filter_network_index_name );\n\t\t\trestore_current_blog();\n\t\t}\n\t}", "function get_custom_network_maps ($query) {\r\n\t\tif (!AGM_USE_POST_INDEXER) return false;\r\n\r\n\t\t$tags = explode('tag=', $query);\r\n\t\tif (!isset($tags[1])) return false;\r\n\t\t$tags = explode(',', $tags[1]);\r\n\t\tforeach ($tags as $key=>$val) {\r\n\t\t\t$tags[$key] = \"'\" . trim($val) . \"'\";\r\n\t\t}\r\n\t\t$tags = join(',', $tags);\r\n\r\n\t\t$tag_table = $this->wpdb->base_prefix . 'site_terms';\r\n\t\t$sql = \"SELECT term_id FROM {$tag_table} WHERE type='post_tag' AND slug IN ({$tags})\";\r\n\t\t$tag_ids = $this->wpdb->get_results($sql, ARRAY_A);\r\n\t\tif (empty($tag_ids)) return false;\r\n\r\n\t\t$post_table = $this->wpdb->base_prefix . 'site_posts';\r\n\t\t$where = array();\r\n\t\tforeach ($tag_ids as $tag) {\r\n\t\t\t$where[] = \"post_terms LIKE '%|\" . $tag['term_id'] . \"|%'\";\r\n\t\t}\r\n\t\t$where = join (' OR ', $where);\r\n\t\t$sql = \"SELECT * FROM {$post_table} WHERE {$where} ORDER BY site_id, blog_id\";\r\n\t\t$posts = $this->wpdb->get_results($sql, ARRAY_A);\r\n\t\tif (empty($posts)) return false;\r\n\r\n\t\t$sql = array();\r\n\t\tforeach ($posts as $post) {\r\n\t\t\tswitch_to_blog($post['blog_id']);\r\n\t\t\t$id = (int)$post['post_id'];\r\n\t\t\t$len = strlen($post['post_id']);\r\n\t\t\t$blog_id = $post['blog_id'];\r\n\t\t\t$table = $this->get_table_name();\r\n\t\t\t$sql[] = \"SELECT *, {$blog_id} as blog_id FROM {$table} WHERE {$table}.post_ids LIKE '%s:{$len}:\\\"{$id}\\\";%'\";\r\n\t\t\trestore_current_blog();\r\n\t\t}\r\n\t\t$sql = join(' UNION ', $sql);\r\n\t\t$maps = $this->wpdb->get_results($sql, ARRAY_A);\r\n\r\n\t\tif (is_array($maps)) foreach ($maps as $k=>$v) {\r\n\t\t\t$maps[$k] = $this->prepare_map($v);\r\n\t\t}\r\n\t\treturn $maps;\r\n\t}", "public static function getNetworkConfig($network)\n {\n $id = $network instanceof tx_t3socials_models_Network ? $network->getNetwork() : $network;\n if (!isset(self::$networks[$id])) {\n throw new Exception('Unknown network type: '.$id);\n }\n\n return self::$networks[$id];\n }", "public function getNodes();", "function listNetworkIp($net,$broadcast,$sn) {\n\n $lista=[]; // lista da ritornare \n\n $no = explode('.', $net); // array con gli ottetti dell'indirizzo NET\n $bo = explode('.', $broadcast); // array con gli ottetti dell'indirizzo NET\n\n $nbit = 32-$sn; // numero di bit assegnati agli host\n \n $nhost = pow(2,$nbit); // numero totale degli host\n\n $start = (int) $no[3]+1;\n $end = (int) $bo[3]-1;\n $roots = $no[0].\".\".$no[1].\".\".$no[2].\".\";\n $roote = $bo[0].\".\".$bo[1].\".\".$bo[2].\".\";\n $primo = $roots.$start;\n $ultimo = $roote.$end;\n $hosts = [];\n\n //echo $start.\" - \".$end.\"<br>\";\n\n // verifica che gli IP disponibili non superino le 5000 unità -> stila la lista\n if($nhost > 35000) {\n $lista[0] = $primo;\n $lista[1] = $ultimo;\n }\n else {\n for($i=ip2long($primo); $i<=ip2long($ultimo); $i++) {\n\n $ip2conv = $i;\n $ip2write = long2ip($ip2conv);\n $lista[] = $ip2write;\n \n $host=gethostbyaddr($ip2write); // prelevo il nome del host (se disponibile)\n //echo $host.\" | \";\n\n // se il nome host NON è uguale all'IP -> salvo il nome Host in una lista\n if(!filter_var($host, FILTER_VALIDATE_IP)) {\n $hosts[] = \"IP: $ip2write ==> Nome Host:<b> $host </b><br>\";\n }\n\n }\n }\n\n $ret['hostnames'] = $hosts;\n $ret['primo'] = $primo;\n $ret['ultimo'] = $ultimo;\n $ret['lista'] = $lista;\n $ret['nhost'] = $nhost; \n\n return $ret;\n}", "function ipBlockSearch(){\n if($this->session->userdata('Logged_In')){\n if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']))\n {\n redirect('records/customer_records');\n }\n else{\n $search = $this->input->post('search');\n $this->records_model->setIpSearch($search);\n $result = $this->records_model->searchNodeIP();\n $result1 = $this->records_model->searchCategoryIP();\n $result2=$this->records_model->searchPrivateIP();\n\n\n echo '<div class=\"result\">';\n echo '<ul class=\"search-results\">';\n foreach($result as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p style=\"display: none\">';\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>Node IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n\n foreach($result1 as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p>';\n\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).' /'.$row->subnet.'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>'.$row->ssid.' IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n\n foreach($result2 as $row){\n if($row->customer_id != NULL){\n echo '<li>';\n echo '<p>';\n\n echo '<h2><a href=\"'.base_url().'index.php/records/customer_records/'.$row->customer_id.'\">'.$row->customer_name.'</a></h2>';\n echo '<p>'.str_ireplace($search,'<span class = \"highlight\">'.$search.'</span>',$row->ip_addresses).' /'.$row->subnet.'</p>';\n if(($row->to_date)!=null)\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp'.$row->to_date.'</p>';\n else\n echo '<p> Assigned ON:&nbsp&nbsp'.$row->from_date.'</p><p> Removed ON:&nbsp&nbsp In Use</p>';\n echo '<p>Private IP</p>';\n echo '</p>';\n\n echo '</li>';\n }\n\n }\n echo '</ul>';\n echo '</div>';\n }\n }\n else $this->load->view('login/login');\n }", "function all_client_networks(){\n\t\t$user_id = $this->session->userdata('id');\t\n\t\t$role = $this->session->userdata('role');\n\t\tif($role == 'client'){\t\t\t\n\t\t\t$company_id = $this->InteractModal->get_user_meta($user_id, 'company_id');\n\t\t\t$network__list = $this->InteractModal->all_client_networks($company_id);\n\t\t\t$approve_network_list = $this->InteractModal->get_approve_netword_by_clint_id($user_id);\t\n\t\t $own_network__list = $this->InteractModal->all_client_own_networks($user_id);\t\t\n\t\t\t/*=====all network merge=====*/\n\t\t\tif(!empty($approve_network_list) && !empty($network__list)){\n\t\t\t $all_user_list=array_merge($network__list,$approve_network_list,$own_network__list);\t\t\t\t \n\t\t\t\t}elseif(!empty($own_network__list) && !empty($network__list)){\n\t\t\t\t\t$all_user_list=array_merge($network__list,$own_network__list);\n\t\t\t\t}else{\n\t\t\t\t\t$all_user_list=$own_network__list;\t\t\t\t\t \n\t\t\t\t}\n\t\t\t$uniqueArray = array();\n\t\t\tif(!empty($all_user_list)):\n\t\t\t foreach($all_user_list as $subArray){\n\t\t\t\tif(!in_array($subArray, $uniqueArray)){\n\t\t\t\t $uniqueArray[] = $subArray;\n\t\t\t\t}\n\t\t\t }\n\t\t\t\t$pagedata['network__list'] = $uniqueArray;\n\t\t\t else:\n\t\t\t\t$pagedata['network__list'] = $network__list;\n\t\t\tendif; \n\t\t\t/*=====all network merge=====*/\n\t\t\t$all_listing_as_buyer = $this->InteractModal->get_all_listing_buyer_seller( $user_id, 'for_buy' );\n\t\t\t$all_listing_as_seller = $this->InteractModal->get_all_listing_buyer_seller( $user_id, 'for_sale' );\n\t\t\t$footer_data['all_listing_as_buyer'] = $all_listing_as_buyer;\n\t\t\t$footer_data['all_listing_as_seller'] = $all_listing_as_seller;\n\t\t\t$footer_data['user__id'] = $user_id;\n\t\t\t$this->load->view('client/header');\n\t\t\t$this->load->view('client/client_all_network', $pagedata );\n\t\t\t$this->load->view('client/footer',$footer_data); \n\t\t\t}else{\n\t\t\t\tredirect( base_url() );\n\t\t\t} \n\t}", "function estimates($search)\n {\n $p = new ETA_Feed();\n $p->parse(curl_get_file_contents('http://www.bart.gov/dev/eta/bart_eta.xml'));\n \n $words = preg_split('#[/\\s\\.]+#', strtolower($search));\n \n $special_cases = array();\n $lev_distances = array();\n $station_matches = array();\n \n // look for possible matches\n foreach($p->stations as $s => $station)\n {\n $station_match = false;\n \n if(array_intersect($words, $station['words']))\n $station_match = true;\n \n foreach($words as $search_word)\n if($search_word)\n foreach($station['words'] as $station_word)\n if(substr($station_word, 0, strlen($search_word)) == $search_word)\n $station_match = true;\n \n switch(true)\n {\n // airport code for SF airport\n case strtoupper($search) == 'SFO' && $station['name'] == \"San Francisco Int'l Airport\":\n \n // airport code for Oakland airport\n case strtoupper($search) == 'OAK' && $station['name'] == 'Coliseum/Oakland Airport':\n \n // just searching for \"berkeley\" should match Downtown Berkeley\n case in_array(strtolower($search), array('berk', 'berkeley')) && $station['name'] == 'Downtown Berkeley':\n \n // does it seem more likely that someone would mean the SF airport over the Oakland one?\n case strtolower($search) == 'airport' && $station['name'] == \"San Francisco Int'l Airport\":\n\n // just searching for \"downtown\" should match downtown SF\n case strtolower($search) == 'downtown' && $station['name'] == 'Montgomery St.':\n\n $special_case = 1;\n $station_match = true;\n break;\n \n default:\n $special_case = 0;\n break;\n }\n \n if($station_match)\n {\n $station_matches[] = $station;\n $lev_distances[] = levenshtein($search, $station['name']);\n $special_cases[] = $special_case;\n }\n }\n \n // sort possible matches\n array_multisort($special_cases, SORT_DESC, $lev_distances, $station_matches);\n \n return count($station_matches) ? $station_matches[0] : null;\n }", "public function getWithNetworks(Doctrine_Query $q = null)\n {\n\t if (is_null($q))\n\t {\n\t $q = Doctrine_Query::create()\n ->from('AdvertNetwork an');\n\t }\t \n\t \n $q->leftJoin('an.Network n');\n \n return $q;\n\t \n }", "public function includedInIP4Network($network)\n {\n if( is_object($network) )\n $netStartEnd = $network;\n else\n $netStartEnd = IP4Map::mapFromText($network);\n\n if( count($this->members) == 0 )\n return 1;\n\n $result = -1;\n\n foreach( $this->members as $o )\n {\n $localResult = $o->includedInIP4Network($netStartEnd);\n if( $localResult == 1 )\n {\n if( $result == 2 )\n continue;\n if( $result == -1 )\n $result = 1;\n else if( $result == 0 )\n return 2;\n }\n elseif( $localResult == 2 )\n {\n return 2;\n }\n elseif( $localResult == 0 )\n {\n if( $result == -1 )\n $result = 0;\n else if( $result == 1 )\n return 2;\n }\n }\n\n return $result;\n }", "function searchByXML($xml,$search=0,$findings=0, $classId=0, $linkId=0) {\n\n Debug::printMsg('<div style=\"margin-left:2em;border-left:solid 1px grey;padding:1em\"><h2>Searching '.$this->className.'</h2>');\n $this->tree = XML::nodeTree($this->classNameFull, array($this->classNameFull));\n\n // remove empty nodes\n foreach ($xml->childNodes as $link) {\n if($link->nodeType == 3)\n $xml->removeChild($link);\n }\n\n // if record has no search terms, then return all linked instances\n\n if($xml->hasAttribute(\"id\")) {\n\n $foundId = $xml->getAttribute(\"id\");\n Debug::printMsg(\"Found ID \".$foundId);\n Debug::printMsg('</div>');\n\n return array($foundId);\n\n } else if($xml->hasAttribute(\"map_id\")) {\n\n $mapId = $xml->getAttribute(\"map_id\");\n Debug::printMsg(\"Found MAP ID \".$mapId);\n Debug::printMsg('</div>');\n $res = IdaDb::select(\"_sys_records\", array(\"map_id\"=>$mapId), array(\"id\"),\"\",\"onecol\");\n if(count($res) != 1) {\n \n throw new Exception(\"map_id \\\"\".$mapId.\"\\\" not found!\");\n }\n\n $foundId = $res[0];\n\n // get place hierarchy\n if($this->className == \"Place\" && $this->placeSearch == \"deep\")\n return IdaDB::getInstanceTree(\"_sys_placeorder\", $foundId, true);\n else \n return array($foundId);\n\n \n } else if(!$xml->hasChildNodes()) {\n\n Debug::printMsg('<p>No search terms found for '.$this->className.'. Getting all!</p>');\n $this->foundRecs = IdaDB::getAllInstances($this);\n //Debug::printArray($this->foundRecs);\n \n\n\n } else {\n foreach ($xml->childNodes as $link) {\n\n $lid = XML::getPropertyID($link->tagName);\n\n //TODO: empty text nodes should be removed \n\n // sddkip text nodes\n if($link->nodeType == 3 )\n continue;\n\n // if link has no children, then find all linked records\n if(!$link->hasChildNodes()) {\n Debug::printMsg($lid[\"id\"].\".\".$lid[\"dir\"]);\n $res = IdaDb::allJoins(array(), $lid);\n Debug::printArray($res);\n }\n\n foreach($link->childNodes as $child) {\n \n // skip text nodes\n if($child->nodeType == 3)\n continue;\n\n\n Debug::printMsg('<li><b> '.$this->className.'->'.$link->tagName.'->'.$child->tagName.' </b></li>');\n\n $node = DataNode::factory($child);\n\n // if there is no children, then just search for links\n if(!$child->hasChildNodes() && !$child->hasAttribute(\"id\") && !$child->hasAttribute(\"map_id\")) {\n if(empty($findings)) {\n $cl1 = XML::nodeTree($this->classNameFull, array());\n foreach($cl1 as $class){\n $ex = explode(\".\", $class);\n $classes1[] = $ex[0];\n\n }\n $classes1[] = $this->classId;\n\n $cl2 = XML::nodeTree($node->classNameFull, array());\n foreach($cl2 as $class){\n $ex = explode(\".\", $class);\n $classes2[] = $ex[0];\n\n }\n $classes2[] = $node->classId;\n\n $this->foundRecs = IdaDb::allJoinsClass($classes1, $lid, $classes2);\n //Debug::printArray($this->foundRecs);\n }\n } else {\n\n $node->placeSearch = $this->placeSearch;\n\n foreach($this->tree as $t) {\n $arr[] = XML::getClassId($t);\n }\n foreach($arr as $a) {\n $tar[] = \"'\".$a[\"id\"].\"'\";\n }\n $treeString = implode(\",\", $tar);\n\n // search match\n $matches = $node->searchByXML($child, $search, $this->foundRecs, $treeString, $link->tagName);\n\n Debug::printArray($matches, \"Search for $node->tableName $node->classId ended with result:\");\n\n if(count($matches)) {\n Debug::printDiv(\"Matches found for $this->className !\");\n Debug::printArray($matches);\n /*\n if($this->className == \"Place\" && $search && (count($matches) == 1 || $orFlag) ) { // $this->search flags that we must search place hierarchy \n Debug::printDiv(\"Get instance tree\");\n $matches = IdaDB::getInstanceTree(\"_sys_placeorder\", $matches[0], true);\n }\n */\n // if OR flag is not set, then we search joins with previous hits\n if(count($this->foundRecs) && $orFlag == false) {\n Debug::printDiv(\"Searchig for joins...\");\n $res = $node->isJoin($matches, $this->foundRecs, $linkName);\n } else {\n if(get_class($node) != \"IdaTable\") {\n Debug::printDiv(\"Getting all joins!\");\n Debug::printArray($matches, \"found \".$node->className);\n //$cl3 = XML::nodeTree($node->classNameFull, array());\n foreach($this->tree as $class){\n $ex = explode(\".\", $class);\n $classes3[] = $ex[0];\n }\n\n Debug::printArray($this->tree, \"class tree \".$this->className);\n $res = IdaDb::allJoins($matches, $lid, $classes3);\n }else {\n echo \"res = matches\";\n $res = $matches;\n }\n }\n\n // if there are joins, then make them foundrecs\n if($res) {\n if($orFlag) {\n Debug::printArray($this->foundRecs, \"similar:\");\n Debug::printArray($res, \"res:\");\n $this->foundRecs = array_merge($this->foundRecs, $res);\n } else {\n $this->foundRecs = $res;\n $list = implode(', ',$res);\n Debug::printDiv($this->className.\" \".$link->tagName.\" \".$node->className.$node->tableName.\" joins found!\", \"green\");\n Debug::PrintDiv($list);\n Debug::printMsg('</div>');\n }\n\n } else {\n\n Debug::printDiv($this->className.\" \".$link->tagName.\" \".$node->className.$node->tableName.\" no joins found!\", \"red\");\n Debug::printMsg('</div>');\n if($orFlag) \n return $this->foundRecs;\n else\n return array();\n }\n\n } else {\n Debug::printDiv(\"No matches \".$this->className, \"red\");\n Debug::printMsg('</div>');\n return array();\n\n }\n }\n }\n // set OR flag\n if($link->tagName == \"OR\")\n $orFlag = true;\n else\n $orFlag = false;\n\n\n }\n }\n\n Debug::printMsg('</div>');\n return $this->foundRecs;\n }", "public function get_neighbors()\n\t{\n\t\t// get parent Directory and its children\n\t\t$path = $this->dir->getPath();\n\t\t$parent = new self(dirname($path));\n\t\t$dirs = $parent->get_dirs();\n\n\t\t// find position of current dir\n\t\t$key = array_search(basename($path), $dirs);\n\n\t\t// check if previous/next directories exist\n\t\t$neighbors = array();\n\t\tif (array_key_exists($key - 1, $dirs))\n\t\t\t$neighbors['prev'] = $dirs[$key - 1];\n\t\tif (array_key_exists($key + 1, $dirs))\n\t\t\t$neighbors['next'] = $dirs[$key + 1];\n\n\t\treturn $neighbors;\n\t}", "function findOnCraigslist($state = \"Oregon\",$jsonManufacturers = null,$ignoreWords=array(),$cityDepth=null,$depthOverride=true){\n $cityCounter = 0;\n $itemFoundCounter = 0;\n $foundItems = array();\n //Use the Scraper Web API and pull the results in JSON format\n $jsonData = file_get_contents(\"https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=craigslist_cities_1&query=select%20*%20from%20%60swdata%60%20WHERE%20state%20%3D%20'\".$state.\"'\");\n $jsonCraigCities = json_decode($jsonData);\n //$jsonItemManufacturerData = file_get_contents($manufacturerScraperURL.\"%20WHERE%20manufacturer%20%3D%20'\".$itemManufacturer.\"'\");\n //$jsonItemsFromManufacturer = json_decode($jsonItemManufacturerData);\n //echo \"There are \".count($jsonItemsFromManufacturer).\" \".$itemManufacturer.\" items in the system.\\n\";\n $foundURLS = array(); \n if(!empty($jsonData)){\n foreach($jsonCraigCities as $city){\n $itemCounter = 0;\n echo \"-> Parsing link: \".$city->link.\"\\n\";\n //Search each city for each item for a certain item manufacturer in the vintage item database.\n if($cityCounter < $cityDepth || $depthOverride == true || $cityDepth == 0){\n foreach($jsonManufacturers as $item){\n //Example musical instrument search string http://portland.craigslist.org/search/msg?query=korg+microkorg&srchType=A&minAsk=5&maxAsk=&hasPic=1 \n if(!empty($item)){\n $itemName = urlencode(trim($item->name));\n if(!empty($itemName)){ \n $tManName = preg_replace(\"/\\s/\",\"_\",$item->manufacturer);//Build a temp name for the array key\n $itemManufacturer = urlencode($item->manufacturer);\n $search_string = '\"'.strtolower($itemManufacturer).\"+\".$itemName.'\"';\n //$search_string = urlencode($search_string);\n $search_string2 = urlencode($itemName);\n //\"%7C\" = | (This establishes Craiglist's OR search.)\n if(!empty($search_string) && !empty($search_string2)){\n $search_url = $city->link.\"/search/msg?query=\".$search_string.\"+%7C+\".$search_string2.\"&srchType=T&minAsk=5&maxAsk=&hasPic=1\";//Title only and has image\n echo \"--> Scraping: \".$search_url.\"\\n\";\n $html = scraperWiki::scrape($search_url); \n $dom = new simple_html_dom();\n $dom->load($html); //Load the HTML \n foreach($dom->find(\"p.row\") as $item){\n $itemLink = $item->find('a',0); //Find the second link (not the image link)\n if(!empty($itemLink->href)){\n $itemName = $itemLink->innertext;\n $itemName = preg_replace('/\\s-/','',$itemName);\n $itemName = trim($itemName);\n //Check the name against the ignore words\n $addItem = 1;\n foreach($ignoreWords as $word){\n //Make sure that the itemName doesn't include a word to ignore\n if(strpos(strtolower($itemName),strtolower($word))===false){\n //Do something\n }else{\n $addItem = 0;\n }\n }\n //Check to make sure that the item link matches the search city link. \n $searchCity = preg_match(\"@http://([a-z]*+)\\.@\",$city->link,$cityMatches);\n $searchCity = trim($cityMatches[1]);\n $itemCity = preg_match(\"@http://([a-z]*+)\\.@\",$itemLink->href,$itemCityMatches);\n $itemCity = trim($itemCityMatches[1]);\n //echo \"Search city: \".$searchCity.\"\\n\";\n //echo \"Item city: \".$itemCity.\"\\n\";\n if($itemCity != $searchCity){\n $addItem = 0;\n }\n if($addItem == 1 && in_array($itemLink->href,$foundURLS) == 0){\n echo $itemName.\"\\n\";\n $itemInfo = $item->plaintext;\n $itemInfo = explode('$',$itemInfo);\n $itemPrice = \"$\".trim($itemInfo[1]);\n $itemInfo = $itemInfo[0];\n $itemInfo = explode('-',$itemInfo);\n $itemInfo = preg_replace('/&nbsp;/','',$itemInfo);\n $foundItems[$itemFoundCounter]['manufacturer'] = $itemManufacturer;\n $foundItems[$itemFoundCounter]['name'] = $itemName;\n $foundItems[$itemFoundCounter]['post_item_name'] = $itemName;\n //Find the date and price\n if(!empty($itemInfo)){\n if(isset($itemInfo[0])){\n $itemDate = trim($itemInfo[0]);\n $itemDate = preg_replace('/\\s\\s+/',' ',$itemDate); //Strip excess whitespace\n //Change date string\n $itemDateArray = explode(\" \",$itemDate);\n $monthNumVal = getMonthNum($itemDateArray[0]); //ex Nov\n $curYear = date(\"Y\");\n $itemDate = $curYear.\"-\".$monthNumVal.\"-\".$itemDateArray[1];\n echo \"Date posted: \".$itemDate.\"\\n\";\n $foundItems[$itemFoundCounter]['post_item_date'] = $itemDate;\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n }\n if(isset($itemPrice)){\n $itemPrice = trim($itemPrice);\n $itemPrice = preg_replace('/\\(.*\\)/','',$itemPrice);\n $itemPrice = preg_replace('/[a-z]+|[A-Z]+/','',$itemPrice);\n $itemPrice = trim($itemPrice);\n echo \"Price: \".$itemPrice.\"\\n\";\n //Only add the price if a dollar sign exists\n if($itemPrice[0] == \"$\"){\n $foundItems[$itemFoundCounter]['post_item_price'] = $itemPrice;\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"$\".$itemPrice;\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n $foundURLS[] = $itemLink->href; //Add the url to keep track and make sure that only unique URLs are added.\n $foundItems[$itemFoundCounter]['post_item_link'] = $city->link;\n $foundItems[$itemFoundCounter]['post_item_state'] = $city->state;\n $foundItems[$itemFoundCounter]['query'] = $search_string.\"+%7C+\".$search_string2;\n $foundItems[$itemFoundCounter]['link'] = $itemLink->href;\n //Find the page details on the page\n $craigSynthItemPage = scraperWiki::scrape($itemLink->href); \n $craigSynthItemPageDOM = new simple_html_dom();\n $craigSynthItemPageDOM->load($craigSynthItemPage); //Load the HTML\n if(!empty($craigSynthItemPageDOM)){\n $craigSynthItemDesc = $craigSynthItemPageDOM->find(\"div#userbody\",0);\n //print_r($craigSynthItemDesc);\n if(!empty($craigSynthItemDesc)) $craigSynthItemDesc = $craigSynthItemDesc->plaintext;\n $craigSynthItemBlurb = $craigSynthItemPageDOM->find(\"div#userbody] ul.blurbs\",0);\n if(!empty($craigSynthItemBlurb)) $craigSynthItemBlurb = $craigSynthItemBlurb->plaintext;\n $craigSynthItemDesc = str_replace($craigSynthItemBlurb,\"\",$craigSynthItemDesc);\n $postImages = array();\n foreach($craigSynthItemPageDOM->find(\"table[summary='craigslist hosted images'] tbody tr\") as $imageGroup){\n if(!empty($imageGroup)){\n $image = $imageGroup->find(\"img\",0);\n if(!empty($image)){\n $postImages[] = $image->src;\n }\n }\n }\n //print_r($postImages);\n $postImageStr = implode(\",\",$postImages);\n //echo $postImageStr;\n $craigSynthItemDesc = preg_replace(\"/(\\r|\\n|\\r\\n){2,}/\",\"\",$craigSynthItemDesc);\n $craigSynthItemDesc = preg_replace('/[^(\\x20-\\x7F)]*/','', $craigSynthItemDesc); //Remove non-ASCII characters\n echo $craigSynthItemDesc;\n if(!empty($postImageStr)){\n $foundItems[$itemFoundCounter]['post_item_images'] = $postImageStr;\n }else{\n $foundItems[$itemFoundCounter]['post_item_images'] = \"\";\n }\n if(!empty($craigSynthItemDesc)){\n $foundItems[$itemFoundCounter]['post_item_description'] = $craigSynthItemDesc;\n }else{\n $foundItems[$itemFoundCounter]['post_item_description'] = \"\";\n }\n }\n $itemFoundCounter++;\n }else{\n //Do something if the item wasn't added\n }\n }else{\n //Do something if the link is empty\n }\n }\n }\n }else{\n break;\n }\n $itemCounter++; \n }\n }\n }else{\n break;\n }\n $cityCounter++;\n }\n }else{\n echo \"There were no results found for \".$state.\".\";\n }\n \n return $foundItems;\n}", "function findOnCraigslist($state = \"Oregon\",$jsonManufacturers = null,$ignoreWords=array(),$cityDepth=null,$depthOverride=true){\n $cityCounter = 0;\n $itemFoundCounter = 0;\n $foundItems = array();\n //Use the Scraper Web API and pull the results in JSON format\n $jsonData = file_get_contents(\"https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=craigslist_cities_1&query=select%20*%20from%20%60swdata%60%20WHERE%20state%20%3D%20'\".$state.\"'\");\n $jsonCraigCities = json_decode($jsonData);\n //$jsonItemManufacturerData = file_get_contents($manufacturerScraperURL.\"%20WHERE%20manufacturer%20%3D%20'\".$itemManufacturer.\"'\");\n //$jsonItemsFromManufacturer = json_decode($jsonItemManufacturerData);\n //echo \"There are \".count($jsonItemsFromManufacturer).\" \".$itemManufacturer.\" items in the system.\\n\";\n $foundURLS = array(); \n if(!empty($jsonData)){\n foreach($jsonCraigCities as $city){\n $itemCounter = 0;\n echo \"-> Parsing link: \".$city->link.\"\\n\";\n //Search each city for each item for a certain item manufacturer in the vintage item database.\n if($cityCounter < $cityDepth || $depthOverride == true || $cityDepth == 0){\n foreach($jsonManufacturers as $item){\n //Example musical instrument search string http://portland.craigslist.org/search/msg?query=korg+microkorg&srchType=A&minAsk=5&maxAsk=&hasPic=1 \n if(!empty($item)){\n $itemName = urlencode(trim($item->name));\n if(!empty($itemName)){ \n $tManName = preg_replace(\"/\\s/\",\"_\",$item->manufacturer);//Build a temp name for the array key\n $itemManufacturer = urlencode($item->manufacturer);\n $search_string = '\"'.strtolower($itemManufacturer).\"+\".$itemName.'\"';\n //$search_string = urlencode($search_string);\n $search_string2 = urlencode($itemName);\n //\"%7C\" = | (This establishes Craiglist's OR search.)\n if(!empty($search_string) && !empty($search_string2)){\n $search_url = $city->link.\"/search/msg?query=\".$search_string.\"+%7C+\".$search_string2.\"&srchType=T&minAsk=5&maxAsk=&hasPic=1\";//Title only and has image\n echo \"--> Scraping: \".$search_url.\"\\n\";\n $html = scraperWiki::scrape($search_url); \n $dom = new simple_html_dom();\n $dom->load($html); //Load the HTML \n foreach($dom->find(\"p.row\") as $item){\n $itemLink = $item->find('a',0); //Find the second link (not the image link)\n if(!empty($itemLink->href)){\n $itemName = $itemLink->innertext;\n $itemName = preg_replace('/\\s-/','',$itemName);\n $itemName = trim($itemName);\n //Check the name against the ignore words\n $addItem = 1;\n foreach($ignoreWords as $word){\n //Make sure that the itemName doesn't include a word to ignore\n if(strpos(strtolower($itemName),strtolower($word))===false){\n //Do something\n }else{\n $addItem = 0;\n }\n }\n //Check to make sure that the item link matches the search city link. \n $searchCity = preg_match(\"@http://([a-z]*+)\\.@\",$city->link,$cityMatches);\n $searchCity = trim($cityMatches[1]);\n $itemCity = preg_match(\"@http://([a-z]*+)\\.@\",$itemLink->href,$itemCityMatches);\n $itemCity = trim($itemCityMatches[1]);\n //echo \"Search city: \".$searchCity.\"\\n\";\n //echo \"Item city: \".$itemCity.\"\\n\";\n if($itemCity != $searchCity){\n $addItem = 0;\n }\n if($addItem == 1 && in_array($itemLink->href,$foundURLS) == 0){\n echo $itemName.\"\\n\";\n $itemInfo = $item->plaintext;\n $itemInfo = explode('$',$itemInfo);\n $itemPrice = \"$\".trim($itemInfo[1]);\n $itemInfo = $itemInfo[0];\n $itemInfo = explode('-',$itemInfo);\n $itemInfo = preg_replace('/&nbsp;/','',$itemInfo);\n $foundItems[$itemFoundCounter]['manufacturer'] = $itemManufacturer;\n $foundItems[$itemFoundCounter]['name'] = $itemName;\n $foundItems[$itemFoundCounter]['post_item_name'] = $itemName;\n //Find the date and price\n if(!empty($itemInfo)){\n if(isset($itemInfo[0])){\n $itemDate = trim($itemInfo[0]);\n $itemDate = preg_replace('/\\s\\s+/',' ',$itemDate); //Strip excess whitespace\n //Change date string\n $itemDateArray = explode(\" \",$itemDate);\n $monthNumVal = getMonthNum($itemDateArray[0]); //ex Nov\n $curYear = date(\"Y\");\n $itemDate = $curYear.\"-\".$monthNumVal.\"-\".$itemDateArray[1];\n echo \"Date posted: \".$itemDate.\"\\n\";\n $foundItems[$itemFoundCounter]['post_item_date'] = $itemDate;\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n }\n if(isset($itemPrice)){\n $itemPrice = trim($itemPrice);\n $itemPrice = preg_replace('/\\(.*\\)/','',$itemPrice);\n $itemPrice = preg_replace('/[a-z]+|[A-Z]+/','',$itemPrice);\n $itemPrice = trim($itemPrice);\n echo \"Price: \".$itemPrice.\"\\n\";\n //Only add the price if a dollar sign exists\n if($itemPrice[0] == \"$\"){\n $foundItems[$itemFoundCounter]['post_item_price'] = $itemPrice;\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"$\".$itemPrice;\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n $foundURLS[] = $itemLink->href; //Add the url to keep track and make sure that only unique URLs are added.\n $foundItems[$itemFoundCounter]['post_item_link'] = $city->link;\n $foundItems[$itemFoundCounter]['post_item_state'] = $city->state;\n $foundItems[$itemFoundCounter]['query'] = $search_string.\"+%7C+\".$search_string2;\n $foundItems[$itemFoundCounter]['link'] = $itemLink->href;\n //Find the page details on the page\n $craigSynthItemPage = scraperWiki::scrape($itemLink->href); \n $craigSynthItemPageDOM = new simple_html_dom();\n $craigSynthItemPageDOM->load($craigSynthItemPage); //Load the HTML\n if(!empty($craigSynthItemPageDOM)){\n $craigSynthItemDesc = $craigSynthItemPageDOM->find(\"div#userbody\",0);\n //print_r($craigSynthItemDesc);\n if(!empty($craigSynthItemDesc)) $craigSynthItemDesc = $craigSynthItemDesc->plaintext;\n $craigSynthItemBlurb = $craigSynthItemPageDOM->find(\"div#userbody] ul.blurbs\",0);\n if(!empty($craigSynthItemBlurb)) $craigSynthItemBlurb = $craigSynthItemBlurb->plaintext;\n $craigSynthItemDesc = str_replace($craigSynthItemBlurb,\"\",$craigSynthItemDesc);\n $postImages = array();\n foreach($craigSynthItemPageDOM->find(\"table[summary='craigslist hosted images'] tbody tr\") as $imageGroup){\n if(!empty($imageGroup)){\n $image = $imageGroup->find(\"img\",0);\n if(!empty($image)){\n $postImages[] = $image->src;\n }\n }\n }\n //print_r($postImages);\n $postImageStr = implode(\",\",$postImages);\n //echo $postImageStr;\n $craigSynthItemDesc = preg_replace(\"/(\\r|\\n|\\r\\n){2,}/\",\"\",$craigSynthItemDesc);\n $craigSynthItemDesc = preg_replace('/[^(\\x20-\\x7F)]*/','', $craigSynthItemDesc); //Remove non-ASCII characters\n echo $craigSynthItemDesc;\n if(!empty($postImageStr)){\n $foundItems[$itemFoundCounter]['post_item_images'] = $postImageStr;\n }else{\n $foundItems[$itemFoundCounter]['post_item_images'] = \"\";\n }\n if(!empty($craigSynthItemDesc)){\n $foundItems[$itemFoundCounter]['post_item_description'] = $craigSynthItemDesc;\n }else{\n $foundItems[$itemFoundCounter]['post_item_description'] = \"\";\n }\n }\n $itemFoundCounter++;\n }else{\n //Do something if the item wasn't added\n }\n }else{\n //Do something if the link is empty\n }\n }\n }\n }else{\n break;\n }\n $itemCounter++; \n }\n }\n }else{\n break;\n }\n $cityCounter++;\n }\n }else{\n echo \"There were no results found for \".$state.\".\";\n }\n \n return $foundItems;\n}", "public function getNetworksList() {\n return $this->_get(4);\n }", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getNodeResults($segments = [], $nodeRepository)\n {\n if (count($segments) > 1) {\n\n /*Get Location Node ID*/\n $location = $nodeRepository->getNode($segments[0], false, false)->getKey();\n /*Get Category Node ID*/\n $category = $nodeRepository->getNode($segments[1], false, false)->getKey();\n\n /*Get Business Location Node Meta*/\n $locationMeta = NodeMeta::where('type', 'business')\n ->where('key', 'location')\n ->where('value', $location)\n ->get();\n\n if (count($locationMeta) > 0) {\n\n foreach ($locationMeta as $meta) {\n\n /*Get Companiess NODE*/\n $company = $nodeRepository->getNodeById($meta->node_id, true);\n if ($company) {\n\n /*Get Products UNDER Companiees*/\n $company_products = $company->children()\n ->withType('producttype')\n ->translatedIn(locale())\n ->published()\n ->sortable('id', 'DESC')\n ->get();\n\n\n /*Get Products Node Id's*/\n if (count($company_products) > 0) {\n foreach ($company_products as $nmeta) {\n $nodeIds[] = $nmeta->getKey();\n }\n\n /*Now Check those product node id's with Category in NodeMeta Table JOIN QUERY*/\n $nodeMeta = Node::withType('producttype')\n ->Join('node_meta as P','nodes.id','=','P.node_id')\n ->whereIn('nodes.id',$nodeIds)\n ->where('P.key','category')\n ->where('P.value',$category)\n ->get();\n if(count($nodeMeta) > 0){\n\n $nodeIds = $nodeMeta;\n }else{\n\n $nodeIds = null;\n }\n\n } else {\n $nodeIds[] = null;\n }\n\n\n } else {\n $nodeIds[] = null;\n }\n\n\n }\n\n\n } else {\n\n $nodeIds[] = null;\n }\n\n\n } else { /*If Segment is 1*/\n\n\n /*get Browse Results with Location OR Category\n /*Get Node ID*/\n $arr = $nodeRepository->getNode($segments[0], false, false)->getKey();\n\n /*Get NodeMeta*/\n $nodeMeta = NodeMeta::where('value', $arr)->get();\n if (count($nodeMeta) > 0) {\n\n foreach ($nodeMeta as $meta) {\n\n /*If NodeMeta key == Location*/\n if ($meta->key == 'location') {\n\n /*Get Companies*/\n $company = $nodeRepository->getNodeById($meta->node_id, true);\n if ($company) {\n\n /*Get Products Under Companies*/\n $company_products = $company->children()\n ->withType('producttype')\n ->translatedIn(locale())\n ->published()\n ->sortable('id', 'DESC')\n ->get();\n\n /*Get Products Node Id's*/\n if (count($company_products) > 0) {\n foreach ($company_products as $nmeta) {\n $nodeIds[] = $nmeta->getKey();\n }\n } else {\n\n $nodeIds[] = null;\n }\n } else {\n\n $nodeIds[] = null;\n }\n } else {\n\n /*If NodeMeta Key == Category*/\n $nodeIds[] = $meta->node_id;\n\n }\n }\n } else {\n\n $nodeIds[] = null;\n\n }\n }\n\n\n\n return $nodeIds;\n }", "public function ip_in_range($network,$netmask,$ip)\n {\n $wildcard_mask = pow( 2, ( 32 - $netmask ) ) - 1;\n $mask = ~ $wildcard_mask;\n return ( ( $ip & $mask ) == ( $network & $mask ) );\n }", "function Find($nodes, &$rlt, $id, $pnt, $cnd) {\n foreach ($nodes as $node) {\n if ($node[1] == $id && empty($rlt[$id][0])) {\n $fnd = $cnd['csi'] ? stripos($node[3], $cnd['str']) : strpos($node[3], $cnd['str']);\n $rlt[$id] = array($fnd !== false, $pnt);\n Find($nodes, $rlt, $node[0], $id, $cnd);\n }\n }\n}", "public function getNetwork($ignorePrefix = false)\n {\n // micro-optimization to prevent calling getRange repeatedly\n $k = $ignorePrefix ? 1 : 0;\n if (!isset($this->cache['range'][$k])) {\n $this->cache['range'][$k] = $this->getRange($ignorePrefix);\n }\n return $this->cache['range'][$k][0];\n }", "public function getAllGeonodes() {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\t\t$qb->where(\"rel.geometryvalue IS NOT NULL\");\n\t\treturn $qb->getQuery()->getResult();\n\t}", "public function includesIP4Network($network)\n {\n if( is_object($network) )\n $netStartEnd = $network;\n else\n $netStartEnd = IP4Map::mapFromText($network);\n\n if( count($this->members) == 0 )\n return 0;\n\n $result = -1;\n\n foreach( $this->members as $o )\n {\n $localResult = $o->includesIP4Network($netStartEnd);\n if( $localResult == 1 )\n {\n return 1;\n }\n elseif( $localResult == 2 )\n {\n $result = 2;\n }\n elseif( $localResult == 0 )\n {\n if( $result == -1 )\n $result = 0;\n }\n }\n\n return $result;\n }", "function check_number_prefix($network = NULL, $what = '*')\n\t{\n if($network == NULL) return FALSE;\n // echo $network; exit;\n $query = $this->db->select($what)\n ->from('estate_network_number_prefixes')\n ->where('network', $network)\n ->get();\n $result = $query->result_array();\n // var_dump($result);\n if(count($result) == 0) return FALSE;\n return $result;\n\t}", "public function search(){}", "protected function findLayerNodes() {\n\t\treturn $this->selectMany(array('sos:Contents', 'sos:ObservationOfferingList', 'sos:ObservationOffering'), null, false);\n\t}", "function _prime_network_caches($network_ids)\n {\n }", "public function networkPrune()\n {\n return $this->postJson(\n $this->uri->expand(\n 'networks/prune',\n array()\n ),\n array()\n )->then(array($this->parser, 'expectJson'));\n }", "function searchByXML_deep($xml, $table, $recurLevel=0) {\n // if($this->checkIds($xml, $recurLevel)) {\n\n // return 0;\n\n\n // } else {\n foreach ($xml->childNodes as $link) {\n\n //TODO: empty text nodes should be removed \n if($link->nodeType == 3 )\n continue;\n\n foreach($link->childNodes as $child) {\n \n // skip text nodes\n if($child->nodeType == 3)\n continue;\n\n Debug::printMsg('<li><b> '.$this->className.'->'.$link->tagName.'->'.$child->tagName.' </b></li>');\n $node = DataNode::factory($child);\n\n // if node has id, then do not dive any deeper\n if($this->checkIds($child, $recurLevel+1)) {\n\n $level = $recurLevel + 1;\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table, \"root_\".$level);\n\n } else if(get_class($node) == \"IdaTable\") {\n\n $node->searchByXml_new($child, $table, $this, $link->tagName, \"root_\".$recurLevel);\n\n } else {\n Debug::printMsg('<b>Diving in </b>');\n\n/*\n if($node->searchByXml_new($child, $table, $recurLevel+1, $this, $link->tagName, \"root_0\")) {\n Debug::printMsg(\"nodes found<br>\");\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table, \"root_1\");\n } else {\n\n Debug::printMsg(\"nodes NOT found<br>\");\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table);\n\n \n }\n */\n }\n }\n }\n // }\n }", "public function getAllowedNetworks() {\n $networks = CachedConferenceApi::getNetworks();\n if ((SettingsApi::getSetting(SettingsApi::ALLOW_NETWORK_CHAIRS_TO_SEE_ALL_NETWORKS) <> 1)\n && !LoggedInUserDetails::isCrew()\n ) {\n return NetworkApi::getOnlyNetworksOfChair($networks, LoggedInUserDetails::getUser());\n }\n return $networks;\n }", "static function computeNetworkRangeFromAdressAndNetmask($address, $netmask, &$firstAddress,\n &$lastAddress = null,\n $excludeBroadcastAndNetwork = false) {\n if ($address instanceof IPAddress) {\n $address = $address->getBinary();\n }\n if ($netmask instanceof IPNetmask) {\n $netmask = $netmask->getBinary();\n }\n $start = [];\n $end = [];\n for ($i = 0; $i < 4; ++$i) {\n $start[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] & $netmask[$i]);\n $end[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] | ~$netmask[$i]);\n }\n\n if ($excludeBroadcastAndNetwork) {\n IPAddress::addValueToAddress($start, 1);\n IPAddress::addValueToAddress($end, -1);\n }\n\n if ($firstAddress instanceof IPAddress) {\n $firstAddress->setAddressFromBinary($start);\n } else {\n $firstAddress = $start;\n }\n\n if ($lastAddress instanceof IPAddress) {\n $lastAddress->setAddressFromBinary($end);\n } else {\n $lastAddress = $end;\n }\n }", "function find($ip, $url, $limit);", "public function findAddresses() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! isset($_REQUEST[\"stylesheet\"])) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Address List\n\t\t\t$addressList = new \\Network\\AddressList();\n\t\n\t\t\t# Find Matching Addresses\n\t\t\t$parameters = array();\n\t\t\tif (preg_match('/^([\\w\\-]+)\\.(.*)$/',$_REQUEST['host_name'],$matches)) {\n\t\t\t\t$_REQUEST['host_name'] = $matches[1];\n\t\t\t\t$_REQUEST['domain_name'] = $matches[2];\n\t\t\t}\n\t\t\tif (isset($_REQUEST['domain_name']) && strlen($_REQUEST['domain_name']) > 0) {\n\t\t\t\t$domain = new \\Network\\Domain();\n\t\t\t\t$domain->get($_REQUEST['domain_name']);\n\t\t\t\tif ($domain->id) {\n\t\t\t\t\t$parameters['domain_id'] = $domain->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"domain not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['host_name']) && strlen($_REQUEST['host_name']) > 0) {\n\t\t\t\t$host = new \\Network\\Host();\n\t\t\t\t$host->get($domain->id,$_REQUEST['host_name']);\n\t\t\t\tif ($host->id) {\n\t\t\t\t\t$parameters['host_id'] = $host->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"host not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['adapter_name']) && strlen($_REQUEST['adapter_name']) > 0) {\n\t\t\t\t$adapter = new \\Network\\Adapter();\n\t\t\t\t$adapter->get($host->id,$_REQUEST['adapter_name']);\n\t\t\t\tif ($adapter->id) {\n\t\t\t\t\t$parameters['adapter_id'] = $adapter->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"adapter '\".$_REQUEST['adapter_name'].\"' for host '\".$host->name.\"' not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['type'])) $parameters['type'] = $_REQUEST['type'];\n\t\t\t$addresses = $addressList->find($parameters);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($addressList->error()) $this->error($addressList->error());\n\t\t\telse{\n\t\t\t\t$response->address = $addresses;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "function buscaGrafo($nodoTabela, $graph){\n\t$cont = 0;\n\twhile ($cont < count($graph)) {\n\t\tif ($graph[$cont]['tabelaOrigem'][0] == $nodoTabela[0]) {\n\t\t\treturn $cont;\n\t\t}\n\t\t$cont++;\n\t}\n}", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "public function find();", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public abstract function find();", "public function lookup(){\n\t\t$this->loadModel('CollibraAPI');\n\t\t$resp = $this->CollibraAPI->get('community/'.Configure::read('Collibra.community.byu').'/sub-communities');\n\t\t$parentCommunities = json_decode($resp);\n\t\tusort($parentCommunities->communityReference, 'self::sortCommunities');\n\n\t\t//$query = 'glossary';\n\t\tif ($this->request->is('post')) {\n\t\t\t// search in all communities, vocabularies and users\n\t\t\t//=================================================================\n\t\t\tif(isset($this->request->data['query'])){\n\t\t\t\t$query = $this->request->data['query'];\n\t\t\t\t$query = preg_replace('/[^ \\w]+/', '', $query);\n\t\t\t}\n\n\t\t\t$request = '{\"query\":\"'.$query.'*\", \"filter\": { \"community\": [\"'.Configure::read('Collibra.community.byu').'\"], \"category\":[\"CO\", \"VC\", \"UR\"], \"vocabulary\":[], \"type\":{\"asset\":[]},';\n\t\t\tif(!Configure::read('allowUnapprovedTerms')){\n\t\t\t\t$request .= '\"status\": [\"00000000-0000-0000-0000-000000005009\"], ';\n\t\t\t}\n\t\t\t$request .= '\"includeMeta\":false}, \"fields\":[\"name\",\"attributes\"], \"order\":{\"by\":\"score\",\"sort\": \"desc\"}, \"limit\":500, \"offset\":0, \"highlight\":false}';\n\n\t\t\t$searchResp = $this->CollibraAPI->postJSON('search', $request);\n\t\t\t$searchResp = json_decode($searchResp);\n\t\t\t//=================================================================\n\n\t\t\t// build array to hold users and communities found\n\t\t\t$arrUserResults = array();\n\t\t\t$arrCommunityResults = array();\n\t\t\tforeach($searchResp->results as $r){\n\t\t\t\tif($r->name->type == 'UR'){\n\t\t\t\t\tarray_push($arrUserResults, $r->name->id);\n\t\t\t\t}\n\t\t\t\tif($r->name->type == 'CO'){\n\t\t\t\t\tarray_push($arrCommunityResults, $r->name->id);\n\t\t\t\t}\n\t\t\t\tif($r->name->type == 'VC'){\n\t\t\t\t\t// for vocabularies, add parent community to arrCommunityResults\n\t\t\t\t\tarray_push($arrCommunityResults, $r->context->id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get all communities in the system along with their custodian and steward info\n\t\t\t$communities = $this->CollibraAPI->postJSON(\n\t\t\t\t\t'output/data_table',\n\t\t\t\t\t'{\"TableViewConfig\":{\"Columns\":[{\"Community\":{\"name\":\"Subcommunities\",\"Columns\":[{\"Column\":{\"fieldName\":\"subcommunityid\"}},{\"Column\":{\"fieldName\":\"subcommunity\"}},{\"Column\":{\"fieldName\":\"parentCommunityId\"}},{\"Column\":{\"fieldName\":\"parentCommunity\"}},{\"Column\":{\"fieldName\":\"description\"}},{\"Column\":{\"fieldName\":\"hasNonMetaChildren\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Custodian User ID\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"}},{\"Column\":{\"label\":\"Custodian Gender\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbgender\"}},{\"Column\":{\"label\":\"Custodian First Name\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbfn\"}},{\"Column\":{\"label\":\"Custodian Last Name\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbln\"}}],\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afb\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Custodian Group ID\",\"fieldName\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},{\"Column\":{\"label\":\"Custodian Group Name\",\"fieldName\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbggn\"}}],\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbg\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Steward User ID\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acrid\"}},{\"Column\":{\"label\":\"Steward Gender\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acgender\"}},{\"Column\":{\"label\":\"Steward First Name\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acfn\"}},{\"Column\":{\"label\":\"Steward Last Name\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acln\"}}],\"name\":\"Role8a0a6c89106c4adb9936f09f29b747ac\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Steward Group ID\",\"fieldName\":\"groupRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},{\"Column\":{\"label\":\"Steward Group Name\",\"fieldName\":\"groupRole8a0a6c89106c4adb9936f09f29b747acggn\"}}],\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acg\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Trustee User ID\",\"fieldName\":\"userRolefb97305e00c0459a84cbb3f5ea62d411rid\"}},{\"Column\":{\"label\":\"Trustee Gender\",\"fieldName\":\"userRolefb97305e00c0459a84cbb3f5ea62d411gender\"}},{\"Column\":{\"label\":\"Trustee First Name\",\"fieldName\":\"userRolefb97305e00c0459a84cbb3f5ea62d411fn\"}},{\"Column\":{\"label\":\"Trustee Last Name\",\"fieldName\":\"userRolefb97305e00c0459a84cbb3f5ea62d411ln\"}}],\"name\":\"Rolefb97305e00c0459a84cbb3f5ea62d411\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Trustee Group ID\",\"fieldName\":\"groupRolefb97305e00c0459a84cbb3f5ea62d411grid\"}},{\"Column\":{\"label\":\"Trustee Group Name\",\"fieldName\":\"groupRolefb97305e00c0459a84cbb3f5ea62d411ggn\"}}],\"name\":\"Rolefb97305e00c0459a84cbb3f5ea62d411g\"}}]}}],\"Resources\":{\"Community\":{\"Id\":{\"name\":\"subcommunityid\"},\"Name\":{\"name\":\"subcommunity\"},\"Meta\":{\"name\":\"issubmeta\"},\"hasNonMetaChildren\":{\"name\":\"hasNonMetaChildren\"},\"ParentCommunity\":{\"Id\":{\"name\":\"parentCommunityId\"},\"Name\":{\"name\":\"parentCommunity\"}},\"Description\":{\"name\":\"description\"},\"Member\":[{\"User\":{\"Gender\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbgender\"},\"FirstName\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbfn\"},\"Id\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"},\"LastName\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbln\"}},\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbsig\"},\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afb\",\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.custodian') . '\"},{\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbg\"},\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},\"Group\":{\"GroupName\":{\"name\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbggn\"},\"Id\":{\"name\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.custodian') . '\"},{\"User\":{\"Gender\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acgender\"},\"FirstName\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acfn\"},\"Id\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acrid\"},\"LastName\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acln\"}},\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acsig\"},\"name\":\"Role8a0a6c89106c4adb9936f09f29b747ac\",\"Id\":{\"hidden\":\"true\",\"name\":\"roleRole8a0a6c89106c4adb9936f09f29b747acrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.steward') . '\"},{\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acg\"},\"Id\":{\"hidden\":\"true\",\"name\":\"roleRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},\"Group\":{\"GroupName\":{\"name\":\"groupRole8a0a6c89106c4adb9936f09f29b747acggn\"},\"Id\":{\"name\":\"groupRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.steward') . '\"},{\"User\":{\"Gender\":{\"name\":\"userRolefb97305e00c0459a84cbb3f5ea62d411gender\"},\"FirstName\":{\"name\":\"userRolefb97305e00c0459a84cbb3f5ea62d411fn\"},\"Id\":{\"name\":\"userRolefb97305e00c0459a84cbb3f5ea62d411rid\"},\"LastName\":{\"name\":\"userRolefb97305e00c0459a84cbb3f5ea62d411ln\"}},\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolefb97305e00c0459a84cbb3f5ea62d411sig\"},\"name\":\"Rolefb97305e00c0459a84cbb3f5ea62d411\",\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolefb97305e00c0459a84cbb3f5ea62d411rid\"}},\"roleId\":\"' . Configure::read('Collibra.role.trustee') . '\"},{\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolefb97305e00c0459a84cbb3f5ea62d411g\"},\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolefb97305e00c0459a84cbb3f5ea62d411grid\"}},\"Group\":{\"GroupName\":{\"name\":\"groupRolefb97305e00c0459a84cbb3f5ea62d411ggn\"},\"Id\":{\"name\":\"groupRolefb97305e00c0459a84cbb3f5ea62d411grid\"}},\"roleId\":\"' . Configure::read('Collibra.role.trustee') . '\"}],\"Filter\":{\"AND\":[{\"AND\":[{\"Field\":{\"name\":\"issubmeta\",\"operator\":\"EQUALS\",\"value\":false}}]},{\"AND\":[{\"Field\":{\"name\":\"parentCommunityId\",\"operator\":\"NOT_NULL\"}}]}]},\"Order\":[{\"Field\":{\"name\":\"parentCommunity\",\"order\":\"ASC\"}}]}},\"displayStart\":0,\"displayLength\":500}}'\n\t\t\t);\n\t\t\t$communities = json_decode($communities);\n\n\t\t\t// get all users including their contact info\n\t\t\t$users = $this->CollibraAPI->postJSON(\n\t\t\t\t\t'output/data_table',\n\t\t\t\t\t'{\"TableViewConfig\":{\"Columns\":[{\"Column\":{\"fieldName\":\"userrid\"}},{\"Column\":{\"fieldName\":\"userenabled\"}},{\"Column\":{\"fieldName\":\"userfirstname\"}},{\"Column\":{\"fieldName\":\"userlastname\"}},{\"Column\":{\"fieldName\":\"emailemailaddress\"}},{\"Group\":{\"name\":\"phonenumber\",\"Columns\":[{\"Column\":{\"fieldName\":\"phonephonenumber\"}},{\"Column\":{\"fieldName\":\"phonerid\"}}]}},{\"Column\":{\"fieldName\":\"useractivated\"}},{\"Column\":{\"fieldName\":\"isuserldap\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Custodian User ID\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"}},{\"Column\":{\"label\":\"Custodian Gender\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbgender\"}},{\"Column\":{\"label\":\"Custodian First Name\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbfn\"}},{\"Column\":{\"label\":\"Custodian Last Name\",\"fieldName\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbln\"}}],\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afb\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Custodian Group ID\",\"fieldName\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},{\"Column\":{\"label\":\"Custodian Group Name\",\"fieldName\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbggn\"}}],\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbg\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Steward User ID\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acrid\"}},{\"Column\":{\"label\":\"Steward Gender\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acgender\"}},{\"Column\":{\"label\":\"Steward First Name\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acfn\"}},{\"Column\":{\"label\":\"Steward Last Name\",\"fieldName\":\"userRole8a0a6c89106c4adb9936f09f29b747acln\"}}],\"name\":\"Role8a0a6c89106c4adb9936f09f29b747ac\"}},{\"Group\":{\"Columns\":[{\"Column\":{\"label\":\"Steward Group ID\",\"fieldName\":\"groupRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},{\"Column\":{\"label\":\"Steward Group Name\",\"fieldName\":\"groupRole8a0a6c89106c4adb9936f09f29b747acggn\"}}],\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acg\"}}],\"Resources\":{\"User\":{\"Enabled\":{\"name\":\"userenabled\"},\"UserName\":{\"name\":\"userusername\"},\"FirstName\":{\"name\":\"userfirstname\"},\"LastName\":{\"name\":\"userlastname\"},\"Emailaddress\":{\"name\":\"emailemailaddress\"},\"Phone\":{\"Phonenumber\":{\"name\":\"phonephonenumber\"},\"Id\":{\"name\":\"phonerid\"}},\"Group\":{\"Groupname\":{\"name\":\"groupgroupname\"},\"Id\":{\"name\":\"grouprid\"},\"Filter\":{\"AND\":[{\"FIELD\":{\"name\":\"grouprid\",\"operator\":\"NOT_EQUALS\",\"value\":\"00000000-0000-0000-0000-000001000001\"}},{\"FIELD\":{\"name\":\"grouprid\",\"operator\":\"NOT_EQUALS\",\"value\":\"00000000-0000-0000-0000-000001000002\"}}]}},\"Activated\":{\"name\":\"useractivated\"},\"LDAPUser\":{\"name\":\"isuserldap\"},\"Id\":{\"name\":\"userrid\"},\"Member\":[{\"User\":{\"Gender\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbgender\"},\"FirstName\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbfn\"},\"Id\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"},\"LastName\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbln\"}},\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbsig\"},\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afb\",\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.custodian') . '\"},{\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Rolef86d1d3abc2e4beeb17fe0e9985d5afbg\"},\"Id\":{\"hidden\":\"true\",\"name\":\"roleRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},\"Group\":{\"GroupName\":{\"name\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbggn\"},\"Id\":{\"name\":\"groupRolef86d1d3abc2e4beeb17fe0e9985d5afbgrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.custodian') . '\"},{\"User\":{\"Gender\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acgender\"},\"FirstName\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acfn\"},\"Id\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acrid\"},\"LastName\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acln\"}},\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acsig\"},\"name\":\"Role8a0a6c89106c4adb9936f09f29b747ac\",\"Id\":{\"hidden\":\"true\",\"name\":\"roleRole8a0a6c89106c4adb9936f09f29b747acrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.steward') . '\"},{\"Role\":{\"Signifier\":{\"hidden\":\"true\",\"name\":\"Role8a0a6c89106c4adb9936f09f29b747acg\"},\"Id\":{\"hidden\":\"true\",\"name\":\"roleRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},\"Group\":{\"GroupName\":{\"name\":\"groupRole8a0a6c89106c4adb9936f09f29b747acggn\"},\"Id\":{\"name\":\"groupRole8a0a6c89106c4adb9936f09f29b747acgrid\"}},\"roleId\":\"' . Configure::read('Collibra.role.steward') . '\"}],\"Filter\":{\"AND\":[{\"OR\":[{\"Field\":{\"name\":\"userRole8a0a6c89106c4adb9936f09f29b747acrid\",\"operator\":\"NOT_NULL\"}},{\"Field\":{\"name\":\"userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid\",\"operator\":\"NOT_NULL\"}},]},{\"AND\":[{\"Field\":{\"name\":\"userenabled\",\"operator\":\"EQUALS\",\"value\":\"true\"}}]}]}}},\"Order\":[{\"Field\":{\"name\":\"userlasttname\",\"order\":\"ASC\"}}],\"displayStart\":0,\"displayLength\":1000}}'\n\t\t\t);\n\t\t\t$users = json_decode($users);\n\n\t\t\t$arrUserData = array();\n\t\t\tforeach($users->aaData as $r){\n\t\t\t\tif(in_array($r->userrid, $arrUserResults)){\n\t\t\t\t\t$group = substr($r->userlastname,0,1);\n\t\t\t\t\tif(!isset($arrUserData[$group])){\n\t\t\t\t\t\t$arrUserData[$group] = array();\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!isset($arrUserData[$group][$r->userrid])){\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['id'] = $r->userrid;\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['fname'] = $r->userfirstname;\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['lname'] = $r->userlastname;\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['email'] = $r->emailemailaddress;\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['phone'] = '&nbsp;';\n\t\t\t\t\t\tif(sizeof($r->phonenumber)>0){\n\t\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['phone'] = $r->phonenumber[0]->phonephonenumber;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// add communities in which user has a role\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['stewardRoles'] = array();\n\t\t\t\t\t\t$arrUserData[$group][$r->userrid]['custodianRoles'] = array();\n\t\t\t\t\t\tforeach($communities->aaData[0]->Subcommunities as $c){\n\t\t\t\t\t\t\tforeach($c->Role8a0a6c89106c4adb9936f09f29b747ac as $role){\n\t\t\t\t\t\t\t\tif($role->userRole8a0a6c89106c4adb9936f09f29b747acrid == $r->userrid){\n\t\t\t\t\t\t\t\t\t$this->getParentCommunities($communities, $c->parentCommunityId, $c);\n\t\t\t\t\t\t\t\t\tarray_push($arrUserData[$group][$r->userrid]['stewardRoles'], $c);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach($c->Rolef86d1d3abc2e4beeb17fe0e9985d5afb as $role){\n\t\t\t\t\t\t\t\tif($role->userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid == $r->userrid){\n\t\t\t\t\t\t\t\t\t$this->getParentCommunities($communities, $c->parentCommunityId, $c);\n\t\t\t\t\t\t\t\t\tarray_push($arrUserData[$group][$r->userrid]['custodianRoles'], $c);\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}\n\t\t\t}\n\n\t\t\t// loop through all communities from above and filter out those not found\n\t\t\t// in our first search results\n\t\t\t//=================================================================\n\t\t\t$tmpCommunities = array();\n\t\t\tforeach($communities->aaData[0]->Subcommunities as $c){\n\t\t\t\t$include = false;\n\t\t\t\tif($c->parentCommunityId != Configure::read('Collibra.community.byu')){\n\t\t\t\t\t// add community based on previous search resulta\n\t\t\t\t\tif(in_array($c->subcommunityid, $arrCommunityResults)){\n\t\t\t\t\t\t$include = true;\n\t\t\t\t\t}\n\t\t\t\t\t// add community based on custodian\n\t\t\t\t\tif(count($c->Rolef86d1d3abc2e4beeb17fe0e9985d5afb)>0){\n\t\t\t\t\t\tif(in_array($c->Rolef86d1d3abc2e4beeb17fe0e9985d5afb[0]->userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid, $arrUserResults)){\n\t\t\t\t\t\t\t//$include = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// add community based on steward\n\t\t\t\t\tif(count($c->Role8a0a6c89106c4adb9936f09f29b747ac)>0){\n\t\t\t\t\t\tif(in_array($c->Role8a0a6c89106c4adb9936f09f29b747ac[0]->userRole8a0a6c89106c4adb9936f09f29b747acrid, $arrUserResults)){\n\t\t\t\t\t\t\t//$include = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// look for user in the $users array and insert their details\n\t\t\t\t\tforeach($users->aaData as $u){\n\t\t\t\t\t\tif(count($c->Rolef86d1d3abc2e4beeb17fe0e9985d5afb)>0){\n\t\t\t\t\t\t\t$custodianUserID = $c->Rolef86d1d3abc2e4beeb17fe0e9985d5afb[0]->userRolef86d1d3abc2e4beeb17fe0e9985d5afbrid;\n\t\t\t\t\t\t\tif($u->userrid == $custodianUserID){\n\t\t\t\t\t\t\t\t$c->custodian = $u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(count($c->Role8a0a6c89106c4adb9936f09f29b747ac)>0){\n\t\t\t\t\t\t\t$stewardUserID = $c->Role8a0a6c89106c4adb9936f09f29b747ac[0]->userRole8a0a6c89106c4adb9936f09f29b747acrid;\n\t\t\t\t\t\t\tif($u->userrid == $stewardUserID){\n\t\t\t\t\t\t\t\t$c->steward = $u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($include) array_push($tmpCommunities, $c);\n\t\t\t\t// add parent communities\n\t\t\t\t$this->getParentCommunities($communities, $c->parentCommunityId, $c);\n\t\t\t}\n\t\t\t$communities->aaData[0]->Subcommunities = $tmpCommunities;\n\n\t\t\t//print_r($communities);\n\t\t\t//exit;\n\t\t\t//=================================================================\n\t\t}\n\n\t\t// get definitions for steward and custodian terms\n\t\t$stewardDefinition = $this->CollibraAPI->getTermDefinition(Configure::read('Collibra.term.steward'));\n\t\t$custodianDefinition = $this->CollibraAPI->getTermDefinition(Configure::read('Collibra.term.custodian'));\n\n\t\t$this->set('stewardDef', $stewardDefinition);\n\t\t$this->set('custodianDef', $custodianDefinition);\n\t\t$this->set('communities', $communities);\n\t\t$this->set('parentCommunities', $parentCommunities);\n\t\t$this->set('userData', $arrUserData);\n\t\t$this->set('query', $query);\n\t}", "public function SearchClusters($request){\n\n\t\t$freeText = $request['freeText'];\n\t\t$academicDiscipline = $request['academicDiscipline'];\n\t\t$academicDepartment = $request['academicDepartment'];\n\t\t$courseList = $request['courseList'];\n\n $foundSets = array();\n\n // An empty query should return ALL clusters from the search engine.\n if(empty($courseList) && empty($freeText) && empty($academicDiscipline) && empty($academicDepartment)){\n $rows = $this->Read('[PUBLISH CLUSTERS TABLE]', array());\n\t\t\t$foundSets[] = $this->CreateRecordSet($rows);\n\t\t} else {\t\t\t\n // Otherwise we consider each element in the query separately, find all the ID's for each component,\n // then intersect those sets at the end to come up with the clusters that match the query.\n if(!empty($academicDiscipline)){\n $query = \"SELECT DISTINCT recordID FROM [PUBLISH CLUSTERS TABLE] WHERE academicDiscipline = :academicDiscipline\";\n $bindings = array(':academicDiscipline' => $academicDiscipline);\n\n\t\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings))\n\t\t\t\t\t$foundSets[] = $this->CreateRecordSet($rows); \n }\n\n if(!empty($academicDepartment)){\n $query = \"SELECT DISTINCT recordID FROM [PUBLISH CLUSTERS TABLE] WHERE academicDepartment = :academicDepartment\";\n $bindings = array(':academicDepartment' => $academicDepartment);\n\n\t\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings))\n\t\t\t\t\t$foundSets[] = $this->CreateRecordSet($rows); \n }\n\n if(!empty($freeText)){\n $setOne = array();\n $setTwo = array();\n\n $text = \"%\" . trim($freeText) . \"%\";\n\n $query = \"SELECT DISTINCT recordID FROM [PUBLISH CLUSTERS TABLE] \n WHERE clusterNumber LIKE :clusterNumber OR\n title LIKE :title OR\n description LIKE :description\";\n\n $bindings = array(':clusterNumber' => $text,\n ':title' => $text,\n ':description' => $text);\n\n\t\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings))\n\t\t\t\t\t$setOne = $this->CreateRecordSet($rows);\n\n $query = \"SELECT DISTINCT A.recordID FROM [PUBLISH CLUSTERS TABLE] A\n LEFT JOIN [PUBLISH GROUPS TABLE] B ON A.recordID = B.clusterID\n LEFT JOIN [PUBLISH COURSES TABLE] C ON B.recordID = C.groupID\n WHERE C.courseNumber LIKE :courseNumber OR C.courseTitle LIKE :courseTitle\";\n\n $bindings = array(':courseNumber' => $text,\n ':courseTitle' => $text);\n\n\t\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings))\n\t\t\t\t\t$setTwo = $this->CreateRecordSet($rows);\n\n $union = array_unique(array_merge($setOne, $setTwo));\n $set = array();\n foreach($union as $key => $value)\n $set[] = $value;\n\n $foundSets[] = $set;\n }\n\n if(!empty($courseList)){\n $courses = explode(',',$courseList);\n\n foreach($courses as $course){\n $query = \"SELECT DISTINCT A.recordID FROM [PUBLISH CLUSTERS TABLE] A\n LEFT JOIN [PUBLISH GROUPS TABLE] B ON A.recordID = B.clusterID\n LEFT JOIN [PUBLISH COURSES TABLE] C ON B.recordID = C.groupID\n WHERE C.courseNumber = :courseNumber\";\n\n $bindings = array(':courseNumber' => $course);\n\n\t\t\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings))\n\t\t\t\t\t\t$foundSets[] = $this->CreateRecordSet($rows);\n }\n } \n }\n\n\n $intersection = NULL;\n foreach($foundSets as $found){\n if($intersection == NULL)\n $intersection = $found;\n else\n $intersection = array_intersect($intersection, $found);\n\t\t}\n\t\t\n\t\t$queryRecord = array(\"freeText\" => $freeText,\n\t\t\t\t\t\t\t \"academicDiscipline\" => $academicDiscipline,\n\t\t\t\t\t\t\t \"academicDepartment\" => $academicDepartment,\n\t\t\t\t\t\t\t \"courseList\" => json_encode($courseList),\n\t\t\t\t\t\t\t \"queryDate\" => date('Y-m-d H:i:s', time()),\n\t\t\t\t\t\t\t \"queryHits\" => count($intersection));\n\t\t$this->Create('CSEQuery', $queryRecord);\n\n if(!empty($intersection))\n return array(\"results\" => $this->LoadClusterCollection(\"Publish\", $intersection));\n \n return array(\"results\" => null);\n\t}", "public function searchableIPs() {\n\t\treturn false;\n\t}", "public function getHtmlNetwork() {\n $ntworks = array(\n \n 'facebook',\n 'twitter',\n 'linkedin',\n 'pinterest',\n 'youtube',\n 'google',\n 'myspace',\n \n );\n \n $networks = array();\n \n foreach($ntworks as $name) {\n \n if (\n array_key_exists($name,$this->configWeb)\n && !empty($this->configWeb[$name])\n ) {\n $networks[$this->getUrl($name)] = $this->getImageSkin($name);\n }\n \n }\n \n $tplNetworks = Template::getWebsiteView('widgets/networks',$this->getTheme());\n ob_start(); if (is_file($tplNetworks)) { include $tplNetworks; } $out = ob_get_clean();\n \n return $out;\n \n }", "public function getAvailableNetworks()\n {\n return $this->networks;\n }", "function getAllURLsForSearch($connection){\t\n\t\t\t$allURLsOfWebsite = array();\n\t\t\t$urlsSearched = array();\n\t\t\t$urlsMain = array();\n\t\t\t\n\t\t\t$result = mysqli_query($connection, \"SELECT url FROM _tmp_websites_actual_run\" );\n\t\t\t$result2 = mysqli_query($connection,\"SELECT url FROM _websites_searched\");\n\t\t\t$result3 = mysqli_query($connection,\"SELECT url FROM _websites\");\n\n\t\t\twhile($row = mysqli_fetch_array($result))\n\t\t\t{\n\t\t\t\t$allURLsOfWebsite[] = $row['url'];\n\t\t\t}\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($result2))\n\t\t\t{\n\t\t\t\t$urlsSearched[] = $row['url'];\n\t\t\t}\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($result3))\n\t\t\t{\n\t\t\t\t$urlsMain[] = $row['url'];\n\t\t\t}\n\t\t\t\n\t\t\tforeach($allURLsOfWebsite as $key=>$url){\n\t\t\t\tif((in_array($url,$urlsSearched)) && (!in_array($url, $urlsMain))){\n\t\t\t\t\tunset($allURLsOfWebsite[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $allURLsOfWebsite;\n\t\t}" ]
[ "0.5815753", "0.57038194", "0.56861496", "0.563826", "0.5522029", "0.547092", "0.5449751", "0.5367881", "0.51938516", "0.51894134", "0.51883084", "0.5188256", "0.5176082", "0.51722664", "0.514328", "0.5047469", "0.50350463", "0.49853498", "0.4885369", "0.4821408", "0.48106897", "0.4799021", "0.47876278", "0.47803777", "0.47058293", "0.47002146", "0.468961", "0.4672186", "0.466465", "0.46579888", "0.46466658", "0.46364662", "0.4632662", "0.4624869", "0.46198517", "0.46185416", "0.46138138", "0.4607221", "0.4586446", "0.45749354", "0.457333", "0.45536846", "0.45442346", "0.45442346", "0.45270857", "0.45251584", "0.45200098", "0.44974777", "0.44945386", "0.44828346", "0.4482215", "0.44805902", "0.44797495", "0.44640315", "0.4450187", "0.44476223", "0.44461587", "0.44416344", "0.44382632", "0.44174165", "0.43742526", "0.43723696", "0.4369113", "0.43640894", "0.43603793", "0.4357048", "0.43539432", "0.43466482", "0.43466482", "0.434353", "0.4336406", "0.43320298", "0.4325186", "0.4321343", "0.4266102", "0.4263972", "0.42616016", "0.4242433", "0.42395735", "0.42366284", "0.42292988", "0.42165738", "0.42156178", "0.4214874", "0.42130852", "0.4212597", "0.4211814", "0.4208379", "0.42063215", "0.4197563", "0.41849035", "0.41833168", "0.41833168", "0.41806015", "0.418007", "0.41782972", "0.41776052", "0.41761354", "0.41655916", "0.41655082" ]
0.5834907
0
Get SQL WHERE criteria for requesting elements that are contained inside the current network
function getCriteriaForMatchingElement($tableName, $binaryFieldPrefix, $versionField) { global $DB; $version = $this->fields["version"]; $start = null; $this->computeNetworkRange($start); $result = []; for ($i = ($version == 4 ? 3 : 0); $i < 4; ++$i) { $result[] = new \QueryExpression( "({$DB->quoteName($tableName.'.'.$binaryFieldPrefix.'_'.$i)} & " . $this->fields["netmask_$i"] . ") = ({$start[$i]})" ); } $result["$tableName.version"] = $version; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getWhereClause() {}", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "protected function getGeneralWhereClause() {}", "public static function get_net_where_intersect($nets = array()) \n {\n if (count($nets) > 0) \n {\n // Merge\n return (self::get_net_where()) ? self::get_net_where().\" AND asset_id IN (UNHEX('\".implode(\"'), UNHEX('\",$nets).\"'))\" : \"UNHEX('\".implode(\"'), UNHEX('\",$nets).\"')\";\n } \n else \n {\n // Only allowed\n return self::get_net_where();\n }\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "protected function user_where_clause() {}", "public function buildQueryLimits()\n\t{\n\t\tglobal $modSettings;\n\n\t\t$extra_where = [];\n\n\t\tif (!empty($this->_searchParams->_minMsgID) || !empty($this->_searchParams->_maxMsgID))\n\t\t{\n\t\t\t$extra_where[] = 'id >= ' . $this->_searchParams->_minMsgID . ' AND id <= ' . (empty($this->_searchParams->_maxMsgID) ? (int) $modSettings['maxMsgID'] : $this->_searchParams->_maxMsgID);\n\t\t}\n\n\t\tif (!empty($this->_searchParams->topic))\n\t\t{\n\t\t\t$extra_where[] = 'id_topic = ' . (int) $this->_searchParams->topic;\n\t\t}\n\n\t\tif (!empty($this->_searchParams->brd))\n\t\t{\n\t\t\t$extra_where[] = 'id_board IN (' . implode(',', $this->_searchParams->brd) . ')';\n\t\t}\n\n\t\tif (!empty($this->_searchParams->_memberlist))\n\t\t{\n\t\t\t$extra_where[] = 'id_member IN (' . implode(',', $this->_searchParams->_memberlist) . ')';\n\t\t}\n\n\t\treturn $extra_where;\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "static function searchNetworks($relation, $condition, $entityID = -1, $recursive = true,\n $version = 0) {\n global $DB;\n\n if (empty($relation)) {\n return false;\n }\n\n if (empty($condition[\"fields\"])) {\n $fields = 'id';\n } else {\n $fields = $condition[\"fields\"];\n }\n\n if (!is_array($fields)) {\n $fields = [$fields];\n }\n\n $startIndex = (($version == 4) ? 3 : 1);\n\n $addressDB = ['address_0', 'address_1', 'address_2', 'address_3'];\n $netmaskDB = ['netmask_0', 'netmask_1', 'netmask_2', 'netmask_3'];\n\n $WHERE = [];\n if (isset($condition[\"address\"])\n && isset($condition[\"netmask\"])) {\n $addressPa = new IPAddress($condition[\"address\"]);\n\n // Check version equality ...\n if ($version != $addressPa->getVersion()) {\n if ($version != 0) {\n return false;\n }\n $version = $addressPa->getVersion();\n }\n\n $netmaskPa = new IPNetmask($condition[\"netmask\"], $version);\n\n // Get the array of the adresses\n $addressPa = $addressPa->getBinary();\n $netmaskPa = $netmaskPa->getBinary();\n\n // Check the binary is valid\n if (!is_array($addressPa) || (count($addressPa) != 4)) {\n return false;\n }\n if (!is_array($netmaskPa) || (count($netmaskPa) != 4)) {\n return false;\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n\n if ($relation == \"equals\") {\n for ($i = $startIndex; $i < 4; ++$i) {\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]) . \" & \" . $DB->quoteValue($netmaskPa[$i]) . \") = (\".$DB->quoteValue($addressPa[$i]).\" & \".$DB->quoteValue($netmaskPa[$i]).\")\"),\n $netmaskDB[$i] => $netmaskPa[$i]\n ];\n }\n } else {\n for ($i = $startIndex; $i < 4; ++$i) {\n if ($relation == \"is contained by\") {\n $globalNetmask = $DB->quoteValue($netmaskPa[$i]);\n } else {\n $globalNetmask = $DB->quoteName($netmaskDB[$i]);\n }\n\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]).\" & $globalNetmask) = (\".$DB->quoteValue($addressPa[$i]).\" & $globalNetmask)\"),\n new \\QueryExpression(\"(\".$DB->quoteValue($netmaskPa[$i]).\" & \".$DB->quoteName($netmaskDB[$i]).\")=$globalNetmask\")\n ];\n }\n }\n }\n\n if ($entityID < 0) {\n $entityID = $_SESSION['glpiactive_entity'];\n }\n $entitiesID = [];\n switch ($relation) {\n case \"is contained by\" :\n $ORDER_ORIENTATION = 'ASC';\n if ($recursive) {\n $entitiesID = getSonsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"contains\" :\n $ORDER_ORIENTATION = 'DESC';\n if ($recursive) {\n $entitiesID = getAncestorsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"equals\" :\n $ORDER_ORIENTATION = '';\n if ($recursive) {\n $entitiesID = getSonsAndAncestorsOf('glpi_entities', $entityID);\n }\n break;\n }\n\n $entitiesID[] = $entityID;\n $WHERE['entities_id'] = $entitiesID;\n $WHERE['version'] = $version;\n\n if (!empty($condition[\"exclude IDs\"])) {\n if (is_array($condition[\"exclude IDs\"])) {\n if (count($condition[\"exclude IDs\"]) > 1) {\n $WHERE['NOT'] = ['id' => $condition['exclude IDs']];\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs'][0]];\n }\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs']];\n }\n }\n\n $ORDER = [];\n // By ordering on the netmask, we ensure that the first element is the nearest one (ie:\n // the last should be 0.0.0.0/0.0.0.0 of x.y.z.a/255.255.255.255 regarding the interested\n // element)\n for ($i = $startIndex; $i < 4; ++$i) {\n $ORDER[] = new \\QueryExpression(\"BIT_COUNT(\".$DB->quoteName($netmaskDB[$i]).\") $ORDER_ORIENTATION\");\n }\n\n if (!empty($condition[\"where\"])) {\n $WHERE .= \" AND \" . $condition[\"where\"];\n }\n\n $iterator = $DB->request([\n 'SELECT' => $fields,\n 'FROM' => self::getTable(),\n 'WHERE' => $WHERE,\n 'ORDER' => $ORDER\n ]);\n\n $returnValues = [];\n while ($data = $iterator->next()) {\n if (count($fields) > 1) {\n $returnValue = [];\n foreach ($fields as $field) {\n $returnValue[$field] = $data[$field];\n }\n } else {\n $returnValue = $data[$fields[0]];\n }\n $returnValues[] = $returnValue;\n }\n return $returnValues;\n }", "private function sql_whereWiHits()\n {\n // Get WHERE statement\n $where = $this->pObj->objSqlInit->statements[ 'listView' ][ 'where' ] .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS();\n // Localise the WHERE statement\n $where = $this->sql_whereWiHitsLL( $where );\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "private function internal_get_restrictions() {\n global $DB;\n $where = '';\n $wherearray = array();\n if ($this->courseid) {\n $where .= \"\\nAND d.courseid = ?\";\n $wherearray[] = $this->courseid;\n }\n if ($this->plugin) {\n $where .= \"\\nAND d.plugin = ?\";\n $wherearray[] = $this->plugin;\n }\n $cmrestrictions = false;\n if ($this->coursemoduleid) {\n $where .= \"\\nAND d.coursemoduleid = ?\";\n $wherearray[] = $this->coursemoduleid;\n $cmrestrictions = array($this->coursemoduleid => true);\n }\n if ($this->cmarray) {\n // The courses restriction is technically unnecessary except\n // that we don't have index on coursemoduleid alone, so\n // it is probably better to use course.\n $uniquecourses = array();\n $cmrestrictions = array();\n foreach ($this->cmarray as $cm) {\n $cmrestrictions[$cm->id] = true;\n $uniquecourses[$cm->course] = true;\n }\n list ($cmwhere, $cmwherearray) =\n $DB->get_in_or_equal(array_keys($cmrestrictions));\n list ($coursewhere, $coursewherearray) =\n $DB->get_in_or_equal(array_keys($uniquecourses));\n $where .= \"\\nAND d.coursemoduleid \" . $cmwhere .\n \"\\nAND d.courseid \" . $coursewhere;\n $wherearray = array_merge($wherearray, $cmwherearray, $coursewherearray);\n }\n if (is_array($this->groupids)) {\n if ($this->groupids === self::NONE) {\n $where .= \"\\nAND d.groupid IS NULL\";\n } else {\n $where .= \"\\nAND\";\n if ($this->groupexceptions) {\n $gxcourses = array();\n $gxcms = array();\n foreach ($this->groupexceptions as $cm) {\n // If we are restricting to CMs, don't bother including\n // group exceptions for CMs that are not in that list.\n if ($cmrestrictions) {\n if (!array_key_exists($cm->id, $cmrestrictions)) {\n continue;\n }\n }\n $gxcms[$cm->id] = true;\n $gxcourses[$cm->course] = true;\n }\n if (!empty($gxcms)) {\n list ($cmwhere, $cmwherearray) =\n $DB->get_in_or_equal(array_keys($gxcms));\n list ($coursewhere, $coursewherearray) =\n $DB->get_in_or_equal(array_keys($gxcourses));\n\n $where .= \"\\n(\\n (\\n d.coursemoduleid \" . $cmwhere .\n \"\\n AND d.courseid \" . $coursewhere .\n \"\\n )\\n OR\";\n $wherearray = array_merge($wherearray, $cmwherearray, $coursewherearray);\n }\n }\n if (count($this->groupids) == 0) {\n $where .= \"\\n (\\n FALSE\";\n } else {\n list ($groupwhere, $groupwherearray) =\n $DB->get_in_or_equal($this->groupids);\n $where .= \"\\n (\\n d.groupid \" . $groupwhere;\n $wherearray = array_merge($wherearray, $groupwherearray);\n }\n if ($this->allownogroup) {\n $where .= ' OR d.groupid IS NULL';\n }\n if ($this->groupexceptions && !empty($gxcms)) {\n $where .= \"\\n )\\n)\";\n } else {\n $where .= \"\\n)\";\n }\n }\n }\n if (is_array($this->userids) && !empty($this->userids)) {\n if (reset($this->userids) == self::NONE) {\n $where .= \"\\nAND d.userid IS NULL\";\n } else {\n list ($userwhere, $userwherearray) = $DB->get_in_or_equal($this->userids);\n $where .= \"\\nAND (d.userid \" . $userwhere;\n $wherearray = array_merge($wherearray, $userwherearray);\n if ($this->allownouser) {\n $where .= ' OR d.userid IS NULL';\n }\n $where .= ')';\n }\n }\n return array($where, $wherearray);\n }", "function get_entity_ids_ip_by_network($entity_type, $network, $add_where = '')\n{\n\n // Recursive query for array of networks\n if (is_array($network))\n {\n $ids = array();\n foreach ($network as $entry)\n {\n if ($entry_ids = get_entity_ids_ip_by_network($entity_type, $entry, $add_where))\n {\n $ids = array_merge($ids, $entry_ids);\n }\n }\n\n return $ids;\n }\n\n // Parse for valid network string\n $network_array = parse_network($network);\n //print_vars($network_array);\n if (!$network_array)\n {\n // Incorrect network/address string passed\n return FALSE;\n }\n\n $query = 'SELECT ';\n $join = '';\n $where = ' WHERE 1 ';\n switch ($entity_type)\n {\n case 'ipv4':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv4';\n $query .= ' `ipv4_address_id`';\n break;\n case 'ipv6':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv6';\n $query .= ' `ipv6_address_id`';\n break;\n case 'ip':\n $query .= ($network_array['ip_version'] == 4) ? ' `ipv4_address_id`' : ' `ipv6_address_id`';\n break;\n\n case 'device':\n case 'devices':\n $query .= ' DISTINCT `device_id`';\n break;\n\n case 'port':\n case 'ports':\n $query .= ' DISTINCT `port_id`';\n break;\n }\n\n switch ($network_array['ip_type'])\n {\n case 'ipv4':\n $query .= ' FROM `ipv4_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv4_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv4_binary` >= ? AND `ipv4_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= generate_query_values($network_array['address'], 'ipv4_address', $network_array['query_type']);\n }\n break;\n case 'ipv6':\n $query .= ' FROM `ipv6_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv6_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv6_binary` >= ? AND `ipv6_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= ' AND (' . generate_query_values($network_array['address'], 'ipv6_address', $network_array['query_type'], FALSE) .\n ' OR ' . generate_query_values($network_array['address'], 'ipv6_compressed', $network_array['query_type'], FALSE) . ')';\n }\n break;\n }\n\n if (FALSE)\n {\n // Ignore disabled/deleted/ignored\n $where .= ' AND `device_id` NOT IN (SELECT `device_id` FROM `devices` WHERE `disabled` = \"1\" OR `ignore` = \"1\")';\n $where .= ' AND `port_id` NOT IN (SELECT `port_id` FROM `ports` WHERE `deleted` = \"1\" OR `ignore` = \"1\")';\n } else {\n // Always ignore deleted ports\n $join = ' LEFT JOIN `ports` USING (`device_id`, `port_id`) ';\n // IS NULL allow to search addresses without associated port\n $where .= ' AND (`ports`.`deleted` != \"1\" OR `ports`.`deleted` IS NULL)';\n }\n $query .= $join;\n $where .= $add_where; // Additional query, ie limit by device_id or port_id\n\n $ids = dbFetchColumn($query . $where, $param);\n //$ids = dbFetchColumn($query . $where, $param);\n //print_vars($ids);\n\n return $ids;\n}", "public function createWhere() {\n\t\tlist($where, $joins) = parent::createWhere();\n\t\tif (!($this->parent->parent instanceof QuerySet))\n\t\t\t$where = \" WHERE \" . $where;\n\t\telse\n\t\t\t$where = \" AND \" . $where;\n\t \n\t\treturn array($where, $joins);\n\t}", "function Inscription_Certificates_All_Where()\n {\n $type=$this->CGI_GET(\"Type\");\n $where=$this->UnitEventWhere\n (\n array\n (\n \"Type\" => $this->Certificate_Type,\n )\n );\n\n return $where;\n }", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "function searchwp_query_where() {\n\t\tglobal $wpdb;\n\n\t\t$sql = '';\n\n\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t$this->get_woocommerce_ordering();\n\t\t}\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\t\t\t// ratings need moar SQL\n\t\t\tif ( 'rating' === $this->ordering['wc_orderby'] ) {\n\t\t\t\t$sql = \" AND ( swpwpcommeta.meta_key = 'rating' OR swpwpcommeta.meta_key IS null ) \";\n\t\t\t}\n\t\t}\n\n\t\t// Pre WooCommerce 3.0: use meta to limit visibility\n\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '3.0.0', '<' ) ) {\n\t\t\tif ( $this->is_woocommerce_search() ) {\n\t\t\t\t// visibility\n\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility', true ) ) {\n\t\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility_variations', true ) ) {\n\t\t\t\t\t\t$sql .= \" AND ( ( {$wpdb->prefix}posts.post_type = 'product_variation' OR ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) ) \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" AND ( ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "protected function getWhereClauseForEnabledFields() {}", "function AdvancedSearchWhere() {\n\t\tglobal $Security, $t_tinbai_mainsite;\n\t\t$sWhere = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->PK_TINBAI_ID, FALSE); // PK_TINBAI_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_CONGTY_ID, FALSE); // FK_CONGTY_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DMGIOITHIEU_ID, FALSE); // FK_DMGIOITHIEU_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DMTUYENSINH_ID, FALSE); // FK_DMTUYENSINH_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTSVTUONGLAI_ID, FALSE); // FK_DTSVTUONGLAI_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTSVDANGHOC_ID, FALSE); // FK_DTSVDANGHOC_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTCUUSV_ID, FALSE); // FK_DTCUUSV_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID, FALSE); // FK_DTDOANHNGHIEP_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_TITLE, FALSE); // C_TITLE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_SUMARY, FALSE); // C_SUMARY\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_CONTENTS, FALSE); // C_CONTENTS\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_HIT_MAINSITE, FALSE); // C_HIT_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_NEW_MYSEFLT, FALSE); // C_NEW_MYSEFLT\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_COMMENT_MAINSITE, FALSE); // C_COMMENT_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ORDER_MAINSITE, FALSE); // C_ORDER_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_STATUS_MAINSITE, FALSE); // C_STATUS_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_VISITOR_MAINSITE, FALSE); // C_VISITOR_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ACTIVE_MAINSITE, FALSE); // C_ACTIVE_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE, FALSE); // C_TIME_ACTIVE_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE, FALSE); // FK_NGUOIDUNGID_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_NOTE, FALSE); // C_NOTE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_USER_ADD, FALSE); // C_USER_ADD\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ADD_TIME, FALSE); // C_ADD_TIME\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_USER_EDIT, FALSE); // C_USER_EDIT\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_EDIT_TIME, FALSE); // C_EDIT_TIME\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_EDITOR_ID, FALSE); // FK_EDITOR_ID\n\n\t\t// Set up search parm\n\t\tif ($sWhere <> \"\") {\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->PK_TINBAI_ID); // PK_TINBAI_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_CONGTY_ID); // FK_CONGTY_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DMGIOITHIEU_ID); // FK_DMGIOITHIEU_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DMTUYENSINH_ID); // FK_DMTUYENSINH_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTSVTUONGLAI_ID); // FK_DTSVTUONGLAI_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTSVDANGHOC_ID); // FK_DTSVDANGHOC_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTCUUSV_ID); // FK_DTCUUSV_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID); // FK_DTDOANHNGHIEP_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_TITLE); // C_TITLE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_SUMARY); // C_SUMARY\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_CONTENTS); // C_CONTENTS\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_HIT_MAINSITE); // C_HIT_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_NEW_MYSEFLT); // C_NEW_MYSEFLT\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_COMMENT_MAINSITE); // C_COMMENT_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ORDER_MAINSITE); // C_ORDER_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_STATUS_MAINSITE); // C_STATUS_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_VISITOR_MAINSITE); // C_VISITOR_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ACTIVE_MAINSITE); // C_ACTIVE_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE); // C_TIME_ACTIVE_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE); // FK_NGUOIDUNGID_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_NOTE); // C_NOTE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_USER_ADD); // C_USER_ADD\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ADD_TIME); // C_ADD_TIME\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_USER_EDIT); // C_USER_EDIT\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_EDIT_TIME); // C_EDIT_TIME\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_EDITOR_ID); // FK_EDITOR_ID\n\t\t}\n\t\treturn $sWhere;\n\t}", "public static function getFilter()\n {\n if (isset($conf['kolab']['server']['params']['admin'][self::ATTRIBUTE_SID])) {\n $manager = $conf['kolab']['server']['params']['admin'][self::ATTRIBUTE_SID];\n } else {\n $manager = 'manager';\n }\n\n $criteria = array('AND' => array(\n array('field' => self::ATTRIBUTE_CN,\n 'op' => 'any'),\n array('field' => self::ATTRIBUTE_SN,\n 'op' => 'any'),\n array('field' => self::ATTRIBUTE_OC,\n 'op' => '=',\n 'test' => self::OBJECTCLASS_INETORGPERSON),\n array('NOT' => array(\n array('field' => self::ATTRIBUTE_SID,\n 'op' => '=',\n 'test' => $manager),\n ),\n ),\n ),\n );\n return $criteria;\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "public function getWhereClauseForEnabledFieldsIncludesDeletedCheckInBackend() {}", "function _buildContentWhere()\n\t{\n\t\t$user = & JFactory::getUser() ;\t\t\n\t\t$hidePastEvents = EventBookingHelper::getConfigValue('hide_past_events');\n\t\t$where = array() ;\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$where[] = 'a.published = 1';\n\t\tif (version_compare(JVERSION, '1.6.0', 'ge')) {\n\t\t $where[] = ' a.access IN ('.implode(',', $user->getAuthorisedViewLevels()).')' ;\n\t\t} else {\n\t\t $gid\t\t= $user->get('aid', 0);\n\t\t $where[] = ' a.access <= '.(int)$gid ; \n\t\t}\t\t\n\t\tif ($categoryId) {\n\t\t\t//$where[] = ' a.category_id = '.$categoryId ;\t\t\t\t\t\t\n\t\t\t$where[] = ' a.id IN (SELECT event_id FROM #__eb_event_categories WHERE category_id='.$categoryId.')' ;\n\t\t}\n\t\tif ($hidePastEvents) {\n\t\t\t$where[] = ' DATE(a.event_date) >= CURDATE() ';\n\t\t}\n\t\t$where \t\t= ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );\t\t\n\t\treturn $where;\n\t}", "protected function getWhereKeys(){\n\t\t\t$whereKeys = \"1\";\n\t\t\tif($this->keys){\n\t\t\t\t$whereKeys = array();\n\t\t\t\tforeach ($this->keys as $key) {\n\t\t\t\t\t$whereKeys[] = \"$key = :$key\";\n\t\t\t\t}\n\t\t\t\t$whereKeys = implode(\" AND \", $whereKeys);\n\t\t\t}\n\t\t\treturn $whereKeys;\n\t\t}", "public function getTableWhere() {}", "private function sql_where($filter, $structure) {\n\t\t$pool_class = $structure['class'] . 'Pool_Model';\n\t\t$visitor = new $this->sql_builder_visitor_class_name(array($pool_class, \"map_name_to_backend\"));\n\t\t$sql = \" WHERE \".$filter->visit($visitor, false);\n\t\treturn $sql;\n\t}", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "function paginationConditions() {\n // Only retrieve attributes in the current match server\n \n $ret = array();\n \n $ret['conditions']['MatchServerAttribute.match_server_id'] = $this->request->params['named']['matchserver'];\n \n return $ret;\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "function where($includeContactIDs = FALSE) {\n $this->getCriteria();\n\n $params = array();\n $where = \"contact_a.contact_type = 'Individual'\";\n $where .= \" AND contact_a.contact_sub_type like '%Pers_Medewerker%'\";\n\n//preferred_language\n if (array_key_exists (\"languages\",$this->formValues)) {\n $lang = implode (\"','\",array_keys($this->formValues[\"languages\"]));\n $where .= \" AND contact_a.preferred_language IN ('$lang')\";\n }\n $count = 1;\n $clause = array();\n\n foreach ($this->criteria as $section) {\n if (!$this->$section) continue;\n $t = array();\n \n foreach ($this->$section as $i) {\n $t [] = $this->column[$section] . \" LIKE '%\". $i .\"%'\";\n }\n $clause[] = \" ( \". implode(\" OR \",$t ). \" ) \";\n $params[$count] = array($this->$section, 'String');\n $count++;\n }\n\n/*\n $params[$count] = array($name, 'String');\n $clause[] = \"contact_a.household_name LIKE %{$count}\";\n $count++;\n*/\n if (!empty($clause)) {\n $where .= ' AND ' . implode(' AND ', $clause);\n }\n return $this->whereClause($where, $params);\n }", "function get_companies_where($connection, $params=array())\n{\n try {\n $params_imploded = implode(\"','\",$params);\n $sql = \"SELECT symbol,name FROM companies WHERE symbol IN ('$params_imploded')\";\n $result = runQuery($connection, $sql, null);\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n}", "private static function getSearchableCategories() {\n\t\t$or = \"\";\n\t\t$sql_str = \"(\";\n\t\t\n\t\t# include the list of 'types' from the database that should be searched\n\t\tinclude(\"searchabletypes.inc.php\");\n\t\n\t\tforeach ($searchable_types as $searchable_type) {\t\n\t\t\t$sql_str .= $or.\"type = '\".$searchable_type.\"' \";\n\t\t\tif ($or == \"\") {\n\t\t\t\t$or = \"OR \";\n\t\t\t}\n\t\t}\n\t\t$sql_str .= \")\";\n\t\treturn $sql_str;\n\t}", "protected function getWhereQuery(Request $request){\n $where = [];\n foreach((array) $request->get('q', []) as $query){\n\n $q = array_filter(explode(':', $query));\n\n if(count($q) == 1){\n //worthless\n continue;\n }elseif(count($q) == 2){\n //for consistency\n $q = [$q[0], '=', $q[1]];\n }\n\n //are we allowed to filter by this field?\n if(!in_array($q[0], $this->allowedWheres)){\n continue;\n }\n\n //add like wildcards if not present\n if($q[1] == 'like' && !starts_with($q[2], '%') && !ends_with($q[2], '%')){\n $q[2] = '%' . $q[2] . '%';\n }\n $where[] = $q;\n }\n return $where;\n }", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n if ($debug)\n $warn .= '<p>SubDistrictSet::getWhere: ' . \n print_r($this->parms, true) . \"</p>\\n\";\n $where = '';\n $and = 'WHERE ';\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // create WHERE clause\n foreach($this->parms as $fldname => $value)\n {\n $fieldLc = SubDistrict::getRealFieldName($fldname);\n switch($fieldLc)\n { // act on specific fields\n case 'sd_census':\n { // census field\n if (is_string($value))\n {\n $censusId = $value;\n $censusObj = new Census(array('censusid'=> $value));\n }\n else\n if ($value instanceof Census)\n {\n $censusObj = $value;\n $censusId = $censusObj->get('censusid');\n }\n $where .= \"$and`SD_Census`=:censusid\";\n $this->sqlParms['censusid'] = $censusId;\n $and = ' AND ';\n if (!$censusObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported Census='$value'</p>\\n\";\n break;\n } // census field\n\n case 'sd_distid':\n { // district id field\n if (is_string($value))\n {\n $distId = $value;\n $parms = array('census'=>$censusObj,\n 'id' => $value);\n $districtObj = new District($parms);\n }\n else\n if ($value instanceof District)\n {\n $districtObj = $value;\n $distId = $districtObj->get('id');\n }\n $where .= \"$and`SD_DistId`=:distid\";\n $this->sqlParms['distid'] = $distId;\n $and = ' AND ';\n if (!$districtObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported District='$distId'</p>\\n\";\n break;\n } // domain field\n\n default:\n {\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unrecognized search parameter `$fldname`.</p>\";\n break;\n }\n\n } // act on specific fields\n } // loop through all parameters\n\n return $where;\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "function build_select_query($c, $w)\n{\n $where_temp = array();\n $query = array();\n $columns = '';\n $where = '';\n foreach ($w as $k => $v)\n {\n array_push($where_temp, \"`$k` = '$v'\");\n }\n\n $where = implode(\" AND \", $where_temp);\n $columns = implode(\",\", $c);\n array_push($query, $columns);\n array_push($query, $where);\n return $query;\n}", "protected function getQuery()\n {\n $query = $this->database->select()->from($this->table);\n \n foreach ($this->join as $join) {\n if (!is_array($join[2])) {\n $join[2] = array($join[2]);\n }\n \n $where = array_shift($join[2]);\n if (!empty($join[2])) {\n foreach ($join[2] as $i => $value) {\n $join[2][$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $join[2]);\n }\n \n $query->join($join[0], $join[1], $where, $join[3]);\n }\n \n foreach ($this->filter as $i => $filter) {\n //array('post_id=%s AND post_title IN %s', 123, array('asd'));\n $where = array_shift($filter);\n if (!empty($filter)) {\n foreach ($filter as $i => $value) {\n $filter[$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $filter);\n }\n \n $query->where($where);\n }\n \n return $query;\n }", "function BasicSearchWhere() {\n\tglobal $Security, $dpp_proveedores;\n\t$sSearchStr = \"\";\n\t$sSearchKeyword = ew_StripSlashes(@$_GET[EW_TABLE_BASIC_SEARCH]);\n\t$sSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\tif ($sSearchKeyword <> \"\") {\n\t\t$sSearch = trim($sSearchKeyword);\n\t\tif ($sSearchType <> \"\") {\n\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t$sSearchStr .= \"(\" . BasicSearchSQL($sKeyword) . \")\";\n\t\t\t}\n\t\t} else {\n\t\t\t$sSearchStr = BasicSearchSQL($sSearch);\n\t\t}\n\t}\n\tif ($sSearchKeyword <> \"\") {\n\t\t$dpp_proveedores->setBasicSearchKeyword($sSearchKeyword);\n\t\t$dpp_proveedores->setBasicSearchType($sSearchType);\n\t}\n\treturn $sSearchStr;\n}", "private static function buildCrossRefQueryComponents($obj, $obj_id, $node, $node_id, $opp_obj, $opp_obj_id)\n{\n\n // As ordinarally done, when not cross referencing:\n list($from,$where,$tid) = Stats::buildQueryComponents($obj, $obj_id, $node, $node_id);\n \n // Now filter matches only showing those against a specific opponent:\n list($from_opp,$where_opp,$tid_opp) = Stats::buildQueryComponents($opp_obj, $opp_obj_id, $node, $node_id, '2');\n $where[] = \"(team1_id = $tid_opp OR team2_id = $tid_opp)\";\n $from = array_merge($from, array_values(array_diff($from_opp, $from)));\n $where = array_merge($where, array_values(array_diff($where_opp, $where)));\n\n return array($from,$where,$tid,$tid_opp);\n}", "function BasicSearchWhere() {\r\n\t\tglobal $Security;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\r\n\t\t$sSearchType = $this->BasicSearch->Type;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"=\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t\t$this->Command = \"search\";\r\n\t\t}\r\n\t\tif ($this->Command == \"search\") {\r\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\r\n\t\t\t$this->BasicSearch->setType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function getSQLWhereCondition($query_header, $post, $config_language_id)\n {\n $sql = \" WHERE pd.language_id = '\" . (int) $config_language_id . \"' \";\n\n // Filter by categories\n if (isset($post['categories'])) {\n $category_ids = array_map('intval', $post['categories']);\n $category_ids = implode(\",\", $category_ids);\n\n $sql .= \" AND p2c.category_id IN (\" . $category_ids . \") \";\n }\n\n // Filter by manufacturers\n if (isset($post['manufacturers'])) {\n $manufacturer_ids = array_map('intval', $post['manufacturers']);\n $manufacturer_ids = implode(\",\", $manufacturer_ids);\n\n $sql .= \" AND p.manufacturer_id IN (\" . $manufacturer_ids . \") \";\n }\n\n // Filter by special_groups\n if (isset($post['special_groups'])) {\n $special_groups_ids = array_map('intval', $post['special_groups']);\n $special_groups_ids = implode(\",\", $special_groups_ids);\n\n $sql .= \" AND ps.product_special_group_id IN (\" . $special_groups_ids . \") \";\n }\n\n // Attach additional chosen products\n if (isset($post['products'])) {\n $product_ids = array_map('intval', $post['products']['id']);\n\n $sql .= \" UNION \" . $query_header;\n $sql .= \" WHERE ps.product_id IN (\" . implode(\",\", $product_ids) . \") AND pd.language_id = '\" . (int) $config_language_id . \"' \";\n }\n\n return $sql;\n }", "private function getContainQueries()\n {\n $containStatistics = function (Query $q) {\n return $q->select([\n 'id',\n 'year',\n 'value',\n 'metric_id',\n 'school_id',\n 'school_district_id',\n ]);\n };\n $containCriteria = function (Query $q) {\n return $q\n ->select(['id', 'formula_id', 'weight'])\n ->contain([\n 'Metrics' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containSchools = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'address',\n 'url',\n 'phone',\n ])\n ->contain([\n 'Grades' => function (Query $q) {\n return $q\n ->select(['id', 'name'])\n ->orderAsc('Grades.id');\n },\n 'SchoolTypes' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containDistricts = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'url',\n 'phone',\n ]);\n };\n $containFormulas = function (Query $q) use ($containCriteria) {\n return $q\n ->select(['id'])\n ->contain([\n 'Criteria' => $containCriteria,\n ]);\n };\n $containResultsSchools = function (Query $q) use ($containSchools, $containStatistics) {\n return $q->contain([\n 'Schools' => $containSchools,\n 'Statistics' => $containStatistics,\n ]);\n };\n $containResultsDistricts = function (Query $q) use ($containDistricts, $containStatistics) {\n return $q->contain([\n 'SchoolDistricts' => $containDistricts,\n 'Statistics' => $containStatistics,\n ]);\n };\n\n return [\n 'formulas' => $containFormulas,\n 'resultsSchools' => $containResultsSchools,\n 'resultsDistricts' => $containResultsDistricts,\n ];\n }", "public function getCriteria();", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function operatorK()\n\t{\n\t\t$condition = ['or'];\n\t\tforeach ($this->getRelatedTableName() as $formattedName) {\n\t\t\t$condition[] = ['not like', $formattedName, $this->getValue()];\n\t\t}\n\t\treturn $condition;\n\t}", "function get_sql_where(){\r\n\t\t$where_str='';\r\n\t\t$multiple_search_str='';\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' ORDER BY ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' ORDER BY ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telseif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telse\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7).')';\r\n\t\t}else{\r\n\t\t\t$where_str_ini='';\r\n\t\t}\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++)\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\r\n\t\tfor($i=0; $i<count($arr_sql_fields); $i++){\r\n\r\n\t\t\tif(empty($this->multiple_search[$i]))\r\n\t\t\t\t$this->multiple_search[$i]='';\r\n\r\n\t\t\tif($this->search!='' and $this->search_init[$i]!='f')\r\n\t\t\t\t$where_str.=(($i==0 and $where_str_ini) ? ' AND ' : '').($where_str ? ' OR ' : '(').$arr_sql_fields[$i].\" LIKE '%\".$this->search.\"%'\";\r\n\r\n\t\t\tif(count($this->multiple_search)>0 and $this->multiple_search[$i]!='' and $this->multiple_search_init[$i]!='f')\r\n\t\t\t\t$multiple_search_str.=(($where_str_ini or $where_str or $multiple_search_str) ? ' AND ' : '').$arr_sql_fields[$i].\" LIKE '%\".$this->multiple_search[$i].\"%'\";\r\n\r\n\t\t}\r\n\r\n\t\tif($where_str!='')\r\n\t\t\t$where_str.=')';\r\n\r\n\t\treturn (($where_str_ini or $where_str or $multiple_search_str) ? ' WHERE ' : '').$where_str_ini.$where_str.$multiple_search_str;\r\n\t}", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "function start_group_where($key,$value=NULL,$escape=TRUE,$type=\"AND\")\n {\n $this->open_bracket($type); \n return parent::_where($key, $value,'',$escape); \n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "function simplenews_build_subscription_filter_query(SelectQueryInterface $query) {\n if (isset($_SESSION['simplenews_subscriptions_filter'])) {\n foreach ($_SESSION['simplenews_subscriptions_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->condition('su.' . $key, $value);\n }\n break;\n case 'email':\n if (!empty($value)) {\n $query->condition('sn.mail', '%' . $value . '%', 'LIKE');\n }\n break;\n }\n }\n }\n}", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "public function getSearchLabelQuery()\n\t{\n\t\t$query = (new Db\\Query())->select(['csl.crmid', 'csl.setype', 'csl.searchlabel'])\n\t\t\t->from('u_#__crmentity_search_label csl')->innerJoin('vtiger_tab', 'csl.setype = vtiger_tab.name');\n\t\t$where = ['and', ['vtiger_tab.presence' => 0]];\n\t\tif ($this->moduleName) {\n\t\t\t$where[] = ['csl.setype' => $this->moduleName];\n\t\t\tif (\\is_string($this->moduleName) && isset($this->moduleConditions[$this->moduleName])) {\n\t\t\t\t$where[] = $this->moduleConditions[$this->moduleName]['where'];\n\t\t\t\tif (isset($this->moduleConditions[$this->moduleName]['innerJoin'])) {\n\t\t\t\t\tforeach ($this->moduleConditions[$this->moduleName]['innerJoin'] as $table => $on) {\n\t\t\t\t\t\t$query->innerJoin($table, $on);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->entityName) {\n\t\t\t$where[] = ['vtiger_entityname.turn_off' => 1];\n\t\t\t$query->innerJoin('vtiger_entityname', 'csl.setype = vtiger_entityname.modulename');\n\t\t\tif (2 === \\App\\Config::search('GLOBAL_SEARCH_SORTING_RESULTS')) {\n\t\t\t\t$query->orderBy('vtiger_entityname.sequence');\n\t\t\t}\n\t\t}\n\t\tif ($this->checkPermissions) {\n\t\t\t$where[] = ['like', 'csl.userid', \",$this->userId,\"];\n\t\t}\n\t\tswitch ($this->operator) {\n\t\t\tcase 'Begin':\n\t\t\t\t$where[] = ['like', 'csl.searchlabel', \"$this->searchValue%\", false];\n\t\t\t\tbreak;\n\t\t\tcase 'End':\n\t\t\t\t$where[] = ['like', 'csl.searchlabel', \"%$this->searchValue\", false];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tcase 'Contain':\n\t\t\t\tif (false !== strpos($this->searchValue, '*') || false !== strpos($this->searchValue, '_')) {\n\t\t\t\t\t$where[] = ['like', 'csl.searchlabel', str_replace('*', '%', \"%{$this->searchValue}%\"), false];\n\t\t\t\t} else {\n\t\t\t\t\t$where[] = ['like', 'csl.searchlabel', $this->searchValue];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'FulltextBegin':\n\t\t\t\t$query->addSelect(['matcher' => new \\yii\\db\\Expression('MATCH(csl.searchlabel) AGAINST(:searchValue IN BOOLEAN MODE)', [':searchValue' => $this->searchValue . '*'])]);\n\t\t\t\t$query->andWhere('MATCH(csl.searchlabel) AGAINST(:findvalue IN BOOLEAN MODE)', [':findvalue' => $this->searchValue . '*']);\n\t\t\t\t$query->addOrderBy(['matcher' => \\SORT_DESC]);\n\t\t\t\tbreak;\n\t\t\tcase 'FulltextWord':\n\t\t\t\t$query->addSelect(['matcher' => new \\yii\\db\\Expression('MATCH(csl.searchlabel) AGAINST(:searchValue IN BOOLEAN MODE)', [':searchValue' => $this->searchValue])]);\n\t\t\t\t$query->andWhere('MATCH(csl.searchlabel) AGAINST(:findvalue IN BOOLEAN MODE)', [':findvalue' => $this->searchValue]);\n\t\t\t\t$query->addOrderBy(['matcher' => \\SORT_DESC]);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $query->andWhere($where);\n\t}", "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 }", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "protected function sourceQuery(){\n $query = parent::sourceQuery();\n $query->condition('i.field_name', array_keys($this->getFieldNameMappings()), 'NOT IN');\n return $query;\n }", "function searchSQL ($aRequest) {\n $sVersion = DBUtil::getOneResultKey(\"SHOW VARIABLES LIKE 'version'\", \"Value\");\n if ((int)substr($sVersion, 0, 1) >= 4) {\n $boolean_mode = \"IN BOOLEAN MODE\";\n } else {\n $boolean_mode = \"\";\n }\n\n $p = array();\n $p[0] = \"MATCH(DDCT.body) AGAINST (? $boolean_mode)\";\n\t$p[1] = KTUtil::phraseQuote($aRequest[$this->getWidgetBase()]);\n \n // handle the boolean \"not\" stuff.\n $want_invert = KTUtil::arrayGet($aRequest, $this->getWidgetBase() . '_not');\n if (is_null($want_invert) || ($want_invert == \"0\")) {\n return $p;\n } else {\n $p[0] = '(NOT (' . $p[0] . '))';\n } \n \n return $p;\n }", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n \tif($search = trim($this->_state->search))\n\t\t{\n\t\t\t$parts\t= explode(' ', $search);\n\t\t\t$states\t= array();\n\t\t\tforeach($parts as $i => $part)\n\t\t\t{\n\t\t\t\tif(strpos($part, ':') === false) continue;\n\t\t\t\t$keys = explode(':', $part);\n\t\t\t\t$states[$keys[0]] = $keys[1];\n\t\t\t\tunset($parts[$i]);\n\t\t\t}\n\t\t\t\n\t\t\tif($states)\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\tforeach(array('username', 'email') as $key)\n\t\t\t\t{\n\t\t\t\t\tif(isset($states[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query->where('tbl.'.$key, 'LIKE', '%'.$states[$key].'%');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($parts) $query->where('tbl.name', 'LIKE', '%'.implode($parts).'%');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//To avoid auto quoting, and also trim trailing whitespace\n\t\t\t\t$search = $this->getTable()->getDatabase()->quoteValue('%'.strtoupper($search).'%');\n\t\t\t\t$name \t= '';\n\n\t\t\t\tif (JFactory::getApplication()->isAdmin())\n\t\t\t\t\t\t$name = 'tbl.name LIKE '.$search.' OR';\n\t\t\t\t$query\n\t\t\t\t\t ->where(\"($name tbl.username LIKE $search OR tbl.email LIKE $search OR person.alias LIKE $search)\")\n\t\t\t\t\t /*->where('tbl.name', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.username', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.email', 'LIKE', '%'.$search.'%', 'or')*/;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$group = $this->_state->usergroup;\n\t\tif($group)\n\t\t{\n\t\t\t$column = version_compare(JVERSION,'1.6.0','ge') ? 'group_id' : 'gid';\n\t\t\t$query->where($column, '=', (int)$group);\n\t\t}\n\t\t\n\t\tif(!$this->_state->me)\n\t\t{\n\t\t $me = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t\t$query->where('tbl.id', '!=', $me->id);\n\t\t}\n\t\t\n\t\t//Don't show blocked users\n\t\t$query->where('tbl.block', '=', 0);\n\n\t\tparent::_buildQueryWhere($query);\n\t}", "function get_occurs_within_where_clause($table_name, $rel_table, $start_ts_obj, $end_ts_obj, $field_name='date_start', $view){\n\t\tglobal $timedate;\n\t\n\t\t$start = clone $start_ts_obj;\n\t\t$end = clone $end_ts_obj;\n\n\t\t$field_date = $table_name.'.'.$field_name;\n\t\t$start_day = $GLOBALS['db']->convert(\"'{$start->asDb()}'\",'datetime');\n\t\t$end_day = $GLOBALS['db']->convert(\"'{$end->asDb()}'\",'datetime');\n\n\t\t$where = \"($field_date >= $start_day AND $field_date < $end_day\";\n\t\tif($rel_table != ''){\n\t\t\t$where .= \" AND $rel_table.accept_status != 'decline'\";\n\t\t}\n\n\t\t$where .= \")\";\n\t\treturn $where;\n\t}", "public function getFilters() {\n\t\tif (!$this->filter) {\n\t\t\t$f = $this->db->getAndFilter();\n\t\t} else {\n\t\t\t$f = $this->filter;\n\t\t}\n\t\tforeach ($this->join as $j) {\n\t\t\t$f->subEq($j[2]->getFilters());\n\t\t}\n\t\treturn $f;\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "function MyMod_Search_Vars_Pre_Where()\n {\n $searchvars=array();\n foreach ($this->MyMod_Search_Vars() as $data)\n {\n $wheres=array();\n if ($this->MyMod_Data_Access($data)>=1)\n {\n $rdata=$this->MyMod_Search_CGI_Name($data);\n $value=$this->MyMod_Search_CGI_Value($data);\n\n if (!empty($value))\n {\n $where=$this->MyMod_Search_Var_Where($data,$value);\n if (!empty($where))\n {\n array_push($wheres,$where);\n }\n\n $searchjoined=$this->ItemData($data,\"Search_Joined\");\n\n if (is_array($searchjoined))\n {\n foreach ($searchjoined as $rdata)\n {\n if (!empty($this->ItemData[ $rdata ]))\n {\n array_push\n (\n $wheres,\n $this->MyMod_Search_Var_Where($data,$value,$rdata)\n );\n }\n }\n }\n\n $searchvars[ $data ]=\"(\".join(\" OR \",$wheres).\")\";\n }\n }\n \n }\n\n return $searchvars;\n }", "function getJoinCondition() ;", "function helperGetAvailableRecords($catList='', $areaSearch='') {\n\t\t$where = ' lng!=0 AND lat!=0 '.$this->config['pid_list'];\n\n\t\tif (!empty($areaSearch)) {\n\t\t// build the query\n\t\t$areaArr= $this->intExplode('%2C%20',$areaSearch, 1);\n\t\t$where .= ' AND lng between '.$areaArr[1].' AND '.$areaArr[3].'\n\t\t\t\t\t\t\tAND\tlat between '.$areaArr[0].' AND '.$areaArr[2];\n\t\t}\n\n\t\t// if no category chosen, be sure no result gets displayed\n\t\tif($catList==9999) {\n\t\t\t$where .= ' AND 1=2 ';\n\t\t} elseif ($catList!='') {\n\n\t\t\t$catList = $this->intExplode(',', $catList);\n\t\t\tforeach ($catList as $key=>$value) {\n\t\t\t\t$where2 = ' FIND_IN_SET('.$value.',rggmcat) OR';\n\t\t\t}\n\t\t\t$where .= ' AND ( '.substr($where2,0,-3).' ) ';\n\t\t}\n\n\t\treturn $where;\n\t}", "private function isFilteredByJoinTable()\n {\n $globalFiltering = (isset($this->requestParams['search']) && '' !== $this->requestParams['search']['value']);\n\n $individualFiltering = false;\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (true === array_key_exists($key, $this->requestParams['columns'])) {\n $searchEntity = explode('.', $this->searchColumns[$key])[0];\n if ($searchEntity !== $this->entityShortName) {\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' !== $searchValue && 'null' !== $searchValue) {\n $individualFiltering = true;\n break;\n }\n }\n }\n }\n }\n\n return $globalFiltering || $individualFiltering;\n }", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "protected function prepareFilterQuery()\n\t{\n\t\t$filterQuery = array();\n\n\t\t$storeid = $this->getParam('storeid');\n\n\t\t$config = $this->getConfig();\n\n\t\t$websiteid = isset($config['stores'][$storeid]['website_id'])?$config['stores'][$storeid]['website_id']:0;\n\n\t\t$checkInstock = (int) $this->getConfigValue('check_instock');\n\n\t\t$filterQuery = array_merge($filterQuery, array(\n\t\t\t\t'store_id' => array($storeid),\n\t\t\t\t'website_id' => array($websiteid),\n\t\t\t\t'product_status' => array(1)\n\t\t));\n\n\t\tif ($checkInstock > 0) {\n\t\t\t$filterQuery['instock_int'] = array(1);\n\t\t}\n\n\t\t$filterQueryArray = array();\n\n\t\tforeach($filterQuery as $key=>$filterItem)\n\t\t{\n\n\t\t\tif(count($filterItem) > 0){\n\t\t\t\t$query = '';\n\t\t\t\tforeach($filterItem as $value){\n\t\t\t\t\t\t$query .= $key.':%22'.urlencode(trim(addslashes($value))).'%22+OR+';\n\t\t\t\t}\n\n\t\t\t\t$query = trim($query, '+OR+');\n\n\t\t\t\t$filterQueryArray[] = $query;\n\t\t\t}\n\t\t}\n\n\t\t$filterQueryString = '';\n\n\t\tif(count($filterQueryArray) > 0) {\n\t\t\tif(count($filterQueryArray) < 2) {\n\t\t\t\t$filterQueryString .= $filterQueryArray[0];\n\t\t\t}else{\n\t\t\t\t$filterQueryString .= '%28'.@implode('%29+AND+%28', $filterQueryArray).'%29';\n\t\t\t}\n\t\t}\n\n\t\t$this->filterQuery = $filterQueryString;\n\t}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "function BasicSearchSQL($Keyword) {\r\n\t\tglobal $fs_multijoin_v;\r\n\t\t$sKeyword = ew_AdjustSql($Keyword);\r\n\t\t$sWhere = \"\";\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->mount, $Keyword);\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->path, $Keyword);\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->name, $Keyword);\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->CONTACT, $Keyword);\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->CONTACT2, $Keyword);\r\n\t\t$this->BuildBasicSearchSQL($sWhere, $fs_multijoin_v->RESCOMP, $Keyword);\r\n\t\treturn $sWhere;\r\n\t}", "private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tif ($this->CurrentFilter <> \"\") {\n\t\t\tif ($sFilter <> \"\") $sFilter = \"(\" . $sFilter . \") AND \";\n\t\t\t$sFilter .= \"(\" . $this->CurrentFilter . \")\";\n\t\t}\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),\n\t\t\t$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);\n\t}", "protected function where(array $filter){\n if (array_key_exists(\"order\", $filter)){\n $order = $filter[\"order\"];\n unset($filter[\"order\"]);\n if (gettype($order) != \"array\")\n $order = [$order];\n }\n\n if (array_key_exists(\"limit\", $filter)){\n $limit = $filter[\"limit\"];\n unset($filter[\"limit\"]);\n if (gettype($limit) != \"integer\")\n throw new appException(\"This is off-limits, literally\");\n }\n\n if (!empty($filter)){\n $query = \" WHERE \";\n\n foreach ($filter as $k => $v){\n if (gettype($v) == \"array\"){\n $query .= $this->genTableVar($k) . \" IN ( \";\n $query .= join(\", \", array_fill(0, count($v), \"?\"));\n $query .= \") AND \";\n }\n else if (gettype($v) == \"object\" && get_class($v) == \"dbContains\"){\n $query .= $v->genSql($this->genTableVar($k)) . \" AND \";\n }\n else {\n $query .= $this->genTableVar($k) . \" = ? AND \";\n }\n $this->args[] = $v;\n }\n\n $query = substr($query, 0, -4);\n\n $this->query .= $query;\n }\n\n if (isset($order))\n $this->orderBy($order);\n\n if (isset($limit))\n $this->limit($limit);\n }", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "public function getDescendantsWhere($column, $operator = null, $value = null, array $columns = ['*']);", "function sql_condition_statemment(array $criteria, int $totalCount)\n {\n // Init\n $sql = \"\";\n\n // Rendr base on condition\n $count = 0;\n foreach ($criteria as $filter => $value) {\n\n $str = (is_array($value)) \n ? objectSearchHandle($filter, $value)\n : \"$filter = '$value'\";\n \n $is_not_last = ($totalCount - 1 != $count);\n\n if($str):\n $sql .= $str;\n $sql .= ($is_not_last) ? \" AND \" : \"\";\n endif;\n\n $count ++;\n }\n // Return\n return $sql;\n }", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "function BasicSearchWhere() {\n\t\tglobal $Security, $tbl_slide;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = $tbl_slide->BasicSearchKeyword;\n\t\t$sSearchType = $tbl_slide->BasicSearchType;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t}\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$tbl_slide->setSessionBasicSearchKeyword($sSearchKeyword);\n\t\t\t$tbl_slide->setSessionBasicSearchType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "private function sql_whereAnd_sysLanguage()\n {\n if ( !isset( $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] ) )\n {\n return;\n }\n\n $languageField = $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ];\n $languageId = $GLOBALS[ 'TSFE' ]->sys_language_content;\n\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = '$this->int_localisation_mode PI1_SELECTED_OR_DEFAULT_LANGUAGE: for each language a query!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n switch ( $this->int_localisation_mode )\n {\n case( PI1_DEFAULT_LANGUAGE ):\n $andWhere = \" AND \" . $languageField . \" <= 0 \";\n break;\n case( PI1_SELECTED_OR_DEFAULT_LANGUAGE ):\n $andWhere = \" AND ( \" .\n $languageField . \" <= 0 OR \" .\n $languageField . \" = \" . intval( $languageId ) .\n \" ) \";\n break;\n case( PI1_SELECTED_LANGUAGE_ONLY ):\n $andWhere = \" AND \" . $languageField . \" = \" . intval( $languageId ) . \" \";\n break;\n default:\n $andWhere = null;\n break;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function getViaTableCondition();", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE l.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "function queryFilterContains(&$layout_def)\n {\n $matches = explode(',', $layout_def['input_name0']);\n $q = \"\";\n foreach ($matches as $match) {\n // Make the match field the lowercase version of the field. This feels\n // a little dirty but I bet Mike Rowe would approve\n $match = strtolower(trim($match));\n $q .= \" \" . $this->getLowercaseColumnSelect($layout_def) . \" LIKE '%\" .$GLOBALS['db']->quote($match).\"%' OR\";\n }\n\n return rtrim($q, \" OR\");\n }", "function BasicSearchWhere() {\n\t\tglobal $Security;\n\t\t$sSearchStr = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\n\t\t$sSearchType = $this->BasicSearch->Type;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"=\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t\t$this->Command = \"search\";\n\t\t}\n\t\tif ($this->Command == \"search\") {\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\n\t\t\t$this->BasicSearch->setType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}" ]
[ "0.5869196", "0.58457327", "0.58227", "0.5776463", "0.5734356", "0.57283235", "0.5692753", "0.5684749", "0.5660201", "0.5647875", "0.5643681", "0.5608006", "0.5550788", "0.55147797", "0.5498872", "0.54972374", "0.5480785", "0.545838", "0.54242843", "0.5420333", "0.54174924", "0.5403012", "0.5400967", "0.53995144", "0.53930116", "0.5389153", "0.53835976", "0.5375994", "0.5344061", "0.5341892", "0.5340464", "0.53346586", "0.5320435", "0.5311534", "0.52959746", "0.52952397", "0.52891046", "0.5280067", "0.5270758", "0.52211434", "0.52186", "0.5215397", "0.51922745", "0.51889116", "0.5186042", "0.5168753", "0.51602995", "0.51519126", "0.51427007", "0.5139384", "0.5138937", "0.5135246", "0.51344955", "0.5123142", "0.5121619", "0.51186985", "0.51107335", "0.51074153", "0.5106891", "0.51044524", "0.5091153", "0.5091153", "0.50897074", "0.50859696", "0.5085687", "0.5080986", "0.50786227", "0.50760865", "0.5071049", "0.5068656", "0.5062989", "0.5062989", "0.50625896", "0.50598943", "0.50519556", "0.5048421", "0.5048024", "0.50436044", "0.5039507", "0.5034667", "0.5028115", "0.5026527", "0.5020426", "0.50182587", "0.5018052", "0.5016753", "0.50144345", "0.50093013", "0.49994937", "0.49994528", "0.49984345", "0.4995083", "0.49913034", "0.49863666", "0.49817994", "0.49811202", "0.49805415", "0.4979811", "0.49712834", "0.4968955" ]
0.51790226
45
Check to see if an IP is inside a given network See : \ref ipAddressToNetwork
static function checkIPFromNetwork($address, $networkAddress, $networkNetmask, $version = 0) { $IPNetmask = [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff]; $relativity = self::checkNetworkRelativity($address, $IPNetmask, $networkAddress, $networkNetmask, $version); return ($relativity == "equals") || ($relativity == "second contains first"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ip_in_range($network,$netmask,$ip)\n {\n $wildcard_mask = pow( 2, ( 32 - $netmask ) ) - 1;\n $mask = ~ $wildcard_mask;\n return ( ( $ip & $mask ) == ( $network & $mask ) );\n }", "function current_ip_in_network() {\r\n return ip_in_network(current_user_ip());\r\n}", "public function isIPAddressInNetwork($ipAddress)\n {\n $first = $this->_getSubnetFirstUsableHost($this->getNetworkAddress(),\n $this->getNetworkMask());\n\n $last = $this->_getSubnetLastUsableHost($this->getNetworkAddress(),\n $this->getNetworkMask());\n \n $long = ip2long($ipAddress);\n \n return (ip2long($first) <= $long\n && $long <= ip2long($last));\n }", "function check_subnet($ip, $network, $netmask) {\n\t$network_long = ip2long($network);\n\t$mask_long = ip2long($netmask);\n\t$ip_long = ip2long($ip);\n\n\t// Remove the host part of the addresses.\n\t$network_net_long = $network_long & $mask_long;\n\t$ip_net_long = $ip_long & $mask_long;\n\n\t// If the network parts are equal, return true.\n\treturn ($network_net_long === $ip_net_long);\n}", "public function contains( $ip )\n\t{\n\t\tif( !$this->valid ) return false;\n\t\tif( $this->isIPv4( $ip ))\n\t\t{\n\t\t\t$ip = '::'.$ip;\n\t\t}\n\t\t$addr = @inet_pton( $ip );\n\t\tif( $addr === false ) return false;\n\t\t$gmp = $this->inet_ntogmp( $addr );\n\t\treturn( \\gmp_cmp( $this->net_addr_long, $gmp ) <= 0 && \\gmp_cmp( $gmp, $this->net_broadcast_long ) <= 0 );\t\t\n\t}", "protected function verifyNetwork($input): bool\n {\n if ($this->networkRange === null) {\n return true;\n }\n\n if (isset($this->networkRange['mask'])) {\n return $this->belongsToSubnet($input);\n }\n\n $input = sprintf('%u', ip2long($input));\n\n $min = sprintf('%u', ip2long($this->networkRange['min']));\n $max = sprintf('%u', ip2long($this->networkRange['max']));\n\n return ($input >= $min) && ($input <= $max);\n }", "public static function isIPWanAddress($string) {\n $bytes = self::isIPAddress($string, true);\n\n // Die Logik entspricht dem Gegenteil von self:: isIPLanAdress() + zusaetzlicher Tests.\n if ($bytes) {\n if ($bytes[0] == 10) // 10.0.0.0 - 10.255.255.255\n return false;\n\n if ($bytes[0] == 127) // 127.0.0.0 - 127.255.255.255\n return false;\n\n if ($bytes[0]==169) // 169.0.0.0 - 169.255.255.255 !!! wem zugewiesen? niemandem?\n return false;\n\n if ($bytes[0] == 172) // 172.16.0.0 - 172.31.255.255\n return !(15 < $bytes[1] && $bytes[1] < 32);\n\n if ($bytes[0]==192) // 192.168.0.0 - 192.168.255.255\n return ($bytes[1]!=168);\n }\n\n // dieses TRUE ist eher spekulativ\n return true;\n }", "function ip_in_subnet($addr,$subnet) {\n\tlist($ip, $mask) = explode('/', $subnet);\n\t$mask = 0xffffffff << (32 - $mask);\n\treturn ((ip2long($addr) & $mask) == (ip2long($ip) & $mask));\n}", "function rest_is_ip_address($ip)\n {\n }", "public static function isIPLanAddress($string) {\n $bytes = self::isIPAddress($string, true);\n\n if ($bytes) {\n if ($bytes[0] == 10) // 10.0.0.0 - 10.255.255.255\n return true;\n\n if ($bytes[0] == 172) // 172.16.0.0 - 172.31.255.255\n return (15 < $bytes[1] && $bytes[1] < 32);\n\n if ($bytes[0]==192 && $bytes[1]==168) // 192.168.0.0 - 192.168.255.255\n return true;\n }\n\n return false;\n }", "function ip_in_subnet($ip, $subnet)\n{\n // Converts a human-readable IP address into its binary representation\n $binary_ip = inet_pton($ip);\n\n // Converts the binary IP into a string of bits.\n // We can't convert the IP to an int (using, for example ip2long()) because php only\n // natively supports unsigned 32 bit ints, while an ipv6 address is 128 bits.\n // If we want, we could make use of some php libraries (e.g. BC Math or GMP) to create a 128\n // bit int, but this is not necessary because we don't need to perform any math operations\n // on this int anyway.\n // Instead, we just convert the IP to a string which is sufficient because we only need to\n // use it for a single string comparison later.\n $ip_bits = inet_to_bits($binary_ip);\n\n // Get the bit string for the subnet address, as well as the length of the subnet mask (in bits)\n list($range, $netmask_len) = explode('/', $subnet, 2); //$netmask_len is aka. the CIDR prefix\n $binary_range = inet_pton($range);\n $range_bits = inet_to_bits($binary_range);\n\n // Get the network bits of the given IP address and the subnet address\n $ip_net_bits = substr($ip_bits, 0, $netmask_len);\n $range_net_bits = substr($range_bits, 0, $netmask_len);\n\n // If the network bits are identical, then this IP is part of the subnet\n return ($ip_net_bits == $range_net_bits);\n}", "public function isUserIPAddressAllowedAccess()\n\t{\n\t\ttry\n {\n $IpBin = new IpBin();\n return $IpBin->isUserIPAddressAllowedAccess($this->getSiteUser()->getId());\n }\n catch(\\Whoops\\Example\\Exception $e)\n {\n Log::error(\"Could not check if ip address is allowed access for user [\" . $this->getSiteUser()->getId() . \"]. \" . $e);\n return FALSE;\n }\n\t}", "function is_private_ip($iptocheck) {\n\t$isprivate = false;\n\t$ip_private_list = array(\n\t\t\"10.0.0.0/8\",\n\t\t\"100.64.0.0/10\",\n\t\t\"172.16.0.0/12\",\n\t\t\"192.168.0.0/16\",\n\t);\n\tforeach ($ip_private_list as $private) {\n\t\tif (ip_in_subnet($iptocheck, $private) == true) {\n\t\t\t$isprivate = true;\n\t\t}\n\t}\n\treturn $isprivate;\n}", "public static function checkIPSubnet( $ipAddress ){\n\t\t\tglobal $wpdb;\n\n\t\t\t/*\n\t\t\t\tGrabs allowed subnets from the \n\t\t\t\tcurrent blog.\n\t\t\t*/\n\t\t\tif( is_multisite() ){\n\t\t\t\t$currentBlogID = get_current_blog_id();\n\n\t\t\t\tglobal $switched;\n\t\t\t\tswitch_to_blog(1);\n\n\t\t\t\t$subnets = $wpdb->get_results( $wpdb->prepare(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM \".$wpdb->prefix.\"wps_subnets\n\t\t\t\t\t WHERE blog_id = '%d'\",\n\t\t\t\t\t $currentBlogID\n\t\t\t\t), ARRAY_A );\n\n\t\t\t\trestore_current_blog();\n\t\t\t}else{\n\t\t\t\t$subnets = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.\"wps_subnets\", ARRAY_A );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tIterates through subnets and checks to see\n\t\t\t\tif the IP address is within the range.\n\t\t\t*/\n\t\t\tforeach( $subnets as $subnet ){\n\t\t\t\t$subnetParts \t= explode( '.', $subnet['start_ip'] );\n\n\t\t\t\t$firstOctet \t= $subnetParts[0];\n\t\t\t\t$secondOctet \t= $subnetParts[1];\n\t\t\t\t$thirdOctet \t= $subnetParts[2];\n\t\t\t\t$fourthOctet \t= $subnetParts[3];\n\n\t\t\t\t$newFirstOctet \t= '';\n\t\t\t\t$newSecondOctet\t= '';\n\t\t\t\t$newThirdOctet \t= '';\n\t\t\t\t$newFourthOctet = '';\n\n\t\t\t\t/*\n\t\t\t\t\tChecks from the largest networks\n\t\t\t\t\tfirst down to the smallest.\n\t\t\t\t*/\n\t\t\t\tif( $subnet['subnet'] <= 8 ){\n\t\t\t\t\tif( ( $firstOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFirstOctet = 255;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min \t= ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max \t= ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress );\n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 8 ) && ( $subnet['subnet'] <= 16 ) ){\n\t\t\t\t\tif( ( $secondOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newScondOctet = ( $secondOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress ); \n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 16 ) && ( $subnet['subnet'] <= 24 ) ){\n\t\t\t\t\tif( ( $thirdOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newThirdOctet \t= ( $thirdOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + 1;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}else if( $subnet['subnet'] > 24 ){\n\t\t\t\t\tif( ( $fourthOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFourthOctet = ( $fourthOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + 1;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFourthOctet = $fourthOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tOnly reachable if nothing was returned\n\t\t\t\tmeaning that the IP is NOT in the subnet.\n\t\t\t*/\n\t\t\treturn false;\n\t\t}", "private function doIpCheck($ip)\r\n {\r\n $allowedList = array();\r\n $allowedList['85.158.206.17'] = 1;\r\n $allowedList['85.158.206.18'] = 1;\r\n $allowedList['85.158.206.19'] = 1;\r\n $allowedList['85.158.206.20'] = 1;\r\n $allowedList['85.158.206.21'] = 1;\r\n if (!isset($allowedList[$ip]))\r\n {\r\n return false;\r\n }\r\n return true;\r\n }", "public static function ipaddress_or_cidr(string $input): bool {\r\n return preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(\\d|[1-2]\\d|3[0-2]))?$/', $input) === 1;\r\n }", "public function validate_ip($ip) {\n\t\tif (strtolower($ip) === 'unknown')\n\t\t\treturn false;\n\n\t\t// generate ipv4 network address\n\t\t$ip = ip2long($ip);\n\n\t\t// if the ip is set and not equivalent to 255.255.255.255\n\t\tif ($ip !== false && $ip !== -1) {\n\t\t\t// make sure to get unsigned long representation of ip\n\t\t\t// due to discrepancies between 32 and 64 bit OSes and\n\t\t\t// signed numbers (ints default to signed in PHP)\n\t\t\t$ip = sprintf('%u', $ip);\n\t\t\t// do private network range checking\n\t\t\tif ($ip >= 0 && $ip <= 50331647) return false;\n\t\t\tif ($ip >= 167772160 && $ip <= 184549375) return false;\n\t\t\tif ($ip >= 2130706432 && $ip <= 2147483647) return false;\n\t\t\tif ($ip >= 2851995648 && $ip <= 2852061183) return false;\n\t\t\tif ($ip >= 2886729728 && $ip <= 2887778303) return false;\n\t\t\tif ($ip >= 3221225984 && $ip <= 3221226239) return false;\n\t\t\tif ($ip >= 3232235520 && $ip <= 3232301055) return false;\n\t\t\tif ($ip >= 4294967040) return false;\n\t\t}\n\t\treturn true;\n\t}", "function cidr_match($ip, $range){\n list ($subnet, $bits) = explode('/', $range);\n $ip = ip2long($ip);\n $subnet = ip2long($subnet);\n $mask = -1 << (32 - $bits);\n $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned\n return ($ip & $mask) == $subnet;\n}", "public function validate_ip($ip) {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n }", "private function is_from_valid_ip() {\n\t\t$my_ip = getenv( 'REMOTE_ADDR' );\n\t\t\n\t\t// Check if we are in testing mode, and get list of valid IPs\n\t\t//if ( Mage::getStoreConfig( 'payment/fssnet/is_testing' ) )\n\t\t\t$valid_ips = array( '221.134.101.174', '221.134.101.169','198.64.129.10','198.64.133.213' );\n\t\t//else\n\t\t\t//$valid_ips = array( '221.134.101.187', '221.134.101.175', '221.134.101.166','198.64.129.10','198.64.133.213' );\n\t\t\n\t\t// Check if our IP is valid\n\t\tif ( in_array( $my_ip, $valid_ips ) )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function validate_ip($ip)\n {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n }", "static function ip__is_private_network($ip, $ip_type = 'v4')\n\t{\n\t\treturn self::ip__mask_match($ip, self::$private_networks[$ip_type], $ip_type);\n\t}", "function validate_ip($ip) {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647)\n return false;\n if ($ip >= 167772160 && $ip <= 184549375)\n return false;\n if ($ip >= 2130706432 && $ip <= 2147483647)\n return false;\n if ($ip >= 2851995648 && $ip <= 2852061183)\n return false;\n if ($ip >= 2886729728 && $ip <= 2887778303)\n return false;\n if ($ip >= 3221225984 && $ip <= 3221226239)\n return false;\n if ($ip >= 3232235520 && $ip <= 3232301055)\n return false;\n if ($ip >= 4294967040)\n return false;\n }\n return true;\n }", "function ip_in_whitelist($whitelist)\n{\n $ip = get_ip();\n\n // Check if the IP is in our defined whitelist\n foreach ($whitelist as $subnet) {\n if (ip_in_subnet($ip, $subnet) == true) {\n return true;\n }\n }\n\n return false;\n}", "function ip_in_range($ip, $range) {\n if ( is_string($range) ) $ranges = explode(',',$range);\n else $ranges = $range;\n if (strpos($ip,':') !== false) {\n return in_array($ip,$ranges);\n } else {\n $in = false;\n foreach($ranges as $range) {\n if ($in) return $in;\n if (strpos($range,':') !== false) continue;\n # If IP has the 4 blocks is a host, but we need the prefix, so put it\n if (strpos($range,'/') === false && strpos($range,'-') === false && strpos($range,'*') === false) $range .= '/32';\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n $in = (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n $in = ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n }\n }\n return $in;\n }\n}", "Function ip_in_range($ip, $range) {\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2long($netmask);\r\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n list($a,$b,$c,$d) = $x;\r\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range_dec = ip2long($range);\r\n $ip_dec = ip2long($ip);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n\r\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\r\n }\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\r\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\r\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n\r\n}", "public function inNetwork($networks = [], $ip = \"\") {\n $network_group = [];\n $netmask_group = [];\n\n foreach($networks as $network) {\n list($subnet, $cidr) = explode('/', $network);\n $netmask = (1 << 32) - (1 << (32 - $cidr));\n $network_group[ip2long($subnet)] = $network;\n\n if(!in_array($netmask, $netmask_group)) $netmask_group[] = $netmask;\n }\n\n // sort netmask in desc order - important to work properly\n rsort($netmask_group);\n\n foreach($netmask_group as $netmask) {\n // get network from ip address and netmask\n $network = ip2long($ip) & $netmask;\n\n if(array_key_exists($network, $network_group)) return $network_group[$network];\n }\n\n }", "function check_cidr($ip, $cidr) {\n\t$ip_arr = explode('/', $cidr);\n\t// Fill in any missing \".0\" parts, and turn the address into a long.\n\t$cidr_long = ip2long($ip_arr[0].str_repeat('.0', 3 - substr_count($ip_arr[0], '.')));\n\t$cidr_bits = (int) $ip_arr[1];\n\t// Turn the IP into a long.\n\t$ip_long = ip2long($ip);\n\n\t// Get the network part of the CIDR and the IP.\n\t$cidr_network = $cidr_long >> (32 - $cidr_bits);\n\t$ip_network = $ip_long >> (32 - $cidr_bits);\n\n\t// If the network parts are equal, return true.\n\treturn ($cidr_network === $ip_network);\n}", "Function ip_in_range($ip, $range) {\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n\n //echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\n return false;\n }\n\n}", "public static function isPublic( $ip ) {\n if ( self::isIPv6( $ip ) ) {\n return self::isPublic6( $ip );\n }\n $n = self::toUnsigned( $ip );\n if ( !$n ) {\n return false;\n }\n\n // ip2long accepts incomplete addresses, as well as some addresses\n // followed by garbage characters. Check that it's really valid.\n if ( $ip != long2ip( $n ) ) {\n return false;\n }\n\n static $privateRanges = false;\n if ( !$privateRanges ) {\n $privateRanges = array(\n array( '10.0.0.0', '10.255.255.255' ), # RFC 1918 (private)\n array( '172.16.0.0', '172.31.255.255' ), # \"\n array( '192.168.0.0', '192.168.255.255' ), # \"\n array( '0.0.0.0', '0.255.255.255' ), # this network\n array( '127.0.0.0', '127.255.255.255' ), # loopback\n );\n }\n\n foreach ( $privateRanges as $r ) {\n $start = self::toUnsigned( $r[0] );\n $end = self::toUnsigned( $r[1] );\n if ( $n >= $start && $n <= $end ) {\n return false;\n }\n }\n return true;\n }", "public static function subnetContainsIP($subnet, $ip) {\n\t\tlist($network, $prefix) = array_pad(explode('/', $subnet, 2), 2, null);\n\t\t\n\t\tif (filter_var($network, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n\t\t\t// If no prefix was supplied, 32 is implied for IPv4\n\t\t\tif ($prefix === null) {\n\t\t\t\t$prefix = 32;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the IPv4 network prefix\n\t\t\tif ($prefix < 0 || $prefix > 32) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Increase the IPv4 network prefix to work in the IPv6 address space\n\t\t\t$prefix += 96;\n\t\t} else {\n\t\t\t// If no prefix was supplied, 128 is implied for IPv6\n\t\t\tif ($prefix === null) {\n\t\t\t\t$prefix = 128;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the IPv6 network prefix\n\t\t\tif ($prefix < 1 || $prefix > 128) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$bin_network = wfWAFUtils::substr(self::inet_pton($network), 0, ceil($prefix / 8));\n\t\t$bin_ip = wfWAFUtils::substr(self::inet_pton($ip), 0, ceil($prefix / 8));\n\t\tif ($prefix % 8 != 0) { //Adjust the last relevant character to fit the mask length since the character's bits are split over it\n\t\t\t$pos = intval($prefix / 8);\n\t\t\t$adjustment = chr(((0xff << (8 - ($prefix % 8))) & 0xff));\n\t\t\t$bin_network[$pos] = ($bin_network[$pos] & $adjustment);\n\t\t\t$bin_ip[$pos] = ($bin_ip[$pos] & $adjustment);\n\t\t}\n\t\t\n\t\treturn ($bin_network === $bin_ip);\n\t}", "public static function ipInRange (string $ip, string $range): bool {\n if (!str_contains($range, '/')) {\n $range .= '/32';\n }\n $range_full = explode('/', $range, 2);\n $netmask_decimal = ~(pow(2, (32 - $range_full[1])) - 1);\n return (ip2long($ip) & $netmask_decimal) == (ip2long($range_full[0]) & $netmask_decimal);\n }", "function is_internal_IP() {\n if (is_admins())\n return true;\n $ip_prefix = array(\"172.31.\",\n \"172.\",\n \"10.\",\n \"222.200.\",\n \"192.168.\",\n \"202.116.\",\n \"211.66\",\n \"219.222\",\n \"125.217\",\n \"127.0.0.1\"\n );\n foreach ($ip_prefix as $ip) {\n if (!strncmp($_SERVER['REMOTE_ADDR'], $ip, strlen($ip)))\n return true;\n }\n return false;\n}", "public static function validateIpAddress($ipAddress = '') {\n if (strtolower($ipAddress) === 'unknown') {\n return false;\n }\n // Generate ipv4 network address\n $ipAddress = ip2long($ipAddress);\n // If the ip is set and not equivalent to 255.255.255.255\n if ($ipAddress !== false && $ipAddress !== -1) {\n /**\n * Make sure to get unsigned long representation of ip\n * due to discrepancies between 32 and 64 bit OSes and\n * signed numbers (ints default to signed in PHP)\n */\n $ipAddress = sprintf('%u', $ipAddress);\n // Do private network range checking\n if ($ipAddress >= 0 && $ipAddress <= 50331647) return false;\n if ($ipAddress >= 167772160 && $ipAddress <= 184549375) return false;\n if ($ipAddress >= 2130706432 && $ipAddress <= 2147483647) return false;\n if ($ipAddress >= 2851995648 && $ipAddress <= 2852061183) return false;\n if ($ipAddress >= 2886729728 && $ipAddress <= 2887778303) return false;\n if ($ipAddress >= 3221225984 && $ipAddress <= 3221226239) return false;\n if ($ipAddress >= 3232235520 && $ipAddress <= 3232301055) return false;\n if ($ipAddress >= 4294967040) return false;\n }\n return true;\n }", "function check_ip($ip)\r\n\t{\r\n\t\treturn (!strcmp(long2ip(sprintf('%u',ip2long($ip))),$ip) ? true : false);\r\n\t}", "function _checkIP($ip)\n{\n _log(\"checkIP: Starting.\",\"info\");\n global $caasnode;\n _log(\"checkIP: IP address is $ip.\",\"info\");\n $cIP = ip2long($ip);\n $fIP = long2ip($cIP);\n if($fIP=='0.0.0.0')\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): IPaddress is not valid.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: IPaddress is not valid.\");\n\t\t_exit1(\"Exiting at checkIP: Invalid ip address, aborting \\n\\n\\n\");\n\t}\n _log(\"checkIP: $ip is a valid ip address.\",\"info\");\n _log(\"checkIP: Exiting.\",\"info\");\n}", "public function checkIPs () {\n\n\t\t$validation = true;\n\n\t\tforeach ($this->allow as $key => $ip) {\n\t\t\t\n\t\t\tif ($this->matchIP($ip)) {\n \n return true;\n \n }\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "static function cidr_check($ip, $cidr)\n\t{\n\t\tlist ($net, $mask) = explode(\"/\", $cidr);\n\n\t\t// Allow non-standard /0 syntax\n\t\tif ($mask == 0)\n\t\t{\n\t\t\tif (ip2long($ip) == ip2long($net))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t$ip_net = ip2long ($net);\n\t\t$ip_mask = ~((1 << (32 - $mask)) - 1);\n\n\t\t$ip_ip = ip2long ($ip);\n\n\t\t$ip_ip_net = $ip_ip & $ip_mask;\n\n\t\treturn ($ip_ip_net == $ip_net);\n\t}", "function is_ip_banned($ip, $banned_ips)\n {\n foreach($banned_ips as $banned_ip) // go through every $banned_ip\n {\n if(strpos($banned_ip,'*')!==false) // $banned_ip contains \"*\" = > IP range\n {\n $ip_range = substr($banned_ip, 0, strpos($banned_ip, '*')); // fetch part before \"*\"\n if(strpos($ip, $ip_range)===0) // check if IP begins with part before \"*\"\n {\n return true;\n }\n }\n elseif(strpos($banned_ip,'/')!==false && preg_match(\"/(([0-9]{1,3}\\.){3}[0-9]{1,3})\\/([0-9]{1,2})/\", $banned_ip, $regs)) // $banned_ip contains \"/\" => CIDR notation (the regular expression is only used if $banned_ip contains \"/\")\n {\n // convert IP into bit pattern:\n $n_user_leiste = '00000000000000000000000000000000'; // 32 bits\n $n_user_ip = explode('.',trim($ip));\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_user_ip[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_user_ip[$i] = $n_user_ip[$i] - pow(2, 7-$n_j);\n $n_user_leiste[$n_j + $i*8] = '1';\n }\n }\n }\n // analyze prefix length:\n $n_byte_array = explode('.',trim($regs[1])); // IP -> 4 Byte\n $n_cidr_bereich = $regs[3]; // prefix length\n // bit pattern:\n $n_bitleiste = '00000000000000000000000000000000';\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n if ($n_byte_array[$i] > 255) // invalid\n {\n $n_cidr_bereich = 0;\n }\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_byte_array[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_byte_array[$i] = $n_byte_array[$i] - pow(2, 7-$n_j);\n $n_bitleiste[$n_j + $i*8] = '1';\n }\n }\n }\n // check if bit patterns match on the first n chracters:\n if (strncmp($n_bitleiste, $n_user_leiste, $n_cidr_bereich) == 0 && $n_cidr_bereich > 0)\n {\n return true;\n }\n }\n else // neither \"*\" nor \"/\" => simple comparison:\n {\n if($ip == $banned_ip)\n {\n return true;\n }\n }\n }\n return false;\n }", "protected function isValidIp($ip)\n{\n $ips = array('IP_ADDRESS');\nreturn in_array($ip, $ips);\n}", "public function checkForAddrMatchIpv4($ip, $network)\n {\n // See also ip2long PHP online manual: Kenneth Shaw\n // coded a network matching function called net_match.\n // We use here his way of doing bit-by-bit network comparison\n\n // Start applying the discovering of the network mask\n $ip_arr = explode('/', $network);\n\n $network_long = ip2long($ip_arr[0]);\n $ip_long = ip2long($ip);\n\n if (!isset($ip_arr[1])) {\n // $network seems to be a simple ip address, instead of a network address\n $matched = ($network_long == $ip_long);\n } else {\n // $network seems to be a real network address\n $x = ip2long($ip_arr[1]);\n // Evaluate the netmask: <Network Mask> or <CIDR>\n $mask = ( long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]));\n $matched = ( ($ip_long & $mask) == ($network_long & $mask) );\n }\n\n return $matched;\n }", "public function checkForAddrMatchIpv4($ip, $network)\n {\n // See also ip2long PHP online manual: Kenneth Shaw\n // coded a network matching function called net_match.\n // We use here his way of doing bit-by-bit network comparison\n\n // Start applying the discovering of the network mask\n $ip_arr = explode('/', $network);\n\n $network_long = ip2long($ip_arr[0]);\n $ip_long = ip2long($ip);\n\n if (!isset($ip_arr[1])) {\n // $network seems to be a simple ip address, instead of a network address\n $matched = ($network_long == $ip_long);\n } else {\n // $network seems to be a real network address\n $x = ip2long($ip_arr[1]);\n // Evaluate the netmask: <Network Mask> or <CIDR>\n $mask = (long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]));\n $matched = (($ip_long & $mask) == ($network_long & $mask));\n }\n\n return $matched;\n }", "public function checkForAddrMatchIpv6($ip, $network)\n {\n if (false === strpos($network, '/')) {\n throw new InvalidArgumentException(\"Not a valid IPv6 subnet.\");\n }\n\n list($addr, $preflen) = explode('/', $network);\n if (!is_numeric($preflen)) {\n throw new InvalidArgumentException(\"Not a valid IPv6 preflen.\");\n }\n\n if (!filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n throw new InvalidArgumentException(\"Not a valid IPv6 subnet.\");\n }\n\n\n $bytes_addr = unpack(\"n*\", inet_pton($addr));\n $bytes_test = unpack(\"n*\", inet_pton($ip));\n\n for ($i = 1; $i <= ceil($preflen / 16); $i++) {\n $left = $preflen - 16 * ($i-1);\n if ($left > 16) {\n $left = 16;\n }\n $mask = ~(0xffff >> $left) & 0xffff;\n if (($bytes_addr[$i] & $mask) != ($bytes_test[$i] & $mask)) {\n return false;\n }\n }\n return true;\n }", "public static function isIPAddress( $ip ) {\n return (bool)preg_match( '/^' . IP_ADDRESS_STRING . '$/', $ip );\n }", "public function isValidIP(string $ip, string $which = null): bool;", "function ip_is_local($ip){\r\n\t\r\n\t $ipv4array = explode('.',$ip); $ipv6array = explode(':',$ip);\r\n\t $lenipv4 = count($ipv4array) ; $lenipv6 = count($ipv6array); \r\n\t $ipint = array(); \r\n\t if($lenipv4 > 0 ){//We have an ipv4 address\r\n\t\t for ($i = 0 ; $i<$lenipv4 ; $i++){\r\n\t\t\t $ipint[$i] = intval($ipv4array[$i]) ; //Generating integera values for the ips\r\n\t\t }\r\n\t\t \r\n\t\t\t//Let's see if our IP is riv ate\r\n\t\t\tif ($ipint[0] == 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 172 && $ipint[1] > 15 && $ipint[1] < 32) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 192 && $ipint[1] == 168) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else return false ;\r\n\t }else{\r\n\t //Either something went wrong, or we are in IPV6 format.\t \r\n\t\t \r\n\t\t if( $lenipv6 > 0){//We are having a big IPV6 address here !\r\n\t\t\t //We are in IPV4. Haven't implemented IPV6 yet\r\n\t\t\t \r\n\t\t }\r\n\t\t return false ;\r\n\t }\r\n\t \r\n\t \r\n\t return false;\r\n}", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "protected function checkIpAddress()\n {\n $allowedIpAddresses = \\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_allowed_ip_addresses;\n return !$allowedIpAddresses \n || false !== strpos($allowedIpAddresses, $_SERVER['REMOTE_ADDR']);\n }", "public static function isValidIpAddress($ip_address){\n return (filter_var($ip_address, FILTER_VALIDATE_IP)) ? true : false;\n }", "public function testInRange()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.0.44', '127.0.0.0/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.250.44', '127.0.250.250/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.1.44', '127.0.0.0/24');\n $this->assertEquals(false, $t);\n\n // Single Ip\n $t = $ipComponent->inRange('127.0.0.1', '127.0.0.1');\n $this->assertEquals(true, $t);\n\n // Test 2. Check IP is if in C class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.33.33', '127.0.0.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.33.33', '127.0.250.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.1.33.33', '127.0.0.0/16');\n $this->assertEquals(false, $t);\n\n // Test 3. Check IP is if in B class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.33.250.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.33.33.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('128.33.250.33', '127.0.0.0/8');\n $this->assertEquals(false, $t);\n\n // Test 4. Check IPv6\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::/32');\n $this->assertEquals(true, $t);\n\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::0/32');\n $this->assertEquals(false, $t);\n\n // Test 5. Check Invalid IP\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.333.33', '127.0.250.0/16');\n $this->assertEquals(false, $t);\n }", "private function cidr_includes($ip, $cidr) {\n list ($net, $mask) = explode (\"/\", $cidr);\n $ip_net = ip2long ($net);\n $ip_mask = ~((1 << (32 - $mask)) - 1);\n $ip_ip = ip2long ($ip);\n $ip_ip_net = $ip_ip & $ip_mask;\n return ($ip_ip_net == $ip_net);\n }", "function is_ip($ip){\n return (filter_var($ip, FILTER_VALIDATE_IP) !== false);\n}", "public static function check_ip_address($ip_addr) {\n\t // First of all the format of the ip address is matched\n\t if (preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\", $ip_addr)) {\n\t // Now all the intger values are separated\n\t $parts = explode(\".\", $ip_addr);\n\t // Now we need to check each part can range from 0-255\n\t foreach ($parts as $ip_parts)\n\t {\n\t if (intval($ip_parts) > 255 || intval($ip_parts) < 0)\n\t return false; // If number is not within range of 0-255\n\t }\n\t return true;\n\t }\n\t else\n\t return false; // If format of ip address doesn't matches\n\t}", "public function checkForAddrMatchIpv6($ip, $network)\n {\n if (false === strpos($network, '/')) {\n throw new InvalidArgumentException('Not a valid IPv6 subnet.');\n }\n\n list($addr, $preflen) = explode('/', $network);\n if (!is_numeric($preflen)) {\n throw new InvalidArgumentException('Not a valid IPv6 preflen.');\n }\n\n if (!filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n throw new InvalidArgumentException('Not a valid IPv6 subnet.');\n }\n\n $bytes_addr = unpack('n*', inet_pton($addr));\n $bytes_test = unpack('n*', inet_pton($ip));\n\n for ($i = 1; $i <= ceil($preflen / 16); ++$i) {\n $left = $preflen - 16 * ($i - 1);\n if ($left > 16) {\n $left = 16;\n }\n $mask = ~(0xffff >> $left) & 0xffff;\n if (($bytes_addr[$i] & $mask) != ($bytes_test[$i] & $mask)) {\n return false;\n }\n }\n\n return true;\n }", "public static function check_ipv6($ip, $cidr) {\n\n if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1')))\n return false;\n\n if (false !== strpos($cidr, '/')) {\n list($address, $netmask) = explode('/', $cidr, 2);\n if ($netmask < 1 || $netmask > 128)\n return false;\n } else {\n $address = $cidr;\n $netmask = 128;\n }\n\n $bytesAddr = unpack('n*', @inet_pton($address));\n $bytesTest = unpack('n*', @inet_pton($ip));\n if (!$bytesAddr || !$bytesTest)\n return false;\n\n for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) {\n $left = $netmask - 16 * ($i - 1);\n $left = ($left <= 16) ? $left : 16;\n $mask = ~(0xffff >> $left) & 0xffff;\n if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) {\n return false;\n }\n }\n\n return true;\n }", "public static function is_ip(&$ip) {\r\n\t\treturn self::is_ip4($ip) || self::is_ip6($ip);\r\n\t}", "function is_main_network($network_id = \\null)\n {\n }", "protected function ipInRange($ip, $range)\n {\n // $range is in IP/CIDR format eg 127.0.0.1/24\n list($range, $netmask) = explode('/', $range, 2);\n $range_decimal = ip2long($range);\n $ip_decimal = ip2long($ip);\n $wildcard_decimal = pow(2, (32 - $netmask)) - 1;\n $netmask_decimal = ~$wildcard_decimal;\n\n return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal));\n }", "function is_ipaddr($ipaddr) {\n\tif (!is_string($ipaddr))\n\treturn false;\n\n\t$ip_long = ip2long($ipaddr);\n\t$ip_reverse = long2ip($ip_long);\n\n\tif ($ipaddr == $ip_reverse)\n\treturn true;\n\telse\n\treturn false;\n}", "function isValidIP($ip_addr){\n //first of all the format of the ip address is matched\n if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) {\n //now all the intger values are separated\n $parts=explode(\".\",$ip_addr);\n //now we need to check each part can range from 0-255\n foreach($parts as $ip_parts) {\n if(intval($ip_parts)>255 || intval($ip_parts)<0)\n return false; //if number is not within range of 0-255\n }\n return true;\n }\n else\n return false; //if format of ip address doesn't matches\n}", "function subnet ($ip=NULL, $subnet=NULL)\n\t{\n\n\t\t// assign defaults\n\t\tif (is_null($ip))\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\n\t\t// default to REMOTE_ADDR\n\t\tif (!is_null($subnet))\n\t\t{\n\t\t\t$explodeip = explode('.', $ip);\n\t\t\t$subnetip = explode('.', substr($subnet, 0, strpos($subnet, '/')));\n\t\t\t$subnetmask = substr($subnet, strpos($subnet, '/') + 1);\n\t\t\tif ($subnetmask == 32)\n\t\t\t{\n\t\t\t\tif (substr($subnet, 0, strpos($subnet, '/')) == $ip)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif ($subnetmask < 32 && $subnetmask >= 24)\n\t\t\t{\n\t\t\t\t$start = $subnetip[3];\n\t\t\t\t$check = 32;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[3];\n\t\t\t} elseif ($subnetmask < 24 && $subnetmask >= 16)\n\t\t\t{\n\t\t\t\t$start = $subnetip[2];\n\t\t\t\t$check = 24;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[2];\n\t\t\t} elseif ($subnetmask < 16 && $subnetmask >= 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[1];\n\t\t\t\t$check = 16;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[1];\n\t\t\t} elseif ($subnetmask < 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[0];\n\t\t\t\t$check = 8;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[0];\n\t\t\t}\n\t\t\t$end = $start + pow(2, ($check - $subnetmask));\n\t\t\tif ($end > $top) $end = $top;\n\t\t\tif ($checkip >= $start && $checkip <= $end)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t\t\n\t\t} else {\t\t\t\t\n\t\t\t\t\n\t\t\t// wow hard\n\t\t\t$subnet = substr($ip, 0, strrpos($ip, '.')).\".0/24\";\n\t\n\t\t\treturn $subnet;\n\t\t}\n\t}", "function validIP($ip){\r\n if(preg_match(\"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}^\", $ip))\r\n return true;\r\n else\r\n return false;\r\n}", "function ip_in_pfb_localsub($subnet) {\n\tglobal $pfb_localsub;\n\n\tif (!empty($pfb_localsub)) {\n\t\tforeach ($pfb_localsub as $line) {\n\t\t\tif (ip_in_subnet($subnet, $line)) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}", "function checkIPorRange ($ip_address) {\r\n\t if (ereg(\"-\",$ip_address)) {\r\n\t // Range\r\n\t $ar = explode(\"-\",$ip_address);\r\n\t $your_long_ip = ip2long($_SERVER[\"REMOTE_ADDR\"]);\r\n\t if ( ($your_long_ip >= ip2long($ar[0])) && ($your_long_ip <= ip2long($ar[1])) ) {\r\n\t return TRUE;\r\n\t }\r\n\t } else {\r\n\t // Single IP\r\n\t if ($_SERVER[\"REMOTE_ADDR\"] == $ip_address) {\r\n\t return TRUE;\r\n\t }\r\n\t }\r\n\t return FALSE;\r\n\t}", "private static function isPublic6( $ip ) {\n static $privateRanges = false;\n if ( !$privateRanges ) {\n $privateRanges = array(\n array( 'fc00::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)\n array( '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1' ), # loopback\n );\n }\n $n = self::toHex( $ip );\n foreach ( $privateRanges as $r ) {\n $start = self::toHex( $r[0] );\n $end = self::toHex( $r[1] );\n if ( $n >= $start && $n <= $end ) {\n return false;\n }\n }\n return true;\n }", "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "public function checkLockToIP() {}", "function access_control_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//get the access control allowed nodes\n\t\t$sql = \"select access_control_node_uuid, access_control_uuid, node_cidr, node_description \";\n\t\t$sql .= \"from v_access_control_nodes \";\n\t\t$sql .= \"where node_type = 'allow' \";\n\t\t$sql .= \"and length(node_cidr) > 0 \";\n\t\t$parameters = null;\n\t\t$database = new database;\n\t\t$allowed_nodes = $database->select($sql, $parameters, 'all');\n\t\tunset($database);\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif (is_array($allowed_nodes)) {\n\t\t\tforeach($allowed_nodes as $row) {\n\t\t\t\tif (check_cidr($row['node_cidr'], $ip_address)) {\n\t\t\t\t\t//debug info\n\t\t\t\t\t//if ($debug) {\n\t\t\t\t\t//\tprint_r($row);\n\t\t\t\t\t//\techo $ip_address.\"\\n\";\n\t\t\t\t\t//}\n\n\t\t\t\t\t//set the allowed to true\n\t\t\t\t\t$allowed = true;\n\n\t\t\t\t\t//exit the loop\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "function is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\tif (count(where_is_ipaddr_configured($ipaddr, $ignore_if, $check_localip, $check_subnets, $cidrprefix))) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function IsVPN($ip)\n{\n $iphub = json_decode(ReadURL(\"https://v2.api.iphub.info/guest/ip/\" . GetUserIP()));\n return $iphub->block;\n}", "function is_blocked($ip_address) {\n\t\t//define the global variables\n\t\tglobal $firewall_path, $firewall_name;\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//determine whether to return true or false\n\t\tif ($firewall_name == 'iptables') {\n\t\t\t//check to see if the address is blocked\n\t\t\t$command = $firewall_path.'/./iptables -L -n --line-numbers | grep '.$ip_address;\n\t\t\t$result = shell($command);\n\t\t\tif (strlen($result) > 3) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telseif ($firewall_name == 'pf') {\n\t\t\t//check to see if the address is blocked\n\t\t\t$command = $firewall_path.'/pfctl -t \".$filter.\" -Ts | grep '.$ip_address;\n\t\t\t$result = shell($command);\n\t\t\tif (strlen($result) > 3) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkIfRemoteIpIsInRange($ip, $mask)\n {\n $this->checkMask($mask);\n //TODO check if IP format is valid\n\n $allow = false;\n\n $headers = $this->getBe2billRemoteAddrHeaders();\n\n $firstIp2Long = $this->getFirtAddress($ip, $mask, true);\n $lastIp2Long = $this->getLastAddress($ip, $mask, true);\n\n foreach ($headers as $var) {\n if ($this->_getRequest()->getServer($var, false)) {\n $remoteAdr2Long = ip2long($_SERVER[$var]);\n if (($remoteAdr2Long >= $firstIp2Long) && ($remoteAdr2Long <= $lastIp2Long)) {\n $allow = true;\n break;\n }\n }\n }\n\n return $allow;\n }", "private function isIPAddressMeetRange() {\n\t\tif(get_option(\"wp_broadbean_iprange\") == \"\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn ip_in_range($this->ip_request, get_option(\"wp_broadbean_iprange\"));\n\t\t}\n\t}", "protected function validateIp(): bool\n {\n $meta = $this->getGitHubApiMeta();\n\n $ip = @$_SERVER['REMOTE_ADDR'];\n $ranges = (array) ($meta['hooks'] ?? []);\n\n // Check if IP comes from a GitHub hook.\n foreach ($ranges as $range) {\n if (Utils::cidrMatch($ip, $range)) {\n return true;\n }\n }\n\n return false;\n }", "function validateIp($ip) {\n\treturn inet_pton($ip);\n }", "public static function isValidAddress($ip_address)\n {\n return filter_var($ip_address, FILTER_VALIDATE_IP) !== false;\n }", "function validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}", "function f_validateIP($ip)\r\n{\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\r\n return false;\r\n }\r\n return true;\r\n}", "public static function cidr_match($ip, $cidr) {\n if(!preg_match(self::IP_REGEX, $ip) || !preg_match(self::CIDR_REGEX, $cidr, $parts)) {\n throw new InvalidArgumentException(self::INVALID_ARGUMENT);\n }\n \n $ip = ip2long($ip);\n $n = ip2long($parts[1]);\n $b = 32 - intval($parts[2]);\n \n if($ip === false || $n === false || $b < 0 || $b > 32) {\n throw new InvalidArgumentException(self::INVALID_ARGUMENT);\n }\n \n return ((self::lrs($ip, $b) << $b) === (self::lrs($n, $b) << $b));\n }", "public static function is_private_ip($ip) { \n\t\treturn ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);\n\t}", "function valid_ip($ip)\n\t{\n\t\t$ip_segments = explode('.', $ip);\n\n\t\t// Always 4 segments needed\n\t\tif (count($ip_segments) != 4)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// IP can not start with 0\n\t\tif ($ip_segments[0][0] == '0')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Check each segment\n\t\tforeach ($ip_segments as $segment)\n\t\t{\n\t\t\t// IP segments must be digits and can not be\n\t\t\t// longer than 3 digits or greater then 255\n\t\t\tif ($segment == '' OR preg_match(\"/[^0-9]/\", $segment) OR $segment > 255 OR strlen($segment) > 3)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "static function isUserIPInList($ipAddress){\n\t\t//IP list of specific anonymous users\n\t\t$ini = eZINI::instance('ssoip.ini');\n \t$ipList = $ini->variable('AuthSettings', 'IP');\n \t if ( $ipAddress && is_array( $ipList ) ){\n\t\t\t//If IP address of current user exists and IP list available\n \t\tforeach( $ipList as $itemToMatch => $id ){\n \t\tif ( ip_in_range($ipAddress, $itemToMatch) ){\n \t\t\treturn $id;\n \t\t}\n \t}\n }\n\t\t//Current user not identified as specific anonymous user\n \treturn false;\n \t}", "static function Match6($ip, $cidr) {\n\t\tif (is_array($cidr)) {\n\t\t\tforeach($cidr as $mask) {\n\t\t\t\tif (self::Match6($ip, $mask)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t$ip = inet_pton($ip);\n\t\tif ($ip===false) { return false; }\n\n\t\tlist($net,$maskbits) = explode('/',\"$cidr/\");\n\t\t$net = inet_pton($net);\n\t\tif ($net===false) { return false; }\n\n\t\t$binaryip = self::InetToBits($ip);\n\t\t$binarynet = self::InetToBits($net);\n\t\tif ($binarynet===false) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$ip_net_bits = substr($binaryip,0,(int)$maskbits);\n\t\t$net_bits = substr($binarynet,0,(int)$maskbits);\n\n\t\treturn ($ip_net_bits==$net_bits);\n\t}", "public static function ip_is_listed( $ip, $ip_list ) {\n\t\t$expanded = array();\n\t\tforeach ( $ip_list as $address ){\n\t\t\t$expanded = array_merge( $expanded, self::expandIPBlockToArray( $address ) );\n\t\t}\n\n\t\treturn in_array( $ip, $expanded, true );\n\t}", "public function checkIp($ip) {\n $this->db->query('SELECT Ip FROM Ip WHERE Ip=:ip');\n $this->db->bind(':ip', $ip);\n $row = $this->db->single();\n\n if ($row) {\n return true;\n } else {\n return false;\n }\n }", "public static function is_ip_address($maybe_ip)\n {\n }", "static function searchNetworksContainingIP($IP, $entityID = -1, $recursive = true,\n $fields = \"\", $where = \"\") {\n\n return self::searchNetworks('contains', ['address' => $IP,\n 'netmask' => [0xffffffff, 0xffffffff,\n 0xffffffff, 0xffffffff],\n 'fields' => $fields,\n 'where' => $where],\n $entityID, $recursive);\n }", "public static function check_ip($ip, $ips) {\n\n if (!Validator::is_ip($ip))\n return false;\n\n $method = substr_count($ip, ':') > 1 ? 'check_ipv6' : 'check_ipv4';\n $ips = is_array($ips) ? $ips : array($ips);\n foreach ($ips as $_ip) {\n if (self::$method($ip, $_ip)) {\n return true;\n }\n }\n\n return false;\n }", "private function _isNetworkSpecified()\n {\n return ($this->getNetworkAddress() && $this->getNetworkMask());\n }", "function verify_address($address) // Colorize: green\n { // Colorize: green\n return isset($address) // Colorize: green\n && // Colorize: green\n is_string($address) // Colorize: green\n && // Colorize: green\n ( // Colorize: green\n filter_var($address, FILTER_VALIDATE_IP) // Colorize: green\n || // Colorize: green\n filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) // Colorize: green\n ); // Colorize: green\n }", "public static function matchCIDR($ip, $range)\n {\n list($net, $mask) = explode('/', $range);\n\n // Check IP version\n $ipv = self::detectIPVersion($ip);\n $rangev = self::detectIPVersion($net);\n\n // Return false if it's not a valid IP\n if ($ipv !== $rangev && !$ipv) {\n return false;\n }\n\n // v4\n if ($ipv === 4) {\n return self::matchCIDRv4($ip, $net, $mask);\n }\n\n // v6\n if ($ipv === 6) {\n return self::matchCIDRv6($ip, $net, $mask);\n }\n\n // Return false by default\n return false;\n }", "public function validate_ip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP, \n FILTER_FLAG_IPV4 | \n FILTER_FLAG_IPV6 |\n FILTER_FLAG_NO_PRIV_RANGE | \n FILTER_FLAG_NO_RES_RANGE) === false)\n return false;\n self::$ip = $ip;\n return true;\n }", "protected function validateIp($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_IP) !== false;\n\t}", "private static function matchCIDRv4($ip, $net, $mask)\n {\n // Convert IP and Net address to long\n $ip = ip2long($ip);\n $net = ip2long($net);\n\n // Generate mask\n $mask = -1 << (32 - $mask);\n\n // Do the check\n return ($ip & $mask) === $net;\n }", "public static function checkIp6(string $requestIp, string $subnet) {\n\t\tif (!((extension_loaded('sockets') && \\defined('AF_INET6')) || @inet_pton('::1'))) {\n\t\t\tthrow new Exception('Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".');\n\t\t}\n\n\t\tif (false !== strpos($subnet, '/')) {\n\t\t\tlist($address, $netmask) = explode('/', $subnet, 2);\n\n\t\t\tif ('0' === $netmask) {\n\t\t\t\treturn (bool) unpack('n*', @inet_pton($address));\n\t\t\t}\n\n\t\t\tif ($netmask < 1 || $netmask > 128) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$address = $subnet;\n\t\t\t$netmask = 128;\n\t\t}\n\n\t\t$bytesAddr = unpack('n*', @inet_pton($address));\n\t\t$bytesTest = unpack('n*', @inet_pton($requestIp));\n\n\t\tif (!$bytesAddr || !$bytesTest) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) {\n\t\t\t$left = $netmask - 16 * ($i - 1);\n\t\t\t$left = ($left <= 16) ? $left : 16;\n\t\t\t$mask = ~(0xffff >> $left) & 0xffff;\n\t\t\tif (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function testIPIsValid()\n {\n $settings = require(__DIR__ . '/../src/settings.php');\n $geo_ip = new GeoIP($settings['settings']);\n\n $this->assertTrue($geo_ip->validateIP('10.0.0.1'));\n }", "public function validIp($ip, $type = 'any', $strict = true)\n {\n switch ($type) {\n case 'any':\n return $this->validIpv4($ip, $strict) || $this->validIpv6($ip, $strict);\n break;\n case 'ipv4':\n return $this->validIpv4($ip, $strict);\n break;\n case 'ipv6':\n return $this->validIpv6($ip, $strict);\n break;\n }\n return false;\n }", "function geoCheckIP($ip)\n{\n\t if(!filter_var($ip, FILTER_VALIDATE_IP))\n\t {\n\t\t\t throw new InvalidArgumentException(\"IP is not valid\");\n\t }\n\n\t //contact ip-server\n\t \n\t //$response=@file_get_contents('http://www.netip.de/search?query='.$ip);\n\t $response=@file_get_contents('http://api.hostip.info/country.php?ip='.$ip);\n\t \n\t if (empty($response))\n\t {\n\t\t\t throw new InvalidArgumentException(\"Error contacting Geo-IP-Server\");\n\t }\n\n\t /*\n\t //Array containing all regex-patterns necessary to extract ip-geoinfo from page\n\t $patterns=array();\n\t $patterns[\"domain\"] = '#Domain: (.*?)&nbsp;#i';\n\t $patterns[\"country\"] = '#Country: (.*?)&nbsp;#i';\n\t $patterns[\"state\"] = '#State/Region: (.*?)<br#i';\n\t $patterns[\"town\"] = '#City: (.*?)<br#i';\n\n\t //Array where results will be stored\n\t $ipInfo=array();\n\n\t //check response from ipserver for above patterns\n\t foreach ($patterns as $key => $pattern)\n\t {\n\t\t\t //store the result in array\n\t\t\t $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';\n\t }\n\n\t return $ipInfo;\n\t */\n\t return $response;\n}", "function checkCIDRBlacklist($ip)\n{\n $us_backlist = array(\n //'23','24','50','63','64','65','66','67','68','69','70','71','72','73','74','75','76','96','97',\n //'98','99','100','104','107','108','142','162','163','172','173','174','184','192','198','199','204','205','206','207','208','209','216'\n );\n $cidr = substr($ip, 0, strpos($ip, '.')); // xxx\n if(!empty($us_backlist) && in_array($cidr, $us_backlist))\n return true;\n\n $blacklist = array(\n //'27.67',\n //'27.74',\n //'171.253',\n //'171.249',\n //'59.153',\n //'113.185',\n //'113.161',\n //'115.84',\n //'115.73',\n //'117.0',\n //'117.1',\n //'117.2',\n //'117.3',\n //'117.4',\n //'117.5',\n //'125.212',\n //'123.31',\n //'123.24',\n //'101.99',\n //'58.187', // FPT\n //'183.80', // FPT\n //'183.81', // FPT\n //'42.112', // FPT\n //'42.117', // FPT\n //'1.52', // FPT\n //'1.53', // FPT\n );\n //$cidr = substr($ip, 0, strrpos($ip, '.')); // xxx.xxx.xxx\n $cidr = substr($ip, 0, strpos($ip, '.', strpos($ip, '.') + 1)); // xxx.xxx\n if(!empty($blacklist) && in_array($cidr, $blacklist))\n return true;\n else\n return false;\n}", "function is_subnet($subnet) {\n\tif (!is_string($subnet))\n\treturn false;\n\n\tlist($hp,$np) = explode('/', $subnet);\n\n\tif (!is_ipaddr($hp))\n\treturn false;\n\n\tif (!is_numeric($np) || ($np < 1) || ($np > 32))\n\treturn false;\n\n\treturn true;\n}" ]
[ "0.72038114", "0.6880698", "0.6820507", "0.6743495", "0.6717032", "0.66977155", "0.6692251", "0.66622865", "0.659471", "0.65540147", "0.65382695", "0.6482406", "0.6455845", "0.64519805", "0.6438251", "0.64145136", "0.6395711", "0.6395322", "0.63698393", "0.63661224", "0.63656557", "0.6359051", "0.6358512", "0.6354498", "0.63269603", "0.6324633", "0.6295125", "0.62701756", "0.62623656", "0.6262127", "0.62143624", "0.62140197", "0.6201224", "0.62000024", "0.6171233", "0.61655533", "0.61368316", "0.6093504", "0.60879105", "0.6085047", "0.6038916", "0.6029092", "0.6020446", "0.601921", "0.6011661", "0.6006659", "0.59982735", "0.59890205", "0.5985009", "0.5969396", "0.5958856", "0.59572434", "0.5944646", "0.5918927", "0.59134305", "0.59072", "0.5903647", "0.58863467", "0.58725244", "0.58688563", "0.58681184", "0.5857723", "0.5850116", "0.5837542", "0.5822816", "0.58174944", "0.58108187", "0.5805609", "0.5789011", "0.57857984", "0.5784803", "0.57728374", "0.5772487", "0.5769011", "0.5762811", "0.5753719", "0.573203", "0.57311976", "0.5727716", "0.5727168", "0.57131916", "0.5698096", "0.56910676", "0.5687107", "0.56732213", "0.56562465", "0.5654934", "0.56436896", "0.5633215", "0.5622838", "0.5618174", "0.5605708", "0.56020707", "0.5602038", "0.56017643", "0.56006134", "0.5582086", "0.55802673", "0.55691344", "0.5569061" ]
0.7276029
0
\brief Check network relativity Check how networks are relative (fully different, equals, first contains second, ...)
static function checkNetworkRelativity($firstAddress, $firstNetmask, $secondAddress, $secondNetmask, $version = 0) { if ($firstAddress instanceof IPAddress) { if ($version == 0) { $version = $firstAddress->getVersion(); } if ($version != $firstAddress->getVersion()) { return "different version"; } $firstAddress = $firstAddress->getBinary(); } if ($firstNetmask instanceof IPAddress) { if ($version != $firstNetmask->getVersion()) { return "different version"; } $firstNetmask = $firstNetmask->getBinary(); } if ($secondAddress instanceof IPAddress) { if ($version != $secondAddress->getVersion()) { return "different version"; } $secondAddress = $secondAddress->getBinary(); } if ($secondNetmask instanceof IPAddress) { if ($version != $secondNetmask->getVersion()) { return "different version"; } $secondNetmask = $secondNetmask->getBinary(); } $startIndex = (($version == 4) ? 3 : 0); $first = true; $second = true; for ($i = $startIndex; $i < 4; ++$i) { $and = ($firstNetmask[$i] & $secondNetmask[$i]); // Be carefull : php integers are 32 bits SIGNED. // Thus, checking equality must be done by XOR ... $first &= (($and ^ $firstNetmask[$i]) == 0); $second &= (($and ^ $secondNetmask[$i]) == 0); } if (!$first && !$second) { return "?"; } if ($first && $second) { $result = "equals"; $mask = &$firstNetmask; } else if ($first) { $result = "first contains second"; $mask = &$firstNetmask; } else { // $second == true $result = "second contains first"; $mask = &$secondNetmask; } for ($i = $startIndex; $i < 4; ++$i) { if ((($firstAddress[$i] & $mask[$i]) ^ ($secondAddress[$i] & $mask[$i])) != 0) { return "different"; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDirected();", "function test_get_parents()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes(); \r\n\t\t// Walk trough all nodes and compare it's relations whith the one provided\r\n\t\t// by the relation tree\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$parents = $this->_tree->get_parents($nid);\r\n\t\t\t$exp_parents = array_reverse($this->_traverse_parent_relations($relation_tree, $nid, true), true);\r\n\t\t\t$this->assertEqual($exp_parents, $parents, 'Differs from relation traversal result.');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function isRelative()\n {\n if($this->_address == $this->_request)\n return true;\n return false;\n }", "function assert_is_workflow_net($petrinet) {\n if (count($petrinet[\"source_places\"]) == 0) {\n terminate(\"The petri net has no source places and therefore is no workflow net\");\n }\n if (count($petrinet[\"source_places\"]) > 1) {\n terminate(\"The petri net has more than one source place and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) == 0) {\n terminate(\"The petri net has no sink places and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) > 1) {\n terminate(\"The petri net has more than one sink place and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) == 0) {\n terminate(\"The petri net has zero initial markings and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) > 1) {\n terminate(\"The petri net has more than one initial marking and therefore is no workflow net\");\n }\n }", "function absolute_distance($allRelations, $user_signals_relations)\n{\n\t$userComparison = array();\n\tforeach ($allRelations as $value) {\n\t\t$localRelations = array();\n\t\t$helperArray = $value->get_relations();\n\t\tforeach ($user_signals_relations as $key => $value_2) {\n\t\t\t$keyBackwards_firstPart = $key[18].$key[19].$key[20].$key[21].$key[22].$key[23].$key[24].\n\t\t\t\t$key[25].$key[26].$key[27].$key[28].$key[29].$key[30].$key[31]\n\t\t\t\t.$key[32].$key[33].$key[34].\"-\";\n\t\t\t$keyBackwards_secondPart = $key[0].$key[1].$key[2].$key[3].$key[4].$key[5].$key[6].\n\t\t\t\t$key[7].$key[8].$key[9].$key[10].$key[11].$key[12].$key[13].$key[14].\n\t\t\t\t$key[15].$key[16];\n\t\t\t$keyBackwards = $keyBackwards_firstPart . $keyBackwards_secondPart;\n\t\t\tif (array_key_exists($key, $helperArray)) {\n\t\t\t\t$localRelations[$key] = abs($value_2 - $helperArray[$key]); \n\t\t\t}\n\t\t\tif (array_key_exists((string)$keyBackwards, $helperArray)) {\n\t\t\t\t$localRelations[$key] = abs($value_2 + $helperArray[$keyBackwards]);\n\t\t\t}\n\t\t}\n\t\t$comparisonRelations = new FprintRelations($value->get_room(), $value->get_position(), $localRelations);\n\t\tarray_push($userComparison, $comparisonRelations);\n\t}\n\n\treturn $userComparison;\n\n\n}", "public function isRelatedToNode(Node $relative): bool\n {\n if ($this->getNode()->getId() === $relative->getId()) {\n return true;\n }\n\n $parents = $this->getParents();\n foreach ($parents as $parent) {\n if ($parent->getId() === $relative->getId()) {\n return true;\n }\n }\n return false;\n }", "function is_main_network($network_id = \\null)\n {\n }", "static function searchNetworks($relation, $condition, $entityID = -1, $recursive = true,\n $version = 0) {\n global $DB;\n\n if (empty($relation)) {\n return false;\n }\n\n if (empty($condition[\"fields\"])) {\n $fields = 'id';\n } else {\n $fields = $condition[\"fields\"];\n }\n\n if (!is_array($fields)) {\n $fields = [$fields];\n }\n\n $startIndex = (($version == 4) ? 3 : 1);\n\n $addressDB = ['address_0', 'address_1', 'address_2', 'address_3'];\n $netmaskDB = ['netmask_0', 'netmask_1', 'netmask_2', 'netmask_3'];\n\n $WHERE = [];\n if (isset($condition[\"address\"])\n && isset($condition[\"netmask\"])) {\n $addressPa = new IPAddress($condition[\"address\"]);\n\n // Check version equality ...\n if ($version != $addressPa->getVersion()) {\n if ($version != 0) {\n return false;\n }\n $version = $addressPa->getVersion();\n }\n\n $netmaskPa = new IPNetmask($condition[\"netmask\"], $version);\n\n // Get the array of the adresses\n $addressPa = $addressPa->getBinary();\n $netmaskPa = $netmaskPa->getBinary();\n\n // Check the binary is valid\n if (!is_array($addressPa) || (count($addressPa) != 4)) {\n return false;\n }\n if (!is_array($netmaskPa) || (count($netmaskPa) != 4)) {\n return false;\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n\n if ($relation == \"equals\") {\n for ($i = $startIndex; $i < 4; ++$i) {\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]) . \" & \" . $DB->quoteValue($netmaskPa[$i]) . \") = (\".$DB->quoteValue($addressPa[$i]).\" & \".$DB->quoteValue($netmaskPa[$i]).\")\"),\n $netmaskDB[$i] => $netmaskPa[$i]\n ];\n }\n } else {\n for ($i = $startIndex; $i < 4; ++$i) {\n if ($relation == \"is contained by\") {\n $globalNetmask = $DB->quoteValue($netmaskPa[$i]);\n } else {\n $globalNetmask = $DB->quoteName($netmaskDB[$i]);\n }\n\n $WHERE = [\n new \\QueryExpression(\"(\".$DB->quoteName($addressDB[$i]).\" & $globalNetmask) = (\".$DB->quoteValue($addressPa[$i]).\" & $globalNetmask)\"),\n new \\QueryExpression(\"(\".$DB->quoteValue($netmaskPa[$i]).\" & \".$DB->quoteName($netmaskDB[$i]).\")=$globalNetmask\")\n ];\n }\n }\n }\n\n if ($entityID < 0) {\n $entityID = $_SESSION['glpiactive_entity'];\n }\n $entitiesID = [];\n switch ($relation) {\n case \"is contained by\" :\n $ORDER_ORIENTATION = 'ASC';\n if ($recursive) {\n $entitiesID = getSonsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"contains\" :\n $ORDER_ORIENTATION = 'DESC';\n if ($recursive) {\n $entitiesID = getAncestorsOf('glpi_entities', $entityID);\n }\n break;\n\n case \"equals\" :\n $ORDER_ORIENTATION = '';\n if ($recursive) {\n $entitiesID = getSonsAndAncestorsOf('glpi_entities', $entityID);\n }\n break;\n }\n\n $entitiesID[] = $entityID;\n $WHERE['entities_id'] = $entitiesID;\n $WHERE['version'] = $version;\n\n if (!empty($condition[\"exclude IDs\"])) {\n if (is_array($condition[\"exclude IDs\"])) {\n if (count($condition[\"exclude IDs\"]) > 1) {\n $WHERE['NOT'] = ['id' => $condition['exclude IDs']];\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs'][0]];\n }\n } else {\n $WHERE['id'] = ['<>', $condition['exclude IDs']];\n }\n }\n\n $ORDER = [];\n // By ordering on the netmask, we ensure that the first element is the nearest one (ie:\n // the last should be 0.0.0.0/0.0.0.0 of x.y.z.a/255.255.255.255 regarding the interested\n // element)\n for ($i = $startIndex; $i < 4; ++$i) {\n $ORDER[] = new \\QueryExpression(\"BIT_COUNT(\".$DB->quoteName($netmaskDB[$i]).\") $ORDER_ORIENTATION\");\n }\n\n if (!empty($condition[\"where\"])) {\n $WHERE .= \" AND \" . $condition[\"where\"];\n }\n\n $iterator = $DB->request([\n 'SELECT' => $fields,\n 'FROM' => self::getTable(),\n 'WHERE' => $WHERE,\n 'ORDER' => $ORDER\n ]);\n\n $returnValues = [];\n while ($data = $iterator->next()) {\n if (count($fields) > 1) {\n $returnValue = [];\n foreach ($fields as $field) {\n $returnValue[$field] = $data[$field];\n }\n } else {\n $returnValue = $data[$fields[0]];\n }\n $returnValues[] = $returnValue;\n }\n return $returnValues;\n }", "public function hasNetworks() {\n return $this->_has(4);\n }", "static function checkIPFromNetwork($address, $networkAddress, $networkNetmask, $version = 0) {\n\n $IPNetmask = [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff];\n $relativity = self::checkNetworkRelativity($address, $IPNetmask, $networkAddress,\n $networkNetmask, $version);\n\n return ($relativity == \"equals\") || ($relativity == \"second contains first\");\n }", "private function _isNetworkSpecified()\n {\n return ($this->getNetworkAddress() && $this->getNetworkMask());\n }", "public function hasNetworks() {\n return $this->_has(1);\n }", "public function hasNetworks() {\n return $this->_has(5);\n }", "public function isTrueCidr()\n {\n return $this->start == $this->getNetwork() && $this->end == $this->getBroadcast();\n }", "function lola_check_all_transitions($check_name, $formula) {\n global $petrinet;\n foreach ($petrinet[\"transitions\"] as $transition) {\n $ret = lola_check_single_transition($check_name, $formula, $transition[\"id\"]);\n if (!$ret->result) {\n debug(\"Single transition check \" . $check_name . \" for transition \" . $transition[\"id\"] . \" failed, returning false\");\n // Re-using last returned result object - containing witness path\n return $ret;\n }\n }\n return new CheckResult(true, \"\", \"\");\n }", "public function testProjectAssignmentsLinkRelation()\n {\n }", "public function checkNetworkChair() {\n if (self::redirectIfNotLoggedIn()) {\n return TRUE;\n }\n\n if (!LoggedInUserDetails::isCrew() && !LoggedInUserDetails::isNetworkChair()) {\n drupal_set_message(iish_t('Access denied. You are not a chair of a network.'), 'error');\n\n return TRUE;\n }\n\n return FALSE;\n }", "public function testInclusiveCosts()\n {\n $node = new CallTreeNode(\n 'file1', 'func1', self::toCostArray(2, 3, 5, 7)\n );\n $nodeChild = new CallTreeNode(\n 'file2', 'func2', self::toCostArray(11, 14, 17, 19)\n );\n $nodeSubChild = new CallTreeNode(\n 'file3', 'func3', self::toCostArray(1, 3, 7, 29)\n );\n\n $node->addChild($nodeChild);\n $node->addChild($nodeSubChild);\n $costs = $node->getInclusiveCosts();\n $this->assertEquals(14, $costs['time']);\n $this->assertEquals(14, $costs['mem']);\n $this->assertEquals(29, $costs['cycles']);\n $this->assertEquals(29, $costs['peakmem']);\n }", "private function isReachable(array $from, array $to): bool\n {\n $cells = [];\n if ($from[0] === $to[0]) {\n for ($i = min($from[1], $to[1]); $i <= max($from[1], $to[1]); ++$i) {\n $cells[] = $this->getCell($from[0], $i);\n }\n } else if ($from[1] === $to[1]) {\n for ($i = min($from[0], $to[0]); $i <= max($from[0], $to[0]); ++$i) {\n $cells[] = $this->getCell($i, $from[1]);\n }\n } else {\n $x1 = min($from[0], $to[0]);\n $y1 = $x1 === $from[0] ? $from[1] : $to[1];\n $x2 = max($from[0], $to[0]);\n $y2 = $x2 === $from[0] ? $from[1] : $to[1];\n while (abs($x1 - $x2) >= 0 && abs($y1 - $y2) >= 0) {\n $cells[] = $this->getCell($x1, $y1);\n if ($x1 > $x2) {\n --$x1;\n } else if ($x1 < $x2) {\n ++$x1;\n } else if ($x1 === $x2) {\n break;\n }\n if ($y1 > $y2) {\n --$y1;\n } else if ($y1 < $y2) {\n ++$y1;\n } else if ($y1 === $y2) {\n break;\n }\n }\n }\n\n $pieces = count(array_filter($cells, function ($i) {\n return !is_null($i);\n }));\n\n if ($pieces === 1) {\n return true;\n }\n if ($pieces === 2) {\n $result = 0;\n if ($cells[0] instanceof Piece) {\n $result += $cells[0]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if ($cells[count($cells) - 1] instanceof Piece) {\n $result +=\n $cells[count($cells) - 1]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if (\n $this->getCell($from[0], $from[1]) instanceof Pawn &&\n $from[0] === $to[0]\n ) {\n $result += 1;\n }\n return $result === 1;\n }\n return false;\n }", "protected function verifyNetwork($input): bool\n {\n if ($this->networkRange === null) {\n return true;\n }\n\n if (isset($this->networkRange['mask'])) {\n return $this->belongsToSubnet($input);\n }\n\n $input = sprintf('%u', ip2long($input));\n\n $min = sprintf('%u', ip2long($this->networkRange['min']));\n $max = sprintf('%u', ip2long($this->networkRange['max']));\n\n return ($input >= $min) && ($input <= $max);\n }", "public function __validate_acl_network() {\n if (isset($this->initial_data['acl_network'])) {\n # Check if this is an IPv4 or IPv6 address\n if (is_ipaddr($this->initial_data[\"acl_network\"])) {\n $this->ip_version = intval(is_ipaddr($this->initial_data[\"acl_network\"]));\n $this->validated_data[\"acl_network\"] = $this->initial_data['acl_network'];\n } else {\n $this->errors[] = APIResponse\\get(2069);\n }\n } else {\n $this->errors[] = APIResponse\\get(2068);\n }\n }", "public function getIsOnNetworkAttribute()\n {\n return $this->networkDataAtcCurrent->exists;\n }", "function findNet($ip,$sm) {\n\n $res = \"\";\n\n // divido gli ottetti\n $exip = explode('.',$ip);\n $exsm = explode('.',$sm);\n\n for($i=0; $i<4; $i++) {\n\n $subip=$exip[$i]; // ottetto del IP\n $subsm=$exsm[$i]; // ottetto della SM\n\n for($k=0; $k<8; $k++) {\n \n if($subip[$k] & $subsm[$k]) {\n $res.=\"1\";\n }\n else {\n $res.=\"0\";\n }\n }\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $res.=\".\";\n }\n \n }\n\n return $res;\n}", "function url_compare($url, $rel) {\n $url = trailingslashit($url);\n $rel = trailingslashit($rel);\n if ((strcasecmp($url, $rel) === 0) || root_relative_url($url) == $rel) {\n return true;\n } else {\n return false;\n }\n}", "function isecrects($r1, $r2) {\n\n \n $pn; $px;\n for ($pi = 0, $pl = count($r1); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $po$int\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r1[$pi], $r1[$pi+1]],\n [$r1[$pn], $r1[$pn+1]],\n [$r1[$px], $r1[$px+1]], $r2)){ return false;}\n }\n for ($pi = 0, $pl = count($r2); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $point\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r2[$pi], $r2[$pi+1]],\n [$r2[$pn], $r2[$pn+1]],\n [$r2[$px], $r2[$px+1]], $r1)){return false;}\n }\n return true;\n}", "function lola_check_all_transitions_negated($check_name, $formula) {\n global $petrinet;\n foreach ($petrinet[\"transitions\"] as $transition) {\n $ret = lola_check_single_transition($check_name, $formula, $transition[\"id\"]);\n if ($ret->result) {\n debug(\"Single negated transition check \" . $check_name . \" for transition \" . $transition[\"id\"] . \" succeeded, returning false\");\n return new CheckResult(false, $ret->witness_path, $ret->witness_state);\n }\n }\n return new CheckResult(true, \"\", \"\");\n }", "public function hasSiblings();", "function network_domain_check()\n {\n }", "public function isRelationship($name);", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "function catch_information($nodes, $index_own_nodes, $status)\n{\n $own_nodes_list = array();\n foreach ($index_own_nodes as $index) {\n $push = false;\n $node = $nodes[$index];\n $lastseen = format_date($node['lastseen']); # WICHTIG\n\n $hostname = $node['hostname']; # WICHTIG\n $node_id = $node['node_id']; # WICHTIG\n $addresses = $node['addresses'];\n\n $base = $node['firmware']['base'];\n # lösche folgende substrings in base\n $hw = array(\"gluon-\",);\n $base = str_replace($hw, '', $base);\n $release = $node['firmware']['release'];\n\n $model = $node['model'];\n # lösche folgende substrings in model\n $hw = array(\"TP-Link\", \"TP-LINK\", \"ALFA NETWORK\", \"N/ND\");\n $model = str_replace($hw, '', $model);\n\n $gateway = $node['gateway'];\n $gateway_nexthop = $node['gateway_nexthop'];\n # Uplink (Workaround, da Uplink direkt nicht mehr in der JSON steht)\n $uplink = ($gateway == $gateway_nexthop); # WICHTIG\n\n # Richtige IP wählen\n if (startsWith($addresses['0'], \"fe80:\")) {\n $ipv6 = $addresses['1']; # WICHTIG\n } else {\n $ipv6 = $addresses['0']; # WICHTIG\n }\n # Flags\n $online = $node['is_online']; # WICHTIG\n # $uplink = $flags['uplink']; # WICHTIG (kaputt)\n\n # Speichere Werter zur Übergabe\n $inf_node = array(\n \"lastseen\" => $lastseen,\n \"hostname\" => $hostname,\n \"node_id\" => $node_id,\n \"ipv6\" => $ipv6,\n \"online\" => $online,\n \"uplink\" => $uplink,\n \"release\" => $release,\n \"base\" => $base,\n \"model\" => $model,);\n\n # Hier Entscheide, ob offline, uplink oder online\n if ($status == \"offline\") {\n if (!$online) {\n $push = true;\n }\n } else {\n if ($status == \"uplink\") {\n if ($uplink and $online) {\n $push = true;\n }\n } else {\n if ($status == \"online\") {\n if ($online and !$uplink) {\n $push = true;\n }\n }\n }\n }\n if ($push) {\n array_push($own_nodes_list, $inf_node);\n }\n }\n return $own_nodes_list;\n}", "public function isRel() {\n return substr($this->model, -3) == \"Rel\";\n }", "public function testPingTreeGetReferences()\n {\n }", "public function isRelativeUri() {\n return !$this->isAbsoluteUri();\n }", "public function hasSiblings() {}", "public function findrelation(){\n\t\t$famid = \\Input::get('fid'); \n\t\t$memid1 = \\Input::get('rfid1');\n\t\t$memid2 = \\Input::get('rfid2');\n\t\tMisc::isfam_valid($famid,\"Show\");\n\n\t\tif($memid1 == $memid2) return \\Response::make(\"SELF\");\n\t\t$famgraph = new FamilyGraph($famid);\n \t \t\n \t \t$relation = $famgraph->FindRelationsBetween($memid1,$memid2) ;\n \t \treturn \\Response::make(Misc::get_relation_in_mylang($relation) );\n\t}", "public function relationalExpression(){\n try {\n // Sparql11query.g:403:3: ( numericExpression ( EQUAL numericExpression | NOT_EQUAL numericExpression | LESS numericExpression | GREATER numericExpression | LESS_EQUAL numericExpression | GREATER_EQUAL numericExpression )? ) \n // Sparql11query.g:404:3: numericExpression ( EQUAL numericExpression | NOT_EQUAL numericExpression | LESS numericExpression | GREATER numericExpression | LESS_EQUAL numericExpression | GREATER_EQUAL numericExpression )? \n {\n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1369);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:405:3: ( EQUAL numericExpression | NOT_EQUAL numericExpression | LESS numericExpression | GREATER numericExpression | LESS_EQUAL numericExpression | GREATER_EQUAL numericExpression )? \n $alt50=7;\n $LA50 = $this->input->LA(1);\n if($this->getToken('EQUAL')== $LA50)\n {\n $alt50=1;\n }\n else if($this->getToken('NOT_EQUAL')== $LA50)\n {\n $alt50=2;\n }\n else if($this->getToken('LESS')== $LA50)\n {\n $alt50=3;\n }\n else if($this->getToken('GREATER')== $LA50)\n {\n $alt50=4;\n }\n else if($this->getToken('LESS_EQUAL')== $LA50)\n {\n $alt50=5;\n }\n else if($this->getToken('GREATER_EQUAL')== $LA50)\n {\n $alt50=6;\n }\n\n switch ($alt50) {\n case 1 :\n // Sparql11query.g:406:5: EQUAL numericExpression \n {\n $this->match($this->input,$this->getToken('EQUAL'),self::$FOLLOW_EQUAL_in_relationalExpression1379); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1381);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:407:7: NOT_EQUAL numericExpression \n {\n $this->match($this->input,$this->getToken('NOT_EQUAL'),self::$FOLLOW_NOT_EQUAL_in_relationalExpression1389); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1391);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 3 :\n // Sparql11query.g:408:7: LESS numericExpression \n {\n $this->match($this->input,$this->getToken('LESS'),self::$FOLLOW_LESS_in_relationalExpression1399); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1401);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 4 :\n // Sparql11query.g:409:7: GREATER numericExpression \n {\n $this->match($this->input,$this->getToken('GREATER'),self::$FOLLOW_GREATER_in_relationalExpression1409); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1411);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 5 :\n // Sparql11query.g:410:7: LESS_EQUAL numericExpression \n {\n $this->match($this->input,$this->getToken('LESS_EQUAL'),self::$FOLLOW_LESS_EQUAL_in_relationalExpression1419); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1421);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 6 :\n // Sparql11query.g:411:7: GREATER_EQUAL numericExpression \n {\n $this->match($this->input,$this->getToken('GREATER_EQUAL'),self::$FOLLOW_GREATER_EQUAL_in_relationalExpression1429); \n $this->pushFollow(self::$FOLLOW_numericExpression_in_relationalExpression1431);\n $this->numericExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function isCanonical();", "function recognize_relationship($relations_array, $parent, $child)\n{\n\t$out = \"\"; // create empty output string (will be concatenated to final output)\n\tif($parent == $child) // if child and parent are same\n\t\treturn \"1:1\";\n\n\t$out = isset($relations_array[$parent][$child]) ? $out . \"N\" : $out . \"1\"; //relation parent to children\n\n\t$out = isset($relations_array[$child][$parent]) ? $out . \":N\" : $out . \":1\"; //relation child to parents\n\n\treturn ($out == \"N:N\" ? \"N:M\" : $out); //converting \"N:N\" relation to \"N:M\"\n}", "public function testInconsistentSiblings()\n {\n $unit1 = $this->getUnit('shipment');\n $unit1->setReversedMapping([\n 'total' => 'map.total'\n ]);\n $unit1->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit1->setMapping([\n 'shipment_id' => 'map.shipment_id',\n 'total' => 'map.total',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n [1, 30],\n [2, 33],\n [3, 55],\n [4, 11],\n false,\n ]\n ));\n $unit1->setIsEntityCondition(function (MapInterface $map) {\n return !empty($map['shipment_id']);\n });\n $unit1->setTmpFileName('shipment_tmp.csv');\n\n $unit3 = $this->getUnit('tracking');\n $unit3->setReversedMapping([\n 'tracking_number' => 'map.tracking_number',\n ]);\n $unit3->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit3->setMapping([\n 'id' => 'map.incr(\"track_id\", 1)',\n 'tracking_number' => 'map.tracking_number',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit3->setFilesystem($this->getFS(\n [\n [1, '56465454', 1],\n [2, '13122333', 3],\n [3, '13343443', 4],\n false,\n ]\n ));\n $unit3->setTmpFileName('tracking_tmp.csv');\n $unit3->addSibling($unit1);\n $unit3->setOptional(true);\n\n $expected = [\n [[\n 'total' => 30,\n 'tracking_number' => '56465454',\n ]],\n [[\n 'total' => 33,\n 'tracking_number' => null,\n ]],\n [[\n 'total' => 55,\n 'tracking_number' => '13122333',\n ]],\n [[\n 'total' => 11,\n 'tracking_number' => '13343443',\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit3], $expected);\n $action->process($this->getResultMock());\n }", "public function testHasNet()\n\t{\n\t\t$this->assertFalse($this->object->hasNet());\n\n\t\tTestReflection::setValue($this->object, 'net', new PNPetrinet('test'));\n\n\t\t$this->assertTrue($this->object->hasNet());\n\t}", "public static function workflowRelations();", "public function isRelative()\n {\n if (preg_match('~^https?:\\/\\/~i', $this->url) OR preg_match('~^\\/\\/~i', $this->url)) {\n return false;\n } else {\n return true;\n }\n }", "function test_get_parent()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes(); \r\n\t\t// Walk trough all nodes and compare it's relations whith the one provided\r\n\t\t// by the relation tree\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$parent = $this->_tree->get_parent($nid, true);\r\n\t\t\tif (!isset($relation_tree[$nid]['parent_id']))\r\n\t\t\t{\r\n\t\t\t\t$this->assertFalse($parent, 'A rootnode returned a parent');\r\n\t\t\t\tcontinue;\r\n\t\t\t} \r\n\t\t\t$this->assertEqual($relation_tree[$nid]['parent_id'], $parent['id'], 'Relation tree parent doesn\\'t match method return');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function other()\n {\n //$graph = $factory->createGraph('my graph');\n//\n //$begin = $graph->addBegin(\"begin\");\n //$flow1 = $graph->addDecision(\"task1\");\n //$complete = $graph->addTask(\"completed\");\n //$failed = $graph->addTask(\"failed\");\n//\n //$graph1 = $graph->addGraph(\"graph1\");\n //$task3 = $graph1->addTask(\"task3\");\n //$task4 = $graph1->addTask(\"task4\");\n //$graph1->addArrow($task3, $task4);\n //$graph1->addInputPoint($task3->getInputPoint());\n //$graph1->addOutputPoint($task4->getOutputPoint());\n //\n //$end = $graph->addEnd(\"end\");\n//\n //$graph->addArrow($begin, $task1);\n //$graph->addArrow($task1, $complete, Decision::TASK_COMPLETED);\n //$graph->addArrow($complete, $graph1);\n //\n //$graph->addArrow($task1, $failed, Decision::TASK_FAILED);\n //$graph->addArrow($failed, $graph1);\n//\n //$graph->addArrow($graph1, $end);\n\n // $graph = $graph->addGraph(\"graph1\");\n // $task4 = $graph->addDecision(\"task4\");\n // $task5 = $graph->addTask(\"task5\");\n // $graph->addInputPoint($task4->getInputPoint());\n // $graph->addOutputPoint($task5->getOutputPoint());\n // $graph->addArrow($task4, $task5, 'OnTaskCompleted');\n\n // $graph->addArrow($task3, $graph);\n // $graph->addArrow($graph, $task2);\n\n // Creating a file Network.dot ready to be opened by the Graphviz software\n //$dumper = new GraphvizDumper();\n ////file_put_contents('flowchart.dot', $dumper->dump($graph));\n\n// //// Creating a file Network.dot ready to be opened by the Graphviz software\n //$dumper = new \\Petrinet\\Dumper\\GraphvizDumper();\n //$petrinet = $graph->getPetriBuilder()->getPetrinet();\n ////file_put_contents('petrinet1.dot', $dumper->dump($petrinet));\n\n// //$engine = new Engine($petrinet);\n //$dispatcher = new EventDispatcher();\n //\n //// Listening to an EngineEvent\n //$stopped = function (EngineEvent $e) use ($dumper) {\n // $petrinet = $e->getEngine()->getPetrinet();\n // echo 'The execution of the Petrinet ' . $petrinet->getId() . ' just stopped';\n // file_put_contents('petrinet2.dot', $dumper->dump($petrinet));\n //};\n //$listenInsertion = function (TokenAndPlaceEvent $e) {\n // $placeId = $e->getToken()->getId();\n // echo sprintf('The place %s just received a new token', $placeId);\n //};\n\n// //// Adding the listener to the dispatcher\n //$dispatcher->addListener(PetrinetEvents::AFTER_ENGINE_STOP, $stopped);\n //$dispatcher->addListener(PetrinetEvents::AFTER_TOKEN_INSERT, $listenInsertion);\n\n// //// Injecting the dispatcher into the engine\n //$engine->setDispatcher($dispatcher);\n //\n //// Starting the execution\n //$engine->start();\n\n// //$this->assertInstanceOf('\\Flow\\Graph\\Components\\Graph\\Graph', $graph);\n }", "public function originIsValid(): bool;", "public function hasAncestors();", "function upgrade_network()\n {\n }", "function show_position($userComparison) \n{\n\t$allTotals = array();\n\n\t$smallestValue = -1.0;\n\n\t$rightRoom = \"default\";\n\n\t$rightCoordinates = \"default\";\n\n\tforeach($userComparison as $value) {\n\t\n\n\t\t$local_relations = $value->get_relations();\n\n\t\t$temp_sum = 0.0;\n\n\t\t$n = 0;\n\n\t\tforeach($local_relations as $value_2) {\t\n\t\t\t$temp_sum = $temp_sum + $value_2;\n\t\t\t$n = $n + 1;\t\n\t\t\t}\n\t\n\t\tif ( $n >= 3) {\n\n\t\t\t$relative_sum = $temp_sum / (double)($n);\n\n\t\t\tif ($smallestValue == -1.0) {\n\n\t\t\t\t$smallestValue = $relative_sum;\n\t\t\t\t$rightRoom = $value->get_room();\n\t\t\t\t$rightCoordinates = $value->get_position();\n\n\t\t\t\t}\n\t\t\telseif ($smallestValue > $relative_sum) {\n\t\t\t\n\t\t\t\t$smallestValue = $relative_sum;\n\t\t\t\t$rightRoom = $value->get_room();\n\t\t\t\t$rightCoordinates = $value->get_position();\n\t\t\t\n\t\t\t\t}\n\n\n\t\t\t$totalDifference = new FprintDifference($value->get_room(), $value->get_position(), $relative_sum);\n\t\t\tarray_push($allTotals, $totalDifference);\n\t\t\t}\n\n\t}\n\n\n\techo $rightRoom . \": \" . $rightCoordinates . \", relative distance was:\" . $smallestValue;\n\n\n\treturn $allTotals;\n\n\n}", "function lola_check_single_transition($check_name, $formula, $transition_name) {\n global $petrinet;\n \n // Check if this transition is present\n if (!array_filter($petrinet[\"transitions\"], function($transition) use ($transition_name) { return $transition[\"id\"] == $transition_name; })) {\n terminate(\"This transition does not exist in the petri net\");\n }\n \n $safe_transition_name = preg_replace(\"/\\W/\", \"\", $transition_name);\n $individual_check_name = $check_name . \".\" . $safe_transition_name;\n \n $formula = $formula . \"(\" . $transition_name . \")\";\n return exec_lola_check($individual_check_name, $formula);\n }", "function icu_drush_nodes_match($node1, $node2, $fullComparison=FALSE) {\n\n if ($node1->nodeName === $node2->nodeName) {\n if ($node1->nodeType === $node2->nodeType) {\n if ($node1->nodeValue === $node2->nodeValue) {\n $len = strlen(trim((string) $node1->nodeValue));\n if ($len > 0) {\n if (!$fullComparison) { return TRUE; }\n\n $sameAttr = TRUE;\n if ($node1->hasAttributes() && $node2->hasAttributes()) {\n $attr1 = $attr2 = array( );\n if (count($node1->attributes) != count($node2->attributes)) { $sameAttr = FALSE; }\n if ($sameAttr) {\n foreach ($node1->attributes as $attr) { $attr1[] = $attr; }\n foreach ($node2->attributes as $attr) { $attr2[] = $attr; }\n for ($i=0; $i<count($attr1); $i++) {\n if ($attr1[$i]->name != $attr2[$i]->name) { $sameAttr = FALSE; }\n if ($attr1[$i]->value != $attr2[$i]->value) { $sameAttr = FALSE; }\n }\n }\n }\n\n if ($node1->parentNode === $node2->parentNode && $sameAttr) { return TRUE; }\n }\n }\n }\n }\n\n return FALSE;\n}", "public function testGetNet()\n\t{\n\t\t$this->assertNull($this->object->getNet());\n\n\t\tTestReflection::setValue($this->object, 'net', true);\n\n\t\t$this->assertTrue($this->object->getNet());\n\t}", "function checkInter( $node ){\n\t\tif( ! is_a($node, \"KDT_node\") )\n\t\t{\n\t\t\texit(\"input error\");\n\t\t}\n\t\t\n\t\t// the node should not be a leaf node\n\t\tif( $node->is_leaf() ){\n\t\t\treturn NULL;\n\t\t}\n\t\tif( $node->is_x() ){\n\t\t\tif( eDistance($this->x,$node->y,$node->x,$node->y) < $this->r ){\n\t\t\t\treturn 0;\n\t\t\t}else{\n\t\t\t\tif( $node->x < $this->x ){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}elseif( $node->is_y() ){\n\t\t\tif( eDistance($node->x,$this->y,$node->y,$node->y) < $this->r ){\n\t\t\t\treturn 0;\n\t\t\t}else{\n\t\t\t\tif( $node->y < $this->y ){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function relMatches($rel_attr, $target_rel)\n { // XXX: TESTME\n $rels = preg_split(\"/\\s+/\", trim($rel_attr));\n foreach ($rels as $rel) {\n $rel = strtolower($rel);\n if ($rel == $target_rel) {\n return 1;\n }\n }\n\n return 0;\n }", "public function bidirectional_relation_exists() {\n $this->db->query(\"SELECT * FROM user_relation WHERE (`from` = ? AND `to` = ?) OR (`from` = ? AND `to` = ?)\",\n array(\n $this->from,\n $this->to,\n $this->to,\n $this->from,\n ));\n\n if($this->db->count() > 0) {\n return $this->db->results()[0]->status;\n } else {\n return false;\n }\n }", "abstract function isConnected();", "public function verify(Model $Model) {\n\t\textract($this->settings[$Model->alias]);\n\t\tif (!$Model->find('count', array('conditions' => $scope))) {\n\t\t\treturn true;\n\t\t}\n\t\t$min = $this->_getMin($Model, $scope, $left, $recursive);\n\t\t$edge = $this->_getMax($Model, $scope, $right, $recursive);\n\t\t$errors = array();\n\n\t\tfor ($i = $min; $i <= $edge; $i++) {\n\t\t\t$count = $Model->find('count', array('conditions' => array(\n\t\t\t\t$scope, 'OR' => array($Model->escapeField($left) => $i, $Model->escapeField($right) => $i)\n\t\t\t)));\n\t\t\tif ($count != 1) {\n\t\t\t\tif (!$count) {\n\t\t\t\t\t$errors[] = array('index', $i, 'missing');\n\t\t\t\t} else {\n\t\t\t\t\t$errors[] = array('index', $i, 'duplicate');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$node = $Model->find('first', array(\n\t\t\t'conditions' => array($scope, $Model->escapeField($right) . '< ' . $Model->escapeField($left)),\n\t\t\t'order' => false,\n\t\t\t'recursive' => 0\n\t\t));\n\t\tif ($node) {\n\t\t\t$errors[] = array('node', $node[$Model->alias][$Model->primaryKey], 'left greater than right.');\n\t\t}\n\n\t\t$Model->bindModel(array('belongsTo' => array('VerifyParent' => array(\n\t\t\t'className' => $Model->name,\n\t\t\t'foreignKey' => $parent,\n\t\t\t'fields' => array($Model->primaryKey, $left, $right, $parent)\n\t\t))));\n\n\t\t$rows = $Model->find('all', array('conditions' => $scope, 'recursive' => 0));\n\t\tforeach ($rows as $instance) {\n\t\t\tif ($instance[$Model->alias][$left] === null || $instance[$Model->alias][$right] === null) {\n\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey],\n\t\t\t\t\t'has invalid left or right values');\n\t\t\t} elseif ($instance[$Model->alias][$left] == $instance[$Model->alias][$right]) {\n\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey],\n\t\t\t\t\t'left and right values identical');\n\t\t\t} elseif ($instance[$Model->alias][$parent]) {\n\t\t\t\tif (!$instance['VerifyParent'][$Model->primaryKey]) {\n\t\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey],\n\t\t\t\t\t\t'The parent node ' . $instance[$Model->alias][$parent] . ' doesn\\'t exist');\n\t\t\t\t} elseif ($instance[$Model->alias][$left] < $instance['VerifyParent'][$left]) {\n\t\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey],\n\t\t\t\t\t\t'left less than parent (node ' . $instance['VerifyParent'][$Model->primaryKey] . ').');\n\t\t\t\t} elseif ($instance[$Model->alias][$right] > $instance['VerifyParent'][$right]) {\n\t\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey],\n\t\t\t\t\t\t'right greater than parent (node ' . $instance['VerifyParent'][$Model->primaryKey] . ').');\n\t\t\t\t}\n\t\t\t} elseif ($Model->find('count', array('conditions' => array($scope, $Model->escapeField($left) . ' <' => $instance[$Model->alias][$left], $Model->escapeField($right) . ' >' => $instance[$Model->alias][$right]), 'recursive' => 0))) {\n\t\t\t\t$errors[] = array('node', $instance[$Model->alias][$Model->primaryKey], 'The parent field is blank, but has a parent');\n\t\t\t}\n\t\t}\n\t\tif ($errors) {\n\t\t\treturn $errors;\n\t\t}\n\t\treturn true;\n\t}", "public function testPingTreeGetTargets()\n {\n }", "public function validUserRelationship($input){\n\n $suppliedRelationship = $input['user_relationship'];\n\n if(isset(LoungeUser::$relationships[$suppliedRelationship]))\n return true;\n\n return false;\n }", "public static function checkTotalCreditsInNetworkTransactions($customer_id, $start, $end)\n\t{\n\t\t$account = DB::table('customer_link_customer_buy')->where('customer_buy_start_id', $customer_id)->first();\n\n\t\t$corporate_members = DB::table('corporate_members')->where('corporate_id', $account->corporate_id)->get();\n\t\t$lite_plan = StringHelper::liteCompanyPlanStatus($customer_id);\n\t\t$total_transaction_spent = 0;\n\t\t$total_consultation = 0;\n\n\t\tforeach ($corporate_members as $key => $member) {\n\t\t\t$ids = StringHelper::getSubAccountsID($member->user_id);\n\n\t // if($lite_plan) {\n\t\t\t$temp_trans_lite_plan = DB::table('transaction_history')\n\t\t\t->whereIn('UserID', $ids)\n\t // ->where('in_network', 1)\n\t\t\t->where('lite_plan_enabled', 1)\n\t\t\t->where('deleted', 0)\n\t\t\t->where('paid', 1)\n\t\t\t->where('created_at', '>=', $start)\n\t\t\t->where('created_at', '<=', $end)\n\t\t\t->orderBy('created_at', 'desc')\n\t\t\t->get();\n\n\t\t\t$temp_trans = DB::table('transaction_history')\n\t\t\t->whereIn('UserID', $ids)\n\t // ->where('in_network', 1)\n\t\t\t->where('credit_cost', '>', 0)\n\t\t\t->where('deleted', 0)\n\t\t\t->where('paid', 1)\n\t\t\t->where('created_at', '>=', $start)\n\t\t\t->where('created_at', '<=', $end)\n\t\t\t->orderBy('created_at', 'desc')\n\t\t\t->get();\n\t\t\t$transactions_temp = array_merge($temp_trans_lite_plan, $temp_trans);\n\t\t\t$transactions = self::my_array_unique($transactions_temp);\n\t // } else {\n\t // // get in-network transactions\n\t // $transactions = DB::table('transaction_history')\n\t // ->whereIn('UserID', $ids)\n\t // // ->where('in_network', 1)\n\t // ->where('health_provider_done', 0)\n\t // ->where('deleted', 0)\n\t // ->where('created_at', '>=', $start)\n\t // ->where('created_at', '<=', $end)\n\t // ->orderBy('created_at', 'desc')\n\t // ->get();\n\n\t // }\n\n\t // return $transactions;\n\n\t // in-network transactions\n\t\t\tforeach ($transactions as $key => $trans) {\n\t\t\t\tif($trans) {\n\t\t\t\t\t$total_transaction_spent += $trans->credit_cost;\n\t\t\t\t\tif($trans->lite_plan_enabled == 1) {\n\n\t\t\t\t\t\tif($trans->spending_type == 'medical') {\n\t\t\t\t\t\t\t$table_wallet_history = 'wallet_history';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$table_wallet_history = 'wellness_wallet_history';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($trans->lite_plan_enabled == 1) {\n\t\t\t\t\t\t\t$logs_lite_plan = DB::table($table_wallet_history)\n\t\t\t\t\t\t\t->where('logs', 'deducted_from_mobile_payment')\n\t\t\t\t\t\t\t->where('lite_plan_enabled', 1)\n\t\t\t\t\t\t\t->where('id', $trans->transaction_id)\n\t\t\t\t\t\t\t->first();\n\n\t\t\t\t\t\t\tif($logs_lite_plan && $trans->credit_cost > 0 && $trans->lite_plan_use_credits == 0) {\n\t\t\t\t\t\t\t\t$total_consultation += floatval($logs_lite_plan->credit);\n\t\t\t\t\t\t\t\t$consultation_credits = true;\n\t\t\t\t\t\t\t\t$service_credits = true;\n\t\t\t\t\t\t\t} else if($logs_lite_plan && $trans->procedure_cost >= 0 && (int)$trans->lite_plan_use_credits == 1){\n\t\t\t\t\t\t\t\t$total_consultation += floatval($logs_lite_plan->credit);\n\t\t\t\t\t\t\t\t$consultation_credits = true;\n\t\t\t\t\t\t\t\t$service_credits = true;\n\t\t\t\t\t\t\t} else if($trans->procedure_cost >= 0 && (int)$trans->lite_plan_use_credits == 0){\n\t\t\t\t\t\t\t\t$total_consultation += floatval($trans->consultation_fees);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn array(\n\t\t\t'total_credits' => $total_transaction_spent,\n\t\t\t'total_consultation' => $total_consultation\n\t\t);\n\t}", "function is_reachable()\r\n {\r\n return $this->is_connected();\r\n }", "public function testCreateUnitRelationships()\n {\n }", "public function hasMirrors() {}", "public function is_network_migration() {\r\n /**\r\n * Comment the line below if you'd like to support network level licenses migration.\r\n * This is only relevant if you have a special network level integration with your plugin\r\n * and you're utilizing the Freemius SDK's multisite network integration mode.\r\n */\r\n return false;\r\n }", "public function isValidRelative()\n {\n if ($this->scheme || $this->host || $this->userInfo || $this->port) {\n return false;\n }\n\n if ($this->path) {\n // Check path-only (no host) URI\n if (0 === strpos($this->path, '//')) {\n return false;\n }\n return true;\n }\n\n if (! ($this->query || $this->fragment)) {\n // No host, path, query or fragment - this is not a valid URI\n return false;\n }\n\n return true;\n }", "public function isRelationshipData();", "function get_networks($args = array())\n {\n }", "public function testPingTreeUpdateTargets()\n {\n }", "public function testUrlReconstruction() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestQuery']);\n\n\t\t(new Verify(\n\t\t\t'check that GetURL() reconstructed an accurate URL.',\n\t\t\t$router->GetURL()\n\t\t))->equals('http://www.nether.io/test');\n\n\t\treturn;\n\t}", "function test_get_sub_branch()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t//$allnodes = $this->_tree->get_all_nodes();\r\n\t\tforeach($relation_tree AS $nid => $relations)\r\n\t\t{\r\n\t\t\t$subbranch = $this->_tree->get_sub_branch($nid);\r\n\t\t\t$exp_sub_branch = $this->_traverse_child_relations($relation_tree, $nid, true, true);\r\n\t\t\t$this->assertEqual($subbranch, $exp_sub_branch, 'Differs from relation traversal result.');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function accept_request() {\n // Only send request if there's no existed relation between the two users\n $existed_relation_status = $this->bidirectional_relation_exists();\n \n if($existed_relation_status === \"P\") {\n /* \n Here w passed P as argument to update method to tell to update record with:\n from=$this->from\n to=$this->to\n status=\"P\"\n and change it to be like :\n from=$this->from\n to=$this->to\n status=\"F\"\n */\n\n // Update the current direction record\n $this->status = \"F\";\n $this->update(\"P\");\n\n // Add the other direction record\n $other_end = new UserRelation();\n $other_end->set_data(array(\n 'from'=>$this->to,\n 'to'=>$this->from,\n 'status'=>\"F\",\n 'since'=>date(\"Y/m/d h:i:s\")\n ));\n $other_end->add();\n\n return true;\n }\n\n return false;\n }", "public function isLivenetNetwork() {\n return $this->getNetwork() === 'livenet';\n }", "function fetch_full_network($dbc)\t{\n\t//fetch nodes\n\t//$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path` FROM `artist_profile` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n//$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path`, `artist_living_status`, `artist_dob`, `artist_dod`,`artist_genre`,`artist_ethnicity`,`artist_gender`,`artist_residence_country` FROM `artist_profile` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n$artist_id_name_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name`, `is_user_artist`, `artist_photo_path`, `artist_living_status`, `artist_dob`, `artist_dod`,`artist_genre`,`artist_ethnicity`,`artist_gender`,`artist_residence_country` FROM `artist_profile` WHERE `artist_profile_id`\";\n\t$artist_id_name_result = mysqli_query($dbc,$artist_id_name_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_id_name_result);\n\tif($count>0){\n\t\t$nodes = Array();\n\t\t$node_border_array = Array();\n\t\twhile($row = mysqli_fetch_array($artist_id_name_result)){\n\t\t\t$image = $row['artist_photo_path'];\n\t\t\tif($row['artist_photo_path'] == \"\") {\n\t\t\t\t$image = \"upload/photo_upload_data/missing_image.jpg\";\n\t\t\t}\n\t\t\t$nodes[] = array('id' => $row['artist_profile_id'], 'title' => $row['artist_first_name'].\" \".$row['artist_last_name'], 'label' => $row['artist_first_name'].\" \".$row['artist_last_name'], 'shape'=>\"circularImage\", 'image' => $image, 'size' => 20,'isLiving' => $row['artist_living_status'],'dob' => $row['artist_dob'],'dod' => $row['artist_dod'],'genre' => $row['artist_genre'],'ethnicity' => $row['artist_ethnicity'],'gender' => $row['artist_gender'],'country' => $row['artist_residence_country']);\n\t\t\tif($row['is_user_artist'] == \"artist\") {\n\t\t\t\t$node_border_array[] = array('id' => $row['artist_profile_id'], 'border_color' => '#da0067');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$node_border_array[] = array('id' => $row['artist_profile_id'], 'border_color' => '#025457');\n\t\t\t}\n\t\t}\n\t}\n\t//fetch edges\n\t$artist_id_relation_query = \"SELECT `artist_profile_id_1`, `artist_profile_id_2`, `artist_relation`, `duration_years`, `duration_months` FROM `artist_relation`\";\n\t$artist_id_relation_result = mysqli_query($dbc,$artist_id_relation_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_id_relation_result);\n\tif($count>0){\n\t\t$edges = Array();\n\t\t$edge_id = 0;\n\t\twhile($row = mysqli_fetch_array($artist_id_relation_result)){\n\t\t\tif($row['artist_relation'] == \"Influenced By\"){\n $duration = 1;\n $edges[] = array('id' => $edge_id, 'from' => $row['artist_profile_id_1'], 'to' => $row['artist_profile_id_2'], 'width' => $duration, 'label' => $row['artist_relation']);\n $edge_id++;\n\t\t\t}else{\n $duration = ($row['duration_years'] * 12 + $row['duration_months'])/3;\n if($row['duration_years'] == 0){\n \tif($row['duration_months'] == 1){\n $title = $row['duration_months'].\" month\";\n\t\t\t\t\t}else {\n $title = $row['duration_months'] . \" months\";\n }\n\t\t\t\t}else if($row['duration_years'] == 1){\n if($row['duration_months'] == 0){\n $title = $row['duration_years'].\" year \";\n }else if($row['duration_months'] == 1){\n $title = $row['duration_years'].\" year \".$row['duration_months'].\" month\";\n }else {\n $title = $row['duration_years'].\" year \".$row['duration_months'].\" months\";\n }\n }else{\n if($row['duration_months'] == 0){\n $title = $row['duration_years'].\" years \";\n }else if($row['duration_months'] == 1){\n $title = $row['duration_years'].\" years \".$row['duration_months'].\" month\";\n }else {\n $title = $row['duration_years'].\" years \".$row['duration_months'].\" months\";\n }\n\t\t\t\t}\n $edges[] = array('id' => $edge_id, 'from' => $row['artist_profile_id_1'], 'to' => $row['artist_profile_id_2'], 'width' => $duration, 'label' => $row['artist_relation'], 'title' => $title);\n $edge_id++;\n\t\t\t}\n\t\t}\n\t}\n//fetch education nodes\n\t//$artist_education_query = \"SELECT `artist_profile_id`, `education_type`, `institution_name`, `major`, `degree` FROM `artist_education` WHERE `artist_profile_id` IN (SELECT DISTINCT `artist_profile_id_1` FROM `artist_relation` UNION SELECT DISTINCT `artist_profile_id_2` FROM `artist_relation`)\";\n\t$artist_education_query = \"SELECT `artist_profile_id`, `education_type`, `institution_name`, `major`, `degree` FROM `artist_education` WHERE `education_type` = 'main'\";\n\t$artist_education_result = mysqli_query($dbc,$artist_education_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_education_result);\n\t$education_nodes = Array();\n\tif($count>0){\n\t\twhile($row = mysqli_fetch_array($artist_education_result)){\n\t\t\t$education_nodes[] = array('id' => $row['artist_profile_id'], 'education_type' => $row['education_type'], 'institution_name' => $row['institution_name'], 'major' => $row['major'],'degree' => $row['degree']);\n\t\t}\n\t}\n\n\t//fetches artist details\n\t$artist_details_query = \"SELECT `artist_profile_id`, `artist_first_name`, `artist_last_name` ,`artist_living_status`, `artist_gender`, `artist_residence_state`, `artist_residence_country` FROM `artist_profile`\";\n\t$artist_details_result = mysqli_query($dbc,$artist_details_query)\n\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t$count = mysqli_num_rows($artist_details_result);\n\t$artist_details = Array();\n\tif($count>0){\n\t\twhile($row = mysqli_fetch_array($artist_details_result)){\n\t\t\t$artist_details[] = array('id' => $row['artist_profile_id'], 'artist_first_name' => $row['artist_first_name'], 'artist_last_name' => $row['artist_last_name'], 'artist_living_status' => $row['artist_living_status'],'artist_gender' => $row['artist_gender'],'artist_residence_state' => $row['artist_residence_state'],'artist_residence_country' => $row['artist_residence_country']);\n\t\t}\n\t}\n\n\t$profile_details = Array();\n\t$profile_details = $artist_details+$education_nodes;\n\t// $education_nodes.forEach(function(element){\n\t// \t$profile_details.push({\n\t// \tid:element.id,\n\t// \tdate:element.date,\n\t// \tname:(arrayB.find(e=>e.id===element.id)).name\n\t// \t}); \n\t// });\n\t \n\t// console.log(arrayC);\n\t \n\t//$education_nodes.push(artist_details);\n\n\t//fetch number of connections for each node\n\t$updated_nodes = Array();\n\tforeach($nodes as $node) {\n\t\t$id = $node['id'];\n\t\t$artist_id_connections_query = \"SELECT COUNT(`artist_profile_id_1`) AS `num_connections` FROM artist_relation WHERE artist_profile_id_1 = $id OR artist_profile_id_2 = $id\";\n\t\t// echo $artist_id_connections_query;\n\t\t$artist_id_connections_result = mysqli_query($dbc,$artist_id_connections_query)\n\t\tor die('Error querying database.: ' .mysqli_error($dbc));\n\t\t$row = mysqli_fetch_array($artist_id_connections_result);\n\t\t$node['size'] = $node['size'] + ($row['num_connections'] * 10);\n\t\t$updated_nodes[] = $node;\n\t}\n\t$nodes = $updated_nodes;\n\n\treturn array(\"nodes\" => $nodes, \"edges\" => $edges, \"node_borders\" => $node_border_array,\n\t \"education_nodes\" => $education_nodes, \"artist_details\" =>$artist_details,\n\t \"profile_details\" =>$profile_details);\n}", "public function findOnline() {}", "function tinc_enabled()\n{\n $mdl = new \\OPNsense\\Tinc\\Tinc();\n\n foreach ($mdl->networks->network->iterateItems() as $network) {\n if ($network->enabled == '1') {\n return true;\n }\n }\n\n return false;\n}", "public function testInconsistentSiblings2Levels()\n {\n $unit1 = $this->getUnit('shipment');\n $unit1->setReversedMapping([\n 'total' => 'map.total'\n ]);\n $unit1->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit1->setMapping([\n 'shipment_id' => 'map.shipment_id',\n 'total' => 'map.total',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n [1, 30],\n [2, 33],\n [3, 55],\n [4, 11],\n false,\n ]\n ));\n $unit1->setIsEntityCondition(function (MapInterface $map) {\n return !empty($map['shipment_id']);\n });\n $unit1->setTmpFileName('shipment_tmp.csv');\n\n $unit2 = $this->getUnit('item');\n $unit2->setReversedMapping([\n 'item_name' => 'map.name',\n ]);\n $unit2->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit2->setMapping([\n 'id' => 'map.incr(\"item_id\", 1)',\n 'name' => 'map.item_name',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n [1, 'cool item', 1],\n [2, 'another super item', 1],\n [3, 'Coca Cola', 2],\n [4, 'Pepsi', 3],\n [5, 'pants', 4],\n false,\n ]\n ));\n $unit2->setTmpFileName('item_tmp.csv');\n $unit2->setParent($unit1);\n\n $unit3 = $this->getUnit('tracking');\n $unit3->setReversedMapping([\n 'tracking_number' => 'map.tracking_number',\n ]);\n $unit3->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit3->setMapping([\n 'id' => 'map.incr(\"track_id\", 1)',\n 'tracking_number' => 'map.tracking_number',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit3->setFilesystem($this->getFS(\n [\n [1, '56465454', 1],\n [2, '13122333', 3],\n [3, '13343443', 4],\n false,\n ]\n ));\n $unit3->setTmpFileName('tracking_tmp.csv');\n $unit3->addSibling($unit1);\n $unit3->setOptional(true);\n\n $expected = [\n [[\n 'total' => 30,\n 'tracking_number' => '56465454',\n 'item' => [\n [\n 'item_name' => 'cool item'\n ],\n [\n 'item_name' => 'another super item'\n ],\n ],\n ]],\n [[\n 'total' => 33,\n 'tracking_number' => null,\n 'item' => [\n [\n 'item_name' => 'Coca Cola'\n ],\n ],\n ]],\n [[\n 'total' => 55,\n 'tracking_number' => '13122333',\n 'item' => [\n [\n 'item_name' => 'Pepsi'\n ],\n ],\n ]],\n [[\n 'total' => 11,\n 'tracking_number' => '13343443',\n 'item' => [\n [\n 'item_name' => 'pants'\n ],\n ],\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit2, $unit3], $expected);\n $action->process($this->getResultMock());\n }", "public function testIsComputed() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\n\n\t\t$this->boolean($objBuilder->isComputed())->isFalse();\n\t\t$objBuilder->compute();\n\t\t$this->boolean($objBuilder->isComputed())->isTrue();\n\n\t\t/* * */\n\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$this->boolean($objBuilder->isComputed())->isFalse();\n\t\t$objBuilder->compute();\n\t\t$this->boolean($objBuilder->isComputed())->isFalse(); // an empty graph cannot be computed\n\t}", "function Similarity ($str, $a_link) \r\n{\t\r\n\t$str1=getDNSName($str);\r\n\t$adns1=getDNSName($a_link);\r\n $thresh=0.8;\r\n $pos=((strstr($adns1,$str1)) || (strstr($str1,$adns1)));\r\n if($pos===true)\r\n {\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true;\r\n\t}\r\n\t$maxlen=strlen($adns1);\r\n\t$minchanges = levenshtein($str1, $adns1);\r\n\t$temp=($maxlen-$minchanges)/$maxlen;\r\n\tif (($thresh<$temp) && ($temp<1))\r\n\t{ \t\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true; \r\n\t}\r\n\treturn false;\r\n}", "function has_descendants()\n\t{ \n\t\treturn (($this->model->{$this->right_column} - $this->model->{$this->left_column}) > 1);\n\t}", "public function testProjectAssignmentsUnlinkRelation()\n {\n }", "public function testRegonLocal5()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function relationshipsAction()\n\t{\n\t\t$params = $this->getRequest()->getPost();\n\t\tif(!isset($params['uri']) || empty($params['uri'])) {\n\t\t\t$this->_forward('error', 'api', null, array(\n\t\t\t\t'code' => 'RequiredError',\n\t\t\t\t'message' => 'Not all parameters given. This method requires: uri.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$uri = $this->escape($params['uri'], 'uri');\n\t\tif(!($id = $this->loadUri($uri))) {\n\t\t\treturn;\n\t\t}\n\n\t\t$relationships = array();\n\t\tforeach($params as $key => $value) {\n\t\t\tif($key != 'uri' && isset($this->_relationships[$key]))\n\t\t\t\t$relationships[] = $key;\n\t\t}\n\t\t$relationships = array_unique($relationships);\n\n\t\tif(count($relationships) == 0)\n\t\t\t$relationships = array_keys($this->_relationships);\n\n\t\t$query = $this->_queryPrefix .\n\t\t\t'SELECT ?to ?p ?label WHERE {' .\n\t\t\t\t'{ <' . $id . '> ?p ?to . }' .\n\t\t\t\t' UNION ' .\n\t\t\t\t'{ <' . $id . '> owl:sameAs ?sameas . ' .\n\t\t\t\t'?sameas ?p ?to . ' .\n\t\t\t\t'OPTIONAL { ?sameas rdfs:label ?label . } }' .\n\t\t\t\t'FILTER(';\n\n\t\t$first = true;\n\t\tforeach($relationships as $rel) {\n\t\t\tif($first)\n\t\t\t\t$first = false;\n\t\t\telse\n\t\t\t\t$query .= ' || ';\n\t\t\t$query .= ' ?p = <' . $this->_relationships[$rel] . '> ';\n\t\t}\n\t\t$query .= ') }';\n\n\t\t$store = $this->getBrowserStore();\n\t\t$rows = $store->query($query, 'rows');\n\t\tif($errors = $store->getErrors()) {\n\t\t\t$this->forwardTripleStoreError($errors);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$rels = array();\n\t\tforeach($rows as $row) {\n\t\t\tif(isset($rels[$row['to']])) \n\t\t\t\t$rels[$row['to']] .= ',';\n\t\t\telse\n\t\t\t\t$rels[$row['to']] = '';\n\n\t\t\t$rels[$row['to']] .= array_search($row['p'], $this->_relationships);\n\t\t}\n\n\t\t$xml = '<result>';\n\n\t\tforeach($rels as $to => $rel) {\n\t\t\t$profile = $this->getProfile($to, $store);\n\t\t\tif($profile === false)\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t$xml .= '<relationship from=\"' . $id . '\"';\n\t\t\t\n\t\t\tif(isset($row['label']) && !empty($row['label'])) {\n\t\t\t\t$xml .= ' label=\"' . htmlentities($row['label'], ENT_COMPAT, 'UTF-8') . '\"';\n\t\t\t}\n\n\t\t\t$xml .= ' type=\"' . $rel . '\">';\n\t\t\t$xml .= $profile;\n\t\t\t$xml .= '</relationship>';\n\t\t}\n\n\t\t$xml .= '</result>';\n\t\t\t\n\t\t$this->outputXml($xml);\n\t}", "function fann_get_network_type($ann)\n{\n}", "public function testGetSibling_DifferentConditions()\n\t{\n\t\t$this->object->AddSibling($this->sibling);\n\t\t$this->object->AddSibling($this->sibling2);\n\t\t$this->object->Save();\n\t\t$siblingList = $this->object->GetSiblingList(array(array(\"attribute\", \"=\", \"sibling att\")));\n\t\t$this->assertEquals(1, sizeof($siblingList));\n\t\t$siblingList = $this->object->GetSiblingList(array(array(\"attribute\", \"=\", \"sibling att2\")));\n\t\t$this->assertEquals(1, sizeof($siblingList));\n\t}", "public function testRegonLocal7()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function hasPrevSiblings();", "function current_ip_in_network() {\r\n return ip_in_network(current_user_ip());\r\n}", "function consolidatePath2($path, $type) {\n $cpath = array();\n /*\n What are the conditions that determine a transfer?\n 1. If the connection type is different (express -> local)\n 2. If the train in the next segment is different and the original one is not available\n 3. if the connection type is transfer\n */\n // debugging\n $debug = true;\n $path_array = $path->path;\n $count = count($path_array);\n // this is a direction path and there is only one or two paths.\n // that means it either goes from loc->station->loc or just loc->loc\n if ($type == \"dir\" && $count <= 2) {\n return \"walk\";\n }\n //set up the first segment\n $segment = $path_array[0];\n if ($type == \"s2s\") {\n $i = 1; \n }\n else {\n $cpath[] = $segment;\n $segment = $path_array[1];\n $i = 2;\n }\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n $segment2 = $path_array[$i+1];\n // loop through the path, starting at the next segment.\n for (; $i < $count; $i++) {\n // grab the segment\n $segment2 = $path_array[$i];\n \n if ($debug) {\n echo \"@\" . $segment2->m1->name . \"<br/>\";\n echo \"lines = \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n \n if ($connection == \"transfer\") {\n // we know this segment is a transfer, so they will have to get off the train\n echo \"transfer<br/>\";\n \n // end the segment\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // add the transfer segment\n // we need to get the transfer lines\n $lines = $segment2->m1->getOverlapLines($segment2->m2);\n $lines = getCorrectLines($lines, $segment2->connection);\n // create new segment\n $new_segment = new Segment($segment2->m1, $segment2->m2, $lines, $segment2->t, $segment2->connection);\n $cpath[] = $new_segment;\n \n // increment if we need to\n if ($i < $count) {\n // increment\n $i++;\n $segment = $path_array[$i];\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n if ($i < $count) {\n // more segments available\n continue;\n }\n // we end here with this segment\n $new_segment = new Segment($segment->m1, $segment->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment;\n return $cpath;\n }\n }\n else if ($connection != $segment2->connection) {\n // the connection types are different, but trains can shift from express to local and vice versa.\n if ($debug) {\n echo \"old conn: \" . $connection . \" | new conn: \" . $segment2->connection . \"<br/>\";\n }\n // do we have the same train available?\n if (sameTrain($current_lines, $segment2)) {\n // it's the same train, so we just update our lines and continue\n $current_lines = updateLines($segment, $current_lines);\n $total_time += $segment2->t;\n $connection = $segment2->connection;\n continue;\n }\n // different trains, so we need to transfer\n \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n else if (!sameTrain($current_lines, $segment2)) {\n // different trains, so we need to transfer\n if ($debug) {\n echo \"old lines: \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n echo \"new line: \" . $segment2->lines[0]->name . \"<br/>\";\n } \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n // otherwise, we keep going and merge the segments\n $current_lines = linesIntersect($current_lines, $segment2->m1->getOverlapLines($segment2->m2));\n if ($debug) {\n echo \"# current_lines after intersect: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $current_lines = getCorrectLines($current_lines, $connection);\n if ($debug) {\n echo \"# current_lines after correction: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n } // for\n // add the last segment\n $new_segment = new Segment($marker1, $segment2->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment; \n return $cpath;\n}", "public function testGetIncludeRelationships()\n {\n $type = 'some-type';\n\n /** @var ContainerInterface $container */\n $container = $this->container;\n $analyzer = (new Factory())->createParametersAnalyzer(new EncodingParameters([\n 'some',\n 'some.path',\n 'some.path.deeper',\n 'some.another.path',\n 'some.another.even.deeper',\n ]), $container);\n\n $getRels = function ($path) use ($analyzer, $type) {\n return $analyzer->getIncludeRelationships($path, $type);\n };\n\n $this->assertEquals(['some' => 'some'], $getRels(null));\n $this->assertEquals(['some' => 'some'], $getRels(''));\n $this->assertEquals(['path' => 'path', 'another' => 'another'], $getRels('some'));\n $this->assertEquals(['deeper' => 'deeper'], $getRels('some.path'));\n $this->assertEquals(['path' => 'path', 'even' => 'even'], $getRels('some.another'));\n }", "public function includedInIP4Network($network)\n {\n if( is_object($network) )\n $netStartEnd = $network;\n else\n $netStartEnd = IP4Map::mapFromText($network);\n\n if( count($this->members) == 0 )\n return 1;\n\n $result = -1;\n\n foreach( $this->members as $o )\n {\n $localResult = $o->includedInIP4Network($netStartEnd);\n if( $localResult == 1 )\n {\n if( $result == 2 )\n continue;\n if( $result == -1 )\n $result = 1;\n else if( $result == 0 )\n return 2;\n }\n elseif( $localResult == 2 )\n {\n return 2;\n }\n elseif( $localResult == 0 )\n {\n if( $result == -1 )\n $result = 0;\n else if( $result == 1 )\n return 2;\n }\n }\n\n return $result;\n }", "public function testRegonLocal3()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function get_networks()\n {\n }", "public function testRegonLocal6()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRegonLocal2()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function equal(self $network)\n {\n return $this->comparator->equal($network);\n }", "public function testGetBaseLayerWithNoLocalSetting()\n {\n\n // Create exhibit.\n $neatline = $this->_createNeatline();\n\n // Get base layer.\n $baseLayer = $neatline->getBaseLayer();\n\n // Check identity.\n $this->assertEquals($baseLayer->name, 'Google Physical');\n\n }", "public function testRegonLocal4()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testAssertEqualsCanonicalizing() {\n\t\tself::assertEqualsCanonicalizing( [ 3, 2, 1 ], [ 2, 3, 1 ] );\n\t}", "function test1(){\n // format: $ns, $page, $output\n $tests = array();\n\n // relative current in root\n $tests[] = array('','page','page');\n $tests[] = array('','.page','page');\n $tests[] = array('','.:page','page');\n\n // relative current in namespace\n $tests[] = array('lev1:lev2','page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','.page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','.:page','lev1:lev2:page');\n\n // relative upper in root\n $tests[] = array('','..page','page');\n $tests[] = array('','..:page','page');\n\n // relative upper in namespace\n $tests[] = array('lev1:lev2','..page','lev1:page');\n $tests[] = array('lev1:lev2','..:page','lev1:page');\n $tests[] = array('lev1:lev2','..:..:page','page');\n $tests[] = array('lev1:lev2','..:..:..:page','page');\n\n // strange and broken ones\n $tests[] = array('lev1:lev2','....:....:page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','..:..:lev3:page','lev3:page');\n $tests[] = array('lev1:lev2','..:..:lev3:..:page','page');\n $tests[] = array('lev1:lev2','..:..:lev3:..:page:....:...','page');\n\n foreach($tests as $test){\n $this->assertEquals(resolve_id($test[0],$test[1]),$test[2]);\n }\n }", "public function testGetBaseLayerWithLocalSetting()\n {\n\n // Create exhibit and layer.\n $neatline = $this->_createNeatline();\n $layer = new NeatlineBaseLayer;\n $layer->name = 'Test Layer';\n $layer->save();\n\n // Set key.\n $neatline->default_base_layer = $layer->id;\n $neatline->save();\n\n // Get base layer.\n $baseLayer = $neatline->getBaseLayer();\n\n // Check identity.\n $this->assertEquals($baseLayer->name, 'Test Layer');\n\n }" ]
[ "0.56949615", "0.53314906", "0.5270601", "0.5263973", "0.5160398", "0.50616235", "0.49973422", "0.49032396", "0.48929366", "0.48797956", "0.48735332", "0.48520777", "0.48424068", "0.4836058", "0.47972962", "0.47896957", "0.4777618", "0.47748917", "0.47605568", "0.47245163", "0.47192106", "0.47144288", "0.47022936", "0.4679922", "0.46703807", "0.46698454", "0.46458772", "0.46317527", "0.46310076", "0.4627949", "0.4625809", "0.46222094", "0.46130368", "0.46124506", "0.46011284", "0.45835117", "0.45830533", "0.45795304", "0.45788577", "0.45567775", "0.4545942", "0.45410222", "0.45391998", "0.45271882", "0.4523839", "0.45204797", "0.45160356", "0.45086366", "0.45056945", "0.45039284", "0.45037436", "0.44941822", "0.4487881", "0.4481854", "0.44797125", "0.44776055", "0.44674405", "0.4467398", "0.44671828", "0.4461263", "0.44568643", "0.445679", "0.4443958", "0.44435194", "0.4439632", "0.44336542", "0.44255272", "0.4419", "0.44177708", "0.4410276", "0.44051415", "0.44026253", "0.43973878", "0.438959", "0.437301", "0.43671668", "0.43639278", "0.43527234", "0.43491632", "0.4345286", "0.43449304", "0.4344507", "0.43437228", "0.43429706", "0.43391362", "0.43388262", "0.4335279", "0.43349835", "0.43308863", "0.4323058", "0.43223235", "0.43104452", "0.4299111", "0.4296661", "0.42914003", "0.42891017", "0.42878738", "0.4287263", "0.42862108", "0.42828527" ]
0.5473636
1
Compute the first and the last address of $this \see computeNetworkRangeFromAdressAndNetmask()
function computeNetworkRange(&$start, &$end = null, $excludeBroadcastAndNetwork = '') { if (!is_bool($excludeBroadcastAndNetwork)) { if (isset($this->fields['addressable'])) { $excludeBroadcastAndNetwork = ($this->fields['addressable'] == 1); } else { $excludeBroadcastAndNetwork = false; } } self::computeNetworkRangeFromAdressAndNetmask($this->getAddress(), $this->getNetmask(), $start, $end, $excludeBroadcastAndNetwork); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function computeNetworkRangeFromAdressAndNetmask($address, $netmask, &$firstAddress,\n &$lastAddress = null,\n $excludeBroadcastAndNetwork = false) {\n if ($address instanceof IPAddress) {\n $address = $address->getBinary();\n }\n if ($netmask instanceof IPNetmask) {\n $netmask = $netmask->getBinary();\n }\n $start = [];\n $end = [];\n for ($i = 0; $i < 4; ++$i) {\n $start[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] & $netmask[$i]);\n $end[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] | ~$netmask[$i]);\n }\n\n if ($excludeBroadcastAndNetwork) {\n IPAddress::addValueToAddress($start, 1);\n IPAddress::addValueToAddress($end, -1);\n }\n\n if ($firstAddress instanceof IPAddress) {\n $firstAddress->setAddressFromBinary($start);\n } else {\n $firstAddress = $start;\n }\n\n if ($lastAddress instanceof IPAddress) {\n $lastAddress->setAddressFromBinary($end);\n } else {\n $lastAddress = $end;\n }\n }", "public function getNetworkAddress()\n\t{\n\t\treturn $this->first_ip;\n\t}", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public function getAddress();", "public function getAddress();", "public function getAddress() {}", "public function getGivenIpWithNetmask()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->getMask();\n\t}", "public function getTrueCidr()\n {\n return $this->getNetwork() . '/' . $this->prefix;\n }", "public function getAddressAddition() {\n\t\treturn $this->addressAddition;\n\t}", "function broadcast(){\n return (long2ip(ip2long($this->network())\n | (~(ip2long($this->netmask())))));\n }", "public function validAddresses() {}", "private function calcIpRange($ip_range)\n {\n// $subnet = new SubnetCalculator($network[0], $network[1]);\n\n if(preg_match(\"/\\-/\",$ip_range)){\n $address_range = explode(\"-\",$ip_range);\n return [\n 'from' => trim($address_range[0]),\n 'to' => trim($address_range[1])\n ];\n }\n\n $subnet = SubnetCalculator::factory($ip_range);\n\n // [192.168.112.0, 192.168.113.255]\n $address_range = $subnet->getIPAddressRange();\n return [\n 'from' => $address_range[0],\n 'to' => $address_range[1]\n ];\n }", "function range_to_cidr($a, $b) {\n\t$c = null;\n\t$bitmask1 = 0x80000000;\n\t$bitmask0 = 0x7fffffff;\n\t$cidr = 1;\n\t$best = array(null, 32);\n\n\t$c = $a & $bitmask1;\n\t$same_start = $c == ($b & $bitmask1);\n\t$same_end = ($a & $bitmask0) ^ ($b & $bitmask0) == $bitmask0;\n\twhile ($cidr < 32 && $same_start) {\n\t\tif ($same_end) {\n\t\t\t$best = array($c, $cidr);\n\t\t}\n\t\t$cidr += 1;\n\t\t$bitmask1 = ($bitmask1 >> 1) | 0x80000000;\n\t\t$bitmask0 = ($bitmask0 >> 1) & 0x7fffffff;\n\t\t$c = $a & $bitmask1;\n\t\t$same_start = $c == ($b & $bitmask1);\n\t\t$same_end = ($a & $bitmask0) ^ ($b & $bitmask0) == $bitmask0;\n\t}\n\n\treturn $best;\n}", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "public function getAddr()\n {\n return $this->addr->getAddr();\n }", "public function getBroadcastAddress()\n\t{\n\t\treturn $this->last_ip;\n\t}", "public static function fetch_alt_ip() {\n $alt_ip = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n // try to avoid using an internal IP address, its probably a proxy\n $ranges = array(\n '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')),\n '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')),\n '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')),\n '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')),\n '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')),\n );\n foreach ($matches[0] AS $ip) {\n $ip_long = ip2long($ip);\n if ($ip_long === false) {\n continue;\n }\n\n $private_ip = false;\n foreach ($ranges AS $range) {\n if ($ip_long >= $range[0] AND $ip_long <= $range[1]) {\n $private_ip = true;\n break;\n }\n }\n\n if (!$private_ip) {\n $alt_ip = $ip;\n break;\n }\n }\n } else if (isset($_SERVER['HTTP_FROM'])) {\n $alt_ip = $_SERVER['HTTP_FROM'];\n }\n\n return $alt_ip;\n }", "public function getRange($ignorePrefix = false)\n {\n $range = $ignorePrefix\n ? array($this->start, $this->end)\n : self::cidr_to_range($this->start, $this->prefix);\n // watch out for IP '0' being converted to IPv6 '::'\n if ($range[0] == '::' and strpos($range[1], ':') == false) {\n $range[0] = '0.0.0.0';\n }\n return $range;\n }", "public function getAddress()\n {\n return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address;\n }", "public function isTrueCidr()\n {\n return $this->start == $this->getNetwork() && $this->end == $this->getBroadcast();\n }", "public function getNetworkAddress()\n {\n return $this->_networkAddress;\n }", "public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}", "public function getCanonicalAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n }\n\n $fields = explode(':', $this->getExpandedAddress());\n $fields[] = ''; // auxiliary sentinel\n\n // compute the longest zero sequence\n $lzsStart = -1;\n $lzsLen = 1; // so that only sequences of length at least 2 are considered\n $czsStart = null;\n $czsLen = 0;\n foreach ($fields as $i => $field) {\n if ($field === '0000') {\n if ($czsStart === null) {\n $czsStart = $i;\n $czsLen = 1;\n } else {\n $czsLen++;\n }\n } else {\n if ($czsStart !== null) {\n if ($czsLen > $lzsLen) {\n $lzsStart = $czsStart;\n $lzsLen = $czsLen;\n }\n $czsStart = null;\n }\n }\n }\n\n $result = '';\n if ($lzsStart == 0) {\n $result .= ':';\n }\n for ($i = 0; $i < 8; $i++) {\n if ($i > 0) {\n $result .= ':';\n }\n if ($i == $lzsStart) {\n $i += $lzsLen - 1;\n continue;\n }\n $result .= (ltrim($fields[$i], '0') ? : '0');\n }\n if ($lzsStart + $lzsLen == 8) {\n $result .= ':';\n }\n return $result;\n }", "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "public function toString(): string\n {\n if ($this->isSingleHost()) {\n return $this->addrStr;\n } else {\n return $this->toCidrString();\n }\n }", "public function get_addresses() {\n\t\treturn $this->addresses;\n\t}", "public function getAddr()\n {\n return $this->addr;\n }", "private function isIPAddressMeetRange() {\n\t\tif(get_option(\"wp_broadbean_iprange\") == \"\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn ip_in_range($this->ip_request, get_option(\"wp_broadbean_iprange\"));\n\t\t}\n\t}", "public function getAddress1()\r\n {\r\n return $this->_address1;\r\n }", "public function getIdentityServiceAddress();", "public function getAddress() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Domain Object\n\t\t\t$address = new \\Network\\IPAddress();\n\t\t\tif (! isset($_REQUEST['address'])) $this->error(\"address required\");\n\t\n\t\t\t$address->get($_REQUEST['address']);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($address->error()) $this->error($address->error());\n\t\t\telseif ($address->id) {\n\t\t\t\t$response->address = $address;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Address not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function getAddress()\n {\n return implode(' ', $this->address);\n }", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "public function getIpCidrRange()\n {\n return isset($this->ip_cidr_range) ? $this->ip_cidr_range : '';\n }", "public static function getAddress()\n {\n\n if( $_SERVER['REMOTE_ADDR'] == \"::1\" || $_SERVER['REMOTE_ADDR'] == \"localhost\" )\n {\n\n return gethostbyname( gethostname() );\n }\n\n return $_SERVER['REMOTE_ADDR'];\n }", "public function getAccountAddress($account);", "public function getFormatedAddress()\n\t{\n\t\tif (!$this->formatedAddress)\n\t\t{\n\t\t\t$this->formatAddress();\n\t\t}\n\n\t\treturn $this->formatedAddress;\n\t}", "public function getAddressStringMultiLine()\n {\n $params = $this->createFormatAddressParams();\n $retVal = StringUtils::formatAddressMultiLine($params);\n\n return $retVal;\n }", "function getServiceAddress();", "public function getAddresses()\n {\n return $this->addresses;\n }", "public function getAddresses()\n {\n return $this->addresses;\n }", "public function __toString()\n {\n // do not include the prefix if its a single IP\n try {\n if ($this->isTrueCidr() && (\n ($this->version == 4 and $this->prefix != 32) ||\n ($this->version == 6 and $this->prefix != 128)\n )\n ) {\n return $this->start . '/' . $this->prefix;\n }\n } catch (\\Exception $e) {\n // isTrueCidr() calls getRange which can throw an exception\n }\n if (strcmp($this->start, $this->end) == 0) {\n return $this->start;\n }\n return $this->start . ' - ' . $this->end;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getIpv4();", "public function getIpAddress();", "public function getLocalFormatedAddress()\n\t{\n\t\treturn substr($this->formatedAddress, 0, strrpos($this->formatedAddress, ','));\n\t}", "function inet6_to_range($addr, $prefix)\r\n{\r\n $size = 128 - $prefix;\r\n $addr = gmp_init('0x' . str_replace(':', '', inet6_expand($addr)));\r\n $mask = gmp_init('0x' . str_replace(':', '', inet6_expand(inet6_prefix_to_mask($prefix))));\r\n $prefix = gmp_and($addr, $mask);\r\n $start = gmp_strval(gmp_add($prefix, '0x1'), 16);\r\n $end = '0b';\r\n for ($i = 0; $i < $size; $i++) $end .= '1';\r\n $end = gmp_strval(gmp_add($prefix, gmp_init($end)), 16);\r\n for ($i = 0; $i < 8; $i++) {\r\n $start_result .= substr($start, $i * 4, 4);\r\n if ($i != 7) $start_result .= ':';\r\n } // for\r\n for ($i = 0; $i < 8; $i++) {\r\n $end_result .= substr($end, $i * 4, 4);\r\n if ($i != 7) $end_result .= ':';\r\n } // for\r\n $result = array(inet6_compress($start_result), inet6_compress($end_result));\r\n return $result;\r\n}", "public function recurlyAddress()\n {\n return [\n 'phone' => '+4912345678901',\n 'street1' => 'Eine Strasse 1',\n 'street2' => '',\n 'city' => 'Berlin',\n 'region' => 'Berlin',\n 'postal_code' => '13409',\n 'country' => 'DE',\n ];\n }", "public function parseAddressesProvider() {}", "public function invalidAddresses() {}", "public function getAddress()\n {\n \treturn $this->address;\n }", "private function inIPAdressRange($packedAddress, $range)\n {\n if ($range === 'private') { // RFC 6890, RFC 4193\n return ($this->inIPAdressRange($packedAddress, \"10.0.0.0-10.255.255.255\")\n || $this->inIPAdressRange($packedAddress, \"172.16.0.0-172.31.255.255\")\n || $this->inIPAdressRange($packedAddress, \"192.168.0.0-192.168.255.255\")\n || $this->inIPAdressRange($packedAddress, \"fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\"));\n } elseif ($range === 'loopback') { // RFC 6890\n return ($this->inIPAdressRange($packedAddress, \"127.0.0.1-127.255.255.255\")\n || $this->inIPAdressRange($packedAddress, \"::1-::1\"));\n } elseif ($range === 'link-local') { // RFC 6890, RFC 4291\n return ($this->inIPAdressRange($packedAddress, \"169.254.0.0-169.254.255.255\")\n || $this->inIPAdressRange($packedAddress, \"fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff\"));\n } else {\n $rangeLimits = explode('-', $range);\n if (count($rangeLimits) == 2) {\n $lowerLimit = $this->packedIPAddress($rangeLimits[0]);\n $upperLimit = $this->packedIPAddress($rangeLimits[1]);\n return $lowerLimit <= $packedAddress && $packedAddress <= $upperLimit;\n }\n }\n\n return FALSE;\n }", "public function getFullNameAddress()\n {\n\n return [\n \"id\" => $this->id,\n \"address\" => $this->address_1 . $this->location->prevNodes()->get()->push($this->location)->reverse()->implode('name', ','),\n 'default' => $this->default,\n ];\n }", "public function getAddr() {\r\n return (is_null($this->ipAddr)) ? null : $this->ipAddr;\r\n }", "public function getUseIPAddress() \n \t{\n \t\treturn $this->use_ipaddr;\n \t}", "static function checkNetworkRelativity($firstAddress, $firstNetmask, $secondAddress,\n $secondNetmask, $version = 0) {\n\n if ($firstAddress instanceof IPAddress) {\n if ($version == 0) {\n $version = $firstAddress->getVersion();\n }\n if ($version != $firstAddress->getVersion()) {\n return \"different version\";\n }\n $firstAddress = $firstAddress->getBinary();\n }\n\n if ($firstNetmask instanceof IPAddress) {\n if ($version != $firstNetmask->getVersion()) {\n return \"different version\";\n }\n $firstNetmask = $firstNetmask->getBinary();\n }\n\n if ($secondAddress instanceof IPAddress) {\n if ($version != $secondAddress->getVersion()) {\n return \"different version\";\n }\n $secondAddress = $secondAddress->getBinary();\n }\n\n if ($secondNetmask instanceof IPAddress) {\n if ($version != $secondNetmask->getVersion()) {\n return \"different version\";\n }\n $secondNetmask = $secondNetmask->getBinary();\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n $first = true;\n $second = true;\n for ($i = $startIndex; $i < 4; ++$i) {\n $and = ($firstNetmask[$i] & $secondNetmask[$i]);\n // Be carefull : php integers are 32 bits SIGNED.\n // Thus, checking equality must be done by XOR ...\n $first &= (($and ^ $firstNetmask[$i]) == 0);\n $second &= (($and ^ $secondNetmask[$i]) == 0);\n }\n\n if (!$first && !$second) {\n return \"?\";\n }\n\n if ($first && $second) {\n $result = \"equals\";\n $mask = &$firstNetmask;\n } else if ($first) {\n $result = \"first contains second\";\n $mask = &$firstNetmask;\n } else { // $second == true\n $result = \"second contains first\";\n $mask = &$secondNetmask;\n }\n\n for ($i = $startIndex; $i < 4; ++$i) {\n if ((($firstAddress[$i] & $mask[$i]) ^ ($secondAddress[$i] & $mask[$i])) != 0) {\n return \"different\";\n }\n }\n return $result;\n }", "public function getExpandedAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n } else {\n if (!self::ipv6Support()) {\n throw new NotImplementedException('PHP must be compiled with IPv6 support');\n }\n $hexdigits = unpack('H*', inet_pton($this->addrStr))[1];\n $result = substr($hexdigits, 0, 4);\n for ($i = 1; $i < 8; $i++) {\n $result .= ':' . substr($hexdigits, $i * 4, 4);\n }\n return $result;\n }\n }", "public function getRegistrationAuthorityServiceAddress();", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getAddr()\n {\n return $this->get(self::_ADDR);\n }", "public function getFullAddressAttribute()\n { \n # Get the Name of User\n $name = $this->name ? $this->name.', ' : '';\n\n # Get the address of User\n $address = $this->address ? $this->address.', ' : '';\n\n # Get the city of User\n $city = $this->city ? $this->city.', ' : '';\n\n # Get the zip of User\n $zip = $this->zip ? $this->zip.', ' : '';\n\n return $name.$address.$city.$zip;\n }", "public function getOrganizationAddress1() :string {\n\t\treturn($this->organizationAddress1);\n\t}", "public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }", "public function getIpCidrRange()\n {\n return $this->ip_cidr_range;\n }", "private function getAddresses()\n {\n $doctrine = $this->getDoctrine();\n\n /** @var \\Doctrine\\ORM\\QueryBuilder $qb */\n $qb = $doctrine\n ->getRepository('BadcowAddressBundle:BaseAddress')\n ->createQueryBuilder('a');\n\n $qb->add('where', $qb->expr()->orX(\n $qb->expr()->isNull('a.latitude'),\n $qb->expr()->isNull('a.longitude')\n ));\n\n return $qb->getQuery()->getResult();\n }", "public function calculate_ipv6_range()\n {\n return Ip::calc_ip_range_ipv6($_POST['ip'], $_POST['cidr']);\n }", "public function ip()\n {\n $serverAll = parent::server();\n\n // source: https://stackoverflow.com/a/41769505\n foreach (['HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'] as $key) {\n if (array_key_exists($key, $serverAll) === true) {\n foreach (explode(',', $serverAll[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n\n return parent::ip();\n }", "public function getIPAddress(): string;", "function address() { return ($this->address); }", "public function getExternalIpAddress() {\n\t\treturn trim(shell_exec(\"dig +short myip.opendns.com @resolver1.opendns.com\"));\n\t}", "public function gatewayIpAddr()\n {\n $datas = 'N.A';\n\n if(exec('ip route | awk \\'/a/ { print $3 }\\'',$output))\n $datas = $output[0];\n\n return $datas;\n }", "function ipRange($ip){\n\n $ipArray = [];\n\n $ipadd = explode(\".\", $ip);\n\n #For loop that traverses the closely matching objects in the db\n #to check if it is composed of a range (specified with a \"-\" or a \"~\")\n for ($i = 0; $i < sizeof($ipadd); $i++){\n \tif(strpos(($ipadd[$i]), \"-\") == true){\n \t$octet = $i;\n $iprange = explode(\"-\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n \telse if(strpos(($ipadd[$i]), \"~\") == true){\n \t$octet = $i;\n $iprange = explode(\"~\",$ipadd[$i]);\n $min = $iprange[0];\n $max = $iprange[1]; \n \t}\n\n }\n\n\n for($i = $min; $i <= $max; $i++){\n $ipadd[$octet] = $i;\n \n for ($j = 0; $j < sizeof($ipadd); $j++){\n\n $address = implode(\".\", $ipadd);\n }\n \n $ipArray[] = $address;\n \n }\n\n #Return the list of all IP addresses in the range\n return $ipArray;\n\n }", "function ip_in_range($ip, $range) {\n if ( is_string($range) ) $ranges = explode(',',$range);\n else $ranges = $range;\n if (strpos($ip,':') !== false) {\n return in_array($ip,$ranges);\n } else {\n $in = false;\n foreach($ranges as $range) {\n if ($in) return $in;\n if (strpos($range,':') !== false) continue;\n # If IP has the 4 blocks is a host, but we need the prefix, so put it\n if (strpos($range,'/') === false && strpos($range,'-') === false && strpos($range,'*') === false) $range .= '/32';\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n $in = (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n $in = ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n }\n }\n return $in;\n }\n}", "public function getAddress2()\n\t{\n\t\treturn $this->address2;\n\t}", "public function getAddress()\n {\n $res = $this->getEntity()->getAddress();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getAddress();\n\t\t}\n return $res;\n }", "public function getAddress(){\n\t\treturn $this->sourceAddress;\n\t}", "public function getDestIpRange()\n {\n return $this->dest_ip_range;\n }", "public function provideIpAddresses () {\n/******************************************************************************\n ** **\n ** The mapIpAddress method always returns the same coordinates no matter **\n ** what is passed into it. The first test should result in mapIpAddress **\n ** receiving 127.0.0.1 (which is what we specified in the mocked request **\n ** object) after it calls the getIpAddress method. We have already tested **\n ** the getIpAddress method in another test, so it's not strictly necessary **\n ** to have a test case with a blank IP Address. In fact, it's not strictly **\n ** necessary to test with an additional IP Address. However, it's useful to **\n ** have this data provider set up in the event that some day we update the **\n ** mapIpAddress method so that it has more logic in it. **\n ** **\n ******************************************************************************/\n return [\n ['39.7392° N, 104.9903° W', ''],\n ['39.7392° N, 104.9903° W', '151.101.113.175']\n ];\n }", "public function getLastIp()\n\t{\n\t\treturn $this->last_ip;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n {\n return $this->address;\n }", "public function getFullAddressAttribute()\n {\n return $this->street.' '.$this->city.', '.$this->state.' '.$this->zipcode;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }" ]
[ "0.733612", "0.62481964", "0.6161435", "0.61062586", "0.61062586", "0.5874225", "0.57952756", "0.5791787", "0.56330067", "0.5537068", "0.5509339", "0.5500827", "0.5455524", "0.5404781", "0.54018134", "0.53703904", "0.5331225", "0.5325093", "0.5313558", "0.53076655", "0.5307138", "0.5305847", "0.5270169", "0.5260019", "0.5258086", "0.5222678", "0.52193296", "0.5200562", "0.51974696", "0.5191443", "0.51862144", "0.51805645", "0.51707834", "0.51671475", "0.5162366", "0.51573896", "0.5151453", "0.5140771", "0.51384795", "0.51382965", "0.51382965", "0.51283795", "0.5122057", "0.5122057", "0.5120968", "0.5120239", "0.5113421", "0.51065457", "0.5082764", "0.5073369", "0.50709385", "0.5065624", "0.50654054", "0.5061009", "0.5059143", "0.5055328", "0.50542253", "0.50515276", "0.5042372", "0.5033923", "0.50311637", "0.5025835", "0.50186837", "0.50166684", "0.50110424", "0.5008864", "0.50023025", "0.50006104", "0.5000254", "0.4998533", "0.49957985", "0.49915424", "0.49895495", "0.49891517", "0.49825916", "0.49823487", "0.4981576", "0.49778882", "0.49770176", "0.4975257", "0.4972266", "0.49683216", "0.49683216", "0.4968099", "0.49624383", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196", "0.496196" ]
0.673621
1
\brief Compute the first and the last address of a network. That is usefull, for instance, to compute the "real" network address (the first address) or the broadcast address of the network
static function computeNetworkRangeFromAdressAndNetmask($address, $netmask, &$firstAddress, &$lastAddress = null, $excludeBroadcastAndNetwork = false) { if ($address instanceof IPAddress) { $address = $address->getBinary(); } if ($netmask instanceof IPNetmask) { $netmask = $netmask->getBinary(); } $start = []; $end = []; for ($i = 0; $i < 4; ++$i) { $start[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] & $netmask[$i]); $end[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] | ~$netmask[$i]); } if ($excludeBroadcastAndNetwork) { IPAddress::addValueToAddress($start, 1); IPAddress::addValueToAddress($end, -1); } if ($firstAddress instanceof IPAddress) { $firstAddress->setAddressFromBinary($start); } else { $firstAddress = $start; } if ($lastAddress instanceof IPAddress) { $lastAddress->setAddressFromBinary($end); } else { $lastAddress = $end; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNetworkAddress()\n\t{\n\t\treturn $this->first_ip;\n\t}", "public function getAddress();", "public function getAddress();", "public function getAddress() {}", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public static function getAddress()\n {\n\n if( $_SERVER['REMOTE_ADDR'] == \"::1\" || $_SERVER['REMOTE_ADDR'] == \"localhost\" )\n {\n\n return gethostbyname( gethostname() );\n }\n\n return $_SERVER['REMOTE_ADDR'];\n }", "function getServiceAddress();", "public function getBroadcastAddress()\n\t{\n\t\treturn $this->last_ip;\n\t}", "public function gatewayIpAddr()\n {\n $datas = 'N.A';\n\n if(exec('ip route | awk \\'/a/ { print $3 }\\'',$output))\n $datas = $output[0];\n\n return $datas;\n }", "public function getAddr()\n {\n return $this->addr->getAddr();\n }", "public function getAddress() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Domain Object\n\t\t\t$address = new \\Network\\IPAddress();\n\t\t\tif (! isset($_REQUEST['address'])) $this->error(\"address required\");\n\t\n\t\t\t$address->get($_REQUEST['address']);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($address->error()) $this->error($address->error());\n\t\t\telseif ($address->id) {\n\t\t\t\t$response->address = $address;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Address not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function getAddressAddition() {\n\t\treturn $this->addressAddition;\n\t}", "public function getNetworkAddress()\n {\n return $this->_networkAddress;\n }", "static function checkNetworkRelativity($firstAddress, $firstNetmask, $secondAddress,\n $secondNetmask, $version = 0) {\n\n if ($firstAddress instanceof IPAddress) {\n if ($version == 0) {\n $version = $firstAddress->getVersion();\n }\n if ($version != $firstAddress->getVersion()) {\n return \"different version\";\n }\n $firstAddress = $firstAddress->getBinary();\n }\n\n if ($firstNetmask instanceof IPAddress) {\n if ($version != $firstNetmask->getVersion()) {\n return \"different version\";\n }\n $firstNetmask = $firstNetmask->getBinary();\n }\n\n if ($secondAddress instanceof IPAddress) {\n if ($version != $secondAddress->getVersion()) {\n return \"different version\";\n }\n $secondAddress = $secondAddress->getBinary();\n }\n\n if ($secondNetmask instanceof IPAddress) {\n if ($version != $secondNetmask->getVersion()) {\n return \"different version\";\n }\n $secondNetmask = $secondNetmask->getBinary();\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n $first = true;\n $second = true;\n for ($i = $startIndex; $i < 4; ++$i) {\n $and = ($firstNetmask[$i] & $secondNetmask[$i]);\n // Be carefull : php integers are 32 bits SIGNED.\n // Thus, checking equality must be done by XOR ...\n $first &= (($and ^ $firstNetmask[$i]) == 0);\n $second &= (($and ^ $secondNetmask[$i]) == 0);\n }\n\n if (!$first && !$second) {\n return \"?\";\n }\n\n if ($first && $second) {\n $result = \"equals\";\n $mask = &$firstNetmask;\n } else if ($first) {\n $result = \"first contains second\";\n $mask = &$firstNetmask;\n } else { // $second == true\n $result = \"second contains first\";\n $mask = &$secondNetmask;\n }\n\n for ($i = $startIndex; $i < 4; ++$i) {\n if ((($firstAddress[$i] & $mask[$i]) ^ ($secondAddress[$i] & $mask[$i])) != 0) {\n return \"different\";\n }\n }\n return $result;\n }", "function getAddress() {\n\t\t\t// check for https\n\t\t\t$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';\n\t\t\t// return the full address\n\t\t\treturn $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t\t}", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "public function getCanonicalAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n }\n\n $fields = explode(':', $this->getExpandedAddress());\n $fields[] = ''; // auxiliary sentinel\n\n // compute the longest zero sequence\n $lzsStart = -1;\n $lzsLen = 1; // so that only sequences of length at least 2 are considered\n $czsStart = null;\n $czsLen = 0;\n foreach ($fields as $i => $field) {\n if ($field === '0000') {\n if ($czsStart === null) {\n $czsStart = $i;\n $czsLen = 1;\n } else {\n $czsLen++;\n }\n } else {\n if ($czsStart !== null) {\n if ($czsLen > $lzsLen) {\n $lzsStart = $czsStart;\n $lzsLen = $czsLen;\n }\n $czsStart = null;\n }\n }\n }\n\n $result = '';\n if ($lzsStart == 0) {\n $result .= ':';\n }\n for ($i = 0; $i < 8; $i++) {\n if ($i > 0) {\n $result .= ':';\n }\n if ($i == $lzsStart) {\n $i += $lzsLen - 1;\n continue;\n }\n $result .= (ltrim($fields[$i], '0') ? : '0');\n }\n if ($lzsStart + $lzsLen == 8) {\n $result .= ':';\n }\n return $result;\n }", "public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}", "function findBroad($sn,$net) {\n\n $ob = \"\";\n $ip = \"\";\n\n $oct = explode('.',$net);\n\n foreach($oct as $o) {\n \n for($i=0; $i < strlen($o); $i++) {\n\n if($sn > 0) {\n $ob[$i]= $o[$i]; // ottetto broadcast in copia\n $sn--;\n }\n else {\n $ob[$i]= \"1\";\n }\n }\n $ip.= $ob.\".\";\n }\n\n $ip = rtrim($ip, \".\");\n\n return $ip;\n\n}", "function broadcast(){\n return (long2ip(ip2long($this->network())\n | (~(ip2long($this->netmask())))));\n }", "public function getAccountAddress($account);", "public function getFullNameAddress()\n {\n\n return [\n \"id\" => $this->id,\n \"address\" => $this->address_1 . $this->location->prevNodes()->get()->push($this->location)->reverse()->implode('name', ','),\n 'default' => $this->default,\n ];\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public static function inet() {}", "public function getRemoteAddress();", "public function getExternalIpAddress() {\n\t\treturn trim(shell_exec(\"dig +short myip.opendns.com @resolver1.opendns.com\"));\n\t}", "public function getIdentityServiceAddress();", "public function getAddress1()\r\n {\r\n return $this->_address1;\r\n }", "public function getAddress()\n {\n $res = $this->getEntity()->getAddress();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getAddress();\n\t\t}\n return $res;\n }", "public function getIPAddress(): string;", "public function getAddress2()\n\t{\n\t\treturn $this->address2;\n\t}", "public function getAddress()\n {\n return implode(' ', $this->address);\n }", "public function getAddress()\n {\n return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address;\n }", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "public function getAddr()\n {\n return $this->addr;\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "public function getLocalFormatedAddress()\n\t{\n\t\treturn substr($this->formatedAddress, 0, strrpos($this->formatedAddress, ','));\n\t}", "public function getAddr()\n {\n return $this->get(self::_ADDR);\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "function mswIPAddresses() {\n $ip = array();\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip[] = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'],',')!==FALSE) {\n $split = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($split AS $value) {\n $ip[] = $value;\n }\n } else {\n $ip[] = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n } else {\n $ip[] = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');\n }\n return (!empty($ip) ? implode(', ',$ip) : '');\n}", "function computeNetworkRange(&$start, &$end = null, $excludeBroadcastAndNetwork = '') {\n\n if (!is_bool($excludeBroadcastAndNetwork)) {\n if (isset($this->fields['addressable'])) {\n $excludeBroadcastAndNetwork = ($this->fields['addressable'] == 1);\n } else {\n $excludeBroadcastAndNetwork = false;\n }\n }\n\n self::computeNetworkRangeFromAdressAndNetmask($this->getAddress(), $this->getNetmask(),\n $start, $end, $excludeBroadcastAndNetwork);\n }", "public function getAddr() : string\n {\n return $this->addr;\n }", "public function getAddress()\n {\n \treturn $this->address;\n }", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "private function _getSubnetBroadcastAddress($network, $cidr)\n {\n $host = $this->_getSubnetLastUsableHost($network, $cidr);\n return long2ip(ip2long($host)+1);\n }", "public function getExpandedAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n } else {\n if (!self::ipv6Support()) {\n throw new NotImplementedException('PHP must be compiled with IPv6 support');\n }\n $hexdigits = unpack('H*', inet_pton($this->addrStr))[1];\n $result = substr($hexdigits, 0, 4);\n for ($i = 1; $i < 8; $i++) {\n $result .= ':' . substr($hexdigits, $i * 4, 4);\n }\n return $result;\n }\n }", "public function getOrganizationAddress1() :string {\n\t\treturn($this->organizationAddress1);\n\t}", "public function getStreet();", "public function getAddress2()\r\n {\r\n return $this->_address2;\r\n }", "public function getGivenIpWithNetmask()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->getMask();\n\t}", "public function getAdresseServeur() {\n $ad = (@$_SERVER['SERVER_ADDR'] == '::1') ? \"localhost\" : @$_SERVER['SERVER_ADDR'];\n\n return $ad;\n }", "public function getAddress() : string\n {\n return $_SERVER[\"REMOTE_ADDR\"] ?? \"\";\n }", "public function getNetwork( $full = false )\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( !$full ) \n\t\t{\n\t\t\treturn inet_ntop( $this->net_addr );\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $this->inet_gmptofull( $this->net_addr_long );\n\t\t}\n\t}", "public static function fetch_alt_ip() {\n $alt_ip = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n // try to avoid using an internal IP address, its probably a proxy\n $ranges = array(\n '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')),\n '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')),\n '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')),\n '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')),\n '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')),\n );\n foreach ($matches[0] AS $ip) {\n $ip_long = ip2long($ip);\n if ($ip_long === false) {\n continue;\n }\n\n $private_ip = false;\n foreach ($ranges AS $range) {\n if ($ip_long >= $range[0] AND $ip_long <= $range[1]) {\n $private_ip = true;\n break;\n }\n }\n\n if (!$private_ip) {\n $alt_ip = $ip;\n break;\n }\n }\n } else if (isset($_SERVER['HTTP_FROM'])) {\n $alt_ip = $_SERVER['HTTP_FROM'];\n }\n\n return $alt_ip;\n }", "public function getNameAddr()\n {\n $addr = $this->long_name;\n\n if ($this->street1) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street1;\n }\n \n if ($this->street2) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street2;\n }\n \n if ($this->city) {\n if ($addr) $addr .= ', ';\n $addr .= $this->city;\n }\n \n if ($this->state) {\n if ($addr) $addr .= ', ';\n $addr .= $this->state;\n }\n \n if ($this->zip) {\n if ($addr) $addr .= ' ';\n $addr .= $this->zip;\n }\n \n return $addr;\n }", "public function getFormatedAddress()\n\t{\n\t\tif (!$this->formatedAddress)\n\t\t{\n\t\t\t$this->formatAddress();\n\t\t}\n\n\t\treturn $this->formatedAddress;\n\t}", "function getRemoteAddr()\n{\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] AND (!isset($_SERVER['REMOTE_ADDR']) OR preg_match('/^127\\..*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^172\\.16.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^192\\.168\\.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^10\\..*/i', trim($_SERVER['REMOTE_ADDR']))))\n\t{\n\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ','))\n\t\t{\n\t\t\t$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\treturn $ips[0];\n\t\t}\n\t\telse\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\treturn $_SERVER['REMOTE_ADDR'];\n}", "public function getAddress2()\n {\n return $this->address2;\n }", "public function getAddress2()\n {\n return $this->address2;\n }", "public function getAddress2()\n {\n return $this->address2;\n }", "public function getStreetNumber();", "function listNetworkAdd($searchadd){\n #sends the deconstructed IP to the networkAdd function\n\n\t\t$iplist = explode(\".\", $searchadd);\n\n\t\t$networkList = [];\n\n\t\tfor($i = 8; $i < 33; $i++){\n\t\t\t$ipvar = explode(\".\", $searchadd);\n\t\t\t$temp = networkAdd($ipvar, $i);\n\t\t\t$networkList[] = $temp;\n\t\t}\n\n\t\t#echo\"All network addresses</br>\";\n\n\t\treturn $networkList;\n\t}", "public function getClientAddress(): string {}", "public function getFullAddressAttribute(): string\n {\n return \"$this->address\" . ($this->address2 ? ' #' . $this->address2 : '') . \", $this->city $this->state, $this->zip\";\n }", "public function findAddresses() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! isset($_REQUEST[\"stylesheet\"])) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Address List\n\t\t\t$addressList = new \\Network\\AddressList();\n\t\n\t\t\t# Find Matching Addresses\n\t\t\t$parameters = array();\n\t\t\tif (preg_match('/^([\\w\\-]+)\\.(.*)$/',$_REQUEST['host_name'],$matches)) {\n\t\t\t\t$_REQUEST['host_name'] = $matches[1];\n\t\t\t\t$_REQUEST['domain_name'] = $matches[2];\n\t\t\t}\n\t\t\tif (isset($_REQUEST['domain_name']) && strlen($_REQUEST['domain_name']) > 0) {\n\t\t\t\t$domain = new \\Network\\Domain();\n\t\t\t\t$domain->get($_REQUEST['domain_name']);\n\t\t\t\tif ($domain->id) {\n\t\t\t\t\t$parameters['domain_id'] = $domain->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"domain not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['host_name']) && strlen($_REQUEST['host_name']) > 0) {\n\t\t\t\t$host = new \\Network\\Host();\n\t\t\t\t$host->get($domain->id,$_REQUEST['host_name']);\n\t\t\t\tif ($host->id) {\n\t\t\t\t\t$parameters['host_id'] = $host->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"host not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['adapter_name']) && strlen($_REQUEST['adapter_name']) > 0) {\n\t\t\t\t$adapter = new \\Network\\Adapter();\n\t\t\t\t$adapter->get($host->id,$_REQUEST['adapter_name']);\n\t\t\t\tif ($adapter->id) {\n\t\t\t\t\t$parameters['adapter_id'] = $adapter->id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t $this->error(\"adapter '\".$_REQUEST['adapter_name'].\"' for host '\".$host->name.\"' not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_REQUEST['type'])) $parameters['type'] = $_REQUEST['type'];\n\t\t\t$addresses = $addressList->find($parameters);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($addressList->error()) $this->error($addressList->error());\n\t\t\telse{\n\t\t\t\t$response->address = $addresses;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function recurlyAddress()\n {\n return [\n 'phone' => '+4912345678901',\n 'street1' => 'Eine Strasse 1',\n 'street2' => '',\n 'city' => 'Berlin',\n 'region' => 'Berlin',\n 'postal_code' => '13409',\n 'country' => 'DE',\n ];\n }", "protected static function GetRemoteAddr()\n {\n $ipSet = new IPSet(IPSet::PRIVATE_NETS);\n if ( ! $ipSet->match($_SERVER[\"REMOTE_ADDR\"])) {\n return $_SERVER[\"REMOTE_ADDR\"]; // Remote ADDR is Public Address: Use this! (We want Load-Balancers with private IPs only!)\n }\n if (isset ($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n $forwardsRev = array_reverse($forwards = explode(\",\", $_SERVER[\"HTTP_X_FORWARDED_FOR\"]));\n for ($i=0; $i<count ($forwardsRev); $i++) {\n if ( ! $ipSet->match(trim ($forwardsRev[$i]))) {\n return $forwardsRev[$i]; // Return first non-private IP from last to first\n }\n }\n return $forwards[0]; // Return first IP if no public IP found.\n }\n return $_SERVER[\"REMOTE_ADDR\"]; // Return the private Remote-ADDR\n }", "public function getAddr() {\r\n return (is_null($this->ipAddr)) ? null : $this->ipAddr;\r\n }", "function address() { return ($this->address); }", "public function getAddressStringSingleLine()\n {\n $params = $this->createFormatAddressParams();\n $retVal = StringUtils::formatAddress($params);\n\n return $retVal;\n }", "public function getAddress2()\n {\n return parent::getValue('address2');\n }", "public function getAddress1()\n {\n return parent::getValue('address1');\n }", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "public function getAddress()\n {\n $cityName = '';\n $countryName = '';\n\n if (!empty($this->getCity())) {\n $cityName = $this->getCity()->getName();\n $countryName = $this->getCity()->getCountryName();\n }\n\n $address = array(\n $this->getStreet(),\n $this->getDistrict(),\n $this->getZipCode(),\n $cityName,\n $countryName\n );\n\n return implode(\", \", array_filter($address));\n }", "public function getFullAddress() {\n $address = '';\n if (isset($this->street)) {\n $address .= $this->street . ', ';\n }\n\n if (isset($this->postcode)) {\n $address .= $this->postcode . ' ';\n }\n\n if (isset($this->city)) {\n $address .= $this->city . ', ';\n }\n\n// if (isset($this->state)) {\n// $address .= $this->state . ', ';\n// }\n\n if (isset($this->country)) {\n $address .= trans('countries.' . $this->country);\n }\n\n return $address;\n }", "public function getTrueCidr()\n {\n return $this->getNetwork() . '/' . $this->prefix;\n }", "public function getNewAddress($account = null);", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress(){\n\t\treturn $this->sourceAddress;\n\t}", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "function listNetworkIp($net,$broadcast,$sn) {\n\n $lista=[]; // lista da ritornare \n\n $no = explode('.', $net); // array con gli ottetti dell'indirizzo NET\n $bo = explode('.', $broadcast); // array con gli ottetti dell'indirizzo NET\n\n $nbit = 32-$sn; // numero di bit assegnati agli host\n \n $nhost = pow(2,$nbit); // numero totale degli host\n\n $start = (int) $no[3]+1;\n $end = (int) $bo[3]-1;\n $roots = $no[0].\".\".$no[1].\".\".$no[2].\".\";\n $roote = $bo[0].\".\".$bo[1].\".\".$bo[2].\".\";\n $primo = $roots.$start;\n $ultimo = $roote.$end;\n $hosts = [];\n\n //echo $start.\" - \".$end.\"<br>\";\n\n // verifica che gli IP disponibili non superino le 5000 unità -> stila la lista\n if($nhost > 35000) {\n $lista[0] = $primo;\n $lista[1] = $ultimo;\n }\n else {\n for($i=ip2long($primo); $i<=ip2long($ultimo); $i++) {\n\n $ip2conv = $i;\n $ip2write = long2ip($ip2conv);\n $lista[] = $ip2write;\n \n $host=gethostbyaddr($ip2write); // prelevo il nome del host (se disponibile)\n //echo $host.\" | \";\n\n // se il nome host NON è uguale all'IP -> salvo il nome Host in una lista\n if(!filter_var($host, FILTER_VALIDATE_IP)) {\n $hosts[] = \"IP: $ip2write ==> Nome Host:<b> $host </b><br>\";\n }\n\n }\n }\n\n $ret['hostnames'] = $hosts;\n $ret['primo'] = $primo;\n $ret['ultimo'] = $ultimo;\n $ret['lista'] = $lista;\n $ret['nhost'] = $nhost; \n\n return $ret;\n}", "public function getIpv4();", "function getServerAddress() {\n\t\treturn $this->getParam(self::PARAM_SERVER_ADDRESS);\n\t}", "public function get_address_1( $context = 'view' ) {\n\t\treturn $this->get_prop( 'address_1', $context );\n\t}", "public function getAdress()\n {\n return $this->adress;\n }", "public function getAdress()\n {\n return $this->adress;\n }", "public function address(): string\n {\n return $this->address;\n }", "public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }", "public function getUserAddress() {\n\t\treturn ($this->userStreet);\n\t}", "private function _getAddresses()\n\t {\n\t\t$hashes = [];\n\t\t$rows = $this->_db->exec(\"SELECT `city`, `address` FROM `addresses` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$address = $row[\"city\"] . \", \" . $row[\"address\"];\n\t\t\t$sliced = new AddressSlicer($address);\n\n\t\t\tif ($sliced->valid() === true && isset($hashes[$sliced->hash]) === false)\n\t\t\t {\n\t\t\t\t$hashes[$sliced->hash] = $address;\n\t\t\t } //end if\n\n\t\t } //end while\n\n\t\treturn count($hashes);\n\t }", "public function getNbAddresses()\n\t{\n\t\tif ( $this->nb_addresses === null ) {\n\t\t\t$this->nb_addresses = gmp_strval(gmp_pow(2, $this->getMaxPrefix() - $this->prefix));\n\t\t}\n\t\treturn $this->nb_addresses;\n\t}", "public function getCardsServiceAddress();", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getAddress()\r\n {\r\n return $this->address;\r\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }" ]
[ "0.6799679", "0.6567588", "0.6567588", "0.63166636", "0.62446344", "0.6047264", "0.5999723", "0.58761406", "0.5873083", "0.5813293", "0.5798589", "0.5786191", "0.57513034", "0.57403296", "0.57153904", "0.57093483", "0.56851584", "0.5671451", "0.5653942", "0.56422216", "0.562249", "0.56011283", "0.55999136", "0.55819696", "0.5570844", "0.55685765", "0.5555216", "0.5523151", "0.5517786", "0.5509932", "0.55084157", "0.54895544", "0.54849565", "0.5483395", "0.54775685", "0.5469862", "0.54541755", "0.54500514", "0.54459", "0.54428643", "0.54428643", "0.54383034", "0.54262954", "0.5417121", "0.54087037", "0.5406176", "0.5388192", "0.53861034", "0.53787863", "0.53503096", "0.5348496", "0.53460646", "0.5318352", "0.5313861", "0.5311892", "0.53092015", "0.53015727", "0.52849853", "0.5284859", "0.5280002", "0.5280002", "0.5280002", "0.52736276", "0.52734023", "0.52697635", "0.526712", "0.52625", "0.5261655", "0.52551574", "0.5247605", "0.5236766", "0.5235317", "0.52323836", "0.5232098", "0.5226918", "0.52242047", "0.52239406", "0.5223452", "0.52155834", "0.5214091", "0.5214091", "0.52008057", "0.519363", "0.519018", "0.5184802", "0.5179817", "0.5178434", "0.51772934", "0.51772934", "0.51755357", "0.51685387", "0.5167457", "0.51625276", "0.5161106", "0.5159907", "0.51558805", "0.5151156", "0.5148733", "0.5148733", "0.5148733" ]
0.6544012
3
\brief Recreate network tree Among others, the migration create plan tree network. This method allows to recreate the tree. You can also use it if you suspect the network tree to be corrupted. First, reset the tree, then, update each network by its own field, letting CommonImplicitTreeDropdown working such as it would in case of standard update
static function recreateTree() { global $DB; // Reset the tree $DB->update( 'glpi_ipnetworks', [ 'ipnetworks_id' => 0, 'level' => 1, 'completename' => new \QueryExpression($DB->quoteName('name')) ], [true] ); // Foreach IPNetwork ... $iterator = $DB->request([ 'SELECT' => 'id', 'FROM' => self::getTable() ]); $network = new self(); while ($network_entry = $iterator->next()) { if ($network->getFromDB($network_entry['id'])) { $input = $network->fields; // ... update it by its own entries $network->update($input); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function brokeTree()\n {\n $i = 0;\n foreach ($this->nodeIdList as $node) {\n $this->getDb()->createCommand()->update(\n self::tableName(),\n [\n $this->leftAttribute => ++$i,\n $this->rightAttribute => ++$i,\n $this->depthAttribute => 0,\n '_tree' => $this->globalParentNode,\n ],\n ['=', 'id', $node]\n )->query();\n }\n }", "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 rebuildTree()\n {\n $sql = \"SELECT REBUILD_TREE();\";\n $result = new Resultset(null, $this, $this->getReadConnection()->query($sql));\n\n if (!$result)\n throw new Exception(\"Rebuild tree failed\");\n return $result;\n }", "function hierarchize_refresh_tree($brainstormid, $groupid=0){\r\n global $CFG, $USER;\r\n\r\n // get those responses who are new\r\n $sql = \"\r\n SELECT\r\n r.id,r.id\r\n FROM\r\n {$CFG->prefix}brainstorm_responses as r\r\n WHERE\r\n r.brainstormid = {$brainstormid} AND\r\n r.groupid = {$groupid} AND\r\n r.id NOT IN\r\n (SELECT\r\n od.itemsource\r\n FROM\r\n {$CFG->prefix}brainstorm_operatordata as od\r\n WHERE\r\n od.brainstormid = $brainstormid AND\r\n operatorid = 'hierarchize' AND\r\n od.groupid = {$groupid} AND\r\n od.userid = {$USER->id})\r\n \";\r\n // echo $sql;\r\n $diff = get_records_sql($sql);\r\n $maxordering = brainstorm_tree_get_max_ordering($brainstormid, null, $groupid, 1, 0);\r\n if ($diff){\r\n $treerecord->brainstormid = $brainstormid;\r\n $treerecord->userid = $USER->id;\r\n $treerecord->groupid = $groupid;\r\n $treerecord->operatorid = 'hierarchize';\r\n $treerecord->itemdest = 0;\r\n $treerecord->intvalue = $maxordering + 1;\r\n $treerecord->timemodified = time();\r\n foreach($diff as $adif){\r\n $treerecord->itemsource = $adif->id;\r\n if (!insert_record('brainstorm_operatordata', $treerecord)){\r\n error(\"Could not insert tree regeneration records\");\r\n }\r\n $treerecord->intvalue++;\r\n }\r\n }\r\n}", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "function reset() {\n\t\t$this->recursive = -1;\n\t\t$nodes = array_keys($this->Node->find('list', array(\n\t\t\t'conditions' => array('Node.id >' => 0),\n\t\t\t'order' => 'id',\n\t\t\t'recursive' => -1\n\t\t)));\n\t\tset_time_limit (max(count($nodes) / 10, 30));\n\t\t$this->unbindModel(array('belongsTo' => array('Node')), false);\n\t\t$order = 'Revision.id DESC';\n\t\t$fields = array('id');\n\t\tforeach ($nodes as $id) {\n\t\t\t$langs = $this->find('list', array(\n\t\t\t\t'fields' => array('lang', 'lang'),\n\t\t\t\t'conditions' => array('node_id' => $id)\n\t\t\t));\n\t\t\tforeach ($langs as $lang) {\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'node_id' => $id,\n\t\t\t\t\t'lang' => $lang,\n\t\t\t\t\t'NOT' => array('status' => 'rejected')\n\t\t\t\t);\n\t\t\t\t$count = $this->find('count', compact('conditions'));\n\t\t\t\tif (!$count) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\tif ($this->find('count', compact('conditions')) === 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'previous';\n\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\tif (!$last) {\n\t\t\t\t\tunset($conditions['Revision.status']);\n\t\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\t}\n\t\t\t\t$this->updateAll(array('status' => '\"current\"'), array('Revision.id' => $last['Revision']['id']));\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\t$conditions['NOT'] = array('Revision.id' => $last['Revision']['id']);\n\t\t\t\t$this->updateAll(array('Revision.status' => '\"previous\"'), $conditions);\n\t\t\t}\n\t\t}\n\t}", "function update_tree()\n\t{\n\t\n\t\t$data = array();\n\t\t$field_prefs = array();\n\t\t\n\t\t// get all our post data\n\t\t$data['id'] \t\t= $this->EE->input->post('id');\n\t\t$data['site_id']\t= $this->site_id;\n\t\t$data['label']\t\t= $this->EE->input->post('label');\n\t\t$data['fields'] \t= $this->EE->input->post('fields');\n\t\t$data['template_preferences'] = $this->EE->input->post('template_preferences');\n\t\t$data['channel_preferences'] = $this->EE->input->post('channel_preferences');\n\t\t$data['permissions'] = $this->EE->input->post('member_group_preferences');\n\t\t$data['max_depth'] = (int) $this->EE->input->post('max_depth');\n\t\t\n\t\t// implode posted array data\n\t\t$data['template_preferences'] = (is_array($data['template_preferences']) ? implode('|', $data['template_preferences']) : '');\n\t\t$data['channel_preferences'] = (is_array($data['channel_preferences']) ? implode('|', $data['channel_preferences']) : '');\n\t\t$data['permissions'] \t\t = (is_array($data['permissions']) ? implode('|', $data['permissions']) : '');\n\t\t\n\t\t// prep our custom field data\n\t\tif($data['fields'] && is_array($data['fields']))\n\t\t{\n\t\t\tforeach($data['fields'] as $key => $field)\n\t\t\t{\n\t\t\t\tif($field['label'] && $field['name'])\n\t\t\t\t{\n\t\t\t\t\t$field_prefs[$key] = $field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['fields'] = (count($field_prefs) > 0) ? base64_encode(serialize($field_prefs)) : '';\n\n\t\t$data = $this->EE->security->xss_clean($data);\n\n\t\t// do we have an id? update...\n\t\tif( $data['id'] )\n\t\t{\n\t\t\t$this->EE->db->query($this->EE->db->update_string('exp_taxonomy_trees', $data, \"id = \".$data['id']));\n\t\t\t$this->EE->session->set_flashdata('message_success', lang('properties_updated'));\n\t\t\t$ret = ($this->EE->input->post('update_and_return')) ? $this->_base_url : $this->_base_url.AMP.'method=edit_tree'.AMP.'tree_id='.$data['id'];\n\t\t\t$this->EE->functions->redirect($ret);\t\n\t\t}\n\t\t// if not then create the new tree table\n\t\telse\n\t\t{\n\t\t\tunset($data['id']);\n\t\t\t$this->EE->db->query($this->EE->db->insert_string('exp_taxonomy_trees', $data));\n\t\t\t$tree_id = $this->EE->db->insert_id();\n\t\t\t// build our tree table\n\t\t\t$this->EE->ttree->build_tree_table($tree_id);\n\t\t\t// notify of success and redirect\n\t\t\t$this->EE->session->set_flashdata('message_success', lang('tree_added'));\n\t\t\t$ret = ($this->EE->input->post('update_and_return')) ? $this->_base_url : $this->_base_url.AMP.'method=edit_tree'.AMP.'tree_id='.$tree_id;\n\t\t\t$this->EE->functions->redirect($ret);\t\n\t\t}\n\t\n\t}", "public function run()\n {\n DB::table('binary_tree_nodes')->insert([\n [\n 'parent_id' => null, //1\n 'team_id' => 1,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 1, // 2\n 'team_id' => 1,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 1, // 3\n 'team_id' => 2,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 2, // 4\n 'team_id' => 1,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => false,\n 'is_free' => true,\n 'is_blocked_global' => false,\n 'is_free_global' => true,\n ],\n [\n 'parent_id' => 2, // 5\n 'team_id' => 2,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 3, // 6\n 'team_id' => 1,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 3, // 7\n 'team_id' => 2,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 4, // 8\n 'team_id' => 1,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 4, // 9\n 'team_id' => 2,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 5, // 10\n 'team_id' => 1,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 5, // 11\n 'team_id' => 2,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 6, // 12\n 'team_id' => 1,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 6, // 13\n 'team_id' => 2,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 7, // 14\n 'team_id' => 1,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 7, // 15\n 'team_id' => 2,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n ]);\n }", "function upgrade_network()\n {\n }", "public static function reset() {\n\t\t// Tell the router to generate a new top level group\n\t\tstatic::getRouter()->resetMainGroup();\n\t}", "function edit_nodes()\n\t{\n\t\t\n\t\t$tree_id = $this->EE->input->get('tree_id');\n\t\t\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id, true);\n\t\t\n\t\t$tree_settings = $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t// check this user has access to this tree\n\t\t$permissions = explode('|', $tree_settings['permissions']);\n\t\tif( !has_access_to_tree($this->EE->session->userdata['group_id'], $permissions) )\n\t\t{\n\t\t\t$this->EE->session->set_flashdata('message_failure', lang('unauthorised'));\n\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t}\n\n\t\t$root_array = $this->EE->ttree->get_root();\n\t\t\n\t\t// if we don't have a root redirect and prompt to enter one\n\t\tif( !$root_array)\n\t\t{\n\t\t\t$this->EE->functions->redirect($this->_base_url.AMP.'method=manage_node'.AMP.'tree_id='.$tree_id.AMP.'add_root=1');\n\t\t}\n\t\t\n\t\t$vars = array();\n\t\t$vars['root_insert'] = $this->EE->input->get('root_insert');\n\t\t$vars['tree_id'] = $tree_id;\n\t\t$vars['update_action'] = $this->_form_base_url.AMP.'method=reorder_nodes'.AMP.'tree_id='.$tree_id;\n\t\t$vars['last_updated'] = $tree_settings['last_updated'];\n\t\t$vars['title_extra'] = $tree_settings['label'];\n\t\t$vars['max_depth'] = (int) $tree_settings['max_depth'];\n\t\t\n\t\t$tree_array = $this->EE->ttree->get_tree_array($tree_id);\n\t\t\n\t\t$vars['taxonomy_list'] = $this->EE->ttree->build_cp_list($tree_array);\n\t\t\n\t\treturn $this->content_wrapper('edit_nodes', 'edit_nodes', $vars);\n\n\t}", "function _modifyTree () {\r\n return true;\r\n }", "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}", "function edit_tree()\n\t{\n\n\t\t$tree_id = $this->EE->input->get('tree_id');\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id);\n\t\t\n\t\t$this->EE->cp->add_to_head('<link type=\"text/css\" href=\"'.$this->_theme_base_url.'css/taxonomy.css\" rel=\"stylesheet\" />');\n\n\t\t$new = $this->EE->input->get('new');\n\t\t\n\t\t$vars = array();\n\t\t\n\t\t// fetch the tree\n\t\t$this->EE->db->where_in('id', $tree_id);\n\t\t$vars['tree'] = $this->EE->db->get('taxonomy_trees')->result_array();\n\t\t\n\t\t// make sure if a tree is requested it exists\n\t\t// unless we're adding a new one that is...\n\t\tif( !$vars['tree'] && $new != 1)\n\t\t{\n\t\t\t$this->EE->session->set_flashdata( 'message_failure', lang('invalid_tree') );\n\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$vars['tree'] = (isset($vars['tree'][0])) ? $vars['tree'][0] : '';\n\t\t$vars['tree']['template_preferences'] = (isset($vars['tree']['template_preferences'])) ? explode('|', $vars['tree']['template_preferences']) : '';\n\t\t$vars['tree']['channel_preferences'] = (isset($vars['tree']['channel_preferences'])) ? explode('|', $vars['tree']['channel_preferences']) : '';\n\t\t$vars['tree']['permissions'] = (isset($vars['tree']['permissions'])) ? explode('|', $vars['tree']['permissions']) : '';\n\t\t\n\t\t$vars['tree']['fields'] = (isset($vars['tree']['fields'])) ? array_sort($this->unserialize($vars['tree']['fields']), 'order', SORT_ASC) : '';\n\t\t$vars['tree']['max_depth'] = (isset($vars['tree']['max_depth'])) ? $vars['tree']['max_depth'] : 0;\n\t\t$vars['member_groups'] = array();\n\n\t\t\n\t\t// -----------\n\t\t// Build templates, channels, and member_group select options\n\t\t// -----------\n\t\t\n\t\t\t// fetch our templates\n\t\t\t$templates = $this->EE->template_model->get_templates($this->site_id)->result_array();\n\t\t\t\n\t\t\t// must have templates!\n\t\t\tif ( !$templates )\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_failure', lang('no_templates_exist'));\n\t\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t\t}\n\t\t\t\n\t\t\t// build up our templates array for our multiselect options\n\t\t\tforeach( $templates as $template )\n\t\t\t{\n\t\t\t\t$vars['templates'][$template['template_id']] = '/'.$template['group_name'].'/'.$template['template_name'];\n\t\t\t}\n\n\t\t\t// fetch our channels\n\t\t\t$channels = $this->EE->ttree->get_channels($this->site_id);\n\t\t\t\n\t\t\t// must have channels!\n\t\t\tif (!$channels)\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_failure', $this->EE->lang->line('no_channels_exist'));\n\t\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t\t}\n\t\t\t\n\t\t\t// build our channels array for our multiselect options\n\t\t\tforeach( $channels as $channel )\n\t\t\t{\n\t\t\t\t$vars['channels'][$channel['channel_id']] = $channel['channel_title'];\n\t\t\t}\n\n\t\t\t// fetch our member_groups\n\t\t\t$member_groups = $this->EE->member_model->get_member_groups()->result_array();\n\t\t\t\n\t\t\t// build our member_groups array for our multiselect options\n\t\t\tforeach( $member_groups as $member_group )\n\t\t\t{\n\t\t\t\t// only add to the array if the member group can actuall access the taxonomy module \n\t\t\t\tif( $this->EE->ttree->can_access_taxonomy($member_group['group_id']) )\n\t\t\t\t{\n\t\t\t\t\t$vars['member_groups'][$member_group['group_id']] = $member_group['group_title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t// -----------\n\n\t\tif($new)\n\t\t{\n\t\t\t$vars['tree']['id'] = NULL;\n\t\t\t$vars['tree']['label'] = NULL;\n\t\t\treturn $this->content_wrapper('edit_tree', 'add_tree', $vars);\n\t\t}\n\n\t\treturn $this->content_wrapper('edit_tree', 'edit_tree', $vars);\n\t\n\t}", "protected function rewindRefactoredNodes()\n {\n $this->refactoredNodes = 0;\n }", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "public function routerRebuilding() {\n $this->rebuilding = TRUE;\n }", "public function rebuildtree(){\n\t\t//Rebuild categories ads trigger count.\n\n\t\t//Rebuild nested set - get cat\n\t\tBLog::addToLog('[Items] rebuilding nested sets...');\n\t\t//\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\t//\n\t\t$catslist=$this->itemsFilter(array());\n\t\tBLog::addToLog('[Items] Total categories count:'.count($catslist).'...');\n\n\t\t$rootcats=array();\n\t\t//\n\t\tforeach($catslist as $cat){\n\t\t\t$cat->level=0;\n\t\t\t$cat->lft=0;\n\t\t\t$cat->rgt=0;\n\t\t\tif(empty($cat->{$this->parentKeyName})){\n\t\t\t\t$rootcats[]=$cat;\n\t\t\t\t}\n\t\t\t}\n\t\t//Sort root categories.\n\t\t$n=count($rootcats);\n\t\tBLog::addToLog('[Items] Root categories count:'.$n.'...');\n\t\tfor($i=0; $i<$n; $i++){\n\t\t\t$m=$i;\n\t\t\tfor($j=$i+1; $j<$n; $j++){\n\t\t\t\tif($rootcats[$j]->ordering < $rootcats[$m]->ordering){\n\t\t\t\t\t$m=$j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($m!=$i){\n\t\t\t\t$t=$rootcats[$i];\n\t\t\t\t$rootcats[$i]=$rootcats[$m];\n\t\t\t\t$rootcats[$m]=$t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t//Foreach by root categories...\n\t\tforeach($rootcats as $rcat){\n\t\t\tBLog::addToLog('[Items] Processing root category ['.$rcat->id.']');\n\n\t\t\t$rcat->level=1;\n\t\t\t$lft=1; $rgt=2;\n\t\t\t$this->rebuildtree_recursive($rcat,$lft,$rgt);\n\t\t\t$rcat->lft=1;\n\t\t\t$rcat->rgt=$rgt;\n\t\t\t}\n\t\t$db=\\Brilliant\\BFactory::getDBO();\n\t\tif(empty($db)){\n\t\t\treturn false;\n\t\t\t}\n\t\tBLog::addToLog('[Items] Updating nested set...');\n\t\tforeach($catslist as $ct){\n\t\t\t$qr='UPDATE `'.$this->tableName.'` set `'.$this->leftKeyName.'`='.$ct->lft.', `'.$this->rightKeyName.'`='.$ct->rgt.', `'.$this->levelKeyName.'`='.$ct->level.' WHERE `'.$this->primaryKeyName.'`='.$ct->id;\n\t\t\t$q=$db->query($qr);\n\t\t\tif(empty($q)){\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t//Invalidate all cache.\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\treturn true;\n\t\t}", "function FixTree(&$tree)\r\n\t{\r\n\t\tusort($tree->children, array($this, \"SortByChild\"));\r\n\t\tif (!empty($tree->children))\r\n\t\tforeach ($tree->children as $cnode) $this->FixTree($cnode);\r\n\t}", "function _move_cleanup($copy = false)\r\n\t{\r\n\t\t$relations = $this->_relations;\r\n\r\n\t\t$deletes = array();\r\n\t\t$updates = array();\r\n\t\t$parent_updates = array();\r\n\t\tforeach($relations AS $key => $val)\r\n\t\t{\r\n\t\t\t$clone_id = $val['clone_id'];\r\n\t\t\t$parent_id = $val['parent_id'];\r\n\t\t\t$clone = $this->get_node($clone_id);\r\n\t\t\tif ($copy)\r\n\t\t\t{ \r\n\t\t\t\tcontinue;\r\n\t\t\t} \n\t\t\t\n\t\t\tif($parent_id !== false)\n\t\t\t{\n\t\t\t\t$sql = sprintf('UPDATE %s SET parent_id=%s WHERE id=%s',\r\n\t\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\t$parent_id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t$key);\r\n\t\t\t\t$parent_updates[] = $sql;\n\t\t\t}\n\r\n\t\t\t$deletes[] = $key; \r\n\t\t\t// It's isn't a rootnode\r\n\t\t\tif ($clone['id'] != $clone['root_id'])\r\n\t\t\t{\r\n\t\t\t\t$sql = sprintf('UPDATE %s SET id=%s WHERE id=%s',\r\n\t\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\t$key,\r\n\t\t\t\t\t\t\t\t\t\t\t\t$clone_id);\r\n\t\t\t\t$updates[] = $sql;\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql = sprintf('UPDATE %s SET id=%s, root_id=%s WHERE id=%s',\r\n\t\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\t$key,\r\n\t\t\t\t\t\t\t\t\t\t\t\t$clone_id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t$clone_id);\r\n\t\t\t\t$updates[] = $sql;\r\n\t\t\t\t$oroot_id = $clone['root_id'];\r\n\r\n\t\t\t\t$sql = sprintf('UPDATE %s SET root_id=%s WHERE root_id=%s',\r\n\t\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\t$key,\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oroot_id\n\t\t\t\t);\r\n\t\t\t\t$updates[] = $sql;\r\n\t\t\t} \r\n\t\t} \r\n\r\n\t\tforeach ($deletes as $delete)\r\n\t\t{\r\n\t\t\t$this->delete_node($delete);\r\n\t\t} \r\n\r\n\t\tfor($i = 0;$i < count($updates);$i++)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($updates[$i]);\r\n\t\t} \r\n\r\n\t\tfor($i = 0;$i < count($parent_updates);$i++)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($parent_updates[$i]);\r\n\t\t} \n\t\t\n\t\t$this->_relations = array();\r\n\r\n\t\treturn true;\r\n\t}", "function update_node()\n\t{\n\t\t\n\t\t// @todo form validation properly\n\t\t$this->EE->load->library('form_validation');\n\t\t$this->EE->form_validation->set_rules('label', 'Label', 'required');\n\t\t\n\t\tif ($this->EE->form_validation->run('label') == FALSE)\n\t\t{\n\t\t show_error('\"Label\" is a required field');\n\t\t}\n\n\t\t$tree_id \t= $this->EE->input->post('tree_id');\n\t\t$is_root\t= $this->EE->input->post('is_root');\n\t\t\n\t\t$data = array();\n\t\t$data['label'] \t\t= htmlspecialchars($this->EE->input->post('label'), ENT_COMPAT, 'UTF-8');\n\t\t$data['template_path'] \t= $this->EE->input->post('template');\n\t\t$data['entry_id'] \t= $this->EE->input->post('entry_id');\n\t\t$data['node_id'] \t= $this->EE->input->post('node_id');\n\t\t$data['custom_url']\t= $this->EE->input->post('custom_url');\n\t\t$data['field_data']\t= ( is_array($this->EE->input->post('custom_fields')) ) ? base64_encode(serialize($this->EE->input->post('custom_fields'))) : '';\n\t\t\n\t\t$data = $this->EE->security->xss_clean($data);\n\t\t\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id);\n\t\t\n\t\t// are we adding a root node\n\t\tif($is_root)\n\t\t{\n\t\t\t// returns true if root has been added\n\t\t\tif($this->EE->ttree->insert_root($data))\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_success', $this->EE->lang->line('root_added'));\n\t\t\t}\n\t\t\t// we already have a root!\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_failure', lang('root_already_exists'));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// are we updating\n\t\telseif($data['node_id'])\n\t\t{\n\t\t\t$this->EE->ttree->update_node_by_node_id($data['node_id'], $data);\n\t\t}\n\t\t// we're inserting a new node\n\t\telse\n\t\t{\n\t\t\t$parent_lft = $this->EE->input->post('parent');\n\t\t\t$this->EE->ttree->append_node_last($parent_lft, $data);\n\t\t}\n\t\t\n\t\tunset($data);\n\t\t\n\t\t// insert our tree array\n\t\t$data['tree_array'] = base64_encode(serialize( $this->EE->ttree->tree_to_array() ));\n\t\t$data['last_updated'] = time();\n\t\t$this->EE->db->where('id', $tree_id);\n\t\t$this->EE->db->update('exp_taxonomy_trees', $data); \n\t\t\n\t\t$this->EE->functions->redirect($this->_base_url.AMP.'method=edit_nodes'.AMP.'tree_id='.$tree_id);\n\t\n\t}", "function cognitivefactory_tree_up($cognitivefactoryid, $userid, $groupid, $id, $istree = 1) {\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if (!$res) return;\n $operator = ($istree) ? 'hierarchize' : 'order' ;\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n if ($res->intvalue > 1) {\n $newordering = $res->intvalue - 1;\n\n $sql = \"\n SELECT \n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}' AND\n intvalue = {$newordering}\n {$treeClause}\n {$accessClause}\n \";\n // echo $sql;\n $result = $DB->get_record_sql($sql);\n $resid = $result->id;\n\n // swapping\n $opdata = new StdClass();\n $opdata->id = $resid;\n $opdata->intvalue = $res->intvalue;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "public function rebuild($rootNodeId): void;", "function cognitivefactory_tree_down($cognitivefactoryid, $userid, $groupid, $id, $istree=1) {\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n $operator = ($istree) ? 'hierarchize' : 'order' ;\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n $sql = \"\n SELECT \n MAX(intvalue) AS ordering\n FROM \n {cognitivefactory_opdata} AS od\n WHERE\n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}'\n {$treeClause}\n {$accessClause}\n \";\n $resmaxordering = $DB->get_record_sql($sql);\n $maxordering = $resmaxordering->ordering;\n if ($res->intvalue < $maxordering) {\n $newordering = $res->intvalue + 1;\n\n $sql = \"\n SELECT \n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}' AND\n intvalue = {$newordering}\n {$treeClause}\n {$accessClause}\n \";\n $result = $DB->get_record_sql($sql);\n $resid = $result->id;\n\n // swapping\n $opdata = new StdClass();\n $opdata->id = $resid;\n $opdata->intvalue = $res->intvalue;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "function testUpdatePackageTree() {\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllByParentId(4);\n\t\t$this->assertEqual(count($result), 2);\n\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllBySlug('model');\n\t\t$this->assertEqual(count($result), 1, 'Too many model slugs');\n\t}", "public function run()\n {\n $nodes = [\n ['id' => 1, 'name' => 'Organization','parent_id' => null],\n ['id' => 2, 'name' => 'School A', 'parent_id' => 1],\n ['id' => 3, 'name' => 'Classroom A','parent_id' => 2],\n ['id' => 4, 'name' => 'Family AA', 'parent_id' => 3],\n ['id' => 5, 'name' => 'Family AB', 'parent_id' => 3],\n ['id' => 6, 'name' => 'Node AAA', 'parent_id' => 4],\n ['id' => 7, 'name' => 'Node AAB', 'parent_id' => 6],\n ['id' => 8, 'name' => 'Node ABA', 'parent_id' => 5],\n ['id' => 9, 'name' => 'Node ABB', 'parent_id' => 8],\n\n ['id' => 10, 'name' => 'School B', 'parent_id' => 1],\n ['id' => 11, 'name' => 'Classroom BA','parent_id' => 10],\n ['id' => 12, 'name' => 'Family BA', 'parent_id' => 11],\n ['id' => 13, 'name' => 'Family BB', 'parent_id' => 11],\n ['id' => 14, 'name' => 'Classroom BB', 'parent_id' => 10],\n\n ['id' => 15, 'name' => 'School C', 'parent_id' => 1],\n ['id' => 16, 'name' => 'Classroom CA','parent_id' => 15],\n ['id' => 17, 'name' => 'Family CA', 'parent_id' => 16],\n ['id' => 18, 'name' => 'Family CB', 'parent_id' => 16],\n ['id' => 19, 'name' => 'Classroom CB', 'parent_id' => 15]\n ];\n\n foreach ($nodes as $node)\n {\n Node::create($node);\n }\n\n\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "function updateCreate(){\n \t\t\n \t\t//dsm($this->goodEbsLeaflets);\n \t\tforeach($this->goodEbsLeaflets as $leafletCode => $goodEbsLeaflet):\n \t\t\n \t\t\t//dsm($leafletCode);\t\n \t\t\n\t \t\t$query = new EntityFieldQuery();\n\t \t\t$query->entityCondition('entity_type', 'node')\n\t \t\t->entityCondition('bundle', 'leaflet')\n\t \t\t->fieldCondition('field_leaflet_code', 'value', $leafletCode, '=');\n\t \t\t\n\t \t\t$result = $query->execute();\n\t \t\t\n\t \t\t\n\t \t\tif (count($result) == 0):\n\t \t\t\t//dsm(\"Didn't find an existing node - its a create\");\n\t \t\t\t\t\n\t \t\t\t$node = new stdClass();\n\t \t\t\t$this->setNodeValues($node, $this->goodEbsLeaflets[$leafletCode]);\n\t \t\t\t\t\n\t \t\t\t// Prepare node for saving. Does creation date and node->uid\n\t \t\t\t$node = node_submit($node);\n\t \t\t\t//dsm($node);\n\t \t\t\tnode_save($node);\n\t \t\t\t\t\n\t \t\t\t$this->log[] = get_class($this).\": Created node id \".$node->nid.\" \".$leafletCode.\" \".$node->title;\n\t \t\t\t\t \t\t\n\t \t\telseif (count($result) == 1):\n\t \t\t\t//dsm('Its an update for '.$leafletCode. 'with nid = '.$leaflet_nid[0]);\n\t \t\t\t$leaflet_nid = array_keys($result['node']);\n\t \t\t\t$node = node_load($leaflet_nid[0]);\n\t \t\t\n\t \t\t\t//$link = l(\"node id $leaflet_nid[0]\", \"node/$leaflet_nid[0]\", array('attributes' => array('target'=>'_blank')));\n\t \t\t\n\t \t\t\t//Start with the assumption that no update is required\n\t \t\t\t//Individual functions that populate a field may flag\n\t \t\t\t//that an update IS required for this node\n\t \t\t\t$this->nodeNeedsUpdate[$leaflet_nid[0]] = false;\n\t \t\t\t\t\n\t \t\t\t$oldStatus = $node->status;\n\t \t\t\t\n\t \t\t\t$this->setNodeValues($node, $this->goodEbsLeaflets[$leafletCode]);\n\t \t\t\t\n\t \t\t\t//republishing a node\n\t \t\t\tif ($node->status != $oldStatus):\n\t \t\t\t\t$this->nodeNeedsUpdate[$leaflet_nid[0]] = true;\n\t \t\t\tendif;\n\t \t\t\t\n\t \t\t\t/*\n\t \t\t\tif ($node->nid == '14196'){\n\t \t\t\t\tdsm($node);\n\t \t\t\t}*/\n\t \t\t\t\n\t \t\t\t//if set to manual, don't update\n\t \t\t\tif ($node->field_source['und'][0]['value'] == 'manual'):\n\t \t\t\t\t$this->nodeNeedsUpdate[$leaflet_nid[0]] = false;\n\t \t\t\t\t$this->log[] = get_class($this).\": Didn't update ('manual' set) node id \".$node->nid.\" \".$leafletCode.\" \".$node->title;\n\t \t\t\tendif;\n\t \t\t\t\n\t \t\t\t\n\t \t\t\t//dsm($node);\n\t \t\t\t// Prepare node for saving\n\t \t\t\t//Does creation date and node->uid\n\t \t\t\t\n\t \t\t\t$node = node_submit($node);\n\t \t\t\t\t\n\t \t\t\tif ($this->nodeNeedsUpdate[$leaflet_nid[0]] == true){\n\t \t\t\t\tnode_save($node);\n\t \t\t\t\t$this->log[] = get_class($this).\": Updated node id \".$node->nid.\" \".$leafletCode.\" \".$node->title;\n\t \t\t\t} else {\n\t \t\t\t\t$this->log[] = get_class($this).\": No changes for node id \".$node->nid.\" \".$leafletCode.\" \".$node->title;\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\telseif (count($result) > 1):\n\t \t\t\t//dsm('duplicates leaflets. Report, do nothing.');\n\t \t\tendif;\n \t\t\n \t\t\n \t\tendforeach; \t\t\n \t}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "public function generate_parent(){\n\n // kode rekening\n $kode_rekening = KodeRekening::where(\"is_deleted\", 0)->get(); // collection semua data di databse\n\n // supaya tidak semua data di update, hanya yang perlu saja yang di update\n $data_to_update = [];\n //looping\n foreach($kode_rekening as $idx => $row){\n // array data yang perlu di update\n $new_data_update = [];\n\n // mencari parent dari kode rekening yang sedang di loop , contoh 41 | saya mencari parent si 41 dari seluruh data di database\n $find_parent = $this->find_parent($kode_rekening, $row->kode_rekening);\n\n if($find_parent != null){\n $new_data_update = [\n \"parent_id\" => $find_parent->id,\n 'id' => $row->id\n ];\n\n $data_to_update[] = $new_data_update;\n }\n }\n\n //generate query update case\n $update_string = \"UPDATE mst_kode_rekening\n SET parent_id = CASE\";\n\n $id_where = [];\n foreach($data_to_update as $idx => $row){\n $update_string .= \" WHEN id = \". $row[\"id\"] .\" THEN \".$row[\"parent_id\"].\" \";\n $id_where[] = $row[\"id\"];\n }\n $update_string .=\"\n END\n WHERE id IN (\".implode($id_where, \",\").\")\";\n DB::update($update_string);\n\n // set tidak punya parent maka saya set level 1\n DB::update(\"UPDATE mst_kode_rekening SET level = 1 WHERE parent_id = 0 \");\n //indikator lamun misalna si data masih punya child , contoh , saya di level 1 , check level 2 aya teu\n $have_child = true;\n //set default level 1\n $level = 1; // <-- 2\n // while\n while($have_child){\n //ieu pengecekan level selanjutnya\n $get_child = collect(DB::select(DB::raw(\"SELECT COUNT(*) count FROM mst_kode_rekening WHERE parent_id IN (SELECT id FROM mst_kode_rekening WHERE level = {$level})\")))->first();\n\n if($get_child->count > 0){\n $next_level = $level+1;\n DB::update(\"UPDATE mst_kode_rekening SET level = {$next_level} WHERE parent_id in (SELECT id FROM mst_kode_rekening WHERE level = {$level})\");\n $level++;\n } else {\n $have_child = false;\n }\n }\n\n // update anu parent_id na 0 == 1\n // select * from mst_kode_rekening where parent_id = (id = level 1) update jadi level 2\n // select * from mst_kode_rekening where parent_id = (id = level 2) update jadi level 3\n\n //query == null\n }", "public function testSetParentByNodes() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\n\t\t$this->boolean($objBuilder->setParentByNodes($objNode1, $objNode2))->isTrue();\n\t\t$hashChecks = array(\n\t\t\t1 => array(\n\t\t\t\t'id' \t\t=> 1,\n\t\t\t\t'parent'\t=> null,\n\t\t\t\t'left'\t\t=> 0,\n\t\t\t\t'right'\t\t=> 3\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t'id' \t\t=> 2,\n\t\t\t\t'parent'\t=> 1,\n\t\t\t\t'left'\t\t=> 1,\n\t\t\t\t'right'\t\t=> 2\n\t\t\t)\n\t\t);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\t\t$this->array($arrayResult)->size->isEqualTo(2);\n\t\tforeach ($arrayResult as $hashNode) {\n\t\t\t$this\n\t\t\t\t->array($hashNode)\n\t\t\t\t\t->hasKey('id')\n\t\t\t\t\t->hasKey('left')\n\t\t\t\t\t->hasKey('right')\n\t\t\t\t->integer($hashNode['id'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['id'])\n\t\t\t\t->integer($hashNode['left'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['left'])\n\t\t\t\t->integer($hashNode['right'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['right'])\n\t\t\t;\n\t\t}\n\n\t\t/*\n\t\t * Same tests, inverted\n\t\t */\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\n\t\t$this->boolean($objBuilder->setParentByNodes($objNode2, $objNode1))->isTrue();\n\t\t$hashChecks = array(\n\t\t\t1 => array(\n\t\t\t\t'id' \t\t=> 1,\n\t\t\t\t'parent'\t=> 2,\n\t\t\t\t'left'\t\t=> 1,\n\t\t\t\t'right'\t\t=> 2\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t'id' \t\t=> 2,\n\t\t\t\t'parent'\t=> null,\n\t\t\t\t'left'\t\t=> 0,\n\t\t\t\t'right'\t\t=> 3\n\t\t\t)\n\t\t);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\t\t$this->array($arrayResult)->size->isEqualTo(2);\n\t\tforeach ($arrayResult as $hashNode) {\n\t\t\t$this\n\t\t\t->array($hashNode)\n\t\t\t\t->hasKey('id')\n\t\t\t\t->hasKey('left')\n\t\t\t\t->hasKey('right')\n\t\t\t->integer($hashNode['id'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['id'])\n\t\t\t->integer($hashNode['left'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['left'])\n\t\t\t->integer($hashNode['right'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['right'])\n\t\t\t;\n\t\t}\n\t}", "protected function _unmarkInternalTree(): void\n {\n $config = $this->getConfig();\n $this->_table->updateAll(\n function (QueryExpression $exp) use ($config) {\n $leftInverse = clone $exp;\n $leftInverse->setConjunction('*')->add('-1');\n $rightInverse = clone $leftInverse;\n\n return $exp\n ->eq($config['leftField'], $leftInverse->add($config['leftField']))\n ->eq($config['rightField'], $rightInverse->add($config['rightField']));\n },\n fn (QueryExpression $exp) => $exp->lt($config['leftField'], 0)\n );\n }", "public function actionAjaxFillTree()\n {\n \t$this->allowUser(SUPERADMINISTRATOR);\n // accept only AJAX request (comment this when debugging)\n if (!Yii::app()->request->isAjaxRequest) {\n exit();\n }\n // parse the user input\n $parentId = \"NULL\";\n if (isset($_GET['root']) && $_GET['root'] !== 'source') {\n $parentId = (int) $_GET['root'];\n }\n // read the data (this could be in a model)\n $children = Yii::app()->db->createCommand(\n \"SELECT m1.id, m1.name AS text, m2.id IS NOT NULL AS hasChildren \"\n . \"FROM cms_term AS m1 LEFT JOIN cms_term AS m2 ON m1.id=m2.parent_id \"\n . \"WHERE m1.parent_id <=> $parentId \"\n . \"GROUP BY m1.id ORDER BY m1.order ASC\"\n )->queryAll();\n\t\t\n\t\t$cnt = 0;\n\t\tforeach ($children as $child){\n\t\t//\tif ($child['hasChildren']==0) {\n\t\t//\t\t$children[$cnt]['text'] = '<a href='.Yii::app()->baseUrl.'\"/backend.php/term/update/'.$child['id'].'\">'.$child['text'].'</a>';\n\t\t//\t} else {\n\t\t\t\n\t\t\t\t$children[$cnt]['text'] = $child['text']\n\t\t\t\t.'<a href='.Yii::app()->baseUrl.'\"/backend.php/term/update/'.$child['id'].'\"> '.TbHtml::icon(TbHtml::ICON_PENCIL)\n\t\t\t\t.'</a> <a href='.Yii::app()->baseUrl.'\"/backend.php/TermDescription/update/'.$child['id'].'\"> '.TbHtml::icon(TbHtml::ICON_EDIT).'</a>';\n\t\t\t$cnt++;\t\n\t\t}\n\t\t\n\t\t\n echo str_replace(\n '\"hasChildren\":\"0\"',\n '\"hasChildren\":false',\n CTreeView::saveDataAsJson($children)\n );\n }", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "function build_tree_table( $tree_id )\n\t{\n\t\n\t\t$fields = array(\n\t\t\t'node_id' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t => '8',\n\t\t\t\t'unsigned'\t\t => TRUE,\n\t\t\t\t'auto_increment' => TRUE,\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'lft' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint' => '8',\n\t\t\t\t'unsigned' =>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'rgt' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'depth' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'parent' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'moved'\t=> array(\n\t\t\t\t'type' => 'tinyint',\n\t\t\t\t'constraint'\t=> '1',\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'label'\t=> array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'entry_id' => array(\n\t\t\t\t'type' => 'int',\n\t\t\t\t'constraint' => '10', \n\t\t\t\t'null' => TRUE),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'template_path' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'custom_url' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\n\t\t\t'type' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'field_data' => array(\n\t\t\t\t'type' => 'text'\n\t\t\t)\t\t\t\n\t\t);\n\t\t\t\n\t\tee()->load->dbforge();\n\t\tee()->dbforge->add_field( $fields );\n\t\tee()->dbforge->add_key( 'node_id', TRUE );\n\t\tee()->dbforge->create_table( 'taxonomy_tree_'.$tree_id );\n\t\t\n\t\tunset($fields);\n\t\t\t\t\n\t}", "protected static function repairTrees($classes)\n {\n $processed = array();\n\n try {\n \\D::manager()->clear();\n } catch (\\Exception $e) {}\n\n foreach ($classes as $class) {\n if (is_subclass_of($class, 'CMF\\\\Model\\\\Node')) {\n\n $metadata = $class::metadata();\n $className = $metadata->rootEntityName;\n if (in_array($className, $processed)) continue;\n $processed[] = $className;\n\n try {\n\n $rootNode = $className::getRootNode(true);\n $repo = \\D::manager()->getRepository($className);\n $qb = $repo->getNodesHierarchyQueryBuilder($rootNode);\n $treeValid = $repo->verify();\n\n if ($treeValid !== true) {\n $repo->recover();\n \\D::manager()->flush();\n \\D::manager()->clear();\n }\n\n } catch (\\Exception $e) { }\n\n }\n }\n }", "private function setTrees()\n {\n if (empty($this->generator->types[CustomsInterface::CUSTOM_TYPES_TREES][ApiInterface::RAML_PROPS]) === false) {\n foreach ($this->generator->types[CustomsInterface::CUSTOM_TYPES_TREES][ApiInterface::RAML_PROPS] as $propKey => $propVal) {\n if (is_array($propVal) && empty($this->generator->types[ucfirst($propKey)]) === false) {\n // ensure that there is a type of propKey ex.: Menu with parent_id field set\n $this->openEntity(ConfigInterface::TREES);\n $this->setParamDefault($propKey, $propVal[ApiInterface::RAML_KEY_DEFAULT]);\n $this->closeEntities();\n }\n }\n }\n }", "public function afterUpdate(): void\n {\n if ($this->oldParentId != $this->owner->getAttribute($this->ownerParentIdAttribute)) {\n $this->rebuildTreePath();\n }\n }", "function admin_reparent()\n\t{\n\t\tif(!$this->RequestHandler->prefers('json'))\n\t\t{\n\t\t\t$this->cakeError('error404');\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['parent']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['parent']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['position']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Position'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['position']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Position'));\n\t\t\treturn;\n\t\t}\n\n\t\t$node_id = $this->params['form']['node'];\n\t\t$parent_id = $this->params['form']['parent'];\n\t\t$position = $this->params['form']['position'];\n\n\t\t$node = $this->Navigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Navigation.id' => $node_id,\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\tif(empty($node))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\t$parent = $this->Navigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Navigation.id' => $parent_id,\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\tif(empty($parent))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'Navigation' => array(\n\t\t\t\t'id' => $node_id,\n\t\t\t\t'parent_id' => $parent_id,\n\t\t\t),\n\t\t);\n\t\tif(!$this->Navigation->save($data))\n\t\t{\n\t\t\t$this->cakeError('internal_error', array('action' => 'Reparent', 'resource' => 'Navigation'));\n\t\t\treturn;\n\t\t}\n\n\t\t$this->Navigation->moveup($node_id, true);\n\t\tif($position > 0)\n\t\t{\n\t\t\t$this->Navigation->movedown($node_id, $position);\n\t\t}\n\n\t\t$this->set('response', array('success' => 1));\n\t}", "public function rebuild()\r\n {\r\n $this->delete(array());\r\n\r\n $table = new Car_Types();\r\n\r\n $this->rebuildStep($table, array(0), 0);\r\n }", "function cognitivefactory_tree_right($cognitivefactoryid, $userid, $groupid, $id) {\n global $CFG, $DB;\n\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n\n /// get ordering and parent for the moving node\n $sql = \"\n SELECT \n itemdest, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n id = $id\n \";\n $res = $DB->get_record_sql($sql);\n $ordering = $res->intvalue;\n $fatherid = $res->itemdest;\n\n /// get previous record if not first. It will become our parent.\n if ($ordering > 1) {\n $orderingbis = $ordering - 1;\n\n $sql = \"\n SELECT \n id,\n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n intvalue = $orderingbis AND \n itemdest = $fatherid\n {$accessClause}\n \";\n $resid = $DB->get_record_sql($sql);\n $newfatherid = $resid->id;\n\n /// get our upward brothers. They should be ordered back from ordering\n $sql = \"\n SELECT \n id, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n intvalue > $ordering AND \n itemdest = $fatherid \n {$accessClause}\n ORDER BY \n intvalue\n \";\n $newbrotherordering = $ordering;\n\n /// order back all upward brothers\n if ($resbrothers = $DB->get_records_sql($sql)) {\n foreach ($resbrothers as $resbrother) {\n $opdata = new StdClass();\n $opdata->id = $resbrother->id;\n $opdata->intvalue = $newbrotherordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n $newbrotherordering = $newbrotherordering + 1;\n }\n }\n\n $maxordering = cognitivefactory_tree_get_max_ordering($cognitivefactoryid, null, $groupid, true, $newfatherid);\n $newordering = $maxordering + 1;\n\n // assigning father's id\n $object = new StdClass();\n $opdata->id = $id;\n $opdata->itemdest = $newfatherid;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "private function fixBrokenAgents()\n {\n\n DB::transaction(function () {\n // Move nodes\n\n // 24751\n $rootNode = $this->getNodeByAgentTsa('TSA5524585');\n $newNode = $this->getByUserId(24751);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 21786\n $rootNode = $this->getNodeByAgentTsa('TSA4224936');\n $newNode = $this->getByUserId(21786);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 25350\n $rootNode = $this->getNodeByAgentTsa('TSA7121786');\n $newNode = $this->getByUserId(25350);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 20348\n // kelvin dickson - 20348\n $rootNode = $this->getNodeByAgentTsa('TSA1520348');\n // add willy horn to kelly\n $this->addLeftLeg($rootNode, $this->getNodeByAgentTsa('TSA6419208'));\n $rasaanNode = $this->getNodeByAgentTsa('TSA6619189');\n $bernardNode = $this->getNodeByAgentTsa('TSA3719536');\n $this->addRightLeg($rasaanNode, $bernardNode);\n\n // 24035\n $rasaanNode = $this->getNodeByAgentTsa('TSA6619189');\n $newNode = $this->getByUserId(24035);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rasaanNode),\n $newNode\n );\n\n // 25003\n $rootNode = $this->getNodeByAgentTsa('TSA9618374');\n $newNode = $this->getByUserId(25003);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n\n // 18374\n $rootNode = $this->getNodeByAgentTsa('TSA7116435');\n $newNode = $this->getByUserId(18374);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n // 23837\n $rootNode = $this->getNodeByAgentTsa('TSA3319909');\n $newNode = $this->getByUserId(23837);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n // 19005\n $rootNode = $this->getNodeByAgentTsa('TSA6924197');\n $newNode = $this->getByUserId(19005);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 22645\n $rootNode = $this->getNodeByAgentTsa('TSA1218899');\n $newNode = $this->getByUserId(22645);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 24154\n $from = $this->getByUserId(24154);\n $to = $this->getNodeByAgentTsa('TSA4725350');\n BinaryPlanManager::moveNode($from, $to, BinaryPlanManager::DIRECTION_LEFT, false, true);\n\n // 21796\n $rootNode = $this->getNodeByAgentTsa('TSA8824514');\n $newNode = $this->getByUserId(21796);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 24692\n $rootNode = $this->getNodeByAgentTsa('TSA8824514');\n $newNode = $this->getByUserId(24692);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 14515\n $rootNode = $this->getNodeByAgentTsa('TSA4119395');\n $newNode = $this->getByUserId(14515);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 20752\n $rootNode = $this->getNodeByAgentTsa('TSA6923837');\n $newNode = $this->getByUserId(20752);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n // 2812\n $rootNode = $this->getNodeByAgentTsa('TSA9296164');\n $newNode = $this->getByUserId(2812);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n // 14726\n $rootNode = $this->getNodeByAgentTsa('TSA1012649');\n $newNode = $this->getByUserId(14726);\n $this->addLeftLeg(\n BinaryPlanManager::getLastLeftNode($rootNode),\n $newNode\n );\n\n // 20058\n $rootNode = $this->getNodeByAgentTsa('TSA4419945');\n $newNode = $this->getByUserId(20058);\n $this->addRightLeg(\n BinaryPlanManager::getLastRightNode($rootNode),\n $newNode\n );\n\n $this->removeNodes();\n\n BinaryPlanNode::fixTree();\n });\n }", "public function run()\n {\n User::factory(20)->create();\n Comment::factory(1000)->create();\n Comment::where('id','<', 101)->update(['parent_id' => null]);\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}", "function makeTree($uid, $add_content, $mode) {\n\t\tglobal $add_content;\n\t\t//Execute query depending on mode\n\t\tif ($mode == 'circumstance_tree' || $mode == 'usergroup_tree') {\n\t\t\t$temp_enablefields1 = str_replace('tx_civserv_navigation', 'nv1', $this->cObj->enableFields('tx_civserv_navigation'));\n\n\t\t\t$temp_enablefields2 = str_replace('tx_civserv_navigation', 'nv2', $this->cObj->enableFields('tx_civserv_navigation'));\n\n\t\t\t// we need double quotation marks here!!! because of the single quotation marks within $temp_enablefields1 and $temp_enablefields2\n\t\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t\t\t\"nv1.uid as uid,\n\t\t\t\t\t\t\t\t nv1.nv_name as name\",\n\t\t\t\t\t\t\t\t\"tx_civserv_navigation as nv1,\n\t\t\t\t\t\t\t\t tx_civserv_navigation_nv_structure_mm as nvmm,\n\t\t\t\t\t\t\t\t tx_civserv_navigation as nv2\",\n\t\t\t\t\t\t\t\t\"1 \".\n\t\t\t\t\t\t\t\t$temp_enablefields1.\n\t\t\t\t\t\t\t\t$temp_enablefields2.\n\t\t\t\t\t\t\t\t\" AND nv1.uid = nvmm.uid_local\n\t\t\t\t\t\t\t\t AND nv1.uid = nvmm.uid_local\n\t\t\t\t\t\t\t\t AND nv2.uid = nvmm.uid_foreign\n\t\t\t\t\t\t\t\t AND nv2.uid = \" . intval($uid) ,\n\t\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\t\"\");\n\t\t}\n\t\t// test bk: add organisational code\n\t\tif($this->conf['displayOrganisationCode']){\n\t\t\t$orderby='or1.or_code, or1.sorting';\n\t\t}else{\n\t\t\t$orderby='or1.sorting, or2.sorting';\n\t\t}\n\t\tif ($mode == 'organisation_tree') {\n\t\t\t$temp_enablefields1 = str_replace('tx_civserv_organisation', 'or1', $this->cObj->enableFields('tx_civserv_organisation'));\n\n\t\t\t$temp_enablefields2 = str_replace('tx_civserv_organisation', 'or2', $this->cObj->enableFields('tx_civserv_organisation'));\n\n\t\t\t// we need double quotation marks here!!! because of the single quotation marks within $temp_enablefields1 and $temp_enablefields2\n\t\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t\t\t\"or1.uid as uid,\n\t\t\t\t\t\t\t\t or1.or_code as code,\n\t\t\t\t\t\t\t\t or1.or_name as name\",\n\t\t\t\t\t\t\t\t\"tx_civserv_organisation as or1,\n\t\t\t\t\t\t\t\t tx_civserv_organisation_or_structure_mm as ormm,\n\t\t\t\t\t\t\t\t tx_civserv_organisation as or2\",\n\t\t\t\t\t\t\t\t\"1 \".\n\t\t\t\t\t\t\t\t $temp_enablefields1.\n\t\t\t\t\t\t\t\t $temp_enablefields2.\n\t\t\t\t\t\t\t\t \" AND or1.uid = ormm.uid_local\n\t\t\t\t\t\t\t\t AND or2.uid = ormm.uid_foreign\n\t\t\t\t\t\t\t\t AND or2.uid = \" . intval($uid) ,\n\t\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\t$orderby,\n\t\t\t\t\t\t\t\t\"\");\n\n\t\t}\n\t\t//Check if query returned any results\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {\n\t\t\t$add_content = $add_content . '<ul>';\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {\n\t\t\t\t$uid = $row['uid']; // or1 res. nv1\n\t\t\t\t$makelink=false;\n\t\t\t\tif($this->conf['no_link_empty_nv']){\n#\t\t\t\t\tdebug('no_link_empty_nv gesetzt!');\n\t\t\t\t}else{\n#\t\t\t\t\tdebug('no_link_empty_nv NICHT gesetzt!');\n\t\t\t\t}\n\t\t\t\t$res_connected_services = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t\t'tx_civserv_service.sv_name',\n\t\t\t\t\t\t'tx_civserv_service',\n\t\t\t\t\t\t'tx_civserv_service_sv_navigation_mm',\n\t\t\t\t\t\t'tx_civserv_navigation',\n\t\t\t\t\t\t'AND tx_civserv_service_sv_navigation_mm.uid_foreign = '. intval($uid), //just in case\n\t\t\t\t\t\t'');\n\t\t\t\tswitch ($mode) {\n\t\t\t\t\tcase 'circumstance_tree':\n\t\t\t\t\t\t$link_mode = 'circumstance';\n\t\t\t\t\t\tif(($GLOBALS['TYPO3_DB']->sql_num_rows($res_connected_services) < 1) && $this->conf['no_link_empty_nv']){\n\t\t\t\t\t\t\t$makelink = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$makelink = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'usergroup_tree':\n\t\t\t\t\t\t$link_mode = 'usergroup';\n\t\t\t\t\t\tif(($GLOBALS['TYPO3_DB']->sql_num_rows($res_connected_services) < 1) && $this->conf['no_link_empty_nv']){\n\t\t\t\t\t\t\t$makelink = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$makelink = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'organisation_tree':\n\t\t\t\t\t\t$link_mode = 'organisation';\n\n\t\t\t\t\t\t$makelink = true; // we want detail-information to all organisations\n/*\n// no! we want detail-information to all organisations - not only to those who offer services.....\n\t\t\t\t\t\t$res_connected_services = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t\t\t\t'tx_civserv_service.sv_name',\n\t\t\t\t\t\t\t\t'tx_civserv_service',\n\t\t\t\t\t\t\t\t'tx_civserv_service_sv_organisation_mm',\n\t\t\t\t\t\t\t\t'tx_civserv_organisation',\n\t\t\t\t\t\t\t\t'AND tx_civserv_service_sv_organisation_mm.uid_foreign = '.intval($uid),\n\t\t\t\t\t\t\t\t'');\n*/\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($this->conf['hide_empty_nv'] && $makelink == false){\n\t\t\t\t\t$this->makeTree($uid, $add_content, $mode);\n\t\t\t\t}else{\n\t\t\t\t\t$add_content .= '<li>';\n\t\t\t\t\t$add_content .= $makelink ? '<a href=\"' . htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => $link_mode,id => $row['uid']),1,1)) . '\">' : '';\n\t\t\t\t\t// test bk: add organisational code\n\t\t\t\t\tif($this->conf['displayOrganisationCode'] && !($mode=='usergroup_tree' || $mode=='circumstance_tree')){\n\t\t\t\t\t\t$add_content .= $row['code'].' '.$row['name'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$add_content .= $row['name'];\n\t\t\t\t\t}\n\t\t\t\t\t$add_content .= $makelink ? '</a>': '';\n\t\t\t\t\t$this->makeTree($uid, $add_content, $mode);\n\t\t\t\t\t$add_content .= \"</li>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$add_content = $add_content . \"</ul>\\n\";\n\t\t}\n\t\treturn $add_content;\n\t}", "function getMakeModelTree($makeModelRequest) {\r\r\n\t\tif($makeModelRequest == null) {\r\r\n\t\t\tthrow new InvalidArgumentException(\"makeModelRequest\");\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$url_string = 'https://gateway.developer.telekom.com/plone/autoscout24/rest';\r\r\n\t\t\r\r\n\t\t$url_string .= '/'.$this->environment;\r\r\n\t\t$url_string .= '/makeModelTree';\r\r\n\r\r\n\t\t\r\r\n\t\t\t\r\r\n\t\t$request_array = array();\r\r\n\t\t\t\r\r\n\t\t\t\r\r\n\t\tif($makeModelRequest != null) {\r\r\n\t\t\t$request_array = AutoScout24DataFactory::jsonizeMakeModelRequest($makeModelRequest);\r\r\n\t\t}\r\r\n\t\t\r\r\n\r\r\n\t\t$curl_session = curl_init($url_string);\r\r\n\t\t\r\r\n\t\t$curl_options = array(\r\r\n\t\t\tCURLOPT_CUSTOMREQUEST => 'POST',\r\r\n\t\t\tCURLOPT_RETURNTRANSFER => true,\r\r\n\t\t\tCURLOPT_SSL_VERIFYPEER => false,\r\r\n\t\t\tCURLOPT_HTTPHEADER => array(\r\r\n\t\t\t\t'Authorization: TAuth realm=\"https://odg.t-online.de\",tauth_token=\"'.$this->token_getter->getToken()->getToken().'\"',\r\r\n\t\t\t\t'User-Agent: Telekom PHP SDK/3.1.10',\r\r\n\t\t\t\t'Accept: application/json',\r\r\n\t\t\t\t'Content-Type: application/json'\r\r\n\t\t\t),\r\r\n\t\t\tCURLOPT_POSTFIELDS => $request_array\r\r\n\t\t);\r\r\n\t\t\r\r\n\t\tif($this->additional_curl_options != null) {\r\r\n\t\t\t$curl_options = $curl_options + $this->additional_curl_options;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tcurl_setopt_array($curl_session, $curl_options);\r\r\n\t\t\r\r\n\t\t$curl_response = curl_exec($curl_session);\r\r\n\t\t\r\r\n\t\tif($curl_response !== false) {\r\r\n\t\t\treturn AutoScout24DataFactory::createGetMakeModelTreeResponse($curl_response);\r\r\n\t\t} else {\r\r\n\t\t\tthrow new Exception(curl_error($curl_session));\r\r\n\t\t}\r\r\n\t}", "function automap_fetch_tree($dir, $MAPCFG, $params, &$saved_config, $obj_name, $layers_left, &$this_tree_lvl) {\n // Stop recursion when the number of layers counted down\n if($layers_left != 0) {\n try {\n global $_BACKEND;\n if($dir == 'childs') {\n if($obj_name == '<<<monitoring>>>') {\n try {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getHostNamesWithNoParent();\n } catch(BackendConnectionProblem $e) {\n $relations = array();\n }\n } elseif (cfg('global', 'shinken_features')) {\n if ($params['min_business_impact']){\n $tmp_array = array_flip(list_business_impact());\n $min_business_impact = $tmp_array[$params['min_business_impact']];\n }\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectChildDependenciesNamesByHostName($obj_name, $min_business_impact);\n } else {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectChildNamesByHostName($obj_name);\n }\n } else {\n if (cfg('global', 'shinken_features')) {\n if ($params['min_business_impact']){\n $tmp_array = array_flip(list_business_impact());\n $min_business_impact = $tmp_array[$params['min_business_impact']];\n }\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectParentDependenciesNamesByHostName($obj_name, $min_business_impact);\n } else {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectParentNamesByHostName($obj_name);\n }\n }\n } catch(BackendException $e) {\n $relations = array();\n }\n\n foreach($relations AS $rel_name) {\n if (in_array($rel_name, $params['ignore_hosts']) == True){\n continue;\n }\n $obj = automap_obj($MAPCFG, $params, $saved_config, $rel_name);\n\n // Add to tree\n $this_tree_lvl[$obj['object_id']] = $obj;\n\n // < 0 - there is no limit\n // > 0 - there is a limit but it is no reached yet\n if($layers_left < 0 || $layers_left > 0) {\n automap_fetch_tree($dir, $MAPCFG, $params, $saved_config, $rel_name, $layers_left - 1, $this_tree_lvl[$obj['object_id']]['.'.$dir]);\n }\n }\n }\n}", "public function reSetDepth()\n\t{\t\t\n\t\tif ($this->getParentId() !== 0 && $this->getParentId() != null)\n\t\t{\n\t\t\t$parentCat = $this->getParentCategory();\n\t\t\t$this->setDepth($parentCat->getDepth() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setDepth(0);\n\t\t}\n\t}", "function installTreeToPackage() {\n\t\tif (!is_array($this->packageInfo)) { \n\t\t\tif ($this->debug) { echo \"ERROR - no package info found<BR>\\n\"; }\nexit();\n\t\t\treturn; \n\t\t}\n\t\t$info = $this->packageInfo['info'];\n\t\t$configs = $this->packageInfo['configs'];\n\t\t$mid = $info['name'];\n\t\tlcRegistry::delete($mid);\n\t\t$reg = lcRegistry::load($mid);\n\t\t$reg->mid = $mid;\n\t\t$reg->moduleName = $mid;\n\t\t$reg->displayName = $info['displayName'];\n\t\t$reg->version = $info['version'];\n\t\t$reg->author = $info['author'];\n\t\t$reg->copyright = $info['copyright'];\n\t\t$reg->lastModified = date(\"Y-m-d h:i:s\");\n\t\t$reg->save();\n\t\twhile(list($k,$v) = @each($configs['config'])) {\n\t\t\textract($v);\n\t\t\t$reg->config[$key] = $default;\n\t\t\t$reg->type[$key] = $type;\n\t\t\t$reg->extra[$key] = @implode(\"\\n\",$options);\n\t\t}\n\t\t$reg->saveConfig();\n\t\texec(\"cp \".$this->dir.\" \".SERVICE_PATH.\"/\".$this->moduleName.\"/ -R\");\n\t}", "public function perform()\n {\n if($this->dontPerform == TRUE)\n {\n return;\n }\n\n // forward to node x without update\n if(isset($_POST['gotonode']) && ($_POST['gotonode'] != ''))\n {\n $this->unlockLink();\n $this->redirect((int)$_POST['gotonode']); \n }\n\n // change nothing and switch back\n if(isset($_POST['canceledit']) && ($_POST['canceledit'] == '1'))\n {\n $this->unlockLink();\n $this->redirect((int)$_POST['id_node']); \n }\n \n if( isset($_POST['modifylinkdata']) )\n {\n $this->updateLinkData();\n }\n\n // get whole node tree\n $this->model->action('navigation','getTree', \n array('id_node' => 0,\n 'result' => & $this->tplVar['tree'],\n 'fields' => array('id_parent','status','id_node','title'))); \n \n // get demanded link data\n $this->model->action('link','getLink', \n array('result' => & $this->tplVar['link'],\n 'id_link' => (int)$_REQUEST['id_link'],\n 'error' => & $this->tplVar['error'],\n 'fields' => array('id_link','title','url',\n 'description','status','hits')));\n\n // convert some field values to safely include it in template html form fields\n $this->convertHtmlSpecialChars( $this->tplVar['link'], array('title','url') ); \n\n // get node data of this link\n $this->model->action('navigation','getNode', \n array('result' => & $this->tplVar['node'],\n 'id_node' => (int)$this->current_id_node,\n 'error' => & $this->tplVar['error'],\n 'fields' => array('title','id_node'))); \n \n // get navigation node branch of the current node\n $this->model->action('navigation','getBranch', \n array('result' => & $this->tplVar['branch'],\n 'id_node' => (int)$this->current_id_node,\n 'error' => & $this->tplVar['error'],\n 'fields' => array('title','id_node'))); \n\n // we need the url vars to open this page by the keyword map window\n if($this->config['link']['use_keywords'] == 1)\n {\n if(isset($_REQUEST['addkey']))\n {\n $this->addKeyword();\n }\n $this->getLinkKeywords();\n }\n }", "private function _getTree($create = false) {}", "public function moveAsRoot() {\n if (!$this->hasManyRoots)\n throw new CException(Yii::t('yiiext', 'Many roots mode is off.'));\n\n if ($this->getIsNewRecord())\n throw new CException(Yii::t('yiiext', 'The node should not be new record.'));\n\n if ($this->getIsDeletedRecord())\n throw new CDbException(Yii::t('yiiext', 'The node should not be deleted.'));\n\n if ($this->isRoot())\n throw new CException(Yii::t('yiiext', 'The node already is root node.'));\n\n $db = $this->getDbConnection();\n $extTransFlag = $db->getCurrentTransaction();\n\n if ($extTransFlag === null)\n $transaction = $db->beginTransaction();\n\n try {\n $left = $this->{$this->leftAttribute};\n $right = $this->{$this->rightAttribute};\n $levelDelta = 1 - $this->{$this->levelAttribute};\n $delta = 1 - $left;\n\n $this->updateAll(\n array(\n $this->leftAttribute => new CDbExpression($db->quoteColumnName($this->leftAttribute) . sprintf('%+d', $delta)),\n $this->rightAttribute => new CDbExpression($db->quoteColumnName($this->rightAttribute) . sprintf('%+d', $delta)),\n $this->levelAttribute => new CDbExpression($db->quoteColumnName($this->levelAttribute) . sprintf('%+d', $levelDelta)),\n $this->rootAttribute => $owner->getPrimaryKey(),\n ), $db->quoteColumnName($this->leftAttribute) . '>=' . $left . ' AND ' .\n $db->quoteColumnName($this->rightAttribute) . '<=' . $right . ' AND ' .\n $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount, array(CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++ => $this->{$this->rootAttribute}));\n\n $this->shiftLeftRight($right + 1, $left - $right - 1);\n\n if ($extTransFlag === null)\n $transaction->commit();\n\n $this->correctCachedOnMoveBetweenTrees(1, $levelDelta, $this->getPrimaryKey());\n } catch (Exception $e) {\n if ($extTransFlag === null)\n $transaction->rollBack();\n\n throw $e;\n }\n\n return true;\n }", "function manage_node()\n\t{\n\t\n\t\t$tree_id = $this->EE->input->get('tree_id');\n\t\t\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id, true);\n\t\t\n\t\t$this->EE->load->model('channel_entries_model');\n\t\t\t\t\n\t\t$vars = array();\n\t\t\n\t\t$vars['tree_settings'] \t= $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t// check this user has access to this tree\n\t\t$permissions = explode('|', $vars['tree_settings']['permissions']);\n\t\tif( !has_access_to_tree($this->EE->session->userdata['group_id'], $permissions) )\n\t\t{\n\t\t\t$this->EE->session->set_flashdata('message_failure', lang('unauthorised'));\n\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t}\n\t\t\n\t\t$vars['title_extra'] = $vars['tree_settings']['label'];\n\t\t$vars['root_insert'] = $this->EE->input->get('add_root');\n\t\t$vars['channel_entries'] = array();\n\t\t$vars['templates'] = array();\n\t\t$vars['tree_id'] = $tree_id;\n\t\t$vars['parent_select'] = array();\n\t\t$vars['node_id'] = $this->EE->input->get('node_id');\n\t\t$vars['label'] = '';\n\t\t$vars['template_path'] = '';\n\t\t$vars['entry_id'] = '';\n\t\t$vars['custom_url'] = '';\n\t\t$vars['field_data'] = '';\n\t\t$vars['site_pages'] = $this->EE->config->item('site_pages');\n\t\t$vars['hide'] = \" class='js_hide'\";\n\t\t$vars['select_page_uri_option'] = '';\n\t\t\t\n\t\t// get template info from selected templates\n\t\t$template_ids = explode('|', $vars['tree_settings']['template_preferences']);\n\t\t$templates = $this->EE->ttree->get_templates($template_ids, $tree_id);\n\t\t\n\t\t// build our options for the template form_dropdown\n\t\tif( count($templates))\n\t\t{\n\t\t\t// output our initial value only if there's more than one template\n\t\t\tif(count($templates) != 1)\n\t\t\t{\n\t\t\t\t$vars['templates'][0] = '--';\n\t\t\t}\n\t\t\tforeach($templates as $template)\n\t\t\t{\n\t\t\t\t// strip /index from each template\n\t\t\t\t$vars['templates'][ $template['template_id'] ] = str_replace('index/', '', '/'.$template['group_name'].'/'.$template['template_name'].'/');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get channel entries from selected templates\n\t\t$channel_ids = explode('|', $vars['tree_settings']['channel_preferences']);\n\t\t$fields_needed = array(\"entry_id\", \"channel_id\", \"title\");\n\t\t$channel_entries = $this->EE->channel_entries_model->get_entries($channel_ids, $fields_needed)->result_array();\n\t\t$channels = $this->EE->ttree->get_channels($this->site_id);\n\t\t\n\t\t// build an array of channel_ids => channel_titles\n\t\tforeach($channels as $channel)\n\t\t{\n\t\t\t$channel_names[$channel['channel_id']] = $channel['channel_title'];\n\t\t}\n\t\t// build our channel_entries form_dropdown array\n\t\tif( count($channel_entries))\n\t\t{\n\t\t\t$vars['channel_entries'][0] = '--';\n\t\t\tforeach($channel_entries as $entry)\n\t\t\t{\n\t\t\t\t$vars['channel_entries'][ $entry['entry_id'] ] = '['.$channel_names[$entry['channel_id']].'] &rarr; '.$entry['title'];\n\t\t\t}\n\t\t}\n\n\t\t// sort the entries alphabetically\n\t\tnatcasesort($vars['channel_entries']);\n\t\t\n\t\t// build our nodes array for the select parent form_dropdown\n\t\t// only if we're not inserting a root\n\t\tif(!$vars['root_insert'] && !$vars['node_id'])\n\t\t{\n\t\t\t$parent_select = array();\n\t\t\t$disabled_parents = array();\n\t\t\t\n\t\t\t$flat_tree = $this->EE->ttree->get_flat_tree(1);\n\t\t\t\n\t\t\t// go through our parent options\n\t\t\tforeach($flat_tree as $node)\n\t\t\t{\n\t\t\t\t// find out if any are at or beyond our max_depth limit\n\t\t\t\tif($node['level'] >= $vars['tree_settings']['max_depth'] && $vars['tree_settings']['max_depth'] != 0)\n\t\t\t\t{\n\t\t\t\t\t// store for later\n\t\t\t\t\t$disabled_parents[] = $node['lft'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$parent_select[$node['lft']] = str_repeat('-&nbsp;', $node['level']).$node['label'];\n\t\t\t}\n\t\t\t\n\t\t\t// put our dropdown field into a var\n\t\t\t$vars['parent_select'] = form_dropdown('parent', $parent_select);\n\t\t\t\n\t\t\t// do we have any disabled parents?\n\t\t\tif(count($disabled_parents))\n\t\t\t{\t\n\t\t\t\t// disable each parent we're not allowing.\n\t\t\t\t// haven't figured out a better way of doing this ?\n\t\t\t\tforeach($disabled_parents as $disabled_parent)\n\t\t\t\t{\n\t\t\t\t\t$vars['parent_select'] = str_replace('value=\"'.$disabled_parent.'\"', 'value=\"'.$disabled_parent.'\" disabled=\"disabled\"', $vars['parent_select']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// are we editing a node, get node's existing values\n\t\tif($vars['node_id'])\n\t\t{\n\t\t\t$this_node = $this->EE->ttree->get_node_by_node_id($vars['node_id']);\n\t\t\t\n\t\t\tif(count($this_node))\n\t\t\t{\n\t\t\t\t$vars['label'] = $this_node['label'];\n\t\t\t\t$vars['template_path'] = $this_node['template_path'];\n\t\t\t\t$vars['entry_id'] = $this_node['entry_id'];\n\t\t\t\t$vars['custom_url'] = $this_node['custom_url'];\n\t\t\t\t$vars['field_data'] = ($this_node['field_data']) ? $this->unserialize($this_node['field_data']) : '';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// build options for 'use page uri' checkbox\n\t\t$checked = false;\n\t\t\t\t\t\t\n\t\tif(isset($this_node['custom_url']) && $this_node['custom_url'] == \"[page_uri]\")\n\t\t{\n\t\t\t//check it, and show it\n\t\t\t$checked = TRUE;\n\t\t\t$vars['hide'] = \"\";\n\t\t}\n\t\t\n\t\t$vars['site_pages_checkbox_options'] = array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'name' => 'use_page_uri',\n\t\t\t\t\t\t\t\t\t\t\t\t 'id' => 'use_page_uri',\n\t\t\t\t\t\t\t\t\t\t\t\t 'value' => '1',\n\t\t\t\t\t\t\t\t\t\t\t\t 'checked' => $checked\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\n\t\t$vars['has_page_ajax_url'] = str_replace('&amp;','&', $this->_base_url.AMP.\"method=check_entry_has_pages_uri\".AMP.\"tree_id=\".$tree_id.AMP.\"node_entry_id=\");\n\t\t\n\t\t// put the select entry field into a variable\n\t\t$entries_select_dropdown = form_dropdown('entry_id', $vars['channel_entries'], $vars['entry_id']);\n\t\t\n\t\t// fetch our existing entry_ids\n\t\t$entry_ids_in_tree = $this->EE->ttree->get_tree_entry_ids($tree_id);\n\n\t\tif($entry_ids_in_tree)\n\t\t{\n\t\t\t// loop through our entries and str_replace the disabled=\"disabled\" in there :(\n\t\t\tforeach($entry_ids_in_tree as $row)\n\t\t\t{\n\t\t\t\t// don't want to disable our current node though :)\n\t\t\t\tif($row['entry_id'] != $vars['entry_id'])\n\t\t\t\t{\n\t\t\t\t\t$entries_select_dropdown = str_replace('value=\"'.$row['entry_id'].'\"', 'value=\"'.$row['entry_id'].'\" disabled=\"disabled\"', $entries_select_dropdown);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vars['entries_select_dropdown'] = $entries_select_dropdown;\n\t\t\n\t\tunset($entries_select_dropdown);\n\n\t\treturn $this->content_wrapper('manage_node', 'manage_node', $vars);\n\n\t}", "function SetTreeData($data){\n $this->InitControl($data);\n\n }", "protected function _populateNodes()\n {\n // and some for user 1 and some for user 2.\n // five nodes for each area.\n $nodes = $this->_catalog->getModel('nodes');\n for ($i = 1; $i <= 10; $i++) {\n $node = $nodes->fetchNew();\n $node->subj = \"Subject Line $i: \" . substr(md5($i), 0, 5);\n $node->body = \"Body for $i ... \" . md5($i);\n $node->area_id = $i % 2 + 1; // sometimes 1, sometimes 2\n $node->user_id = ($i + 1) % 2 + 1; // sometimes 2, sometimes 1\n $node->save();\n }\n }", "function admin_reorder()\n\t{\n\t\tif(!$this->RequestHandler->prefers('json'))\n\t\t{\n\t\t\t$this->cakeError('error404');\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['delta']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Delta'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['delta']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Delta'));\n\t\t\treturn;\n\t\t}\n\n\t\t$node_id = $this->params['form']['node'];\n\t\t$delta = $this->params['form']['delta'];\n\n\t\t$node = $this->Navigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Navigation.id' => $node_id,\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\tif(empty($node))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('success' => 1);\n\n\t\tif($delta > 0)\n\t\t{\n\t\t\tif($this->Navigation->movedown($node_id, abs($delta)))\n\t\t\t{\n\t\t\t\t$response = array('success' => 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->cakeError('internal_error', array('action' => 'Reorder', 'resource' => 'Navigation'));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse if($delta < 0)\n\t\t{\n\t\t\tif($this->Navigation->moveup($node_id, abs($delta)))\n\t\t\t{\n\t\t\t\t$response = array('success' => 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->cakeError('internal_error', array('action' => 'Reorder', 'resource' => 'Navigation'));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$this->set('response', $response);\n\t}", "function getModifiedDeepCopy($rootNode, $nonleafNodeChildlessTransformation = null, $leafNodeTransformation = null) {\r\n\r\n if (is_null($nonleafNodeChildlessTransformation)) {\r\n\r\n $nonleafNodeChildlessTransformation = function($treeNode) { \r\n\r\n $outputTreeNode = TreeNode::createStubNode();\r\n\r\n $outputTreeNode->setName($treeNode->getName());\r\n\r\n return $outputTreeNode;\r\n\r\n };\r\n\r\n }\r\n\r\n if (is_null($leafNodeTransformation)) {\r\n\r\n $leafNodeTransformation = function($treeNode) {\r\n\r\n $outputTreeNode = TreeNode::createStubNode();\r\n\r\n $outputTreeNode->setName($treeNode->getName());\r\n \r\n $outputTreeNode->setValue($treeNode->getValue());\r\n\r\n return $outputTreeNode;\r\n\r\n };\r\n\r\n }\r\n\r\n // check whether tree instance is the empty tree instance\r\n\r\n if (is_null($rootNode)) {\r\n\r\n return null;\r\n\r\n }\r\n\r\n // check whether root node is a valid tree node\r\n\r\n TreeNode::checkTreeNode($rootNode);\r\n\r\n // check whether tree instance is the trivial tree instance\r\n\r\n if (!$rootNode->hasChildren()) {\r\n\r\n return $leafNodeTransformation($rootNode);\r\n\r\n }\r\n\r\n // initialize output tree\r\n\r\n $outputRootNode = $nonleafNodeChildlessTransformation($rootNode);\r\n\r\n // initialize previous level input and previous level output non-leaf node tracking data structures\r\n\r\n $previousLevelNonLeafNodes = array($rootNode);\r\n\r\n $outputPreviousLevelNonLeafNodes = array($outputRootNode);\r\n\r\n // traverse tree levels one level at a time starting at the current level just below the root node\r\n\r\n while (count($previousLevelNonLeafNodes) > 0) {\r\n\r\n // set up input and output non-leaf node tracking data structures\r\n\r\n $currentLevelNonLeafNodes = array();\r\n\r\n $outputCurrentLevelNonLeafNodes = array();\r\n\r\n // simultaneously iterate through previous level input and previous level output non-leaf nodes\r\n\r\n for ($previousLevelNonLeafNodeIndex = 0; $previousLevelNonLeafNodeIndex < count($previousLevelNonLeafNodes); $previousLevelNonLeafNodeIndex++) {\r\n\r\n $previousLevelNonLeafNode = $previousLevelNonLeafNodes[$previousLevelNonLeafNodeIndex];\r\n\r\n $outputPreviousLevelNonLeafNode = $outputPreviousLevelNonLeafNodes[$previousLevelNonLeafNodeIndex];\r\n\r\n // set up data structure to collect transformations of all children of input current level non-leaf node\r\n\r\n $outputPreviousLevelNonLeafNodeChildren = array();\r\n\r\n // iterate through children of current previous level input non-leaf node\r\n\r\n foreach ($previousLevelNonLeafNode->getChildren() as $currentLevelNode) {\r\n\r\n // carry out safety check\r\n\r\n TreeNode::checkTreeNode($currentLevelNode);\r\n\r\n // check whether current level input node is a non-leaf node\r\n\r\n if ($currentLevelNode->hasChildren()) {\r\n\r\n // set up output (at the moment childless) transformed non-leaf node\r\n\r\n $outputCurrentLevelNode = $nonleafNodeChildlessTransformation($currentLevelNode);\r\n\r\n // update input and output non-leaf node tracking data structures\r\n\r\n array_push($currentLevelNonLeafNodes, $currentLevelNode);\r\n\r\n array_push($outputCurrentLevelNonLeafNodes, $outputCurrentLevelNode);\r\n\r\n } else {\r\n\r\n // set up output transformed leaf node\r\n\r\n $outputCurrentLevelNode = $leafNodeTransformation($currentLevelNode);\r\n\r\n }\r\n\r\n // keep track of output current level child node for previous level non-leaf node\r\n\r\n array_push($outputPreviousLevelNonLeafNodeChildren, $outputCurrentLevelNode);\r\n\r\n }\r\n\r\n // set children for output previous level non-leaf node\r\n\r\n $outputPreviousLevelNonLeafNode->setChildren($outputPreviousLevelNonLeafNodeChildren);\r\n\r\n }\r\n\r\n // update input and output non-leaf node tracking data structures\r\n\r\n $previousLevelNonLeafNodes = $currentLevelNonLeafNodes;\r\n\r\n $outputPreviousLevelNonLeafNodes = $outputCurrentLevelNonLeafNodes;\r\n\r\n }\r\n\r\n return $outputRootNode;\r\n\r\n }", "public function resetInTreeCache()\n\t{\n\t\t$this->in_tree_cache = array();\n\t}", "private function resetTransactionNestingLevel(): void\n {\n if (! $this->selfReflectionNestingLevelProperty instanceof ReflectionProperty) {\n $reflection = new ReflectionClass(\\Doctrine\\DBAL\\Connection::class);\n\n // Private property has been renamed in DBAL 2.9.0+\n if ($reflection->hasProperty('transactionNestingLevel')) {\n $this->selfReflectionNestingLevelProperty = $reflection->getProperty('transactionNestingLevel');\n } else {\n $this->selfReflectionNestingLevelProperty = $reflection->getProperty('_transactionNestingLevel');\n }\n\n $this->selfReflectionNestingLevelProperty->setAccessible(true);\n }\n\n $this->selfReflectionNestingLevelProperty->setValue($this, 0);\n }", "public function rebuild()\n\t{\n\t\t$id=3;\n\t\t$dataAlbum = $this->admin->data_album($id);\n\t\t$namaAlbum = $dataAlbum->row()->nama_album;\n\t\t$albumKey = $dataAlbum->row()->kode_album;\n\t\t$data['title'] = \"Dashboard | FaceVoting Versi 1.0\";\n\t\t$data['getRebuild']= $this->_prosesRebuild($namaAlbum,$albumKey);\n\t\t$view ='v_rebuildalbum';\n\t\t$this->_template($data,$view);\n\t}", "public function testNewNodePrependToRoot()\n {\n $model2 = Animal::findOne(2);\n $root = $model2->getRoot();\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new';\n \n $this->assertTrue($model->prependTo($root));\n $this->assertSame($root, $model->getRoot());\n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight);\n \n $model2->refresh();\n $this->assertEquals(3, $model2->weight);\n $model4->refresh();\n $this->assertEquals(5, $model4->weight);\n \n }", "function attemptDirectLinkFix() {\n\t\t$ref = array();\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\t$ref[$asset->lft] = $asset;\n\t\t}\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\tif ((!isset($asset->parent_asset)) && ($asset->errors)) {\n\t\t\t\tif (isset($ref[($asset->lft-1)])) {\n\t\t\t\t\t$asset->parent_asset = $ref[($asset->lft-1)];\n\t\t\t\t\t$asset->parent_asset->addChild($asset);\n\t\t\t\t\t$asset->fixes[] = 'Parent assigned by attemptDirectLinkFix';\n\t\t\t\t\t$this->removeRoot($asset->id);\n\t\t\t\t\t$this->fixed[] = $asset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\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 }", "private static function refreshNestings(): void\n {\n if ($ids = array_keys (self::$instancesById)) {\n $rows = Application::getInstance()->getVxPDO()->doPreparedQuery(\n sprintf(\"SELECT foldersid, l, r, level FROM folders WHERE foldersid IN (%s)\", implode(',', array_fill(0, count($ids), '?'))),\n $ids\n );\n\n foreach($rows as $row) {\n $instance = self::$instancesById[$row['foldersid']];\n $instance->level = $instance->data['level'] = $row['level'];\n $instance->r = $instance->data['r'] = $row['r'];\n $instance->l = $instance->data['l'] = $row['l'];\n }\n }\n\t}", "public function run()\n {\n $nodes = [\n [\n 'name' => 'developvbox',\n 'limit_vcpus' => '24',\n 'limit_memory' => '128G',\n ],[\n 'name' => 'X1Carbon',\n 'limit_vcpus' => '8',\n 'limit_memory' => '10G',\n ],\n [\n 'name' => 'node01',\n 'limit_vcpus' => '24',\n 'limit_memory' => '128G',\n ],\n ];\n\n foreach ($nodes as $n) {\n (new \\App\\Models\\Node($n))->save();\n }\n }", "private function rebuildLevel()\n\t{\n\t\techo \"Rebuilding \" . $this->OutputPath . PHP_EOL;\n\n\t\t$InstanceFiles = $this->orderInstances();\n\t\t$this->WriteFile = fopen( $this->OutputPath, \"w\" );\n\t\tfwrite( $this->WriteFile, $this->getHeader( sizeof( $InstanceFiles ) ) );\n\n\t\tforeach( $InstanceFiles as $InstanceFile )\n\t\t{\n\t\t\t$this->Instance = json_decode( file_get_contents( $InstanceFile ) );\n\n\t\t\tif( ! $this->Instance || empty( $this->Instance ) )\n\t\t\t{\n\t\t\t\tvar_dump( $InstanceFile );\n\t\t\t\tdie( 'failed to decode json!' );\n\t\t\t}\n\t\t\t$this->processInstance();\n\t\t}\n\n\t\tfclose( $this->WriteFile );\n\t}", "protected function _getTree($create = false) {}", "function migrate_nodes($drupal_content_type, $scs_content_type) {\n $dbresult = db_query('SELECT nid FROM node WHERE type = \"%s\"', $drupal_content_type);\n $num = 0;\n while ($obj = db_fetch_object($dbresult)) {\n $num++;\n $node = node_load($obj->nid);\n $json = drupal_to_js($node);\n $url = variable_get('backend_url', null) . '/' . $scs_content_type;\n $metodo = 'POST';\n $reqresult = drupal_http_request ( \n $url, \n array ( 'Content-Type' => 'application/json' ),\n $metodo,\n $json,\n 1,\n 30.0\n );\n\t\t\t\t\t\t\t\t\t \n print(\"\\n\" . \"reqresult: \" . print_r($reqresult->data, FALSE) . \"\\n\");\n print(\"\\n\" . \"reqresult: \" . print_r($reqresult->error, FALSE) . \"\\n\");\n }\n return(\"\\nMigrated \" . $num . \" items for content type \" . $drupal_content_type . \" to \" . $scs_content_type . \"\\n\");\n}", "function pico_sync_cattree($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t// rebuild tree informations\n\tlist($tree_array, $subcattree, $contents_total, $subcategories_total, $subcategories_ids_cs) = pico_makecattree_recursive($mydirname, 0);\n\t//array_shift( $tree_array ) ;\n\t$paths = [];\n\t$previous_depth = 0;\n\n\tif (!empty($tree_array)) foreach ($tree_array as $key => $val) {\n\t\t// build the absolute path of the category\n\t\t$depth_diff = $val['depth'] - $previous_depth;\n\t\t$previous_depth = $val['depth'];\n\t\tif ($depth_diff > 0) {\n\t\t\tfor ($i = 0; $i < $depth_diff; $i++) {\n\t\t\t\t$paths[$val['cat_id']] = $val['cat_title'];\n\t\t\t}\n\t\t} else if (0 !== $val['cat_id']) {\n\t\t\tfor ($i = 0; $i < -$depth_diff + 1; $i++) {\n\t\t\t\tarray_pop($paths);\n\t\t\t}\n\t\t\t$paths[$val['cat_id']] = $val['cat_title'];\n\t\t}\n\n\t\t// redundant array\n\t\t$redundants = [\n\t\t\t'cat_id' => $val['cat_id'],\n\t\t\t'depth' => $val['depth'],\n\t\t\t'cat_title' => $val['cat_title'],\n\t\t\t'contents_count' => $val['contents_count'],\n\t\t\t'contents_total' => $val['contents_total'],\n\t\t\t'subcategories_count' => $val['subcategories_count'],\n\t\t\t'subcategories_total' => $val['subcategories_total'],\n\t\t\t'subcategories_ids_cs' => $val['subcategories_ids_cs'],\n\t\t\t'subcattree_raw' => $val['subcattree_raw'],\n ];\n\n\t\t$db->queryF(\n 'UPDATE '\n . $db->prefix($mydirname . '_categories') . ' SET cat_depth_in_tree='\n . (int)$val['depth'] . ', cat_order_in_tree='\n . ($key) . ', cat_path_in_tree='\n . $db->quoteString(pico_common_serialize($paths)) . ', cat_redundants='\n . $db->quoteString(pico_common_serialize($redundants)) . ' WHERE cat_id='\n . $val['cat_id']);\n\t}\n}", "public function modifyNode($dn, $newParams) {\n if(isset($newParams[\"id\"]))\n $newParams = array($newParams);\n\n $connId = $this->getConnection();\n $properties = $this->getNodeProperties($dn);\n $properties = $this->helper->formatToPropertyArray($properties);\n\n $idRegexp = \"/^(.*)_(\\d*)$/\";\n $affectsDN = false;\n\n foreach($newParams as $parameter) {\n\n // ignore inherited params\n if(isset($parameter[\"parent\"]))\n if($parameter[\"parent\"] != \"\")\n continue;\n\n $idElems = array();\n preg_match($idRegexp,$parameter[\"id\"],$idElems);\n if(count($idElems) != 3) {\n throw new AppKitException(\"Invalid ID given to modifyNode \".$parameter[\"id\"]);\n }\n $curProperty = $idElems[1];\n $curIndex = $idElems[2];\n if(!isset($properties[$curProperty]))\n continue;\n if(is_array($properties[$curProperty])) {\n\n $properties[$curProperty][$curIndex] = $parameter[\"value\"];\n if(in_array($curProperty,self::$dnDescriptors))\n $affectsDN = $curProperty.\"=\".$parameter[\"value\"];\n } else {\n $properties[$curProperty] = $parameter[\"value\"];\n if(in_array($curProperty,self::$dnDescriptors))\n $affectsDN = $curProperty.\"=\".$parameter[\"value\"];\n }\n }\n // if the dn is affected, the node must be moved instead of being modified\n if($affectsDN) {\n $dnToPreserve = explode(\",\",$dn,2);\n $dnToPreserve = $dnToPreserve[1];\n // add new node and remove old\n $newDN = $affectsDN.\",\".$dnToPreserve;\n\n\n \n if(!@ldap_add($connId,$newDN,$properties)) {\n throw new AgaviException(\"Could not modify \".$dn. \":\".$this->getError());\n }\n // recursive clone\n if($childs = $this->listDN($dn)) {\n foreach($childs as $key=>$child) {\n if(!is_int($key))\n continue;\n\n $this->moveNode((isset($child[\"aliasdn\"]) ? $child[\"aliasdn\"] : $child[\"dn\"]),$newDN);\n }\n }\n $this->rechainAliasesForNode($dn,$newDN);\n $this->removeNodes($dn, false); // leave broken aliases for safety\n } else {\n\n if(!@ldap_modify($connId,$dn,$properties)) {\n throw new AgaviException(\"Could not modify \".$dn. \":\".$this->getError());\n }\n }\n return $dn;\n }", "public function tree_backup_create($description = \"\", $username = \"Automatic\") {\n global $db, $langval;\n\n $prev_langval = $langval;\n\n // Kompletten baum in den cache laden\n $this->tree_cache_elements();\n\n $ar_backup = $this->cache_nodes;\n // Texte verschieben\n foreach ($ar_backup as $id_node => $data) {\n $langval = 128;\n $text = array();\n $text[\"T1\"] = $data[\"T1\"];\n $text[\"V1\"] = $data[\"V1\"];\n $text[\"V2\"] = $data[\"V2\"];\n\n $ar_backup[$id_node][\"backup_text\"] = array();\n $ar_backup[$id_node][\"backup_text\"][$langval] = $text;\n\n while ($langval > 1) {\n if ($langval & $data[\"BF_LANG_KAT\"]) {\n $data_lang = $this->element_read($id_node, $langval);\n\n $text_lang = array();\n $text_lang[\"T1\"] = $data_lang[\"T1\"];\n $text_lang[\"V1\"] = $data_lang[\"V1\"];\n $text_lang[\"V2\"] = $data_lang[\"V2\"];\n\n $ar_backup[$id_node][\"backup_text\"][$langval] = $text_lang;\n }\n $langval /= 2;\n }\n\n unset($ar_backup[$id_node][\"T1\"]);\n unset($ar_backup[$id_node][\"V1\"]);\n unset($ar_backup[$id_node][\"V2\"]);\n }\n\n $langval = $prev_langval;\n\n $backup = array();\n $backup[\"DATA\"] = serialize($ar_backup);\n $backup[\"DATA_FIELDS\"] = serialize($db->fetch_table(\"SELECT * FROM `\".$this->table.\"2field`\"));\n $backup[\"DESCRIPTION\"] = $description;\n $backup[\"CREATED_BY\"] = $username;\n\n if ($this->backupid = $db->update($this->table.\"_restore\", $backup)) {\n return true;\n }\n return false;\n }", "private function tree_apply_changes($changes) {\n global $db;\n\n foreach ($changes as $id => $change) {\n $change[\"ID_KAT\"] = $id;\n if ($updateid = $db->update($this->table, $change))\n unset($this->cache_nodes[$updateid]);\n }\n\n return $this->tree_create_nestedset();\n }", "public function calc_tree()\n\t{\n\t\t$this->readTree(TRUE);\t\t\t// Make sure we have accurate data\n\t\tforeach ($this->class_parents as $cp)\n\t\t{\n\t\t\t$rights = array();\n\t\t\t$this->rebuild_tree($cp,$rights);\t\t// increasing rights going down the tree\n\t\t}\n\t}", "public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}", "private function recreateCategory(): void\n {\n $this->category = $this->categoryFactory->create();\n $this->category->load(2);\n }", "protected function update_network_to_1_3_0() {\n\n\t\t$this->update_points_type_settings_to_1_3_0();\n\t}", "public function resetRelations()\n\t{\n\t\t$this->relations = array();\n\t}", "public function run()\n {\n\t DB::table('networks')->insert([\n\t 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t 'updated_at' => Carbon\\Carbon::now()->toDateTimeString()\n\t ]);\n\n\t for($i=1; $i<=5; $i++){\n\n\t\t DB::table('network_nodes')->insert([\n\t\t 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t 'network_id' => 1,\n\t\t 'node' => $i\n\t\t ]);\n\n\t\t DB::table('user_nodes')->insert([\n\t\t 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t 'user_id' => $i,\n\t\t 'node_id' => $i\n\t\t ]);\n\n\t }\n\n\t for($i=1; $i<=5; $i++){\n\n\n\t \tfor($j=1; $j<=5; $j++){\n\t \t\tif($j != $i){\n\n\t\t\t\t DB::table('network_edges')->insert([\n\t\t\t\t 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t\t\t 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n\t\t\t\t 'network_id' => 1,\n\t\t\t\t 'source' => $i,\n\t\t\t\t 'target' => $j\n\t\t\t\t ]);\n\n\n\t \t\t}\n\n\n\t \t}\n\n\t }\n\n }", "public static function rebuild_tree($model, $local_parent, $site_id, $left)\n\t{\n\t\t# the right value of this node is the left value + 1\n\t\t$right = $left+1;\n\t\t\n\t\t$navigation_items = ORM::factory($model)\n\t\t\t->where(array(\n\t\t\t\t'fk_site'\t\t=> $site_id,\n\t\t\t\t'local_parent'\t=> $local_parent,\n\t\t\t))\n\t\t\t->orderby('position', 'asc')\n\t\t\t->find_all();\t\n\n\t\tforeach($navigation_items as $item)\n\t\t{\n\t\t # recursive function for each child of this node\n\t\t # $right is the current right value;\n\t\t # incremented by the rebuild_tree function\n\t\t $right = Tree::rebuild_tree($model, $item->id, $site_id, $right);\n\t\t}\n\t\t\n\t\t# we've got the left value, and now that we've processed\n\t\t# the children of this node we also know the right value\n\t\t$item = ORM::factory($model, $local_parent); \n\t\t$item->lft = $left;\n\t\t$item->rgt = $right;\n\t\t$item->save();\t\t\n\n\t\t# return the right value of this node + 1\n\t\treturn $right+1;\n\t}", "private function updateNetworks()\n {\n foreach ($this->networks as $net_key => $net_value) {\n $url = $net_value['template'];\n\n foreach ($this->args as $arg_key => $arg_value) {\n $url = str_replace('{' . $arg_key . '}', $arg_value, $url);\n }\n\n $this->networks[$net_key]['url'] = $url;\n }\n }", "function create_left_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\treturn $this->create_root_node($values, $id, false, NESE_MOVE_BEFORE);\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr>=%s AND level=%s AND l BETWEEN %s AND %s',\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['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], $parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN l >= %s THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN (r >= %s OR l >= %s) THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\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['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'];\r\n\t\t$insert_data['l'] = $this_node['l'];\r\n\t\t$insert_data['r'] = $this_node['l'] + 1;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\r\n\r\n\t\tif (!$this->_dumb_mode || !$node_id = isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function run()\n {\n DB:: table('modules')->truncate();\n DB:: table('modules')->insert(array(\n // Cashier\n array('id' => 1, 'parent_id' => 0, 'description'=>'Cashier', 'icon' => 'fas fa-laptop', 'path' => 'cashier', 'rank' => 1),\n // Master List\n array('id' => 2, 'parent_id' => 0, 'description'=>'Master List', 'icon' => 'fas fa-clipboard-list', 'path' => '', 'rank' => 2),\n array('id' => 3, 'parent_id' => 2, 'description'=>'Product', 'icon' => 'fa fa-address-card-o', 'path' => '', 'rank' => 2),\n array('id' => 4, 'parent_id' => 3, 'description'=>'Product List', 'icon' => 'fas fa-box', 'path' => 'product_list', 'rank' => 2),\n array('id' => 5, 'parent_id' => 3, 'description'=>'Category', 'icon' => 'fas fa-th', 'path' => 'product_category', 'rank' => 2),\n array('id' => 6, 'parent_id' => 2, 'description'=>'Discount', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 7, 'parent_id' => 6, 'description'=>'Discount List', 'icon' => 'fa fa-address-card-o', 'path' => 'discount_list', 'rank' => 2),\n array('id' => 27, 'parent_id' => 0, 'description'=>'Bus', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 28, 'parent_id' => 27, 'description'=>'Bus List', 'icon' => 'fas fa-bus', 'path' => 'bus_list', 'rank' => 1),\n array('id' => 29, 'parent_id' => 27, 'description'=>'Bus Type', 'icon' => 'fas fa-th', 'path' => 'bus_type', 'rank' => 2),\n array('id' => 30, 'parent_id' => 27, 'description'=>'Route Management', 'icon' => 'fas fa-map-marker', 'path' => 'route_management', 'rank' => 3),\n // Trip\n array('id' => 31, 'parent_id' => 0, 'description'=>'Bus Trip', 'icon' => 'fa fa-road', 'path' => '', 'rank' => 3),\n array('id' => 32, 'parent_id' => 31, 'description'=>'Bus Trip', 'icon' => 'fa fa-road', 'path' => 'bus_trip', 'rank' => 1),\n array('id' => 33, 'parent_id' => 31, 'description'=>'Bus Trip Ticket', 'icon' => 'fa-ticket-alt', 'path' => 'bus_trip_ticket', 'rank' => 2),\n // Inventory\n array('id' => 8, 'parent_id' => 0, 'description'=>'Inventory', 'icon' => 'fa fa-archive', 'path' => 'counter', 'rank' => 4),\n array('id' => 9, 'parent_id' => 8, 'descri4ption'=>'Inventory', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 10, 'parent_id' => 9, 'description'=>'Product Inventory', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 11, 'parent_id' => 9, 'description'=>'Daily Production Count', 'icon' => '', 'path' => 'production_count', 'rank' => 2),\n array('id' => 12, 'parent_id' => 9, 'description'=>'Quantity Adjustment', 'icon' => '', 'path' => 'product_quantity_adjustment', 'rank' => 2),\n array('id' => 13, 'parent_id' => 8, 'description'=>'Manufacturing', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 14, 'parent_id' => 13, 'description'=>'Ingredient Supply', 'icon' => '', 'path' => 'ingredient_supply', 'rank' => 2),\n array('id' => 15, 'parent_id' => 13, 'description'=>'Formulation', 'icon' => '', 'path' => 'formulation', 'rank' => 2),\n array('id' => 16, 'parent_id' => 13, 'description'=>'Ingredient List', 'icon' => '', 'path' => 'ingredient_list', 'rank' => 2),\n array('id' => 17, 'parent_id' => 0, 'description'=>'Others', 'icon' => '', 'path' => '', 'rank' => 2),\n array('id' => 18, 'parent_id' => 17, 'description'=>'Quantity Adjustment', 'icon' => '', 'path' => 'quantity_adjustment_type', 'rank' => 2),\n // Transactions\n array('id' => 19, 'parent_id' => 0, 'description'=>'Transaction', 'icon' => 'fa fa-clipboard', 'path' => '', 'rank' => 5),\n array('id' => 20, 'parent_id' => 19, 'description'=>'Pending Transactions', 'icon' => '', 'path' => 'transaction_history', 'rank' => 2),\n array('id' => 21, 'parent_id' => 19, 'description'=>'Transaction History', 'icon' => '', 'path' => 'transaction_history', 'rank' => 2),\n // Reports\n array('id' => 22, 'parent_id' => 0, 'description'=>'Reports', 'icon' => 'fa fa-file-alt', 'path' => '', 'rank' => 6),\n array('id' => 23, 'parent_id' => 22, 'description'=>'X Reading', 'icon' => '', 'path' => 'x_reading', 'rank' => 1),\n array('id' => 24, 'parent_id' => 22, 'description'=>'Z Reading', 'icon' => '', 'path' => 'z_reading', 'rank' => 2),\n array('id' => 25, 'parent_id' => 22, 'description'=>'Daily Sales Report', 'icon' => '', 'path' => 'daily_sales_report', 'rank' => 3),\n array('id' => 26, 'parent_id' => 22, 'description'=>'Product Sales Summary', 'icon' => '', 'path' => 'product_sales_summary', 'rank' => 4),\n\n array('id' => 34, 'parent_id' => 22, 'description'=>'Bus Daily Sales Report', 'icon' => '', 'path' => 'bus_daily_sales_report', 'rank' => 5),\n array('id' => 35, 'parent_id' => 22, 'description'=>'Route Sales Summary', 'icon' => '', 'path' => 'route_sales_summary', 'rank' => 6),\n array('id' => 36, 'parent_id' => 22, 'description'=>'Bus Collection Summary', 'icon' => '', 'path' => 'bus_collection_summary', 'rank' => 7)\n // LAST ID 36\n ));\n }", "function moveTestSuite(&$smartyObj,$template_dir,&$tprojectMgr,$argsObj)\r\n{\r\n $exclude_node_types=array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1);\r\n\r\n $tprojectMgr->tree_manager->change_parent($argsObj->objectID,$argsObj->containerID);\r\n $tprojectMgr->tree_manager->change_child_order($argsObj->containerID,$argsObj->objectID,\r\n $argsObj->target_position,$exclude_node_types);\r\n\r\n $guiObj = new stdClass();\r\n $guiObj->id = $argsObj->tprojectID;\r\n $guiObj->refreshTree = $argsObj->refreshTree;\r\n\r\n $tprojectMgr->show($smartyObj,$guiObj,$template_dir,$argsObj->tprojectID,null,'ok');\r\n}", "public static function buildTree($nodes){\n\t\t// Initialize hierarchy and lookup arrays\n\t\tself::$hierarchy = array();\n\t\tself::$lookup = array();\n\t\t// Walk through nodes\n\t\tarray_walk($nodes, 'hierarchy::addNode');\n\t\t// Return the hierarchical (tree) hierarchy\n\t\treturn self::$hierarchy;\n\t}", "function update_tables($inst=null) {\n// create the nodes of all the tables\n\tglobal $conn,$DB,$DTB_PRE,$TB_PRE,$wise_table,$VWMLDBM;\n\tif($inst==1) {\n\t\tif($_SESSION['vwmldbm_inst']!=1) return; // inst=1 is super inst,so access should be protected\n\t}\n\telseif($inst>1 && $inst!=$_SESSION['vwmldbm_inst'] && $_SESSION['vwmldbm_inst']!=1) return; // inst=1 can access other inst\n\telseif(!$inst) $inst=$_SESSION['vwmldbm_inst']; \n\n// SJH_MOD \n\tif($TB_PRE==\"\" || $TB_PRE==null) $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '%'\";\n\telse $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '$TB_PRE\".\"\\_%'\";\n\n\t$res_tables=mysqli_query($conn,$sql);\n \n\tif($res_tables) {\n\t\twhile($rs_tables=mysqli_fetch_array($res_tables)) $wise_table[]=Table_node::get_new_node($rs_tables['no'],$inst);\n\t}\n\t$num_tables=0;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$num_tables++;\n\t}\n\techo \"The number of tables: <b>$num_tables</b> <br>\";\n\t\n\tif($num_tables<1) return;\n\n// update upLinks and downlinks\n\t$res_f=mysqli_query($conn,\"select * from {$DTB_PRE}vwmldbm_rmd_fkey_info \");\n\t\n\tif($res_f) {\n\t\tif(mysqli_num_rows($res_f)<1) return; // there is no data in wise_rmd_feky_info\n\t\twhile($rs_f=mysqli_fetch_array($res_f)) {\n\t\t\t$from_tb_no=get_tree_no($rs_f['from_db'],$rs_f['from_tb'],$inst);\n\t\t\t$to_tb_no=get_tree_no($rs_f['to_db'],$rs_f['to_tb'],$inst);\n\t\t\t//echo $from_tb_no .\" => \".$to_tb_no.\"<br>\";\n\t\t\tupdate_node($from_tb_no,$to_tb_no);\n\t\t}\n\t}\n\n\t\n// root/terminal node unmarking\t\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif(count($wise_table[$i]->upLink))\n\t\t\t$wise_table[$i]->is_root=false;\n\t\tif(count($wise_table[$i]->downLink)){\n\t\t\t$wise_table[$i]->is_terminal=false;\n\t\t}\n\t}\n\t\n\t\n// Find each root node and do the df_traversal.\n\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->is_root) { // root node found\n\t\t\tif($wise_table[$i]->is_terminal) {\n\t\t\t\t//echo \"#\".$wise_table[$i]->tb_no.\" is an isolated node.<br>\";\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($wise_table[$i]->downLink as $child) \n\t\t\t\t\tdf_traversal(find_node($child),$wise_table[$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\n// Update the orders of creation into wise2_vwmldbm_tb\n\t$how_many_in_each_level=array();\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\t$how_many_in_each_level[$wise_table[$i]->level]++;\t\n\t}\n\t$cnt=0;\n\tfor($i=0;$i<count($wise_table);$i++){ // update the isolated nodes\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no),$inst)=='V') continue; // skip VIEW\n\t\tif($wise_table[$i]->is_root==true && $wise_table[$i]->is_terminal==true) $wise_table[$i]->order_of_creation=++$cnt;\n\t}\n\tfor($i=count($how_many_in_each_level)-1;$i>=0;$i--){ // update all other nodes\n\t\tfor($j=0;$j<count($wise_table);$j++){\n\t\t\tif($wise_table[$j]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no,$inst))=='V') continue; // skip VIEW\n\t\t\tif($wise_table[$j]->is_root==true && $wise_table[$j]->is_terminal==true) continue; // these isolated nodes were counted already before.\n\t\t\tif($wise_table[$j]->level==$i){\n\t\t\t\t$wise_table[$j]->order_of_creation=++$cnt;\t\t\t\n\t\t\t}\n\t\t}\n\t}\n // update the order of creation info into wise2.wise2_system.wise_table\t\n\tfor($i=0;$i<count($wise_table);$i++){ // Tables (not views)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)=='V') continue; // skip VIEW\n\t\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='\".$wise_table[$i]->order_of_creation.\"' where name='$tb_name'\");\n\t\t//echo $wise_table[$i]->tb_no.\": \".$wise_table[$i]->order_of_creation.\"<br>\";\t\n\t}\n\n// Determine the creating order of views from installation file\n\tif(file_exists($VWMLDBM['wise_rt'].\"/install/sql/view.php\")){\t\t\n\t\t$sql_view=array();\n\t\trequire_once($VWMLDBM['wise_rt'].\"/install/sql/view.php\");\t\n\t}\n\t\n// Remark: during the init_inst, view.php didn't become the part of the array.\n// But second time is okay. So for now let it go.\n//echo \"COUNT SQL_VIEW=\".count($sql_view);\n\n\tfor($i=0;$i<count($wise_table);$i++){ // Views (not tables)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)!='V') continue; // skip Tables (Not views)\n\t\t$view_name=substr($tb_name,strlen($TB_PRE)+1);\n\t\tif($sql_view) $tb_c_order=array_search($view_name,array_keys($sql_view))+$cnt+1;\n\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='$tb_c_order' where name='$tb_name'\");\t\n\t}\n}", "public function reorder()\n {\n $node = $this->page->find($this->request->get('nodeToChangeParent'));\n\n if ($this->request->get('parent') === '#') {\n $node->makeRoot();\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n } else {\n $parent = $this->page->find($this->request->get('parent'));\n $node->makeChildOf($parent);\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n }\n\n return [\n 'Position changed' => true,\n ];\n }", "public function reset(): void {\n $this->node = $this->dfa->getStartNode();\n $this->errorState = false;\n $this->finalState = $this->dfa->isFinal($this->node);\n }", "public function cleanUp()\n\t{\n\t\tif (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'elements-tree.php')) {\n\t\t\tinclude(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'elements-tree.php');\n\t\t\tif (!isset($elements) or !is_array($elements))\n\t\t\t\treturn;\n\n\t\t\t$db = \\Model\\Db\\Db::getConnection();\n\n\t\t\tforeach ($elements as $el => $elData) {\n\t\t\t\tif (!$elData['table'])\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ($elData['order_by'] and $elData['order_by']['custom']) {\n\t\t\t\t\t$qryOrderBy = [];\n\t\t\t\t\tforeach ($elData['order_by']['depending_on'] as $field)\n\t\t\t\t\t\t$qryOrderBy[] = $field;\n\t\t\t\t\t$qryOrderBy[] = $elData['order_by']['field'];\n\n\t\t\t\t\t$righe = $db->selectAll($elData['table'], [], [\n\t\t\t\t\t\t'order_by' => $qryOrderBy,\n\t\t\t\t\t\t'stream' => true,\n\t\t\t\t\t]);\n\n\t\t\t\t\t$lastParent = null;\n\t\t\t\t\t$currentOrder = 0;\n\t\t\t\t\tforeach ($righe as $r) {\n\t\t\t\t\t\t$parentString = [];\n\t\t\t\t\t\tforeach ($elData['order_by']['depending_on'] as $field)\n\t\t\t\t\t\t\t$parentString[] = $r[$field];\n\t\t\t\t\t\t$parentString = implode(',', $parentString);\n\t\t\t\t\t\tif ($parentString and $parentString !== $lastParent) {\n\t\t\t\t\t\t\t$lastParent = $parentString;\n\t\t\t\t\t\t\t$currentOrder = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$currentOrder++;\n\n\t\t\t\t\t\tif ($r[$elData['order_by']['field']] != $currentOrder) {\n\t\t\t\t\t\t\t$db->update($elData['table'], $r[$elData['primary']], [\n\t\t\t\t\t\t\t\t$elData['order_by']['field'] => $currentOrder,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function mktree_ops(array &$ops, replica $r, $parent_id, $depth=2, $max_depth=12) {\n if($depth > $max_depth) {\n return;\n }\n for($i=0; $i < 2; $i++) {\n $name = sprintf( \"%s\", $i == 0 ? 'a' : 'b' );\n $ops[] = new op_move($r->tick(), $parent_id, $name, $child_id = new_id());\n mktree_ops($ops, $r, $child_id, $depth+1, $max_depth);\n }\n}", "public function networkPrune()\n {\n return $this->postJson(\n $this->uri->expand(\n 'networks/prune',\n array()\n ),\n array()\n )->then(array($this->parser, 'expectJson'));\n }", "public function reset(): void\n {\n $this->level = 0;\n $this->statements = [];\n }", "final function resetDpLiving()\n {\n $this->resetDpNpc();\n }", "protected function rebuild()\n {\n $this->cleanCaches();\n $mi = new ModuleInstaller();\n $mi->silent = true;\n $mi->rebuild_modules();\n }", "public function recover(): void\n {\n $this->_table->getConnection()->transactional(function (): void {\n $this->_recoverTree();\n });\n }", "function cognitivefactory_tree_updateordering($cognitivefactoryid, $groupid, $userid, $id, $istree) {\n\n // getting ordering value of the current node\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if (!$res) return;\n\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n // getting subsequent nodes that have same father\n $sql = \"\n SELECT \n id \n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n intvalue > {$res->intvalue}\n {$treeClause}\n {$accessClause}\n ORDER BY \n intvalue\n \";\n\n // reordering subsequent nodes using an object\n if ( $nextsubs = $DB->get_record_sql($sql)) {\n $ordering = $res->intvalue + 1;\n foreach ($nextsubs as $asub) {\n $opdata = new StdClass();\n $opdata->id = $asub->id;\n $opdata->intvalue = $ordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n $ordering++;\n }\n }\n}", "public function rebuild_tree($left = 1, $target = NULL)\n {\n // check if using target or self as root and load if not loaded\n if (is_null($target) AND ! $this->loaded)\n {\n return FALSE;\n }\n elseif (is_null($target))\n {\n $target = $this;\n }\n\n if ( ! $target->loaded)\n {\n $target = $this->factory_item($target);\n }\n\n // Use the current node left value for entire tree\n if (is_null($left))\n {\n $left = $target->left;\n }\n\n $target->lock();\n $right = $left + 1;\n $children = $target->children();\n\n foreach ($children as $child)\n {\n $right = $child->rebuild_tree($right);\n }\n\n $target->left = $left;\n $target->right = $right;\n $target->save();\n $target->unlock();\n\n return $right + 1;\n }", "public function tree_preview_changes($changes) {\n global $db;\n\n // Kompletten baum in den cache laden\n $this->tree_cache_elements();\n // Änderungen vorcachen\n foreach ($changes as $id => $data) {\n if (isset($this->cache_nodes[$id])) {\n $this->cache_nodes[$id] = array_merge($this->cache_nodes[$id], $data);\n } else {\n // New node\n $this->cache_nodes[$id] = $data;\n }\n }\n\n $root = $this->tree_get_parent();\n $node = $this->element_read($root);\n if (!$root) {\n // Root-Knoten nicht gefunden\n $this->error = \"ERR_ROOT_NOT_FOUND\";\n return false;\n }\n $nestedset_ar = array();\n $nestedset_ar[] = array(\n \t\t\"id\" \t\t=> $root,\n \t\t\"title\"\t\t=> $node[\"V1\"],\n \t\t\"childs\"\t=> $this->node_create_nestedset_cached($root)\n );\n\n $nestedset = array();\n // $nestedset_ar als Nested-Set nach -> $nestedset\n $this->tree_create_nestedset_from_array($nestedset_ar, $nestedset);\n if (!$this->tree_check_nestedset($nestedset)) {\n $this->error = \"ERR_BROKEN_TREE\";\n return false;\n }\n return $this->tree_get($nestedset);\n }", "private function eval_treeview()\n {\n static $bool_drsFirstPrompt = true;\n\n // LOOP each filter\n foreach ( ( array ) $this->conf_view[ 'filter.' ] as $table => $fields )\n {\n // CONTINUE : table hasn't any dot\n if ( rtrim( $table, '.' ) == $table )\n {\n continue;\n }\n // CONTINUE : table hasn't any dot\n\n foreach ( array_keys( ( array ) $fields ) as $field )\n {\n // CONTINUE : field has an dot\n if ( rtrim( $field, '.' ) != $field )\n {\n continue;\n }\n // CONTINUE : field has an dot\n // Class var table.field\n $tableField = $table . $field;\n\n $conf_view = $this->conf_view;\n $cObj_name = $conf_view[ 'filter.' ][ $table ][ $field . '.' ][ 'treeview.' ][ 'enabled' ];\n $cObj_conf = $conf_view[ 'filter.' ][ $table ][ $field . '.' ][ 'treeview.' ][ 'enabled.' ];\n $treeviewEnabled = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n\n // CONTINUE : field has an dot\n if ( !$treeviewEnabled )\n {\n continue;\n }\n // CONTINUE : field has an dot\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n if ( $bool_drsFirstPrompt )\n {\n $prompt = 'DON\\'T USE AJAX: The treeview of ' . $tableField . ' is enabled. ' .\n 'You will get unexpected effects!';\n t3lib_div :: devLog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n $bool_drsFirstPrompt = false;\n }\n }\n // DRS\n // #i0117, 141223, dwildt, 1+\n $this->treeviewTableFields[] = $tableField;\n\n switch ( $this->conf_view[ 'filter.' ][ $table ][ $field ] )\n {\n case( 'CATEGORY_MENU' ):\n $this->eval_treeviewCategoryMenu( $tableField );\n break;\n case( 'TREEVIEW' ):\n $this->eval_treeviewCheckbox( $tableField );\n // #43692, 121206, dwildt, 13+\n // Adding jQuery\n $bool_success_jQuery = $this->pObj->objJss->load_jQuery();\n if ( $bool_success_jQuery )\n {\n if ( $this->pObj->b_drs_javascript )\n {\n $prompt = 'Current filter is a treeview.';\n t3lib_div::devlog( '[INFO/JSS] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'jQuery will be loaded.';\n t3lib_div::devlog( '[INFO/JSS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n // Adding jQuery\n // #43692, 121206, dwildt, 13+\n break;\n default:\n $header = 'Evaluation of treeview filter failed!';\n $text = '' . $tableField . ' is configured as ' . $this->conf_view[ 'filter.' ][ $table ][ $field ] . '\n <br />\n But ' . $tableField . '.treeview.enabled is true. This isn\\'t proper.\n <br />\n Please take care of a proper TypoScript configuration.<br />\n Remove ' . $tableField . '.treeview.enabled or set it to false.';\n $this->pObj->drs_die( $header, $text );\n break;\n }\n }\n }\n // LOOP each filter\n\n return;\n }" ]
[ "0.60080266", "0.56274223", "0.5486264", "0.54171586", "0.53880537", "0.5298186", "0.5275199", "0.52409387", "0.51710075", "0.5131758", "0.51309633", "0.5115454", "0.51113147", "0.5085477", "0.50829095", "0.5061777", "0.50433534", "0.5042315", "0.5038402", "0.5030509", "0.5021052", "0.49822104", "0.49767187", "0.49671724", "0.49483812", "0.49264535", "0.49219477", "0.48343953", "0.48273307", "0.48273307", "0.48138082", "0.47998708", "0.4777493", "0.47647116", "0.47562546", "0.4723171", "0.47090372", "0.4700485", "0.4690662", "0.4686887", "0.4682901", "0.46692944", "0.46644676", "0.46487808", "0.46432033", "0.46367815", "0.46358904", "0.4635812", "0.462818", "0.46175253", "0.46053678", "0.4599926", "0.45997664", "0.45956632", "0.4584488", "0.45732203", "0.4566312", "0.45662084", "0.4557132", "0.45553133", "0.45509332", "0.45472828", "0.45382234", "0.45357615", "0.4530133", "0.45233876", "0.4522503", "0.45170206", "0.45071056", "0.45039913", "0.4501027", "0.44994423", "0.4497436", "0.44889054", "0.4485589", "0.44853327", "0.44786373", "0.44674447", "0.44644317", "0.445529", "0.4451783", "0.44467548", "0.44448608", "0.4435611", "0.44231707", "0.442048", "0.4417921", "0.4414899", "0.44056845", "0.44007614", "0.4399307", "0.43929374", "0.4391828", "0.4391715", "0.43869776", "0.43867716", "0.43858197", "0.43824732", "0.43757972", "0.43693706" ]
0.7536038
0
Show all available IPNetwork for a given entity
static function showIPNetworkProperties($entities_id = -1) { global $CFG_GLPI; $rand = mt_rand(); self::dropdown(['entity' => $entities_id, 'rand' => $rand]); $params = ['ipnetworks_id' => '__VALUE__']; Ajax::updateItemOnSelectEvent("dropdown_ipnetworks_id$rand", "show_ipnetwork_$rand", $CFG_GLPI["root_doc"]. "/ajax/dropdownShowIPNetwork.php", $params); echo "<span id='show_ipnetwork_$rand'>&nbsp;</span>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNetworks() {\n\n //GET NETWORK TABLE\n $tableNetwork = Engine_Api::_()->getDbtable('networks', 'network');\n\n //MAKE QUERY\n $select = $tableNetwork->select()\n ->from($tableNetwork->info('name'), array('network_id', 'title'))\n ->order('title');\n $result = $tableNetwork->fetchAll($select);\n\n $everyone = Zend_Registry::get('Zend_Translate')->_('Everyone');\n\n //MAKE DATA ARRAY\n $networksOptions = array('0' => $everyone);\n foreach ($result as $value) {\n $networksOptions[$value->network_id] = $value->title;\n }\n\n //RETURN\n return $networksOptions;\n }", "public function get_networks()\n {\n }", "public function networks()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/networks');\n }", "public function allIpAction() {\n\n $url = \"156.17.231.34\";\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_exec($ch);\n $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($retcode >= 100 && $retcode <= 505) {\n //echo \"work \" . $retcode . \"<br/>\";\n } else {\n // echo \"nie dziala \" . $retcode . \"<br/>\";\n }\n }", "public function networkList($filter = array())\n {\n return $this->collection('OpenCloud\\Compute\\Resource\\Network');\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MccASMemberBundle:Ip')->findAll();\n\n return $this->render('MccASMemberBundle:Ip:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "function get_entity_ids_ip_by_network($entity_type, $network, $add_where = '')\n{\n\n // Recursive query for array of networks\n if (is_array($network))\n {\n $ids = array();\n foreach ($network as $entry)\n {\n if ($entry_ids = get_entity_ids_ip_by_network($entity_type, $entry, $add_where))\n {\n $ids = array_merge($ids, $entry_ids);\n }\n }\n\n return $ids;\n }\n\n // Parse for valid network string\n $network_array = parse_network($network);\n //print_vars($network_array);\n if (!$network_array)\n {\n // Incorrect network/address string passed\n return FALSE;\n }\n\n $query = 'SELECT ';\n $join = '';\n $where = ' WHERE 1 ';\n switch ($entity_type)\n {\n case 'ipv4':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv4';\n $query .= ' `ipv4_address_id`';\n break;\n case 'ipv6':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv6';\n $query .= ' `ipv6_address_id`';\n break;\n case 'ip':\n $query .= ($network_array['ip_version'] == 4) ? ' `ipv4_address_id`' : ' `ipv6_address_id`';\n break;\n\n case 'device':\n case 'devices':\n $query .= ' DISTINCT `device_id`';\n break;\n\n case 'port':\n case 'ports':\n $query .= ' DISTINCT `port_id`';\n break;\n }\n\n switch ($network_array['ip_type'])\n {\n case 'ipv4':\n $query .= ' FROM `ipv4_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv4_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv4_binary` >= ? AND `ipv4_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= generate_query_values($network_array['address'], 'ipv4_address', $network_array['query_type']);\n }\n break;\n case 'ipv6':\n $query .= ' FROM `ipv6_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv6_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv6_binary` >= ? AND `ipv6_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= ' AND (' . generate_query_values($network_array['address'], 'ipv6_address', $network_array['query_type'], FALSE) .\n ' OR ' . generate_query_values($network_array['address'], 'ipv6_compressed', $network_array['query_type'], FALSE) . ')';\n }\n break;\n }\n\n if (FALSE)\n {\n // Ignore disabled/deleted/ignored\n $where .= ' AND `device_id` NOT IN (SELECT `device_id` FROM `devices` WHERE `disabled` = \"1\" OR `ignore` = \"1\")';\n $where .= ' AND `port_id` NOT IN (SELECT `port_id` FROM `ports` WHERE `deleted` = \"1\" OR `ignore` = \"1\")';\n } else {\n // Always ignore deleted ports\n $join = ' LEFT JOIN `ports` USING (`device_id`, `port_id`) ';\n // IS NULL allow to search addresses without associated port\n $where .= ' AND (`ports`.`deleted` != \"1\" OR `ports`.`deleted` IS NULL)';\n }\n $query .= $join;\n $where .= $add_where; // Additional query, ie limit by device_id or port_id\n\n $ids = dbFetchColumn($query . $where, $param);\n //$ids = dbFetchColumn($query . $where, $param);\n //print_vars($ids);\n\n return $ids;\n}", "protected function get_network_ids()\n {\n }", "public function getNetworksList() {\n return $this->_get(4);\n }", "public function getNetworksList() {\n return $this->_get(1);\n }", "function listNetworkIp($net,$broadcast,$sn) {\n\n $lista=[]; // lista da ritornare \n\n $no = explode('.', $net); // array con gli ottetti dell'indirizzo NET\n $bo = explode('.', $broadcast); // array con gli ottetti dell'indirizzo NET\n\n $nbit = 32-$sn; // numero di bit assegnati agli host\n \n $nhost = pow(2,$nbit); // numero totale degli host\n\n $start = (int) $no[3]+1;\n $end = (int) $bo[3]-1;\n $roots = $no[0].\".\".$no[1].\".\".$no[2].\".\";\n $roote = $bo[0].\".\".$bo[1].\".\".$bo[2].\".\";\n $primo = $roots.$start;\n $ultimo = $roote.$end;\n $hosts = [];\n\n //echo $start.\" - \".$end.\"<br>\";\n\n // verifica che gli IP disponibili non superino le 5000 unità -> stila la lista\n if($nhost > 35000) {\n $lista[0] = $primo;\n $lista[1] = $ultimo;\n }\n else {\n for($i=ip2long($primo); $i<=ip2long($ultimo); $i++) {\n\n $ip2conv = $i;\n $ip2write = long2ip($ip2conv);\n $lista[] = $ip2write;\n \n $host=gethostbyaddr($ip2write); // prelevo il nome del host (se disponibile)\n //echo $host.\" | \";\n\n // se il nome host NON è uguale all'IP -> salvo il nome Host in una lista\n if(!filter_var($host, FILTER_VALIDATE_IP)) {\n $hosts[] = \"IP: $ip2write ==> Nome Host:<b> $host </b><br>\";\n }\n\n }\n }\n\n $ret['hostnames'] = $hosts;\n $ret['primo'] = $primo;\n $ret['ultimo'] = $ultimo;\n $ret['lista'] = $lista;\n $ret['nhost'] = $nhost; \n\n return $ret;\n}", "public static function get_allowed_on_network()\n {\n }", "public function getAll()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/ip/address/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No Ip Address To Set, Please Your Add Ip Address\";\n }\n }", "function get_networks($args = array())\n {\n }", "public function index()\n {\n $ips = Ip::withCount('dnsrecords')->get();\n return view('ip.index', compact('ips'));\n }", "function getNodes() {\n\treturn db_query(\"SELECT nodename,ipaddress FROM Nodes\");\n}", "public function get_all_net_information_by_obj_id($p_obj_id)\n {\n $l_net_row = [];\n\n if (class_exists('isys_cmdb_dao_category_s_net_ip_addresses'))\n {\n $l_dao_ip_list = new isys_cmdb_dao_category_s_net_ip_addresses($this->get_database_component());\n $l_ip_list_res = $l_dao_ip_list->get_data(null, $p_obj_id, '', [], C__RECORD_STATUS__NORMAL);\n\n $l_ip_list_data = [];\n while ($l_ip_list_row = $l_ip_list_res->get_row())\n {\n $l_ip_list_data[] = Ip::ip2long($l_ip_list_row['isys_cats_net_ip_addresses_list__title']);\n } // while\n\n $l_net_row['used_ips'] = $l_ip_list_data;\n }\n else\n {\n $l_net_row['used_ips'] = [];\n }\n\n $l_dao_dhcp = new isys_cmdb_dao_category_s_net_dhcp($this->get_database_component());\n $l_dao_ip = new isys_cmdb_dao_category_g_ip($this->get_database_component());\n\n $l_net_row = $this->get_data(null, $p_obj_id)\n ->get_row();\n $l_objtype = _L($this->get_objtype_name_by_id_as_string($l_net_row['isys_obj__isys_obj_type__id']));\n $l_net_row['object_browser_title'] = $l_objtype . ' >> ' . $l_net_row['isys_obj__title'];\n\n // Get DNS Server from net.\n $l_assigned_dns_server = $this->get_assigned_dns_server($l_net_row['isys_cats_net_list__id']);\n for ($i = 0;$i < count($l_assigned_dns_server);$i++)\n {\n $l_assigned_dns_server[$i] = [\n 'id' => $l_assigned_dns_server[$i],\n 'details' => $l_dao_ip->format_selection($l_assigned_dns_server[$i], true)\n ];\n } // for\n\n $l_net_row['assigned_dns_server'] = $l_assigned_dns_server;\n\n // Get DNS Domain from net.\n $l_domain_arr = [];\n $l_res_dns_domain = $this->get_assigned_dns_domain(null, $l_net_row['isys_cats_net_list__id']);\n if ($l_res_dns_domain)\n {\n while ($l_dns_domain_row = $l_res_dns_domain->get_row())\n {\n $l_domain_arr[] = [\n 'caption' => $l_dns_domain_row['isys_net_dns_domain__title'],\n 'value' => $l_dns_domain_row['isys_net_dns_domain__id']\n ];\n } // while\n } // if\n\n $l_net_row['assigned_dns_domain'] = $l_domain_arr;\n\n $l_dhcp_types_res = $this->get_dialog('isys_net_dhcp_type');\n $l_dhcp_types = [];\n while ($l_dhcp_type_row = $l_dhcp_types_res->get_row())\n {\n $l_dhcp_types[$l_dhcp_type_row['isys_net_dhcp_type__const']] = $l_dhcp_type_row['isys_net_dhcp_type__id'];\n } // while\n\n if (count($l_dhcp_types) > 0)\n {\n $l_dhcp_arr = [];\n foreach ($l_dhcp_types AS $l_dhcp_key => $l_dhcp_type_id)\n {\n $l_dhcp_res = $l_dao_dhcp->get_data(\n null,\n $p_obj_id,\n ' AND isys_net_dhcp_type__id = ' . $this->convert_sql_id($l_dhcp_type_id),\n null,\n C__RECORD_STATUS__NORMAL\n );\n while ($l_dhcp_row = $l_dhcp_res->get_row())\n {\n $l_dhcp_arr[$l_dhcp_key][] = [\n 'from' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_from']),\n 'to' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_to'])\n ];\n } // while\n } // foreach\n $l_net_row['dhcp_ranges'] = $l_dhcp_arr;\n }\n\n return $l_net_row;\n }", "public function getAvailableNetworks()\n {\n return $this->networks;\n }", "public function getAll()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand('/ip/hotspot/getall');\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return 'No IP Hotspot To Set, Please Your Add IP Hotspot';\n }\n }", "private function get_ipv4Nets()\n\t{\n\t\treturn $this->m_ipv4Nets;\n\t}", "public function show(NetworkIPSEC $networkIPSEC)\n {\n //\n }", "public function getModelIps(){\n\t\treturn $this->hasMany(Ip::className(), ['subnet' => 'id']);\n\t}", "function all_client_networks(){\n\t\t$user_id = $this->session->userdata('id');\t\n\t\t$role = $this->session->userdata('role');\n\t\tif($role == 'client'){\t\t\t\n\t\t\t$company_id = $this->InteractModal->get_user_meta($user_id, 'company_id');\n\t\t\t$network__list = $this->InteractModal->all_client_networks($company_id);\n\t\t\t$approve_network_list = $this->InteractModal->get_approve_netword_by_clint_id($user_id);\t\n\t\t $own_network__list = $this->InteractModal->all_client_own_networks($user_id);\t\t\n\t\t\t/*=====all network merge=====*/\n\t\t\tif(!empty($approve_network_list) && !empty($network__list)){\n\t\t\t $all_user_list=array_merge($network__list,$approve_network_list,$own_network__list);\t\t\t\t \n\t\t\t\t}elseif(!empty($own_network__list) && !empty($network__list)){\n\t\t\t\t\t$all_user_list=array_merge($network__list,$own_network__list);\n\t\t\t\t}else{\n\t\t\t\t\t$all_user_list=$own_network__list;\t\t\t\t\t \n\t\t\t\t}\n\t\t\t$uniqueArray = array();\n\t\t\tif(!empty($all_user_list)):\n\t\t\t foreach($all_user_list as $subArray){\n\t\t\t\tif(!in_array($subArray, $uniqueArray)){\n\t\t\t\t $uniqueArray[] = $subArray;\n\t\t\t\t}\n\t\t\t }\n\t\t\t\t$pagedata['network__list'] = $uniqueArray;\n\t\t\t else:\n\t\t\t\t$pagedata['network__list'] = $network__list;\n\t\t\tendif; \n\t\t\t/*=====all network merge=====*/\n\t\t\t$all_listing_as_buyer = $this->InteractModal->get_all_listing_buyer_seller( $user_id, 'for_buy' );\n\t\t\t$all_listing_as_seller = $this->InteractModal->get_all_listing_buyer_seller( $user_id, 'for_sale' );\n\t\t\t$footer_data['all_listing_as_buyer'] = $all_listing_as_buyer;\n\t\t\t$footer_data['all_listing_as_seller'] = $all_listing_as_seller;\n\t\t\t$footer_data['user__id'] = $user_id;\n\t\t\t$this->load->view('client/header');\n\t\t\t$this->load->view('client/client_all_network', $pagedata );\n\t\t\t$this->load->view('client/footer',$footer_data); \n\t\t\t}else{\n\t\t\t\tredirect( base_url() );\n\t\t\t} \n\t}", "public function get_all_hotspot(){\n return $this->query('/ip/hotspot/getall');\n }", "public function calcularTodas() {\n $padres = InventarioIp::where('Netmask', '=', 18)->select('IpAddress', 'Netmask', 'RangeId')->get();\n foreach ($padres as $padre) {\n $this->calcularIpArriba($padre->IpAddress, $padre->Netmask, $padre->RangeId);\n echo $padre->IpAddress . \"/\" . $padre->Netmask . \"<br>\";\n }\n }", "public function beLoginLinkIPList() {}", "public function show_all_computers(){\r\n\t\t$result = $this->c->show_all_computers();\r\n\t\techo json_encode($result);\r\n\t}", "public function getOurNetwork()\n {\n $data = HomeController::getPage('our-network');\n return view('our_network')->with(['data' => $data]);\n }", "function get_networks( $args = array() ) {\n\t$query = new WP_Network_Query();\n\n\treturn $query->query( $args );\n}", "function getIps() {\n\t\treturn $this->findParentsOfClass('Ip');\n\t}", "function get_all_ip()\r\n{ \r\n global $db,$strings;\r\n $count = 0;\r\n $result = $db->query('SELECT ip_id,ipaddr FROM ipmap ORDER BY ipaddr ASC');\r\n\r\n while (@extract($db->fetch_array($result), EXTR_PREFIX_ALL, 'db')) {\r\n \t$iplist[$db_ip_id] = $db_ipaddr;\r\n\t\t$count ++;\r\n }\r\n\r\n\t$iplist[-1] = $strings[IPMAP_NOTASSIGNED];\r\n \r\n return $iplist;\r\n}", "public function adnetworkDetailsTable() {\n $qb = $this->getEntityManager()->createQueryBuilder();\n $qb\n -> select('ad.partner_name as NetworkName,\n tt.trafficTypeName as TrafficType,\n ad.geo as Geo,\n ad.size as Size,\n tr.tireName as Tire')\n -> from('AppBundle:PartnerDetails', 'ad')\n -> join('ad.trafficType', 'tt')\n -> join('ad.tire', 'tr')\n -> where('ad.partnerType = 2')\n ;\n $result = $qb ->getQuery() ->getResult();\n return $result;\n\n }", "public function index()\n {\n $ips = Blockip::all();\n\n $data = [\n 'ips' => $ips\n ];\n\n return view('ip.index', $data);\n }", "public function show($ip_id)\n {\n $ips = implementing_partner::find($ip_id);\n $facilities = Facility::where('ip_id', $ip_id)->groupBy('facilitylevel_id')->get();//get all facilities supported by IP\n\n //return all facilities supported by an IP\n $healthFacilities = DB::table('health_facility')->select('health_facility.healthfacility_id',\n 'health_facility.name as facilityName', 'health_facility.code', 'facility_level.name as levelName',\n 'subcounty.name as subcountyName','health_facility.facilitylevel_id', 'district.name as districtName',\n 'district.district_id as didtrictId')\n ->join('facility_level', 'facility_level.facilitylevel_id', '=', 'health_facility.facilitylevel_id')\n ->join('subcounty', 'subcounty.subcounty_id', '=', 'health_facility.subcounty_id')\n ->join('district','district.district_id','=','subcounty.district_id')\n ->where(['health_facility.ip_id' => $ip_id])\n// ->groupBy('health_facility.facilitylevel_id')\n ->get();\n $totalFacilities = count($healthFacilities); //Count of all facilities supported by IP\n\n //Count number of Facility Levels Suppoted by one IP\n $noFacilityLevel = DB::table('health_facility')\n ->select(DB::raw('count(*) as facilityLevel_count, facilitylevel_id'))\n ->where('health_facility.ip_id', '=', $ip_id)\n ->groupBy('health_facility.facilitylevel_id')\n ->get();\n //Count the Number of District supported by an IP\n $noDistricts = DB::table('district')\n ->select(DB::raw('count(*) as district_count', 'district_id'))\n ->join('subcounty','subcounty.district_id', '=', 'district.district_id')\n ->join('health_facility', 'subcounty.subcounty_id', '=', 'health_facility.subcounty_id' )\n ->where('health_facility.ip_id', '=', $ip_id)\n ->groupBy('district.district_id')\n ->get();\n $totalDistrict =count($noDistricts);\n\n //Show base allocation for IP on IP dashboard URL baseURL/ips/ip_id\n foreach ($facilities as $facility) {\n //return Base allocation for an IP\n $facilityLevelId = $facility['facilitylevel_id'];\n $facilityID = $facility['healthfacility_id'];\n $allocation[] = DB::table('allocation')->distinct()->select('allocation.date_allocated', 'allocation.tool_id as toolId',\n 'allocation.health_facility_level_id as levelId', 'allocation.quantity', 'allocation.allocated_by',\n 'tools.name as toolName', 'packaging.package_name as packageName', 'packaging.quantity as packageQuantity',\n 'facility_level.name as facilityLevel', 'health_facility.name as facilityName')\n ->join('health_facility','health_facility.facilitylevel_id','=','allocation.health_facility_level_id')\n ->join('tools', 'tools.tools_id', '=', 'allocation.tool_id')\n ->join('packaging', 'packaging.package_id', '=', 'tools.package_id')\n ->join('facility_level', 'facility_level.facilitylevel_id', '=', 'allocation.health_facility_level_id')\n ->where(['allocation.health_facility_level_id' => $facilityLevelId, 'health_facility.healthfacility_id'=>$facilityID] )\n// ->groupBy('allocation.health_facility_level_id')\n ->get();\n }\n\n $array = array();\n $index = 0;\n if(!empty($allocation)) {\n for ($index = 0; $index < count($allocation); $index++) {\n foreach ($allocation[$index] as $alloc_obj) {\n array_push($array, get_object_vars($alloc_obj));\n }\n }\n }\n else{\n $array = array();\n }\n\n// print_r($array);\n// $ids = array();\n $allocated_id = array();\n $all_allocation = array();\n foreach ($array as $tool_allocated){\n if(in_array($tool_allocated['toolId'].\"|\".$tool_allocated['toolName'].\"|\".$tool_allocated['packageQuantity'].\"|\".$tool_allocated['packageName'], $allocated_id)){\n $total_allocated = $all_allocation[$tool_allocated['toolId'].\"|\".$tool_allocated['toolName'].\"|\".$tool_allocated['packageQuantity'].\"|\".$tool_allocated['packageName']]+ $tool_allocated['quantity'];\n $all_allocation[$tool_allocated['toolId'].\"|\".$tool_allocated['toolName'].\"|\".$tool_allocated['packageQuantity'].\"|\".$tool_allocated['packageName']] = $total_allocated;\n }else{\n $all_allocation[$tool_allocated['toolId'].\"|\".$tool_allocated['toolName'].\"|\".$tool_allocated['packageQuantity'].\"|\".$tool_allocated['packageName']] = $tool_allocated['quantity'];\n array_push($allocated_id, $tool_allocated['toolId'].\"|\".$tool_allocated['toolName'].\"|\".$tool_allocated['packageQuantity'].\"|\".$tool_allocated['packageName']);\n }\n }\n\n\n// print_r($all_allocation);\n// $grouped = $allocation->groupBy('toolId');\n// print_r($grouped);\n\n //$end = $grouped->toArray();\n //print_r($grouped);\n\n// $temp = [];\n//\n// foreach ($healthFacilities as $k => $v) {\n// foreach ($v as $kk => $kv) {\n// $temp[$kv->levelName][] = $kv->facilityName;\n// }\n// }\n// //print_r($ip_facilities);\n//\n// print_r(count($temp['HCIII']));\n\n\n return view('layouts.ip_dashboard.ipdashboard',\n compact('ips', 'facilities', 'totalFacilities', 'allocation',\n 'healthFacilities', 'noFacilityLevel', 'array', 'all_allocation',\n 'totalDistrict'\n ));\n }", "public function showAllAction( Request $request)\n { $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('GererEntrepotBundle:Entrepot')->findAll();\n\n\n return $this->render('@GererEntrepot/admin/index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n\n }", "public function ip()\n {\n \n try {\n $ip_arr = Yaml::parseFile($this->config['ip_config_path']);\n } catch (\\Exception $e) {\n // Do something\n $ip_arr = [];\n }\n\n $out = [];\n\n // Compile SQL\n $cnt = 0;\n $sel_arr = array('COUNT(1) as count');\n foreach ($ip_arr as $key => $value) {\n if (is_scalar($value)) {\n $value = array($value);\n }\n $when_str = '';\n foreach ($value as $k => $v) {\n $when_str .= sprintf(\" WHEN remote_ip LIKE '%s%%' THEN 1\", $v);\n }\n $sel_arr[] = \"SUM(CASE $when_str ELSE 0 END) AS r{$cnt}\";\n $cnt++;\n }\n $sql = \"SELECT \" . implode(', ', $sel_arr) . \"\n\t\t\t\tFROM reportdata \"\n .get_machine_group_filter();\n\n $reportdata = Reportdata_model::selectRaw(implode(', ', $sel_arr))\n ->filter()\n ->first();\n // Create Out array\n if ($reportdata) {\n $cnt = $total = 0;\n foreach ($ip_arr as $key => $value) {\n $col = 'r' . $cnt++;\n\n $out[] = array('key' => $key, 'cnt' => intval($reportdata[$col]));\n\n $total += $reportdata[$col];\n }\n\n // Add Remaining IP's as other\n if ($reportdata['count'] - $total) {\n $out[] = array('key' => 'Other', 'cnt' => $reportdata['count'] - $total);\n }\n }\n\n $obj = new View();\n $obj->view('json', array('msg' => $out));\n }", "public function all()\n {\n $resources = $this->connection->get(\"/floating_ips\");\n return $this->load($resources, 'FloatingIP', 'floating_ips');\n }", "public function actionGetnearbycountry(){\t\t\n\t\t$ip = $this->get_client_ip();\n\t\tif($ip){\n\t\t\t$countries = Countries::model()->get_current_nearbycountries($ip);\n\t\t}\n\t\techo $countries;\n\t\tYii::app()->end();\t\t\n\t}", "public function index()\n\t{\n\t\t$networks = $this->network->all();\n\n\t\treturn View::make('networks.index', compact('networks'));\n\t}", "public function getNodes();", "public function getNetworkTags()\n {\n return $this->network_tags;\n }", "public function index()\n {\n $networks = Network::all();\n\n// return $clients;\n return view('IT.index', compact('networks'));\n }", "function _tsuiseki_tracking_get_network_names() {\n return array(\n 'site',\n );\n}", "public function index(Request $request)\n {\n if ($request->has('filter')) {\n $white_listed_ips = WhiteListedIp::has('user')\n ->with(['user' => function($query) use ($request) {\n $role = User::ROLE_CLIENT;\n if ($request->filter == 'admin')\n $role = User::ROLE_ADMIN;\n\n $query->where('role', $role);\n }])->get();\n } else {\n $white_listed_ips = WhiteListedIp::all();\n }\n\n return WhiteListedIpResource::collection($white_listed_ips);\n }", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "public function actionIndex()\n {\n $searchModel = new NetworkElementSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $downloadProvider = $searchModel->search(Yii::$app->request->queryParams);\n $downloadProvider->setPagination(false);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'downloadProvider' => $downloadProvider,\n ]);\n }", "public function listpoboxAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\n $name = $request->query->get('city_name');\n $len = strlen($name);\n\n $em = $this->getDoctrine()->getManager();\n $rs = $em->getRepository('NvCargaBundle:Tariff')->createQueryBuilder('t')\n ->select('DISTINCT r.id')\n ->leftjoin('t.region', 'r')\n ->where('r.id = t.region')\n ->getQuery()\n ->getResult();\n\n // $regions = $em->getRepository('NvCargaBundle:Region')->findBy(array('id' => $rs));\n\n \n $regions = $em->getRepository('NvCargaBundle:Region')->createQueryBuilder('r')\n ->where('r.id IN (:ids)')\n ->setParameter('ids',$rs)\n ->getQuery()\n ->getResult();\n\n $entities = array();\n foreach ($regions as $region) {\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($region->getName())); \n $cities = $region->getRegionCities();\n foreach ($cities as $city) {\n if ((!in_array($city, $entities)) && (strncasecmp($city->getName(), $name, $len) == 0) && ($city->getActive())){\n $entities[] = $city;\n }\n }\n }\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->createQueryBuilder('c')\n ->select('c')\n ->where('c.state IN (:ids)')\n ->setParameter('ids',$states)\n ->getQuery()\n ->getResult();\n\n */\n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n $result[$counter]['cityid'] = $entity->getId();\n $result[$counter]['cityname'] = $entity->getName();\n $result[$counter]['state'] = $entity->getState()->getName();\n $result[$counter]['country'] = $entity->getState()->getCountry()->getName();\n $counter++;\n }\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($result));\n return new JsonResponse($result); \n }", "function getNodes() {\n $sql = \"SELECT * FROM nodes WHERE status='public' ORDER BY name\";\n try {\n $db = getConnection();\n $stmt = $db->query($sql);\n $nodes = $stmt->fetchAll(PDO::FETCH_OBJ);\n $db = null;\n echo '{\"Nodes\": ' . json_encode($nodes) . '}';\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":\"'. $e->getMessage() .'\"}}';\n }\n}", "public function showAll() {\n $qry = $this->db->prepare('SELECT DISTINCT NAME,ADDRESS,SUBURB,LATITUDE,LONGITUDE FROM n8598177.items;');\n $qry->execute();\n foreach ($qry as $hotspot) {\n include('server/includes/recentReview.tpl.php');\n }\n }", "function ccdev_hosting_list_entities() {\n module_load_include('inc','ccHosting','includes/entity_load');\n module_load_include('inc','ccHosting','includes/lib');\n global $user;\n\n ctools_include('modal');\n ctools_modal_add_js();\n\n $content = array();\n $rows = array();\n\n $header = array(\n 'site_name' => array(\n 'data' => t('Site Name'),\n 'type' => 'property',\n 'specifier' => 'site_name',\n 'field' => 'site_name'\n ),\n 'site_description' => array(\n 'data' => t('Description'),\n 'type' => 'property',\n 'specifier' => 'total_balance',\n 'field' => 'total_balance'\n ),\n 'site_domain' => array(\n 'data' => t('Domain'),\n 'type' => 'property',\n 'specifier' => 'site_domain',\n 'field' => 'site_domain'\n ),\n 'site_cms' => array(\n 'data' => t('CMS'),\n 'type' => 'property',\n 'specifier' => 'site_cms',\n 'field' => 'site_cms'\n ),\n );\n\n\n $entities = ccdev_hosting_load_multiple(FALSE, array(), FALSE, $header);\n if (!empty($entities)) {\n foreach ($entities as $entity) {\n\tif($user->uid == $entity->user_id || user_access('administer ccdev_hosting entities')) {\n\t // Create tabular rows for our entities.\n\t $rows[] = array(\n\t\t'data' => array(\n\t\t'site_name' => l($entity->site_name, 'ccMods/ccHosting/basic/' . $entity->site_name),\n\t\t'site_description' => $entity->site_description,\n\t\t'site_domain' => $entity->site_domain,\n\t\t'site_cms' => $entity->site_cms,\n\t\t'manage' => _ccHosting_make_link(array('site_id' => $entity->basic_id,'title' => 'Manage')),\n\t\t),\n\t );\n\t}\n }\n\n // Put our entities into a themed table. See theme_table() for details.\n $content['entity_table'] = array(\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n '#attributes' => array(\n 'id' => 'sort-table')\n );\n\n //Add pagination to table\n $content['pager'] = array(\n '#theme' => 'pager');\n\n }\n else {\n // There were no entities. Tell the user.\n $content[] = array(\n '#type' => 'item',\n '#markup' => t('No ccdev_hosting entities currently exist.'),\n );\n }\n return $content;\n}", "function _get_nodes($bundle, array $options = array()){\n // Get all nodes related by region\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', $bundle)\n ->propertyCondition('status', NODE_PUBLISHED);\n \n //->fieldOrderBy('field_photo', 'fid', 'DESC')\n if (isset($options['ref_nid'])){\n $query->fieldCondition('field_ref_brand', 'target_id', $options['ref_nid']);\n }\n $query->addMetaData('account', user_load(1)); // Run the query as user 1.\n $query->execute();\n\n if (isset($query->ordered_results)){\n $nodes = $query->ordered_results;\n $nodes_id = array();\n foreach ( $nodes as $node ) {\n array_push ($nodes_id, $node->entity_id );\n }\n $nodes = node_load_multiple($nodes_id);\n } else {\n $nodes = false;\n }\n return $nodes;\n}", "public function listAddressGroupings();", "public function listaddressgroupings(){\n return $this->bitcoin->listaddressgroupings();\n }", "public static function network() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n //whether ip is from proxy\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n //whether ip is from remote address\n } else {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n\n //check to see if the dedicated network is used\n if ($ip_address == \"127.0.0.1\") {\n return view('login');\n } else {\n return view('restricted_access');\n }\n }", "public function getIps()\n {\n return $this->ips;\n }", "public static function getOcrIps ()\n {\n $ec2 = Aws::factory(array(\n 'key' => Config::get('aws::config.key'),\n 'secret' => Config::get('aws::config.secret'),\n 'region' => $_ENV['AWS_VPC_REGION']\n ))->get('ec2');\n\n $res = $ec2->describeInstances(array(\n 'Filters' => array(\n array('Name' => 'subnet-id', 'Values' => array($_ENV['AWS_OCR_SUBNET_ID'])),\n array('Name' => 'instance-state-name', 'Values' => array('running')),\n )\n ));\n\n $ipList = array();\n foreach ($res['Reservations'] as $row) {\n $ipList[] = $row['Instances'][0]['PrivateIpAddress'];\n }\n\n return $ipList;\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MccASMemberBundle:Ip')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Ip entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MccASMemberBundle:Ip:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),));\n }", "public function getSocialNetworkInfo() {\n $retVal = array();\n// $retVal[] = \"Điện thoại: \" . $this->getPhone();\n if (isset($this->rSocialNetwork)) {\n foreach ($this->rSocialNetwork as $value) {\n $retVal[] = SocialNetworks::TYPE_NETWORKS[$value->type_network] . \": $value->value\";\n }\n }\n return implode('<br>', $retVal);\n }", "function GetAll($limit, $offset) {\r\n\t\treturn $this->db->get('Account.dbo.cabal_blockip_list', $limit, $offset);\r\n\t}", "protected function findLayerNodes() {\n\t\treturn $this->selectMany(array('sos:Contents', 'sos:ObservationOfferingList', 'sos:ObservationOffering'), null, false);\n\t}", "protected function displayEntities()\n {\n $enities = $this->_proxyObject->getEntities();\n echo \"<br><br><table align=\\\"center\\\" style=\\\"font-family: Calibri; \"\n . \"width: 95%\\\">\";\n echo \"<tr><td align=\\\"center\\\" style=\\\"font-family: Calibri; \"\n . \"background-color: #97CC00\\\">Entities</td></tr>\";\n foreach ($enities as $entity)\n {\n echo \"<tr ><td style=\\\"font-family: Calibri; \"\n . \"background-color: #99CCFF\\\" border=\\\"1\\\">\";\n echo \"<a href=\\\"\" . $this->_containerScriptName . \"?query=\"\n . $entity\n . '&pagingAllowed=true'\n . \"&serviceUri=\"\n . $this->_uri\n . \"\\\">\"\n . $entity . \"</a>\";\n echo \"</td></tr>\";\n }\n echo \"</table><br><br>\";\n }", "public function actionAddressListAll() \r\n {\r\n return $this->listing(0, true, Yii::$app->request->get('area_id'));\r\n }", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "function listNetworkAdd($searchadd){\n #sends the deconstructed IP to the networkAdd function\n\n\t\t$iplist = explode(\".\", $searchadd);\n\n\t\t$networkList = [];\n\n\t\tfor($i = 8; $i < 33; $i++){\n\t\t\t$ipvar = explode(\".\", $searchadd);\n\t\t\t$temp = networkAdd($ipvar, $i);\n\t\t\t$networkList[] = $temp;\n\t\t}\n\n\t\t#echo\"All network addresses</br>\";\n\n\t\treturn $networkList;\n\t}", "public function getHtmlNetwork() {\n $ntworks = array(\n \n 'facebook',\n 'twitter',\n 'linkedin',\n 'pinterest',\n 'youtube',\n 'google',\n 'myspace',\n \n );\n \n $networks = array();\n \n foreach($ntworks as $name) {\n \n if (\n array_key_exists($name,$this->configWeb)\n && !empty($this->configWeb[$name])\n ) {\n $networks[$this->getUrl($name)] = $this->getImageSkin($name);\n }\n \n }\n \n $tplNetworks = Template::getWebsiteView('widgets/networks',$this->getTheme());\n ob_start(); if (is_file($tplNetworks)) { include $tplNetworks; } $out = ob_get_clean();\n \n return $out;\n \n }", "public function all()\n {\n $cacheTime = $this->config()->get('ip_list_cache_expire_time');\n\n if ($cacheTime > 0 && $list = $this->cache()->get(static::IP_ADDRESS_LIST_CACHE_NAME)) {\n return $list;\n }\n\n $list = $this->mergeLists(\n $this->getAllFromDatabase(),\n $this->toModels($this->getNonDatabaseIps())\n );\n\n if ($cacheTime > 0) {\n $this->cache()->put(static::IP_ADDRESS_LIST_CACHE_NAME, $list, $cacheTime);\n }\n\n return $list;\n }", "public function actionShowAvailableOperators(): void\n {\n $operators = Operator::find()->onlyAvailable()->all();\n $table = new Table(new ConsoleOutput());\n\n $table->setHeaders(['name', 'status']);\n foreach ($operators as $operator) {\n $table->addRow(['name' => $operator->name, 'status' => $operator->status]);\n }\n\n $table->render();\n }", "static function searchNetworksContainingIP($IP, $entityID = -1, $recursive = true,\n $fields = \"\", $where = \"\") {\n\n return self::searchNetworks('contains', ['address' => $IP,\n 'netmask' => [0xffffffff, 0xffffffff,\n 0xffffffff, 0xffffffff],\n 'fields' => $fields,\n 'where' => $where],\n $entityID, $recursive);\n }", "function getApnList()\n {\n \t$activeApn = $this->getApn();\t//get the current apn being used by the device\n \tdebug('(cell_controller.inc|getApnList()) current apn being used on the device'.$activeApn); \t\t\t\t//DEBUG\n \t\n \t$sh_args = 'getapnlist';\t\t//admin client command for getting secondary apn list\n \t$sh_out = atsexec(escapeshellcmd($sh_args));\t//socket call\n \tdebug('(cell_controller.inc|getApnList()) admin client api command getapnlist output: sh_out', $sh_out); \t//DEBUG\n \t\n \tif(($sh_out != 'phpcmd: fail') && ($sh_out != 'phpcmd: invalid command'))\n \t{\n \t\t$xml = new SimpleXMLElement($sh_out);\t//create SimpleXML object\n\t \t$html =''; \t\t\t\t\t\t\t\t\t//store the html markup\n\t \tdebug('(cell_controller.inc|getApnList()) apn list converted into SimpleXMLElement object '.$xml); \t\t//DEBUG\n\t \t\n\t \tforeach($xml->network as $network)\t\t\t\n\t \t{\n\t \t\t$html .= '<optgroup label=\"'.$network->attributes()->name.'\">';\t \t\t//create Carrier section\n\t \t\tforeach ($network->apn as $apn)\t\t\t\t\t\t\t\t\t\t\t//group apns under each Carrier\n\t \t\t{\n\t \t\t\tdebug('(cell_controller.inc|getApnList()) $apn '.$apn); \t\t//DEBUG\n\t \t\t\t$html .= '<option '.((strcasecmp($apn,$activeApn) == 0) ? 'selected=\"selected\"':'').' value=\"'.$apn.'\">'.$apn.'</option>';\n\t \t\t}\n\t \t\t$html .= '</optgroup>';\n\t \t}\n\n\t \treturn $html;\n \t}\n \telse\n \t{\n \t\treturn '<option value=\"\">Failed to retrieve APN list</option>';\n \t}\n }", "public function getAvailableSites();", "public function listVisuels()\n {\n $result = DB::table('panneauxes')\n ->join('clients', 'clients.code', '=', 'panneauxes.idclient')\n ->join('campagnes', 'campagnes.code', '=', 'panneauxes.idcampagne')\n ->join('coms', 'coms.id', '=', 'panneauxes.idcommune')\n ->join('regies', 'regies.code', '=', 'panneauxes.idregie')\n ->select(\n 'panneauxes.idPanneaux as id',\n 'panneauxes.emplacement as emplacement',\n 'panneauxes.partdevoix as partdevoix',\n 'panneauxes.latittude as latitude',\n 'panneauxes.longitude',\n 'panneauxes.image',\n 'clients.Raison_Soc as client',\n 'campagnes.libelle as campagne',\n 'coms.name as commune',\n 'regies.Raison_Soc as regie'\n )\n ->get();\n return $result;\n }", "public function GetNetworks()\n {\n return $this->networkManager;\n }", "public function listallAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\t\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $entities = $em->getRepository('NvCargaBundle:Customer')->findBy(['maincompany'=>$maincompany,'active'=>true]);\n \n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n foreach ($entity->getBaddress() as $dir ) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n// foreach ($entities as $entity) {\n// $result[$counter]['customerid'] = $entity->getId();\n// $result[$counter]['name'] = $entity->getName();\n// $result[$counter]['lastname'] = $entity->getLastname();\n// if ($entity->getPobox()) {\n// $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n// } else {\n// $result[$counter]['pobox'] = '';\n// }\n// $result[$counter]['email'] = $entity->getEmail();\n// \n// $result[$counter]['docid'] = $entity->getAdrdefault()->getDocid();\n// $result[$counter]['address'] = $entity->getAdrdefault()->getAddress();\n// $city = $entity->getAdrdefault()->getCity();\n// $result[$counter]['cityid'] = $city->getId();\n// $result[$counter]['cityname'] = $city->getName();\n// $result[$counter]['state'] = $city->getState()->getName();\n// $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n// $result[$counter]['phone'] = $entity->getAdrdefault()->getPhone();\n// $result[$counter]['mobile'] = $entity->getAdrdefault()->getMobile();\n// \n// $result[$counter]['barrio'] = $entity->getAdrdefault()->getBarrio();\n// $result[$counter]['zip'] = $entity->getAdrdefault()->getZip();\n// $result[$counter]['type'] = $entity->getType()->getName();\n// $counter++;\n// }\n return new JsonResponse($result); \n }", "public static function graphInterfaces(){\n $devices = Device::where('devicetype_id',\"1\")->get();\n $themikrotiklibrary = new MikrotikLibrary();\n $themikrotiklibrary->graphAllInterfaces($devices);\n }", "public function get_global_ipv4_net()\n {\n $l_sql = 'SELECT * FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV4\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "public function ip(){\n return $this->hasMany(Ip::class);\n }", "public function allAnnonce(){\n $annonces=$this->repAnnonce->findBy(['disponibilite' =>'1']);\n return $annonces;\n }", "public function index()\n {\n return view('admin.internet.index', [\n 'data'=>Product::where('type', ProductType::$INTERNET)->get(),\n ]);\n }", "public function getWithNetworks(Doctrine_Query $q = null)\n {\n\t if (is_null($q))\n\t {\n\t $q = Doctrine_Query::create()\n ->from('AdvertNetwork an');\n\t }\t \n\t \n $q->leftJoin('an.Network n');\n \n return $q;\n\t \n }", "public function get_all_ip_binding(){\n return $this->query('/ip/hotspot/ip-binding/getall');\n }", "public function getNetwork() {\n return $this->getValue('network');\n }", "private function _network()\n {\n if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {\n $lines = preg_split(\"/\\n/\", $netstat, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($lines as $line) {\n $ar_buf = preg_split(\"/\\s+/\", $line);\n if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) {\n $dev = new NetDevice();\n $dev->setName($ar_buf[0]);\n $dev->setRxBytes($ar_buf[4]);\n $dev->setTxBytes($ar_buf[6]);\n $dev->setErrors($ar_buf[5] + $ar_buf[7]);\n //$dev->setDrops($ar_buf[8]);\n $this->sys->setNetDevices($dev);\n }\n }\n }\n }", "public function ips(){\n return $this->hasMany('App\\Models\\Organization', 'id', 'supportagencyid');\n }", "function viewElements($entity_type, $entity, $field, $instance, $langcode, $items, $display);", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public function hasNetworks() {\n return $this->_has(1);\n }", "public function hasNetworks() {\n return $this->_has(4);\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n */\n $listall = $this->getUser()->getMaincompany()->getCountries();\n $countries = array();\n $count = 0;\n foreach ($listall as $country) {\n $countries[$count]['id'] = $country->getId();\n $countries[$count]['name'] = $country->getName();\n $count++;\n }\n return $this->render('NvCargaBundle:City:index.html.twig',array('countries' => $countries)); \n\n }", "public function get_networks( $user_id, $type, $start, $limit, $key = NULL ) {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(array(\n 'user_id' => $user_id,\n 'type' => $type\n ));\n \n // If $key exists means will displayed ad accounts by search\n if ( $key ) {\n \n // This method allows to escape special characters for LIKE conditions\n $key = $this->db->escape_like_str($key);\n \n // Gets ad accounts which contains the $key\n $this->db->like('user_name', $key);\n \n }\n \n $this->db->order_by('network_id', 'desc');\n \n // Verify if $limit is not null\n if ( $limit ) {\n $this->db->limit($limit, $start);\n }\n \n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n \n // Verify if $limit is not null\n if ( $limit ) {\n \n // Get results\n $results = $query->result();\n\n return $results;\n \n } else {\n return $query->num_rows();\n }\n \n } else {\n \n return false;\n \n }\n \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'>&nbsp;</td></tr> \";\n }\n echo \"</table></div>\";\n }", "public function hasNetworks() {\n return $this->_has(5);\n }", "public static function validIpDataProvider() {}", "public function getVisibleInSiteVisibilities()\n {\n return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();\n }", "function findNet($ip,$sm) {\n\n $res = \"\";\n\n // divido gli ottetti\n $exip = explode('.',$ip);\n $exsm = explode('.',$sm);\n\n for($i=0; $i<4; $i++) {\n\n $subip=$exip[$i]; // ottetto del IP\n $subsm=$exsm[$i]; // ottetto della SM\n\n for($k=0; $k<8; $k++) {\n \n if($subip[$k] & $subsm[$k]) {\n $res.=\"1\";\n }\n else {\n $res.=\"0\";\n }\n }\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $res.=\".\";\n }\n \n }\n\n return $res;\n}", "public function index(GetNetworkRequest $request, Server $server): array\n {\n return $this->fractal->collection($server->allocations)\n ->transformWith($this->getTransformer(AllocationTransformer::class))\n ->toArray();\n }", "public function map_indoor()\n {\n $networks = Network::all();\n\n return view('IT.map_indoor', compact('networks'));\n }", "public function getNiveles(){\n\t\t//Se debe realizar conexion en BD. Ver propiedad de config/Autoload.php para eliminar\n\t\t//esta instruccion de carga de los controladores y modelos.\n\t\t$this->load->database();\n\t\t$this->load->model(\"Criticidad\");\n\t\t$listaNiveles = $this->Criticidad->obtenerNivelesDeCriticidad();\n\t\tforeach ($listaNiveles as $row){\n\t\t\t$nivel = array('id'=>$row[\"id\"],'nombre' => $row[\"nombre\"], 'descripcion'=>$row[\"descripcion\"]);\n\t\t\techo json_encode($nivel);\n\t\t\techo \"/\";\n\t\t}\n\t}", "public function getIpInfo()\n {\n $this->checkAjaxToken();\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('Ztools::', '::', ACCESS_OVERVIEW));\n\n $ip_adr = $this->request->request->get('ip_adr', '');\n $alert = '';\n $content = '';\n \n if (!$ip_adr) {\n $alert .= $this->__('No IP passed.');\n } else {\n ob_start();\n $serviceName = 'ipinfo.io';\n $serviceLinks = 'http://ipinfo.io/' . $ip_adr; // to pass to tpl for visiting site\n @readfile('http://ipinfo.io/' . $ip_adr . '/json');\n $json = ob_get_contents();\n ob_end_clean();\n if ($json) {\n try {\n $item = json_decode($json, true);\n if (false) {\n ob_start();\n pr($item);\n $content .= ob_get_contents();\n ob_end_clean();\n } else {\n if (is_array($item)) {\n // Standardize output\n $item_s = array();\n $item_s['ip'] = isset($item['ip']) ? $item['ip'] : '';\n $item_s['hostname'] = isset($item['hostname']) ? $item['hostname'] : '';\n $item_s['city'] = isset($item['city']) ? $item['city'] : '';\n $item_s['region'] = isset($item['region']) ? $item['region'] : '';\n $item_s['country_code'] = isset($item['country']) ? $item['country'] : '';\n $item_s['country_name'] = (isset($item['country']) && $item['country']) ? ZLanguage::getCountryName($item['country']) : '';\n $item_s['latitude'] = '';\n $item_s['longitude'] = '';\n if (isset($item['loc']) && $item['loc']) {\n $aLatLong = explode(',', $item['loc']);\n if (is_array($aLatLong)) {\n $item_s['latitude'] = $aLatLong[0];\n $item_s['longitude'] = $aLatLong[1];\n }\n }\n $item_s['org'] = isset($item['org']) ? $item['org'] : '';\n // Generate output\n Zikula_AbstractController::configureView();\n $this->view->assign('item', $item_s);\n $this->view->assign('serviceName', $serviceName);\n $this->view->assign('serviceLinks', $serviceLinks);\n $content .= $this->view->fetch('admin/ipinfo.tpl');\n }\n }\n } catch (Exception $e) {\n $content .= $e->getMessage();\n } \n } else {\n $alert .= $this->__f('Could not get info.');\n }\n }\n\n return new Zikula_Response_Ajax(array('ip' => $ip_adr, 'content' => $content, 'alert' => $alert));\n }", "public function index(Request $request)\n {\n\n $data['item'] = DB::table('ip_list')->select('item')->distinct()->get();\n $data['currency'] = DB::table('ip_list')->select('currency')->distinct()->get();\n $data['system_type'] = DB::table('ip_list')->select('system_type')->distinct()->get();\n\n $categroy = $request->categroy;\n $item = $request->item;\n $currency = $request->currency;\n $system_type = $request->system_type;\n $ip = trim($request->ip);\n\n if(!is_null($categroy)){\n if($request->categroy == 'web服务器'){\n $categroy = 1;\n }else{\n $categroy = 0;\n }\n }\n\n\n $data['ip'] = IpList\n ::when(!is_null($categroy), function ($query) use ($categroy) {\n $query->where('categroy', $categroy);\n })\n ->when($item, function ($query) use ($item) {\n $query->where('item', $item);\n })\n ->when($currency, function ($query) use ($currency) {\n $query->where('currency', $currency);\n })\n -> when($system_type, function ($query) use ($system_type) {\n $query->where('system_type', $system_type);\n })\n -> when($ip, function ($query) use ($ip) {\n return $query->where('IP', 'like', '%'.$ip.'%')->orwhere('Intranet_ip', 'like', '%'.$ip.'%');\n })\n ->where('status',0)->select()->paginate(10);\n\n return view('home.home',$data);\n }", "public function getAllEntities();" ]
[ "0.613891", "0.6118857", "0.5933595", "0.5888416", "0.5865109", "0.5749755", "0.5653926", "0.56399393", "0.56361955", "0.56121606", "0.56051093", "0.5473263", "0.54387516", "0.53757596", "0.5371093", "0.53609663", "0.5321669", "0.5269923", "0.5226984", "0.52207553", "0.52057433", "0.52028596", "0.5176191", "0.51106465", "0.5085308", "0.50823915", "0.5069459", "0.5066032", "0.5064409", "0.5058785", "0.50562125", "0.5046247", "0.5039438", "0.5033269", "0.50329185", "0.5031507", "0.5016563", "0.4997843", "0.49913907", "0.49769232", "0.49676818", "0.49645534", "0.49580517", "0.49501693", "0.49499956", "0.49453574", "0.49408236", "0.48970634", "0.48936662", "0.48935372", "0.48933238", "0.48894495", "0.48795182", "0.48643872", "0.48528767", "0.48450938", "0.4833762", "0.4824606", "0.4808351", "0.48079044", "0.4807316", "0.47980496", "0.4795654", "0.47954148", "0.47855598", "0.47826022", "0.47803277", "0.4776337", "0.47737992", "0.47703278", "0.4757226", "0.4748437", "0.47408032", "0.47397313", "0.47392562", "0.47330514", "0.47288328", "0.47186542", "0.47179043", "0.47035828", "0.46972737", "0.46946383", "0.4683678", "0.46799925", "0.46797103", "0.46788818", "0.46772164", "0.4666631", "0.46609488", "0.4660929", "0.4651619", "0.46461287", "0.46444196", "0.46383485", "0.46336788", "0.4630525", "0.4628913", "0.46267515", "0.4625523", "0.46213663" ]
0.6689109
0
Override title function to display the link to reinitialisation of the network tree
function title() { parent::title(); if (Session::haveRight('internet', UPDATE) && Session::canViewAllEntities()) { echo "<div class='spaced' id='tabsbody'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><td class='center'>"; Html::showSimpleForm(IPNetwork::getFormURL(), 'reinit_network', __('Reinit the network topology')); echo "</td></tr>"; echo "</table>"; echo "</div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function link() {\n $this->title = \"link\";\n }", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n }", "public function _syncTitle() {}", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "protected function regeneratePageTitle() {}", "function setTitle($title) {\n\t\t$this->_title = $title;\n\t}", "public function restoration_title($title) {\n\t\techo '<h2>'.$title.'</h2>';\n\t}", "public function __construct($title=false)\n\t{\n\t\t$this->setTitle($title);\n\t}", "function od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "function setTitle($title)\r\n\t{\r\n\t\t$this->title = $title;\r\n\t}", "function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function __construct($title = null) {\n $this->setTitle($title);\n }", "function __construct($title = \"Default\") {\n\t\t$this->_title = $title;\n\t}", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "function setTitle($title)\n {\n $this->m_title = $title;\n }", "function title()\n {\n print($this->_title);\n }", "function _title()\n {\n return _(\"Menu\");\n }", "public function printTitle() {\n\t\techo $this->title;\n\t}", "function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function getTitle() {\n\t\treturn Translation::defaultGet('Premanager', 'editNodeTitle'); \n\t}", "function prepend_title($title){\r\n\t\t$this->_title = \"{$title} - {$this->_title}\";\r\n\t}", "public function __construct($title)\n {\n $this->_title = $title;\n $this->createMenuBar();\n }", "public function title();", "public function title();", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "private function SetTitleProcess() {\r\n $title = \"PhpMX client\";\r\n $title .= \" | PeerID: \" . substr(PoW::hash($this->ip . $this->port), 0, 18);\r\n if ($this->connected_to_bootstrap || $this->bootstrap_node)\r\n $title .= \" | BootstrapNode: Connected\";\r\n else\r\n $title .= \" | BootstrapNode: Disconnected\";\r\n $title .= \" | Peers: \" . count($this->chaindata->GetAllPeers());\r\n\r\n if ($this->syncing)\r\n $title .= \" | Blockchain: Synchronizing\";\r\n else\r\n $title .= \" | Blockchain: Synchronized\";\r\n\r\n if ($this->enable_mine)\r\n $title .= \" | Minning\";\r\n\r\n if ($this->isTestNet)\r\n $title .= \" | TESTNET\";\r\n else\r\n $title .= \" | MAINNET\";\r\n\r\n cli_set_process_title($title);\r\n }", "function setTitlelink($v) {\n\t\t$this->set(\"titlelink\",$v);\n\t}", "public function setTitle($title){\n \t$this->title = $title;\n }", "public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function setTitle($a_title)\n\t{\n\t\t$this->title = $a_title;\n\t}", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function init() {\n $this->title = get_string('blockname', 'block_graph_stats');\n }", "public function change_default_title($title) {\n\t\treturn '';\n\t}", "public static function title();", "public function setTitle($title)\r\n\t\t{\r\n\t\t\t$this->_title = $title;\r\n\t\t}", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "function set_the_title($title) {\n\n md_set_the_title($title);\n \n }", "public function get_page_title() {\n\t\t\treturn __( 'Relations', 'jet-engine' );\n\t\t}", "public function setTitle($title) {\r\n $this->title = $title;\r\n }", "public function getTitle()\n {\n return \"\"; // Should be updated by children classes\n }", "public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n $this->title = $title ;\n }", "public function set_title($title)\n {\n $this->title = $title;\n }", "public function getTabTitle() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "public function defaultNodeTitle()\n {\n return $this->defaultNodeTitle;\n }", "public function setTitle($title){\n $this->title = $title;\n }", "public function setTitle($title) {\n\t\t\n\t\t\t$this->_title = $title;\n\t\t\n\t\t}", "function init() {\n $this->title = get_string('block_synonymous', 'wiki').helpbutton ('synonymous', get_string('block_synonymous', 'wiki'), 'wiki', true, false, '', true);\n $this->version = 2004081200;\n }", "function initialize () {\n $this->set_openingtag ( \"<TITLE[attributes]>\" );\n\t $this->set_closingtag ( \"</TITLE>\" );\n }", "public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title){\n $this->title = $title;\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "public function actionTitles()\n\t{\n $this->setPageTitle(\"IVR Branch Titles\");\n $this->setGridDataUrl($this->url('task=get-ivr-branch-data&act=get-titles'));\n $this->display('ivr_branch_titles');\n\t}", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "public function titleCallback() {\r\n return [\r\n '#markup' => $this->t('The title of this page is dynamically changed by the title callback for this route defined in menu_example.routing.yml.'),\r\n ];\r\n }", "protected function initTitles() {\n\t\t$title \t = \"\";\n\t\t\n\t\tif(isset($this->config['titles']['title']))\n\t\t \t$title = $this->config['titles']['title'];\n\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['title']))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['title'];\n\t\t \t\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()]))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()];\n\t\t \t\n\t\t$this->layout->setTitle($title);\n\t}", "abstract protected function getTitle();", "public function beforeRender(){\n\t\t$title_for_layout = __('エネルギー効率評価システム | 一般社団法人 日本工業炉協会');\n\t\t$this->set('title_for_layout', $title_for_layout);\t\t\n\t}", "public function set_title($title){\n\t\t$this->set_channel_element('title', $title);\n\t}", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "private function renderTitle()\n\t{\n\t\treturn '<h1 class=\"block-new-title\">' . $this->title . '</h1>';\n\t}", "public function set_title($text){\n $this->title=$text;\n }", "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "function title()\n {\n // TRANS: Page title for revising a question\n return _m('Revise answer');\n }", "public function setTitle($title){\n $this->p_title = $title;\n }", "function setTitle() {\n global $pageTitle;\n\n $pageTitle = isset($pageTitle) ? $pageTitle : 'Default' ;\n echo $pageTitle;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }" ]
[ "0.66859394", "0.6351994", "0.62658876", "0.6089723", "0.6071411", "0.6055869", "0.6055869", "0.60291296", "0.6025733", "0.6005665", "0.597989", "0.5975042", "0.597472", "0.5958967", "0.5958177", "0.59494334", "0.59471", "0.5938044", "0.5934578", "0.59263206", "0.59172094", "0.59095", "0.5891204", "0.5890101", "0.58825296", "0.58736473", "0.5855673", "0.58548427", "0.58548194", "0.58548194", "0.5847529", "0.5847529", "0.5847529", "0.5832593", "0.5830499", "0.5828133", "0.58227664", "0.5815959", "0.5815959", "0.5815959", "0.5815959", "0.5815959", "0.5815959", "0.5815959", "0.58158886", "0.579751", "0.5791019", "0.57759935", "0.5768581", "0.57659405", "0.57563037", "0.5754739", "0.5741752", "0.5731126", "0.573077", "0.57285166", "0.5728466", "0.5725502", "0.5725502", "0.5725502", "0.5721363", "0.57187855", "0.5716803", "0.5713292", "0.57107264", "0.5700402", "0.5692166", "0.5685368", "0.56821483", "0.56781864", "0.5677887", "0.5675134", "0.56733346", "0.5669915", "0.5668575", "0.5668575", "0.56648725", "0.56648725", "0.5664066", "0.5660331", "0.5646984", "0.5641637", "0.56402665", "0.56378055", "0.56339866", "0.56339866", "0.56268084", "0.5620509", "0.56157875", "0.5613748", "0.5608838", "0.5606654", "0.5600357", "0.5596335", "0.55935824", "0.55935824", "0.55935824", "0.55935824", "0.55935824", "0.55935824" ]
0.6857853
0
Return an instance of an HTTP client all ready to post
public function __construct() { parent::__construct(); $this->httpClient = new Client([ 'base_uri' => config('app.url'), 'headers' => [ 'Authorization' => $this->apiKey, ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }", "protected function http()\n {\n return new Client;\n }", "protected function createHttpClient()\n {\n $stack = HandlerStack::create();\n\n $middleware = new Oauth1([\n 'consumer_key' => $this->consumerKey,\n 'consumer_secret' => $this->consumerSecret,\n 'token' => $this->token,\n 'token_secret' => $this->tokenSecret\n ]);\n\n $stack->push($middleware);\n\n $client = new HttpClient([\n 'handler' => $stack\n ]);\n\n return $this->setHttpClient($client);\n }", "protected function getHttp()\n\t{\n\t\treturn new \\Guzzle\\Http\\Client;\n\t}", "protected static function getHttpClient()\n\t{\n\t\tif (!isset(self::$client))\n\t\t{\n\t\t\tself::$client = Http::getClient();\n\t\t}\n\t\tself::$client->timeout = 10;\n\n\t\treturn self::$client;\n\t}", "protected function build() \n {\n $client = new Zend_Http_Client();\n $config = array('timeout' => 60);\n $client->setConfig($config);\n $client\n ->setUri($this->getEndpoint())\n ->setMethod($this->getMethod())\n ->setHeaders($this->getHeaders());\n\n return $client;\n }", "public function http()\n {\n if (!$this->http) {\n $this->http = new GuzzleClient([\n 'base_uri' => $this->baseUri(),\n ]);\n }\n\n return $this->http;\n }", "protected function build()\n {\n $client = parent::build();\n\n $client\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setParameterPost($this->getData());\n\n return $client;\n }", "protected function httpClient()\n {\n return new Client([\n 'base_uri' => $this->baseUri(),\n 'timeout' => 10.0,\n 'stream' => false,\n 'headers' => $this->defaultHeaders(),\n 'debug' => false,\n ]);\n }", "static private function setHTTPClient() {\n self::$handler = new \\GuzzleHttp\\Handler\\CurlMultiHandler();\n self::$http = new \\GuzzleHttp\\Client(array(\n 'handler' => \\GuzzleHttp\\HandlerStack::create(self::$handler)\n ));\n }", "protected function getHttpClient()\n {\n return new Client([\n 'timeout' => $this->timeout\n ]);\n }", "protected function constructHttpClient()\n {\n $hasHttpClient = (null !== $this->httpClient);\n $this->httpClient = new HttpClient($this->getOptions());\n if (! $hasHttpClient) {\n $this->httpClient->registerDefaults();\n }\n }", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "public function getHttpClient(): ClientInterface;", "public function getHttp()\n\t{\n\t\t$client = new \\Guzzle\\Http\\Client;\n\n\t\t$client->setSslVerification(false, false, false);\n\n\t\treturn $client;\n\t}", "public function getHttpClient();", "protected function createHttpClient(){\n \t\n\t\trequire_once(INSTALL_PATH.\"/server/classes/class.HttpClient.php\");\n\t\t$httpClient = new HttpClient($this->host);\n\t\t$httpClient->cookie_host = $this->host;\n\t\t$httpClient->timeout = 50;\n\t\tAJXP_Logger::debug(\"Creating Http client\", array());\n\t\t//$httpClient->setDebug(true);\n\t\tif(!$this->use_auth){\n\t\t\treturn $httpClient;\n\t\t}\n\t\t\n\t\t$uri = \"\";\n\t\tif($this->auth_path != \"\"){\n\t\t\t$httpClient->setAuthorization($this->user, $this->password);\t\t\t\n\t\t\t$uri = $this->auth_path;\n\t\t}\n\t\tif(!isSet($_SESSION[\"AJXP_REMOTE_SESSION\"])){\t\t\n\t\t\tif($uri == \"\"){\n\t\t\t\t// Retrieve a seed!\n\t\t\t\t$httpClient->get($this->path.\"?get_action=get_seed\");\n\t\t\t\t$seed = $httpClient->getContent();\n\t\t\t\t$user = $this->user;\n\t\t\t\t$pass = $this->password;\n\t\t\t\t$pass = md5(md5($pass).$seed);\n\t\t\t\t$uri = $this->path.\"?get_action=login&userid=\".$user.\"&password=\".$pass.\"&login_seed=$seed\";\n\t\t\t}\n\t\t\t$httpClient->setHeadersOnly(true);\n\t\t\t$httpClient->get($uri);\n\t\t\t$httpClient->setHeadersOnly(false);\n\t\t\t$cookies = $httpClient->getCookies();\t\t\n\t\t\tif(isSet($cookies[\"AjaXplorer\"])){\n\t\t\t\t$_SESSION[\"AJXP_REMOTE_SESSION\"] = $cookies[\"AjaXplorer\"];\n\t\t\t\t$remoteSessionId = $cookies[\"AjaXplorer\"];\n\t\t\t}\n\t\t}else{\n\t\t\t$remoteSessionId = $_SESSION[\"AJXP_REMOTE_SESSION\"];\n\t\t\t$httpClient->setCookies(array(\"AjaXplorer\"=>$remoteSessionId));\n\t\t}\n\t\tAJXP_Logger::debug(\"Http Client created\", array());\n\t\treturn $httpClient; \t\n }", "private function httpClient()\n {\n if (!self::$httpClient) {\n /**\n * @todo Replce CurlClient with new Guzzle client\n */\n self::$httpClient = GuzzleClient::instance();\n }\n return self::$httpClient;\n }", "abstract public function getHttpClient();", "final protected function getHttpClient(): Client\n {\n $this->httpClient = new Client([\n 'handler' => HandlerStack::create($this->getMockHandler()),\n ]);\n\n return $this->httpClient;\n }", "public function getClient()\n {\n if ($this->http === null) {\n $this->http = $this->initClient();\n }\n return $this->http;\n }", "protected function createClient($config)\n {\n return new HttpClient($config);\n }", "protected function getRequest(){\n $client = $this->client;\n if(!$client instanceof Client){\n $client = new Client();\n }\n return $client;\n }", "public function getHttpClient() {\n\t\tif(is_null($this->_httpClient)) {\n\t\t\trequire_once 'Zend/Http/Client.php';\n\t\t\t$this->_httpClient = new Zend_Http_Client();\n\t\t}\n\t\treturn $this->_httpClient;\n\t}", "protected function getHttpClient()\n {\n if (!is_null($this->httpClient)) {\n\n return $this->httpClient;\n }\n $stack = GuzzleHttp\\HandlerStack::create();\n if ($this->logger instanceof LoggerInterface) {\n $stack->push(GuzzleHttp\\Middleware::log(\n $this->logger,\n new GuzzleHttp\\MessageFormatter(GuzzleHttp\\MessageFormatter::DEBUG)\n ));\n }\n $this->httpClient = new GuzzleHttp\\Client([\n 'handler' => $stack,\n ]);\n\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->_httpClient;\n }", "public function getHttpClient()\n {\n return $this->_httpClient;\n }", "protected function getHttpClient()\n\t{\n\t\treturn $this->httpClient;\n\t}", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "public function getHttpClient()\n {\n return $this->httpClient;\n }", "private function getClient()\n {\n return new \\GuzzleHttp\\Client([\n 'base_uri' => $this->url,\n 'timeout' => 2.0,\n ]);\n }", "public static function create()\n {\n $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : 'text/html';\n return (new Request(\n $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'] ,\n $_REQUEST, $contentType\n ))->processBody();\n }", "public function getHttpClient(): Client\n {\n return $this->httpClient;\n }", "public static function getHttpClient() {\n\t\tif (!self::$_httpClient instanceof Zend_Http_Client_Abstract)\n\t\t{\n\t\t\tself::$_httpClient = new Zend_Http_Client();\n\t\t}\n\n\t\treturn self::$_httpClient;\n\t}", "protected function createCurlHandle()\n {\n $ch = curl_init();\n\n $bdurl = $this->request->getUrl();\n $config = $this->request->getConfig();\n\n \t$curl_opts = array(\n \t\t// request url\n \t\tCURLOPT_URL\t\t\t\t=> $this->requestUrl,\n \t\t// setup write callbacks\n \t\tCURLOPT_HEADERFUNCTION\t=> array($this, 'onWriteHeader'),\n \t\tCURLOPT_WRITEFUNCTION\t=> array($this, 'onWriteBody'),\n \t\t// buffer size\n \t\tCURLOPT_BUFFERSIZE\t\t=> $config['buffer_size'],\n \t\t// save full outgoing headers, in case someone is interested\n CURLINFO_HEADER_OUT\t\t=> true,\n CURLOPT_NOSIGNAL => 1,\n );\n\n // setup connection timeout\n\t\tif (defined('CURLOPT_CONNECTTIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT_MS] = $config['connect_timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT] = ceil($config['connect_timeout'] / 1000);\n\t\t}\n\n // setup request timeout\n\t\tif (defined('CURLOPT_TIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT_MS] = $config['timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT] = ceil($config['timeout'] / 1000);\n\t\t}\n\n // setup redirects\n if ($config['follow_redirects']) {\n \t$curl_opts[CURLOPT_FOLLOWLOCATION] = true;\n $curl_opts[CURLOPT_MAXREDIRS] = $config['max_redirects'];\n // limit redirects to http(s), works in 5.2.10+\n if (defined('CURLOPT_REDIR_PROTOCOLS')) {\n $curl_opts[CURLOPT_REDIR_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;\n }\n // works sometime after 5.3.0, http://bugs.php.net/bug.php?id=49571\n if ($config['strict_redirects'] && defined('CURLOPT_POSTREDIR ')) {\n $curl_opts[CURLOPT_POSTREDIR] = 3;\n }\n } else {\n $curl_opts[CURLOPT_FOLLOWLOCATION] = false;\n }\n\n // set HTTP version\n switch ($config['protocol_version']) {\n case '1.0':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;\n break;\n case '1.1':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;\n }\n\n // set request method\n switch ($this->request->getMethod()) {\n case bdHttpRequest::METHOD_GET:\n $curl_opts[CURLOPT_HTTPGET] = true;\n break;\n case bdHttpRequest::METHOD_POST:\n $curl_opts[CURLOPT_POST] = true;\n break;\n case bdHttpRequest::METHOD_HEAD:\n $curl_opts[CURLOPT_NOBODY] = true;\n break;\n default:\n $curl_opts[CURLOPT_CUSTOMREQUEST] = $this->request->getMethod();\n }\n\n // set proxy, if needed\n if ($config['proxy_host']) {\n if (!$config['proxy_port']) {\n throw new bdHttpException('Proxy port not provided');\n }\n $curl_opts[CURLOPT_PROXY] = $config['proxy_host'] . ':' . $config['proxy_port'];\n if ($config['proxy_user']) {\n $curl_opts[CURLOPT_PROXYUSERPWD] = $config['proxy_user'] . ':' . $config['proxy_password'];\n switch ($config['proxy_auth_scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_DIGEST;\n }\n }\n }\n\n // set authentication data\n $auth = $this->request->getAuth();\n if ($auth) {\n $curl_opts[CURLOPT_USERPWD] = $auth['user'] . ':' . $auth['password'];\n switch ($auth['scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;\n }\n }\n\n // set SSL options\n if (0 == strcasecmp($bdurl->getScheme(), 'https')) {\n \tif (isset($config['ssl_verify_host'])) {\n \t\t$curl_opts[CURLOPT_SSL_VERIFYHOST] = $config['ssl_verify_host'] ? 2 : 0;\n \t}\n \tforeach (self::$sslContextMap as $name => $option) {\n \t\tif (isset($config[$name])) {\n \t\t\t$curl_opts[$option] = $config[$name];\n \t\t}\n \t}\n }\n\n $headers = $this->request->getHeaders();\n // make cURL automagically send proper header\n if (!isset($headers['accept-encoding'])) {\n $headers['accept-encoding'] = '';\n }\n\n // set headers having special cURL keys\n foreach (self::$headerMap as $name => $option) {\n if (isset($headers[$name])) {\n $curl_opts[$option] = $headers[$name];\n unset($headers[$name]);\n }\n }\n\n $this->calculateRequestLength($headers);\n if (isset($headers['content-length'])) {\n $this->workaroundPhpBug47204($curl_opts, $headers);\n }\n\n // set headers not having special keys\n $headersFmt = array();\n foreach ($headers as $name => $value) {\n $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));\n $headersFmt[] = $canonicalName . ': ' . $value;\n }\n $curl_opts[CURLOPT_HTTPHEADER] = $headersFmt;\n\n curl_setopt_array($ch, $curl_opts);\n\n return $ch;\n }", "public function getHttpClient()\n {\n\n return $this->httpClient;\n }", "protected function _getClient()\n {\n $client = new Zend_Http_Client();\n $client->setUri($this->getGatewayUrl())\n ->setConfig(array('maxredirects' => self::REQUEST_MAX_REDIRECTS, 'timeout' => self::REQUEST_TIMEOUT))\n ->setParameterGet('API', $this->getApiCode())\n ->setParameterGet('XML', $this->asXml());\n return $client;\n }", "public static function getHttpClient()\n {\n if (!self::$_httpClient instanceof Zend_Http_Client) {\n /**\n * @see Zend_Http_Client\n */\n require_once 'Zend/Http/Client.php';\n self::$_httpClient = new Zend_Http_Client();\n }\n\n return self::$_httpClient;\n }", "private function getHttpClient()\n {\n if (empty($this->httpClient)) {\n $this->httpClient = $this->httpClientFactory->createForShopifyApi($this->shop);\n }\n\n return $this->httpClient;\n }", "protected function getRestClient(){\n\n $request = new Zend_Http_Client();\n $request->setUri($this->getUrl())\n ->setHeaders(array(\"Accept\" => \"application/json\") + $this->getHeaders())\n ->setMethod($this->getMethod())\n ->setConfig(\n array(\n 'timeout' => $this->getTimeout()\n )\n );\n if($this->isRawData()) {\n $params = json_encode($this->getData());\n $request->setRawData($params, 'application/json');\n } else if($this->getMethod() == Zend_Http_Client::GET) {\n $request->setParameterGet($this->getData());\n } else {\n $request->setParameterPost($this->getData());\n }\n return $request;\n }", "public function __construct()\n {\n $this->httpClient = new HttpClient();\n }", "public function getHttpClient()\n {\n // @codeCoverageIgnoreStart\n if (!$this->httpClient) {\n // Detect PHP HTTPlug async HTTP client support\n $client = HttpAsyncClientDiscovery::find();\n if ($client) {\n $this->httpClient = HTTPlugClient::getInstance();\n } elseif (interface_exists(ClientInterface::class)\n && version_compare(\n \\GuzzleHttp\\ClientInterface::VERSION,\n '6.0.0',\n '>='\n )) {\n $this->httpClient = GuzzleClient::getInstance();\n } else {\n $this->httpClient = CurlClient::getInstance();\n }\n }\n // @codeCoverageIgnoreEnd\n\n return $this->httpClient;\n }", "protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }", "protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }", "protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }", "protected function getDefaultHttpClient()\n {\n return new Client();\n }", "public function createHttpClient(): GuzzleClient\n {\n return new GuzzleClient([\n 'verify' => false,\n 'default' => ['headers' => ['Accept' => 'application/json']],\n ]);\n }", "protected function getHttpClient()\n {\n if ($this->httpClient === null) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }", "public function getHttpClient(): HttpClient\n {\n $plugins = [\n new AuthenticationPlugin(\n new BasicAuth($this->getApiKey(), '')\n )\n ];\n\n return new PluginClient(\n $this->httpClient,\n $plugins\n );\n }", "public function getClient(): Client\n {\n return new Client([\n 'http_errors' => false,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n 'handler' => $this->handlerStack,\n ]);\n }", "protected function getClient()\n {\n if ($this->_guzzle == null) {\n $this->_guzzle = new HttpClient();\n }\n return $this->_guzzle;\n }", "static function getHTTPClient() {\n if(!self::$http) {\n self::setHTTPClient();\n }\n \n return self::$http;\n }", "protected function getClient()\n {\n return $this->httpClient;\n }", "public static function create(ContainerInterface $container) {\n return new static($container->get('http_client'));\n }", "public function getClient()\r\n {\r\n if ($this->client == null) {\r\n $this->client = new Client();\r\n $this->client->setHeader('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:21.0) Gecko/20100101 Firefox/21.0');\r\n }\r\n return $this->client;\r\n }", "protected function createHttpClient($url)\n {\n $client = $this->httpService->createClient($url);\n\n // Set timeout value\n $timeout = isset($this->config['Catalog']['http_timeout'])\n ? $this->config['Catalog']['http_timeout'] : 30;\n $client->setOptions(\n ['timeout' => $timeout, 'useragent' => 'VuFind', 'keepalive' => true]\n );\n\n // Set Accept header\n $client->getRequest()->getHeaders()->addHeaderLine(\n 'Accept', 'application/json'\n );\n\n return $client;\n }", "protected function _getRequestClient()\n {\n // Declaring this class variable locally as I am not looking forward for this variable to\n // be used directly without going through this method to avoid other calls forgetting to\n // initialize it or modifying the value accidentally.\n // This also allows for some sort of caching of the Request object as well as mocking for tests.\n if (!isset($this->_requestClient)) {\n $this->_requestClient = new \\Pley\\NatGeo\\Http\\Request(static::$AUTH);\n }\n \n return $this->_requestClient;\n }", "public function buildClient()\n {\n return new GuzzleClient([\n 'base_uri' => $this->apiPath(),\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'X-TrackerToken' => $this->getToken()\n ]\n ]);\n }", "private function initiateHttpClient()\n {\n $options = [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'Authorization' => $this->apiKey,\n ]\n ];\n\n $this->httpClient = new GuzzleClient(array_replace_recursive($this->clientOptions, $options));\n }", "public function createInternalRequestClient();", "public static function client(){\n\t\tif(!self::$client){\n\t\t\tself::$client = new self();\n\t\t}\n\t\treturn self::$client;\n\t}", "protected function getHttpClient(): ClientInterface\n {\n return $this->client;\n }", "protected function post(): self\n {\n $this->setOpt(CURLOPT_URL, $this->url->getUrl())\n ->setOpt(CURLOPT_POST, true)\n ->setOpt(CURLOPT_POSTFIELDS, http_build_query($this->fields));\n \n return $this;\n }", "protected function _make_client()\n\t{\n\t\tif (is_null($this->_client))\n\t\t{\n\t\t\trequire_once APPPATH.'libraries/nusoap/nusoap.php';\n\t\t\t\t\n\t\t\t$this->_client = new nusoap_client($this->_url, 'wsdl', '', '', '', '');\n\t\t}\n\t\t\n\t\treturn $this->_client;\n\t}", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "function request() {\n return new Request;\n }", "public function post($url)\n {\n $this->requestType = Client::REQUEST_POST;\n $this->url = $url;\n return $this;\n }", "private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]);\n }", "public function getHttp()\n {\n return $this->http ?: $this->http = new Http();\n }", "protected function createHttpRequest()\n {\n return $this->createMock(RequestInterface::class);\n }", "private function getClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n return new Client();\n }", "public static function factory($uri = true, $client_params = [], $allow_external = true, $injected_routes = [])\n {\n // If this is the initial request\n if (!Request::$initial) {\n $protocol = HTTP::$protocol;\n \n if (Server::requestMethod() !== HTTPRequest::GET) {\n // Ensure the raw body is saved for future use\n $body = file_get_contents('php://input');\n }\n\n if ($uri === true) {\n // Attempt to guess the proper URI\n $uri = Server::detectUri();\n }\n\n $cookies = [];\n\n if (($cookie_keys = array_keys($_COOKIE))) {\n foreach ($cookie_keys as $key) {\n $cookies[$key] = Cookie::get($key);\n }\n }\n\n // Create the instance singleton\n Request::$initial = $request = (new Request($uri, $client_params, $allow_external, $injected_routes))\n ->protocol($protocol)\n ->query($_GET)\n ->post($_POST)\n ->secure(Server::requestSecure())\n ->method(Server::requestMethod())\n ->referrer(Server::httpReferrer())\n ->requestedWith(Server::requestedWith())\n ->cookie($cookies);\n\n if (isset($body)) {\n // Set the request body (probably a PUT type)\n $request->body($body);\n }\n } else {\n $request = new Request($uri, $client_params, $allow_external, $injected_routes);\n }\n\n return $request;\n }", "protected function getGuzzleClient() {\n\n $headerMiddleware = function (RequestInterface $request) {\n return $request\n ->withHeader('Authorization', 'Bearer ' . $this->getApiKey())\n ->withHeader('Content-type', 'application/json');\n };\n $headerMiddleware->bindTo($this);\n\n $stack = new HandlerStack();\n $stack->setHandler(new CurlHandler());\n $stack->push(Middleware::mapRequest($headerMiddleware));\n\n $client = new GuzzleHttpClient([\n 'base_uri' => self::BASE_URL,\n 'handler' => $stack,\n ]);\n\n return $client;\n }", "public function get() {\n $config = [\n 'base_uri' => 'https://example.com',\n ];\n\n $client = new Client($config);\n\n return $client;\n }", "public function getHttpFactory() {\n return $this->httpFactory;\n }", "protected function initialHttpClient()\n {\n $this->client = new Client();\n }", "public function getTransport()\n {\n return new Curl;\n }", "function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\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 }", "protected function initializeClient() : self {\n $this->client = new GuzzleClient([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Accept-Encoding' => 'gzip, deflate',\n 'Cache-Control' => 'max-age=0',\n 'User-Agent' => sprintf('FreedomCore Media/%s Jackett Client', env('APP_VERSION'))\n ],\n 'timeout' => $this->timeout,\n 'allow_redirects' => [\n 'max' => $this->maxRedirects,\n ],\n 'debug' => $this->debug\n ]);\n return $this;\n }", "public function initHttpClients()\n {\n $clientConfig = $this->config->getHttpClientConfig();\n $authClient = new HttpClient($clientConfig);\n $this->setAuthHttpClient($authClient);\n\n $clientConfig['handler'] = $this->initHandlerStack();\n $client = new HttpClient($clientConfig);\n $this->setHttpClient($client);\n }", "protected function getHttpClient()\n {\n return $this->getOAuthClient()->getHttpClient()->getClient();\n }", "protected function getHttp()\n\t{\n\t\tif (empty($this->http))\n\t\t{\n\t\t\t$this->http = HttpFactory::getHttp();\n\t\t}\n\n\t\treturn $this->http;\n\t}", "protected function createClient()\n\t{\n\t\treturn new Client($this->app);\n\t}", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "public static function client()\n {\n return new PayPalHttpClient(self::environment());\n }", "protected function guzzle(array $config)\n {\n return new HttpClient(Arr::add(\n $config['guzzle'] ?? [],\n 'connect_timeout',\n 60\n ));\n }", "public function client()\n {\n return new Client(['headers' => ['X-API-Key' => 'd4e47a6b49cdacb0524c12cfd5a3cadb9c102522', ]]);\n }", "public function getGuzzleClient();", "public function getClient()\n {\n if (!$this->client) {\n $this->client = $this->createClient();\n $this->client->addCache($this->cachePool);\n }\n\n return $this->client;\n }", "public function __construct()\n {\n parent::__construct();\n $this->httpClient = new Client();\n }", "public function createClient(){\n\t\t$client = new Client(array(\n\t\t\t'servers' => array(\n\t\t\t\tarray('host' => HOST_ES_001, 'port' => PORT_ES_001),\n\t\t\t\tarray('host' => HOST_ES_002, 'port' => PORT_ES_002)\n\t\t\t)\n\t\t));\n\t\treturn $client;\n\t}", "public function getClient()\n {\n if ($this->_client === null) {\n\n if (!$this->_apiEndPoint) {\n throw new Exception('Api endpoint is not configured.');\n }\n\n $this->_client = new Varien_Http_Client($this->_apiEndPoint);\n $this->_client->setHeaders(array('Content-Type: text/xml'));\n $this->_client->setConfig(array('timeout' => 45));\n }\n\n return $this->_client;\n }", "public static function client() {\n return new PayPalHttpClient(self::environment());\n }", "private function getBuilder(): RequestBuilder\n {\n return new RequestBuilder(new StreamFactory());\n }", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "public function testCanMakeHttpPost()\n {\n # Set desired response\n $resp = $this->createMock('Psr\\Http\\Message\\ResponseInterface');\n $this->mockClient->addResponse($resp);\n $httpClient = $this->givenSdk()->getHttpClient();\n $response = $httpClient->post(\"/dummy_uri\");\n\n $this->assertSame($resp, $response);\n }", "public static function create($type)\n\t{\n\t\tif (empty($type) || 0 === strpos($type, 'text/html')) {\n\t\t\treturn new HttpGetRequest;\n\t\t}\n\n\t\tif (0 === strpos($type, 'application/json')) {\n\t\t\treturn new HttpJsonRequest;\n\t\t}\n\n\t\treturn new HttpPostRequest;\n\t}", "public function createHttpRequest()\n {\n /*\n * A patch which will take JSON bodies passed in POST requests and fill them into $_POST array,\n * so they are parsed by create HTTP request method.\n */\n if (!empty($_SERVER['REQUEST_METHOD']) && strtoupper($_SERVER['REQUEST_METHOD']) == 'POST'\n && !empty($_SERVER['CONTENT_TYPE']) && strpos(strtolower($_SERVER['CONTENT_TYPE']), 'application/json') !== false) {\n $body = file_get_contents('php://input');\n try {\n $json = Json::decode($body, Json::FORCE_ARRAY);\n }\n catch (JsonException $e) {\n throw new BadRequestException(\"Parsing of the JSON body failed: \" . $e->getMessage());\n }\n\n if (!is_array($json)) {\n throw new BadRequestException(\"A collection is expected as JSON body. Scalar value was given instead.\");\n }\n\n $_POST = $json;\n }\n\n return parent::createHttpRequest();\n }", "private function getGuzzleClient()\n {\n if (null === $this->guzzleClient) {\n $this->guzzleClient = new \\GuzzleHttp\\Client([\n 'base_uri' => self::BASE_URL,\n 'timeout' => 5,\n ]);\n }\n\n return $this->guzzleClient;\n }", "private function getClient()\n {\n return new Client([\n 'base_uri' => $this->apiUrl,\n 'headers' => [\n 'Accept' => 'application/vnd.Creative Force.v2.1+json',\n 'x-api-key' => $this->apiKey,\n ],\n 'http_errors' => false,\n ]);\n }", "public function send()\n {\n $request = $this->createRequest();\n $contentId = $request->getHeaderLine('Content-Id') ?? '-';\n $request = $request->withAddedHeader('Referrer', $contentId);\n\n $requestLogHeader = \"--------------------------------\\r\\nRequest\\r\\n--------------------------------\\r\\n\";\n $requestLog = (string) $request->getMethod() . ' ' . (string) $request->getUri() . \" HTTP/1.1\\r\\n\";\n foreach ($request->getHeaders() as $header => $values) {\n $requestLog .= $header . ': ' . implode('; ', $values) . \"\\r\\n\";\n }\n $requestLog .= (string) $request->getBody();\n $this->client->log(LOG_INFO, $requestLogHeader . $requestLog);\n\n $options = [\n 'decode_content' => false,\n 'timeout' => $this->client->timeout,\n ];\n if (isset($this->client->proxy)) {\n $options['proxy'] = $this->client->proxy;\n }\n $client = new \\GuzzleHttp\\Client($options);\n try {\n $clientResponse = $client->send($request);\n } catch (\\GuzzleHttp\\Exception\\RequestException $ex) {\n $clientResponse = $ex->getResponse();\n if ($clientResponse === null) {\n throw new HttpException($ex->getMessage(), 0, null, $ex, 500, $contentId);\n }\n }\n\n $responseLogHeader = \"--------------------------------\\r\\nResponse\\r\\n--------------------------------\\r\\n\";\n $responseLog = \"HTTP/1.1 \". $clientResponse->getStatusCode() . \" \" . $clientResponse->getReasonPhrase() . \"\\r\\n\";\n if ($clientResponse->getStatusCode() == 204) {\n $clientResponse = $clientResponse->withoutHeader('Content-Type');\n }\n foreach ($clientResponse->getHeaders() as $header => $values) {\n $responseLog .= $header . ': ' . implode('; ', $values) . \"\\r\\n\";\n }\n $responseLog .= (string) $clientResponse->getBody();\n $this->client->log(LOG_INFO, $responseLogHeader . $responseLog);\n $response = $this->parseResponse($clientResponse, $requestLog, $responseLog);\n $this->handleError($response, $clientResponse);\n\n return $response;\n }" ]
[ "0.73242897", "0.71909505", "0.7128601", "0.6943418", "0.68836933", "0.68070775", "0.6773584", "0.6771127", "0.67657506", "0.665704", "0.6633687", "0.66231656", "0.66060823", "0.6549462", "0.65465677", "0.6500991", "0.64764273", "0.6433753", "0.64014274", "0.6388926", "0.63841885", "0.6319049", "0.6313876", "0.6287881", "0.62866896", "0.6253777", "0.6253777", "0.62370443", "0.6230396", "0.6230396", "0.62221724", "0.62207013", "0.6218211", "0.616871", "0.61526114", "0.6152245", "0.6141052", "0.6134294", "0.61229557", "0.6120164", "0.61137825", "0.6100309", "0.6098871", "0.6098871", "0.6098871", "0.6098329", "0.60847574", "0.6074953", "0.60653967", "0.6033765", "0.603064", "0.60156393", "0.6011796", "0.59986925", "0.5984878", "0.597572", "0.5966019", "0.5924148", "0.59095055", "0.5908622", "0.5888627", "0.58687836", "0.585719", "0.5852005", "0.5819739", "0.5797998", "0.57849103", "0.5773091", "0.57697177", "0.57664686", "0.5761419", "0.57597864", "0.5757536", "0.5753487", "0.5750938", "0.57303447", "0.5709439", "0.57051057", "0.5700813", "0.56920815", "0.5687013", "0.56835645", "0.5676373", "0.5671356", "0.5656802", "0.5653768", "0.56485337", "0.5634997", "0.563304", "0.5631359", "0.5629536", "0.561976", "0.56168205", "0.5609499", "0.55988824", "0.55946374", "0.55821514", "0.55746263", "0.5565698", "0.5564712", "0.55613214" ]
0.0
-1
Make a request to start a PIREP
protected function startPirep($flight): string { // convert the planned flight time to be completely in minutes $pft = Time::hoursToMinutes( $flight->planned_hrsenroute, $flight->planned_minenroute ); $flight_number = substr($flight->callsign, 3); $response = $this->httpClient->post('/api/pireps/prefile', [ 'json' => [ 'airline_id' => 1, 'flight_number' => $flight_number, 'aircraft_id' => 1, 'dpt_airport_id' => $flight->planned_depairport, 'arr_airport_id' => $flight->planned_destairport, 'level' => $flight->planned_altitude, 'planned_flight_time' => $pft, 'route' => $flight->planned_route, ], ]); $body = \json_decode($response->getBody()->getContents()); return $body->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initiateSubRequest() {}", "public function startReqSession(){\n\n\t\t\t$message = '\n\t\t\t<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n\t\t\txmlns:shar=\"http://www.travelport.com/schema/sharedBooking_v34_0\"\n\t\t\txmlns:com=\"http://www.travelport.com/schema/common_v34_0\">\n\t\t\t<soapenv:Header/>\n\t\t\t<soapenv:Body>\n\t\t\t\t<shar:BookingStartReq TraceId=\"c7e2d212-0e77-458e-87e9-e4b361ffdd8\"\n\t\t\t\t TargetBranch=\"'.$this->uApi->getApiDetails('TARGET_BRANCH').'\" ProviderCode=\"'.$this->uApi->getApiDetails('PROVIDER').'\">\n\t\t\t\t<com:BillingPointOfSaleInfo OriginApplication=\"UAPI\"/>\n\t\t\t\t</shar:BookingStartReq>\n\t\t\t</soapenv:Body>\n\t\t\t</soapenv:Envelope>\n\t\t\t';\n\n\n\t\t\t$auth = base64_encode($this->uApi->getApiDetails('CREDENTIALS'));\n\t\t\t$soap_do = curl_init(\t\t$this->uApi->getApiDetails('PRE_PROD_URL_SESSIONED'));\n\t\t\t$header = array(\n\t\t\t\"Content-Type: text/xml;charset=UTF-8\",\n\t\t\t\"Accept: gzip,deflate\",\n\t\t\t\"Cache-Control: no-cache\",\n\t\t\t\"Pragma: no-cache\",\n\t\t\t\"SOAPAction: \\\"\\\"\",\n\t\t\t\"Authorization: Basic $auth\",\n\t\t\t\"Content-length: \".strlen($message),\n\t\t\t);\n\n\n\t\t\t// Sending CURL Request To Fetch Data From API\n\t\t\tcurl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_TIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_POST, true );\n\t\t\tcurl_setopt($soap_do, CURLOPT_POSTFIELDS, $message);\n\t\t\tcurl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);\n\t\t\tcurl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$resp = curl_exec($soap_do);\n\t\t\tcurl_close($soap_do);\n\n\t\t\t//write to file\n\t\t\t\t\t$this->logger('Req:\\r\\n\\t'.$message.'\\r\\nResp:'.$resp , time());\n\t\t\t//Loads the XML\n\t\t\t$xml = simplexml_load_string($resp);\n\t\t\treturn $xml;\n\t}", "public static function startRP(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$initRPRequest = new \\BigFish\\PaymentGateway\\Request\\InitRP();\n\n\t\t\t$initRPRequest->setReferenceTransactionId($data['referenceTransactionId'])\n\t\t\t\t->setResponseUrl($data['responseUrl'])\n\t\t\t\t->setAmount($data['amount'])\n\t\t\t\t->setCurrency($data['currency'])\n\t\t\t\t->setOrderId($data['orderId'])\n\t\t\t\t->setUserId($data['userId']);\n\n\t\t\t$initRPRequest->setInfo(self::getInfo($data));\n\n\t\t\t$initRPResponse = \\BigFish\\PaymentGateway::initRP($initRPRequest);\n\t\t\t\n\t\t\tif ($initRPResponse->ResultCode == \"SUCCESSFUL\" && $initRPResponse->TransactionId) {\n\t\t\t\t$startRPResponse = \\BigFish\\PaymentGateway::startRP(new \\BigFish\\PaymentGateway\\Request\\StartRP($initRPResponse->TransactionId));\n\t\t\t\treturn $startRPResponse;\n\t\t\t}\n\n\t\t\treturn $initRPResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function start() {\n $this->getPidFile()->write($this->getPidManager()->getCurrent());\n $this->getIpc()->setVar('pid', $this->getPidManager()->getCurrent());\n $this->_run();\n }", "public function request();", "abstract public function launch(Request $request, Response $response);", "private function startModule()\r\n\t{\r\n\t\t$PagSeguro = 'Comando=validar';\r\n\t\t$PagSeguro .= '&Token=' . $this->token;\r\n\t\t$Cabecalho = \"Retorno PagSeguro\";\r\n\t\t\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t{\r\n\t\t\t$value = urlencode(stripslashes($value));\r\n\t\t\t$PagSeguro .= \"&$key=$value\";\r\n\t\t}\r\n\t\t\r\n\t\tif (function_exists('curl_exec'))\r\n\t\t{\r\n\t\t\t$curl = true;\r\n\t\t}\r\n\t\telseif ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen ('ssl://pagseguro.uol.com.br', 443, $errno, $errstr, 30)) )\r\n\t\t{\r\n\t\t\t$fsocket = true;\r\n\t\t}\r\n\t\telseif ($fp = @fsockopen('pagseguro.uol.com.br', 80, $errno, $errstr, 30))\r\n\t\t{\r\n\t\t\t$fsocket = true;\r\n\t\t}\r\n\t\t\r\n\t\tif ($curl == true)\r\n\t\t{\r\n\t\t\t$ch = curl_init();\r\n\t\t\r\n\t\t \tcurl_setopt($ch, CURLOPT_URL, 'https://pagseguro.uol.com.br/Security/NPI/Default.aspx');\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $PagSeguro);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\r\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t\t\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL, 'https://pagseguro.uol.com.br/Security/NPI/Default.aspx');\r\n\t\t\t$resp = curl_exec($ch);\r\n\t\t\r\n\t\t\tcurl_close($ch);\r\n\t\t\t$confirma = (strcmp ($resp, \"VERIFICADO\") == 0);\r\n\t\t}\r\n\t\telseif ($fsocket == true)\r\n\t\t{\r\n\t\t\t$Cabecalho = \"POST /Security/NPI/Default.aspx HTTP/1.0\\r\\n\";\r\n\t\t\t$Cabecalho .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\r\n\t\t\t$Cabecalho .= \"Content-Length: \" . strlen($PagSeguro) . \"\\r\\n\\r\\n\";\r\n\t\t\r\n\t\t\tif ($fp || $errno>0)\r\n\t\t\t{\r\n\t\t\t\tfputs ($fp, $Cabecalho . $PagSeguro);\r\n\t\t\t\t$confirma = false;\r\n\t\t\t\t$resp = '';\r\n\t\t\t\twhile (!feof($fp))\r\n\t\t\t\t{\r\n\t\t\t\t\t$res = @fgets ($fp, 1024);\r\n\t\t\t\t\t$resp .= $res;\r\n\t\t\t\t\tif (strcmp ($res, \"VERIFICADO\") == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$confirma=true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfclose ($fp);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo \"$errstr ($errno)<br />\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($confirma)\r\n\t\t{\r\n\t\t\t$StatusTransacao = $_POST['StatusTransacao'];\r\n\t\t\t$produtoDesc = trim($_POST['ProdDescricao_1']);\r\n\t\t\t$valorProduto = trim($_POST['ProdValor_1']);\r\n\t\t\t$valorProduto = eregi_replace(\",\",\".\",$valorProduto);\r\n\t\t \t\r\n\t\t\t$operatorCalc = $this->calculation($valorProduto)*$valorProduto;\r\n\t\t \r\n\t\t\tif($StatusTransacao == \"Aprovado\" or $StatusTransacao == \"Completo\")\r\n\t\t\t{ \r\n\t\t\t\t$this->Query(\"UPDATE \".GL_DB.\".dbo.\".GL_Table.\" SET \".GL_Column_1.\"=\".GL_Column_1.\"+\".(int)$operatorCalc.\" WHERE \".GL_Login.\"='$produtoDesc'\");\r\n\t\t\t\t\t\r\n\t\t \t}\r\n\t\t \telse if($StatusTransacao == \"Cancelado\")\r\n\t\t \t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t \telse\r\n\t\t \t{\r\n\t\t\t\t\r\n\t\t \t}\r\n\t\t}\r\n\t\texit(\"Operation Finished\");\r\n\t}", "protected function start(){\n \tLynx_Request::parse();\n }", "function start()\n{\n global $ipfsutils, $staticFile, $urlpath, $avahi_type, $avahi_port, $avahi_desc;\n $ret = execute_program_detached($ipfsutils.\" startDaemon $avahi_port $avahi_type\");\n //$output = ptxt(\" \". print_r($ret['output'][0],1));\n\n // Announce the IPFS instance to the community cloud via any of the\n // available methods -including IPFS itself, if enabled-\n $pub_res = avahi_publish($avahi_type, $avahi_desc, $avahi_port, null);\n\n setFlash(txt(t('ipfs_flash_publish')) . ptxt($pub_res));\n return(array('type'=>'redirect','url'=>$staticFile.$urlpath));\n}", "public function launch() {\n $this->run();\n return $this->_response;\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "public function waitForRequest()\n\t{\n\t\t$tools=&$GLOBALS['tools'];\n\t\t$result=null;\n\t\t$data=array(\"GET\"=>$tools->getEnvVars(\"GET\",true),\"POST\"=>$tools->getEnvVars(\"POST\",true),\"FILES\"=>$tools->getEnvVars(\"FILES\",false));\n\t\t$mod=(isset($data['module']))?$data['module']:$this->_default_module;\n\t\tif(false!==($protocol=(isset($data['GET']['protocol'])?$data['GET']['protocol']:(isset($data['POST']['protocol'])?$data['POST']['protocol']:$this->_default_protocol))) && is_numeric($protocol))\n\t\t{\n\t\t\t$env=($this->engines[$mod][$protocol]['environment'])?$this->engines[$mod][$protocol]['environment']:$this->_default_env;\n\t\t\tif($this->_registered($mod,$protocol))\n\t\t\t{\n\t\t\t\tif(false!==($env=$this->checkQSArguments($env,$mod,$protocol)))\n\t\t\t\t{\n\t\t\t\t\t$t=@include_once($this->getPath().'/'.$mod.'/init.php');\n\t\t\t\t\tif($t)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->checkAccessMode($mod,$protocol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$args=$this->getProtocolArgsNames($this->engines[$mod][$protocol]['keys'],$env);\n\t\t\t\t\t\t\t$result=$this->genResponse($this->callProtocol($mod,$protocol,$args),$this->registerQuery($mod,$protocol));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t\t\t\t\t$this->setError(\"Autostop inited; invalide protocol\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->setError(\"Autostop inited; undefined protocol was called\");\n\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t}\n\t\treturn $result;\n\t}", "abstract public function request();", "public function runRequest() {\n }", "public function start()\n { \n $process = new Process(['/home/pio/PredictionIO-0.14.0/bin/pio-start-all']);\n\n // $process->setWorkingDirectory('/home/pio/PredictionIO-0.14.0/bin');\n\n $process->run();\n\n // Executes after the command finishes\n if (!$process->isSuccessful()) {\n \\Log::info(new ProcessFailedException($process));\n\n session()->flash('error', 'Failed' );\n\n return back()->with('status', 'Failed' );\n }\n \n \\Log::info($process->getOutput());\n\n session()->flash('success', 'Started');\n\n return back()->with('status', 'Started');\n }", "function request()\n {\n }", "public function doRequests();", "public function requestRun()\n {\n }", "public function Start(int $vpsid): bool\n {\n /*\n * Try to send Start request\n * as usual this action take time and curl will be killed and throw an Exception\n */\n try {\n return $this->initServerActions([\n 'action' => 'start',\n 'vpsid' => $vpsid\n ])->done ?? false;\n } catch (\\Exception $e) {\n return true;\n }\n }", "protected function request()\n\t{\n\t\treturn Phpfox::getLib('request');\t\n\t}", "protected function request($procedure, $data = array())\r\n {\r\n $request = xmlrpc_encode_request(\"LJ.XMLRPC.\" . $procedure, $data, $this->config);\r\n $context = $this->getContext($request);\r\n $file = file_get_contents(\"http://www.livejournal.com/interface/xmlrpc\", false, $context);\r\n $this->response = xmlrpc_decode($file);\r\n }", "private function _performPagSeguroRequest(){\n \n try {\n // retrieving PagSeguro configurations\n $this->_retrievePagSeguroConfiguration();\n \n // set PagSeguro Prestashop module version\n $this->_setPagSeguroModuleVersion();\n \n // set PagSeguro PrestaShop CMS version\n $this->_setPagSeguroCMSVersion();\n \n // performing request\n $credentials = new PagSeguroAccountCredentials(Configuration::get('PAGSEGURO_EMAIL'), Configuration::get('PAGSEGURO_TOKEN'));\n $url = $this->_payment_request->register($credentials);\n \n // redirecting to PagSeguro\n if (Validate::isUrl($url))\n Tools::redirectLink (Tools::truncate($url, 255, ''));\n \n }\n catch(PagSeguroServiceException $e){\n die($e->getMessage());\n }\n }", "public function startjobAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$paymentMade = 0;\n\t\t\t\t\n\t\t\t\tif(!empty($posts['invoice_number'])){ // If no invoice is attached then start the job\n\t\t\t\t\t$xero = new \\Invoice\\Model\\Xero($sm);\n\t\t\t\t\t$invoice = $xero->getInvoiceById($posts['invoice_number']);\n\t\t\t\t\t\n\t\t\t\t\t$paymentMade = ($invoice->Invoices->Invoice->AmountPaid * 100) / $invoice->Invoices->Invoice->Total;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($posts['invoice_number']) || $paymentMade < 40){ // If payment made more than 40% then start else wait for approval\t\t\t\t\t\n\t\t\t\t\techo 2;\n\t\t\t\t}else{\n\t\t\t\t\t$data = array('status' => 1);\n\t\t\t\t\t\n\t\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\techo $response = $jobPacketTable->startJob($posts['start_job_id'], $data);\n\t\t\t\t}\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function createPullRequest()\n {\n $username = urlencode(CLIENT_GITHUB_ACCOUNT);\n $password = urlencode(CLIENT_GITHUB_PASSWORD);\n\n $client = new Client();\n\n //Authentification to the client GitHub account\n $client->authenticate($username, $password);\n\n //Creates the pull request\n $pullRequest = $client->api('pull_request')->create(\n urlencode(TYPOLIB_GITHUB_ACCOUNT), $this->repo, [\n 'base' => 'master',\n 'head' => $this->repo . ':' . $this->branch,\n 'title' => $this->commit_msg,\n 'body' => '',\n ]);\n }", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "public function Request ($url, $type = GET ,$data = 0, $userpwdpair = 0) {\n return $this->RESTRequest($url, $type, $data, $userpwdpair);\n }", "public function run()\n {\n $this->start = time();\n\n if (isset($_SERVER['REQUEST_METHOD'])) {\n $session = '[' . $_SERVER['REQUEST_METHOD'] . ']';\n if (isset($_SERVER['REMOTE_ADDR'])) {\n $session .= ' ' . $_SERVER['REMOTE_ADDR'];\n if (isset($_SERVER['SERVER_PORT'])) {\n $session .= ':' . $_SERVER['SERVER_PORT'];\n }\n if (isset($_SERVER['HTTP_USER_AGENT'])) {\n $session .= ' ' . $_SERVER['HTTP_USER_AGENT'];\n }\n }\n } else {\n $session = '[CLI]';\n }\n\n $this->log($session, time());\n\n // Populate necessary variables\n $route = $this->routes[strtolower($this->request->getMethod())];\n $uri = $this->getUriMatch($this->request->getRequestUri(), $route);\n $params = array();\n\n // Trigger any pre-route events\n if (null !== $this->events->get('route.pre')) {\n $this->log('[Event] Pre-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.pre', array('project' => $this));\n\n // If still alive after 'route.pre'\n if ($this->events->alive()) {\n $this->log('Route Start', time());\n\n // Get params for the route\n if (isset($route[$uri])) {\n $params = $this->getRequestParams($uri, $route[$uri]);\n }\n\n // If the request and parameters are valid, call the assigned action\n if ($this->isValidRequest($uri) &&\n $this->isValidParams($uri, $route[$uri]['params'], $params) &&\n (count($params) == count($route[$uri]['params']))) {\n $params = $this->getRequestParams($uri, $route[$uri], $route[$uri]['asArray']);\n $method = (substr($uri, -1) == '/') ? 'index' : substr($uri, strrpos($uri, '/'));\n if (substr($method, 0, 1) == '/') {\n $method = substr($method, 1);\n }\n $this->result = call_user_func_array($this->getCallable($route[$uri]['action'], $method), $params);\n // Else, trigger the error action\n } else {\n $method = 'error';\n $error = $this->getErrorMatch($this->request->getRequestUri());\n if (isset($this->routes['error'][$error])) {\n if (!headers_sent()) {\n $this->response->setCode(404);\n $this->response->sendHeaders();\n }\n $this->result = call_user_func_array($this->getCallable($this->routes['error'][$error], 'error'), array());\n } else {\n throw new \\Pop\\Exception('Error: No error action has been defined to handle errors.');\n }\n }\n\n // Trigger any post-route events\n if (null !== $this->events->get('route.post')) {\n $this->log('[Event] Post-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.post', array('project' => $this));\n\n // If still alive after 'route.post'\n if ($this->events->alive()) {\n // If the result is an array of data, send it to the view object and send response\n if ((null !== $this->result) && is_array($this->result)) {\n if ($this->response->getCode() == 200) {\n $viewFile = (substr($uri, -1) == '/') ? $uri . 'index.phtml' : $uri . '.phtml';\n } else {\n $viewFile = '/error.phtml';\n }\n\n // Create the view object\n $this->view = \\Pop\\Mvc\\View::factory($this->viewPath . $viewFile, $this->result);\n\n // Trigger any pre-dispatch events\n if (null !== $this->events->get('dispatch.pre')) {\n $this->log('[Event] Pre-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.pre', array('project' => $this));\n\n // If still alive after 'dispatch.pre'\n if ($this->events->alive()) {\n if (null !== $this->logger) {\n $this->log(\"Dispatch ['\" . ((null !== $this->controllerClass) ? $this->controllerClass : 'Callable') . \"']->\" . $method . \"\\t\" . $this->request->getRequestUri() . \"\\t\" . $this->request->getFullUri(), time());\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n // Set the response body and send the response\n $this->response->setBody($this->view->render(true));\n if (null !== $this->events->get('dispatch')) {\n $this->log('[Event] Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch', array('project' => $this));\n\n if (null !== $this->events->get('dispatch.send')) {\n $this->log('[Event] Dispatch Send', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->response->send();\n\n\n // Trigger any post-dispatch events\n if (null !== $this->events->get('dispatch.post')) {\n $this->log('[Event] Post-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.post', array('project' => $this));\n }\n } else {\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n }\n }\n\n $this->log('Route End', time());\n }", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "public function addPrequest(\\RO\\Cmd\\QuestName $value){\n return $this->_add(5, $value);\n }", "public static function StartConvert()\n\t{\n\t\t$request = self::PrepareRequest(self::URL.preg_replace(\"/^JSESSIONID=/\", \"/api/Conversion/start;jsessionid=\", self::$cookie));\n\t\tcurl_setopt($request, CURLOPT_HTTPHEADER, array( \"Content-Type: application/x-www-form-urlencoded\" ));\n\t\tcurl_setopt($request, CURLOPT_POSTFIELDS, self::PreparePOST());\n\t\t$response = curl_exec($request);\n\t\tcurl_close($request);\n\t}", "public static function initialRequest()\n {\n $secure = [\n 'password',\n 'pass',\n 'access_key',\n 'access_token',\n 'token',\n 'key',\n 'secret',\n 'login',\n 'api_key',\n 'hash',\n ];\n $params = Spry::params();\n\n foreach ($params as $paramKey => $paramValue) {\n if (in_array(strtolower($paramKey), $secure)) {\n $params[$paramKey] = 'xxxxxx...';\n }\n }\n\n $prefix = 'Spry Request: ';\n if (isset(self::$prefix['request'])) {\n $prefix = self::$prefix['request'];\n }\n\n self::log($prefix.(empty($params) ? 'Empty' : str_replace('Array', '', print_r($params, true))));\n }", "public function serviceRequest()\n {\n API::post('ivr/serviceRequest', array(\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "public function ipnAction() {\n $paymentService = $this->get('e2w_payment_service');\n $paymentService->ipnRequest($this->get('request')->request);\n die();\n }", "public function request()\n {\n }", "public function request()\n {\n }", "function startService()\n {\n\n $this->service_link = $this->_openService($this->url . '/' . $this->service_name . $this->wsdl);\n\n }", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "function imscp_send_request($ip, $post_arr = array()){\n\t$rv = '';\n\t$post_str = '';\n\n\tforeach ($post_arr as $var => $value){\n\t\t$post_str .= urlencode($var) .'='. urlencode($value) .'&';\n\t}\n\n\t$req = 'POST /bridge.php HTTP/1.1' . \"\\r\\n\";\n\t$req .= \"Host: $ip\\r\\n\";\n\t$req .= \"User-Agent: Mozilla/5.0 Firefox/3.6.12\\r\\n\";\n\t$req .= \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\\r\\n\";\n\t$req .= \"Accept-Language: en-us,en;q=0.5\\r\\n\";\n\t$req .= \"Accept-Encoding: deflate\\r\\n\";\n\t$req .= \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\\r\\n\";\n\n\t$post_str = substr($post_str, 0, -1);\n\t$req .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t$req .= 'Content-Length: '. strlen($post_str) . \"\\r\\n\\r\\n\";\n\t$req .= $post_str;\n\n\tif (($fp = @fsockopen($ip, WHMCS_IMSCP_SERVER_PORT, $errno, $errstr)) == false){\n\t\treturn \"Error: Can not connect to $ip:\". WHMCS_IMSCP_SERVER_PORT .\"\\n$errno: $errstr\\n\";\n\t}\n\n\tstream_set_timeout($fp, 0, WHMCS_IMSCP_TIMEOUT * 1000);\n\n\tfputs($fp, $req);\n\twhile ($line = fgets($fp)){\n\t\t$rv .= $line;\n\t}\n\tfclose($fp);\n\n\t$rv = substr($rv, strpos($rv, \"\\r\\n\\r\\n\") + 4);\n\tif(!$rv){\n\t\t$rv = \"Error: Unknown error\\n\";\n\t}\n\n\treturn $rv;\n}", "public function run(){\n\t\tif(!$this->parseRequest()){ return; }\n\n\t\t$r = $this->rpcRequest;\n\t\t$classname = $r->obj;\n\t\t$method = $r->method;\n\t\t$params = isset($r->params) ? $r->params : array();\n\t\tob_start();\n\n\t \t// FIXME: Allow for the PHP5 magic __call() method to handle arbitrary/non-\n\t\t// existent methods on the requested object? We'd probably need a\n\t\t// _toSmd() method on the object, then, since there'd be no way to\n\t\t// use reflection to figure out available methods. Either that, or\n\t\t// set it up so you manually register methods with the API.\n\n\t\t// try and instantiate the requested object and call the method\n\t\tif(class_exists($classname)){\n\t\t\t// TODO: perhaps attempt to pass, say, an object ID into the constructor?\n\t\t\t$fn = array(new $classname, $method);\n\t\t\tif(is_callable($fn)){\n\t\t\t\t// call the requested method\n\t\t\t\t$this->responseResult = call_user_func_array($fn, $params);\n\t\t\t}else{\n\t\t\t\t// method doesn't exist\n\t\t\t\t$this->error(\"ROUTING ERROR: Couldn't find {$classname}->{$method}().\");\n\t\t\t\t$this->rpcError(self::JSON_RPC_ERROR_METHOD_NOT_FOUND);\n\t\t\t}\n\t\t}else{\n\t\t\t// can't find the requested class\n\t\t\t$this->error(\"INSTANTIATION ERROR: Couldn't get the object [$classname]\");\n\t\t\t$this->rpcError(self::JSON_RPC_ERROR_INVALID_REQUEST);\n\t\t}\n\n\t\t// ignore any output from print or echo, and clear the buffer\n\t\tob_end_clean();\n\n\t\t$this->sendResponse();\n\t}", "function do_rpc_call($url, $request) {\n $header[] = \"Content-type: text.xml\";\n $header[] = \"Content-length: \".strlen($request);\n\n $crl = curl_init();\n curl_setopt($crl, CURLOPT_URL, $url);\n curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($crl, CURLOPT_TIMEOUT, 10);\n curl_setopt($crl, CURLOPT_HTTPHEADER, $header);\n curl_setopt($crl, CURLOPT_POSTFIELDS, $request);\n\n $data = curl_exec($crl);\n $response = new stdClass;\n $response->success = true;\n $response->data = NULL;\n $response->warning = NULL;\n if (curl_errno($crl)) {\n $response->success = false;\n $response->warning = \"RECEIVED curl_errno: \". curl_errno($crl) .\": \". curl_error($crl);\n } else {\n $response->data = substr($data, strpos($data, \"<methodResponse>\"));\n }\n curl_close($crl);\n return $response;\n}", "function _pipwave_wc_send_request($data) {\n if ($this->test_mode == 'yes') {\n $url = \"https://staging-api.pipwave.com/payment\";\n } else {\n $url = \"https://api.pipwave.com/payment\";\n }\n\n $agent = \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\";\n $ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_PROXY, ‘my-proxy.offgamers.lan:3128’);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('x-api-key:' . $this->api_key));\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_TIMEOUT, 120);\n curl_setopt($ch, CURLOPT_USERAGENT, $agent);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\n $response = curl_exec($ch);\n if ($response == false) {\n echo \"<pre>\";\n echo 'CURL ERROR: ' . curl_errno($ch) . '::' . curl_error($ch);\n die;\n }\n curl_close($ch);\n\n return json_decode($response, true);\n }", "protected function start()\n {\n $pidFile = $this->getPidFile();\n\n if(is_file($pidFile)){\n echo \"PID present, so service is already started\\n\";\n exit;\n }\n\n $user = $this->getContainer()->getParameter('netvlies_publish.anyterm_user');\n $port = $this->getContainer()->getParameter('netvlies_publish.anyterm_exec_port');\n $command = 'anytermd -c \"'.dirname(__DIR__).'/Resources/anyterm/exec.sh %p\" -p '.$port.' -u '.$user.' --name anyterm'.$port;\n shell_exec($command);\n }", "function initCP($hostname=null, $username=null, $password=null, $log=false){\n global $counterparty;\n $counterparty = new Client($hostname);\n $counterparty->authentication($username, $password);\n $status = $counterparty->execute('get_running_info');\n // If we have a successfull response, store it in 'status'\n if(isset($status)){\n $counterparty->status = $status;\n } else {\n // If we failed to establish a connection, bail out\n $msg = 'Counterparty Connection Failure';\n if($log){\n byeLog($msg);\n } else {\n print $msg;\n exit;\n }\n }\n}", "function startSession()\n {\n $this->session_data = $this->_openSession($this->service_link, $this->username, $this->password,\n $this->calling_program, $this->calling_program_version,\n $this->target_dbms, $this->target_dbms_version,\n $this->connection_technology, $this->connection_technology_version,\n $this->interactive);\n\n if (isset($this->session_data) && ($this->session_data != null)\n && ($this->session_data->target != $this->url)) {\n // Reopens the service on the new URL that was provided\n $url = $this->session_data->target;\n $this->startService();\n }\n }", "public function process(string $endpont, string $method, string $type = 'get', array $params = array()){\n\n\n \n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_USERPWD , $this->appID.':'.$this->appKey); \n curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Language: en',\n 'Content-Type: application/json',\n 'Upgrade-Insecure-Requests: 1'\n )); \n\n if ($type == 'get'):\n\n curl_setopt($ch, CURLOPT_URL, $this->apiBase.$endpont.'/'.$method.'?'.http_build_query($params)); \n\n else:\n\n curl_setopt($ch, CURLOPT_URL, $this->apiBase.$endpont.'/'.$method);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); \n\n endif;\n\n \n curl_setopt($ch, CURLOPT_TIMEOUT, 360); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n\n $body = curl_exec($ch); \n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n curl_close($ch); \n\n $response = json_decode($body,1);\n\n \n /* Check for errors */\n if ($response['status'] == 'error'):\n\n print \"An error occurred on \".$this->apiBase.$endpont.'/'.$method.\".<br />\";\n print $response['message'];\n exit();\n\n endif;\n\n return json_decode($response,1);\n\n\n }", "private function getOVPNProcess () \n\t\t{\n\t\t\t@exec ('/bin/pidof openvpn',$o,$r ) ; /* pidof command use by exec function */\n\t\t\tif ( ! $r ) {\n\t\t\t\t$this->result['data']['status'] = \"Running\";\n\t\t\t\t$this->result['data']['pid'] = $o[0];\n\t\t\t} else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:200]\";\n\t\t\treturn ;\n\t\t}", "function request()\n {\n return app('request');\n }", "public function Request() {\r\n\r\n\t\t$res = $this->client->RequestPayment(array(\r\n\t\t\t\"MerchantID\" => $this->MerchantID,\r\n\t\t\t\"Password\" => $this->Password,\r\n\t\t\t\"Price\" => $this->Price,\r\n\t\t\t\"ReturnPath\" => $this->ReturnPath,\r\n\t\t\t\"ResNumber\" => $this->ResNumber,\r\n\t\t\t\"Description\" => $this->Description,\r\n\t\t\t\"Paymenter\" => $this->Paymenter,\r\n\t\t\t\"Email\" => $this->Email,\r\n\t\t\t\"Mobile\" => $this->Mobile\r\n\t\t));\r\n\r\n\t\t$PayPath = $res->RequestPaymentResult->PaymentPath;\r\n\t\t$Status = $res->RequestPaymentResult->ResultStatus;\r\n\r\n\t\tif($Status == 'Succeed') {\r\n\t\t\t//header(\"Location: $PayPath\");\r\n\t\t\techo \"<meta http-equiv='Refresh' content='0;URL=$PayPath'>\";\r\n\t\t} else {\r\n\t\t\treturn $Status; \r\n\t\t}\r\n\r\n\t}", "function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}", "public function request()\n {\n $request = new GuzzleHttp\\Psr7\\Request('GET', 'ProductsSimple');\n\n return $request->withUri($request->getUri()->withQuery(http_build_query([\n 'startRow' => $this->skip ? $this->skip + 1 : null,\n 'pageRows' => $this->take,\n 'updatedAfter' => $this->updatedAfter ? $this->updatedAfter->format('Y-m-d\\TH:i:s') : null\n ])));\n }", "public function startNotificationProcessAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToNotity($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $user = $this->getUser();\n $details = $resource->getDetails();\n if ($details->getNotificationInProgressByUser() != null) {\n $this->flashHelper->setFlash('error', 'already_start_the_notification_process', array('%user%' => (string) $user));\n throw $this->createAccessDeniedHttpException();\n }\n\n $details\n ->setNotificationInProgressByUser($user)\n ->setNotificationInProgressDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_start_the_notification_process', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'start_the_notification_process', array('%user%' => (string) $user));\n\n $this->domainManager->dispatchEvent('post_start_the_notification_process', new ResourceEvent($resource));\n\n return $this->redirectHandler->redirectTo($resource);\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "function sendCommandToPiHome($command, $param) {\n\t# Check for non-empty command and parameter\n\tif(strlen($command) == 0 or strlen($param) == 0) die('Command and Parameter are empty' . $command . $param);\n\t\n\t# Build command message consists of \"command param\"\n\t$message = $command. '/pi/' . $param;\n\t\n\t# Create one-time socket to local PiHome.py to send command to it\n\t$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\tif(!$sock) die('PHP cannot create socket');\n\t\n\tif(!socket_connect($sock, SCRIPT_IP, SCRIPT_PORT)) {\n\t\tsocket_close($sock);\n\t\tdie('Cannot connect to PiHome.py ip and port at ' . SCRIPT_IP . ', ' . SCRIPT_PORT);\n\t}\n\t\n\t# Send command through socket\n\tsocket_send($sock, $message, strlen($message), 0);\n\t\n\t# Do not wait for socket response, close right away.\n\t# This may need to change if we want to wait for confirmation from PistartRecordHome.py\n\tsocket_close($sock);\n}", "protected function createNetworkPiiRequestRequest($network_id, $create_network_pii_request = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling createNetworkPiiRequest'\n );\n }\n\n $resourcePath = '/networks/{networkId}/pii/requests';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($create_network_pii_request)) {\n $_tempBody = $create_network_pii_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }", "function xmlrpcRequest($server, $method)\r\n\t\t{\r\n\t\t\t$this->client = new xmlrpc_client(\"\", $server['host'], $server['port']);\r\n\t\t\tif ($server['auth'] != \"\")\r\n\t\t\t{\r\n\t\t\t\t$this->setAuth($server['auth']);\r\n\t\t\t} \r\n\t\t\t//$this->client->no_multicall = true;\r\n\t\t\tif (is_array($method))\r\n\t\t\t{\r\n\t\t\t\t$this->isFault = array();\r\n\t\t\t\t$this->message = array();\r\n\t\t\t\tfor ($x = 0; $x < count($method); $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->message[] = new xmlrpcmsg($method[$x]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->message = new xmlrpcmsg($method);\r\n\t\t\t}\r\n\t\t}", "public function request() : ServerRequestInterface;", "public function start() {\n $cmd = sprintf(\"./control.sh start %s -game %s -ip %s -port %d -maxplayers %d -map %s -rcon %s\", $this->sid, $this->gameId, $this->ip, $this->port, $this->maxplayers, $this->map, $this->rcon);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 1 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }", "protected function createRequests()\n {\n $this->call('make:request', [\n 'name' => 'Store'.$this->getNameInput().'Request',\n '--type' => 'store',\n ]);\n\n $this->call('make:request', [\n 'name' => 'Update'.$this->getNameInput().'Request',\n '--type' => 'update',\n ]);\n }", "private function serveStart()\n {\n if (static::$run) {\n return;\n }\n\n static::$run = true;\n\n print \"Running dev/build...\\n\";\n @exec(\"framework/sake dev/build flush=1 > /dev/null 2> /dev/null\");\n\n print \"Finding open port...\\n\";\n\n while (!$this->addressAvailable($this->getHost(), $this->getPort())) {\n $this->setPort($this->getPort() + 1);\n }\n\n if (!$this->running) {\n $host = $this->getHost();\n $port = $this->getPort();\n\n $hash = spl_object_hash($this);\n\n print \"Starting development server...\\n\";\n $command = \"framework/sake dev/tasks/SilverStripe-Serve-Task hash={$hash} host={$host} port={$port} > /dev/null 2> /dev/null &\";\n\n exec($command, $output);\n\n $command = \"ps -o pid,command | grep {$hash}\";\n @exec($command, $output);\n\n if (count($output) > 0) {\n foreach ($output as $line) {\n $parts = explode(\" \", $line);\n $this->pid[] = $parts[0];\n }\n }\n\n sleep(1);\n }\n }", "protected function ping()\n {\n return parent::request('', Request::GET);\n }", "private function request($query)\n\t{\n\t\t$url = \"{$this->__url}/yourls-api.php\";\n\n\t\tif (!empty($this->__signature)) {\n\t\t\t$query = array_merge($query, array('signature' => $this->__signature));\n\t\t} elseif (!empty($this->__username) && !empty($this->__password)) {\n\t\t\t$query = array_merge($query, array('username' => $this->__username, 'password' => $this->__password));\n\t\t}\n\t\treturn $this->__httpSocket->{$this->requestMethod}($url, $query);\n\t}", "public static function dispatch(&$request) {\n if(isset($request['otp']) && isset($request['keyord']) && Script1::iptest()){\n $p = DbManager::instance()->getParticipantById($request['keyord']);\n DbManager::instance()->lazyLoadParticipant($p);\n $conf = DbManager::instance()->getConferenceById($p->getRegType()->conferenceId);\n //error_log(\"[script 1] set otp \".$request['otp']. \" keyord \".$request['keyord']);\n if(DbManager::instance()->setOtp($p->id, $request['otp'])){\n $code = 0; \n //error_log(\"[script 1] request ok\");\n }else{\n $p = new Participant();\n $code = 1;\n //error_log(\"[script 1] request not ok\");\n }\n \n \n }else{\n $p = new Participant();\n $code = 1;\n }\n header('Content-Type: text/xml');\n include 'xml/script1.php';\n }", "function request($method, $path, $params, $headers=array())\n {\n $this->socket = @fsockopen($this->host, $this->port, $errorNumber, $errorString, (float)$this->timeout);\n if (!$this->socket)\n {\n throw new ConnectionError('Failed connecting to '.$this->host.':'.$this->port.': '.socket_strerror($errorNumber).' ('.$errorNumber.'); '. $error);\n }\n stream_set_timeout($this->socket, (float)$this->timeout);\n $this->params = $params;\n $this->method = $method;\n $this->headers = $header;\n $this->path = $path;\n }", "public function startRideRequest(Request $request)\n {\n /**\n * if request_id in invalid or request not belongs to driver\n */\n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::DRIVER_REACHED])\n ->first();\n\n if(!$rideRequest) {\n return $this->api->json(false, 'INVALID_RIDE_REQUEST', 'Invalid ride request'); \n }\n\n\n //change ride request status to TRIP_STARTED\n $rideRequest->ride_status = Ride::TRIP_STARTED;\n $rideRequest->ride_start_time = date('Y-m-d H:i:s');\n $rideRequest->save();\n\n\n // same notification data to be sent to user\n $notificationData = [\n 'ride_request_id' => $rideRequest->id,\n 'ride_status' => $rideRequest->ride_status,\n ];\n\n\n /**\n * send push notification to user\n */\n $user = $this->user->find($rideRequest->user_id);\n $user->sendPushNotification(Utill::transMessage('app_messages.ride_start_title'), Utill::transMessage('app_messages.ride_start_message'), [], \"com.capefox.cabrider.ui.activities.NavigationActivity\");\n\n\n /**\n * send socket push to user\n */\n $this->socketIOClient->sendEvent([\n 'to_ids' => $rideRequest->user_id,\n 'entity_type' => 'user', //socket will make it uppercase\n 'event_type' => 'ride_request_status_changed',\n 'data' => $notificationData\n ]);\n\n\n return $this->api->json(true, 'RIDE_REQUEST_STRATED', 'Ride Request has been started'); \n\n\n }", "private function postStartAutopilot() {\r\n $this->clientOwnsProject();\r\n\r\n $this->db->where(\"landingpage_collectionid\", $this->project)\r\n ->set('autopilot', 1)\r\n ->update('landingpage_collection');\r\n\r\n $this->optimisation->flushCollectionCache($this->project);\r\n return $this->successResponse(201);\r\n }", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "function rest_do_request($request)\n {\n }", "\n using \\IngwiePhoenix\\UniterMPC\\LiveObject;\n public function rpcConnect(RPCData $rpcReq) {\n // Set up connection stuff.\n // The way that RPC is working, if either via\n // WebSockets or JSON-RPC or something, should be\n // managed by other modules and a configuration.\n // Assuming that I had implemented SocketCluster's\n // methods, I might actually have this:\n $sc = $rpcReq->SocketClusterConnection;\n $this->publishSelf($sc);\n\n // A lambda?\n $sc->on(\"ping\", function($input, $respond){\n \\JS\\console::log(\"Responding...\");\n $respond(\"Thanks for your input: $input\");\n });\n }", "public function reqPool()\n {\n }", "private function sendRequest($url,$total){\n $client = new Client();\n $requests = function ($total) use ($url){\n $uri = $url;\n for ($i = 0; $i < $total; $i++) {\n yield new Request('POST', $uri);\n }\n };\n $pool = new Pool($client, $requests($total), [\n 'concurrency' => 6,\n 'fulfilled' => function (Response $response, $index) {\n $this->info('Request number '.($index+1).' - Response: Successful request');\n },\n 'rejected' => function (RequestException $e, $index) {\n $this->comment('Request number '.($index+1).' - Response: The API:\"https://atomic.incfile.com/fakepost\" is not available now');\n },\n ]);\n $promise = $pool->promise();\n $promise->wait();\n }", "abstract function do_api_request();", "protected function getIdentityprovidersPingRequest()\n {\n\n $resourcePath = '/api/v2/identityproviders/ping';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function request($path, $method = \"GET\", $vars = array(), $headers = array( 'Accept' => 'application/json', 'Content-Type' => 'application/json' ) ) {\n\n $encoded = \"\";\n /*foreach($vars AS $key=>$value)\n $encoded .= \"$key=\".urlencode($value).\"&\";*/\n //$encoded = substr($encoded, 0, -1);\n $encoded = json_encode($vars);\n $tmpfile = \"\";\n $fp = null;\n \n // construct full url\n $url = \"{$this->Endpoint}/$path\";\n \n // if GET and vars, append them\n if($method == \"GET\") \n $url .= (FALSE === strpos($path, '?')?\"?\":\"&\").$encoded;\n\n // initialize a new curl object \n $curl = curl_init($url);\n \n $opts = array();\n foreach ($headers as $k => $v) $opts[CURLOPT_HTTPHEADER][] = \"$k: $v\";\n curl_setopt_array($curl, $opts);\n \n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n switch(strtoupper($method)) {\n case \"GET\":\n curl_setopt($curl, CURLOPT_HTTPGET, TRUE);\n break;\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n break;\n case \"PUT\":\n // curl_setopt($curl, CURLOPT_PUT, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n file_put_contents($tmpfile = tempnam(\"/tmp\", \"put_\"),\n $encoded);\n curl_setopt($curl, CURLOPT_INFILE, $fp = fopen($tmpfile,\n 'r'));\n curl_setopt($curl, CURLOPT_INFILESIZE, \n filesize($tmpfile));\n break;\n case \"DELETE\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n break;\n default:\n throw(new PocketstopException(\"Unknown method $method\"));\n break;\n }\n \n // send credentials\n curl_setopt($curl, CURLOPT_USERPWD,\n $pwd = \"{$this->AccountId}:{$this->ApiKey}\");\n \n // do the request. If FALSE, then an exception occurred \n if(FALSE === ($result = curl_exec($curl)))\n throw(new PocketstopException(\n \"Curl failed with error \" . curl_error($curl)));\n \n // get result code\n $responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n \n // unlink tmpfiles\n if($fp)\n fclose($fp);\n if(strlen($tmpfile))\n unlink($tmpfile);\n \n return new PocketstopRestResponse($url, $result, $responseCode);\n }", "protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }", "public function start()\n {\n // don't start more than once.\n if ($this->isStarted()) {\n // be sure the segment is loaded, though\n $this->load();\n return;\n }\n \n // set the privacy headers\n if ($this->_config['P3P']) {\n $response = Solar_Registry::get('response');\n $response->setHeader('P3P', $this->_config['P3P']);\n }\n \n // start the session\n $this->_manager->start();\n \n // load the session segment\n $this->load();\n }", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function start()\n {\n self::registerDefault();\n\n $page = rex_request('page', 'string');\n $subpage = rex_request('subpage', 'string');\n $function = rex_request('function', 'string');\n\n if ($page === 'import_export' && $subpage === 'import' && $function === 'dbimport') {\n rex_register_extension('A1_AFTER_DB_IMPORT', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } elseif ($page === 'developer' && $function === 'update') {\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } else {\n self::synchronize(self::START_EARLY);\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(rex_developer_manager::START_LATE);\n });\n }\n }", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "function request($vars=array())\n { \n $this->req->setHeader(array(\n 'user-agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0',\n 'Referer' => $vars['host'].$vars['url'],\n 'Connection' => 'keep-alive'\n\n ));\n\n\n $url_obj = new Net_URL2(($vars['host'] ? $vars['host'] : DATA_HOST).$vars['url']);\n \n if ($vars['method'] == 'post') {\n $this->req->setMethod(HTTP_Request2::METHOD_POST);\n\n if ($this->cookies_jar) {\n $this->req->setCookieJar($this->cookies_jar);\n }\n $this->req->addPostParameter($vars['params']);\n\n\n\n\n } else {\n $url_obj->setQueryVariables($vars['params']);\n }\n\n\n\n ///////////////////////////////////////\n if ($vars['cookies']) {\n foreach ($vars['cookies'] as $k => $cookie) {\n //$this->req->addCookie($cookie['name'], $cookie['value']);\n }\n }\n\n $this->req->setUrl($url_obj);\n $this->response = $this->req->send();\n \n\n\n //HTTP_Request2_CookieJar::addCookiesFromResponse();\n\n //$cookies = HTTP_Request2_CookieJar::getAll();\n \n $this->cookies_jar = $this->req->getCookieJar();\n //echo '<pre>';\n //print_r($this->req);\n \n\n if (DEBUG == 1) {\n //echo \"\\n POST TO: \".$this->req->getUrl().\"\\n\";\n echo '<pre>';\n echo \"Status \".$this->response->getStatus();\n print_r($this->req);\n }\n\n $body = $this->response->getBody();\n //$header = $this->response->getHeader();\n return $body;\n }", "public function launchApp()\n {\n if ($this->findAppPort()) {\n return;\n }\n\n exec('open ' . self::APP_LAUNCH_URL);\n\n while (!$this->findAppPort()) {\n sleep(2);\n }\n }", "function initRequestInfo($sapi='') { \n\n}", "public function provision($request);", "function vpn_setup() {\n\tglobal $g;\n\n\tif ($g['platform'] == 'jail')\n\t\treturn;\n\n\t/* start pptpd */\n\tvpn_pptpd_configure();\n\n\t/* start pppoe server */\n\tvpn_pppoes_configure();\n\n\t/* setup l2tp */\n\tvpn_l2tp_configure();\n}", "function getRequest();", "public function __construct(\n\t\t$ipc='/tmp/xmldb2',\n\t\t$ctl='*sbmjob',\n\t\t$url='http://example.com/cgi-bin/xmlcgi.pgm',\n\t\t$debug='*none' // *none, *in, *out, *all\n)\n{\n}", "function main()\n{\n //getRequestidhl();\n\t //getRequestidlap();\n\t getRequestidpl();\n\n\t\n}", "private function invoke() {\n global $user;\n $req =& $this->request;\n try {\n\n if ($req) {\n if (isset($req->uri) && preg_match(\"/^([^\\?]*)(\\?(.*))?$/\", $req->uri, $match)) {\n $this->q = $match[1];\n parse_str($match[3], $_GET);\n }\n }\n \n if (isset($req) && !is_object($req))\n throw new Exception(\"Invalid Request.\", -32600);\n \n \n if (!preg_match(\"/^(?:(\\D\\w*)[\\.\\/])?(\\D\\w*)\\/?(.*)$/\", $this->q, $match))\n throw new Exception(\"Invalid Request.\", -32600);\n \n list(, $c, $m, $a) = $match;\n \n\t\t\n\t\t//if (!$c)\n\t\t//\t$c = jsonrpc_load_class_by_method($m, TRUE);\n \n\n\t\t\n \n if (!($c && class_exists($c, FALSE))) {\n $c = jsonrpc_load_class($c, $m, TRUE);\n }\n \n if (isset($a) && is_string($a) && FALSE !== strpos($a, ','))\n $a = explode(',', $a);\n if (isset($_GET['id']))\n $req->id = $_GET['id'];\n $is_super = $user->uid == 1;\n if ($user->uid == 0 && $_SERVER['REMOTE_ADDR'] == '127.0.0.1' && !isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $is_super = TRUE;\n $user->uid = 1;\n }\n \n //echo $c;\n \n if (!method_exists($c, $m))\n throw new Exception('Method does not exists.', -32601);\n if (variable_get('site_offline', 0) && !$is_super)\n throw new Exception('Site if offline');\n $refl = new ReflectionMethod($c, $m);\n \n\t//$args = array();\n \n if (!isset($req->params)) {\n if ($a)\n $args = $a;\n elseif (isset($_GET['params']))\n $args = explode(',', $_GET['params']);\n elseif (isset($_GET['param']))\n $args = explode(',', $_GET['param']);\n }\n else\n $args = $req->params;\n \n //if(!is_array($args))\n \t\n\n\t//var_dump(count($args) <= $refl->getNumberOfParameters());\n\n //if ($refl->getNumberOfRequiredParameters() <= 1 && is_array($args) && count($args) > $refl->getNumberOfParameters() )\n \n //if($refl->getNumberOfRequiredParameters\n \n $np = $refl->getNumberOfParameters();\n $nr = $refl->getNumberOfRequiredParameters();\n\n\t\t//if ($np == 1 && count($args)\n//var_dump($args);\n//die;\n \n \n \n if ($nr <= 1 && !(is_array($args) && count($args) == $np && $np > 1 ) && isset($req->params))\n $args = array($args);\n\n\n//var_dump($args);\n\n switch (TRUE) {\n case $refl->isStatic():\n $req->result = call_user_func_array(array($c, $m), $args);\n break;\n case $refl->isPublic():\n $inst = $this->instance($c);\n $req->result = call_user_func_array(array($inst, $m), $args);\n break;\n case $refl->isProtected() && $is_super:\n $refl->setAccessible(TRUE);\n $req->result = $refl->invokeArgs(new $c, $args);\n break;\n default:\n throw new Exception(\"Method not found or permission denied on launching $c::$m.\");\n }\n } catch (Exception $e) {\n if (!is_object($req))\n $req = $this->request = (object)NULL;\n $data = isset($e->data) ? $e->data : get_class($e);\n $req->error = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'data' => $data);\n }\n }", "public function start() {\n\t\t$this->invoke(\"start\");\n\t}", "public function do_service() {\n $this->params_wrapper->check();\n $this->params_wrapper->wrap();\n $xml_content = XMLBuilder::buildXML($this->params_wrapper->getWrappedParameters());\n $sympa_client = new SympaPLClient();\n $main_robot_name = strtolower($this->params_wrapper->getWrappedParameter(SympaRemoteConstants::INPUT_RNE)).\".\".$this->config->sympa_main_domain;\n\n\t\t$operation = $this->params_wrapper->getWrappedParameter(SympaRemoteConstants::INPUT_OPERATION);\n\t\t$this->log->LogDebug(\"Operation : \" . $operation);\n\t\tswitch ($operation) {\n\t\t\tcase \"CREATE\":\n\t\t\t\t$sympa_client->createListWithXML($xml_content, $this->params_wrapper->getWrappedParameter(SympaPLClient::ARGUMENT_FAMILLE), $main_robot_name);\n\t\t\t\tbreak;\n\t\t\tcase \"UPDATE\":\n\t\t\t\t$sympa_client->updateListWithXML($xml_content, $this->params_wrapper->getWrappedParameter(SympaPLClient::ARGUMENT_FAMILLE), $main_robot_name);\n\t\t\t\tbreak;\n\t\t\tcase \"CLOSE\":\n\t\t\t\t$listname = $this->params_wrapper->getWrappedParameter(SympaRemoteConstants::INPUT_LIST_NAME_TO_CLOSE);\n\t\t\t\t$sympa_client->closeList($listname);\n\t\t\t\tbreak;\n\t\t}\n }", "public function sendRequest( ) {\n\n }", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();" ]
[ "0.5612763", "0.5525759", "0.54947025", "0.5483861", "0.5424874", "0.53004473", "0.5292742", "0.52383745", "0.5200733", "0.51928914", "0.51905066", "0.5177111", "0.5133291", "0.5111772", "0.5095762", "0.50861514", "0.5085203", "0.50843054", "0.50738096", "0.50710666", "0.5070365", "0.506262", "0.50092083", "0.49979642", "0.4983782", "0.49734724", "0.49696526", "0.49451703", "0.49316812", "0.49014345", "0.48960334", "0.48778817", "0.48764452", "0.48668477", "0.48668477", "0.48645794", "0.48444274", "0.48361972", "0.48326203", "0.4826423", "0.4823906", "0.48190722", "0.4813095", "0.48076257", "0.4806822", "0.47998872", "0.479199", "0.47760275", "0.4775875", "0.47523117", "0.47456926", "0.47418162", "0.47390613", "0.47373757", "0.47332215", "0.47234088", "0.4723181", "0.47172847", "0.47172403", "0.47172362", "0.47162607", "0.47124752", "0.47019035", "0.4696995", "0.4695339", "0.46943852", "0.46924433", "0.46867403", "0.46843657", "0.4680877", "0.46556798", "0.46552882", "0.46514168", "0.4642181", "0.46420583", "0.46404183", "0.46394372", "0.4633139", "0.46292415", "0.4621868", "0.4619944", "0.46162072", "0.46141192", "0.4613174", "0.461256", "0.46079427", "0.4606045", "0.46008143", "0.4592087", "0.45911762", "0.4579695", "0.4575816", "0.4574739", "0.4574739", "0.4574739", "0.4574739", "0.4574739", "0.4574739", "0.4574739", "0.4574739", "0.4574739" ]
0.0
-1
Mark the PIREP as filed
protected function filePirep($pirep_id) { $response = $this->httpClient->post('/api/pireps/'.$pirep_id.'/file', [ 'json' => [], ]); $body = \json_decode($response->getBody()->getContents()); return $body; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPR($r) {}", "function updatePofAlloc($pid)\n\t {\n\t\t$sql = \"UPDATE pof SET is_allocated = 1 WHERE pof_id =\".$pid;\n\t\t$this->db->query($sql);\n\t\t}", "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 setPending()\n {\n $this->attributes['status'] = 'pending';\n self::save();\n }", "public function setPaid()\n {\n return $this->setMarkedAs($this->getPaidValue());\n }", "function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }", "public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }", "protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }", "public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "function setPID($pid) {\n\t\t$this->_pid = $pid;\n\t}", "public function setDispFields() {}", "public function markAsPending() {\n $this->status = parent::STATUS_PENDING;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public function setPinRequired(?bool $pinRequired): void\n {\n $this->pinRequired = $pinRequired;\n }", "public function setProcessing($id){\n \t\t$model = Mage::getModel(\"mprmasystem/rmarequest\")->load($id);\n \t\t$model->setStatus(\"Processing\")->save();\n \t}", "public function setPid($pid, $reassign = false);", "public function markRequiredFields($mark) {\n $this->markRequiredFields = $mark;\n }", "function setField($field) {\r\r\n\t\t$this->field = $field;\r\r\n\t}", "public function setProcessed()\r\n {\r\n $this->processed = true;\r\n }", "function setRemoteField($field){\n\t\t$this->remote_field = $field;\n\t}", "private function setPopulated() {\n $this->is_populated = true;\n }", "public function asMandatory()\n {\n $this->mandatory = true;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setMandatoryField($this);\n }", "public function setPublic()\n {\n $this->private = false;\n }", "public function markApproved()\n {\n $this->IsSpam = false;\n $this->Moderated = true;\n $this->write();\n $this->extend('afterMarkApproved');\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function setCanShipPartially($flag);", "public function setField($field) {\n\t\t$this->_field = $field;\n\t}", "public function markForDelete() {\n\t$this->_markForDelete = true;\n }", "function set_required() \n {\n $this->error_state = FORMEX_FIELD_REQUIRED;\n }", "public function markIfRequired($mark) {\n $this->markIfRequired = $mark;\n }", "public function onPirepPrefile(PirepPrefiled $event)\n {\n }", "public function setPIID($value)\n {\n return $this->set('PIID', $value);\n }", "public function setPid($pid)\n {\n $this->pid = $pid;\n }", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "public function testUpdatePayslipByID()\n {\n }", "public function pi_setPiVarDefaults() {}", "public function setMiracastRequirePin(?bool $value): void {\n $this->getBackingStore()->set('miracastRequirePin', $value);\n }", "public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }", "public function testSetNotForPaymentDisabledFields()\n {\n $this->slipData->setWithReferenceNumber(false);\n $this->slipData->setWithBankingCustomerId(false);\n\n $this->slipData->setNotForPayment(true);\n }", "protected function _fcpoMarkOrderAsProblematic() {\n $this->_blOrderHasProblems = true;\n }", "public function markIfRequired($mark);", "public function register_field()\n {\n }", "public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}", "public function edit(IP $iP)\n {\n //\n }", "protected function markApproved( )\r\n {\r\n $this->_sessie->registerApproved( $this );\r\n }", "public function testUpdatePackingPlanCustomFields()\n {\n }", "public function testUpdateReplenishmentCustomFields()\n {\n }", "protected abstract function setFields();", "public function setField($field)\n {\n $this->_field = $field;\n }", "public function setField($field);", "public function setField($field);", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function setFlag($flag);", "public function apagarPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"OFF\");\n $this->setEncendidoPizarra(0);\n\n }", "public function propegate() : void\n {\n $this->event->sender->enabledForSite = in_array(\n $this->event->sender->siteId,\n $this->event->sender->getFieldValue('sites')\n );\n }", "function _putSetCheckField($name){\n\t\tif(!isset($this->pkeyID) || isset($this->rc4key)) return;\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"formitable_setcheck[]\\\" value=\\\"$name\\\"/>\\n\\n\";\n\t}", "function set_par($p,$v)\n {\n $this->__par[$p] = $v;\n }", "public function testUpdatePayslip()\n {\n }", "public function enablePlaques()\n\t{\n\t\t$this->_plaques = true;\n\t}", "protected function setPid($pid)\n {\n $this->pid = $pid;\n }", "public function define()\n {\n $labelUnknown = new DLabel('app\\\\decibel', 'unknown');\n // Set field information.\n $ipAddress = new DTextField(self::FIELD_IP_ADDRESS, 'IP Address');\n $ipAddress->setNullOption($labelUnknown);\n $ipAddress->setMaxLength(15);\n $this->addField($ipAddress);\n $url = new DTextField(self::FIELD_URL, 'Request URL');\n $url->setNullOption($labelUnknown);\n $url->setMaxLength(255);\n $this->addField($url);\n $reason = new DTextField(self::FIELD_REASON, 'Reason');\n $reason->setNullOption($labelUnknown);\n $reason->setMaxLength(255);\n $this->addField($reason);\n }", "public function setPid(int $pid){\n $this->pid = $pid;\n }", "protected function _updatefields() {}", "public function setForReferenceOnly($flag = true)\n {\n $this->forReferenceOnly = (boolean)$flag;\n }", "public function setField( WebLab_Data_Field $field ) {\n $this->_field = $field;\n }", "function setField($Field){\n\t\t$this->Field = $Field;\n\t}", "public function save() \n {\n $oForwarding = oxNew('fcpoforwarding');\n $aForwardings = $this->_oFcpoHelper->fcpoGetRequestParameter(\"editval\");\n if(is_array($aForwardings) && count($aForwardings) > 0) {\n $oForwarding->fcpoUpdateForwardings($aForwardings);\n }\n }", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }", "function setARecord( $ip ) {\n\t\tglobal $wgAuth;\n\n\t\t$values = array( 'arecord' => array( $ip ) );\n\t\t$success = LdapAuthenticationPlugin::ldap_modify( $wgAuth->ldapconn, $this->hostDN, $values );\n\t\tif ( $success ) {\n\t\t\t$wgAuth->printDebug( \"Successfully set $ip on $this->hostDN\", NONSENSITIVE );\n\t\t\t$this->domain->updateSOA();\n\t\t\t$this->fetchHostInfo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to set $ip on $this->hostDN\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}", "public function markCompeted() {\n $this->status = self::COMPLETED;\n }", "function mark_notification() {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\t\t\t$nID = pods_v_sanitized( 'nID', $_REQUEST );\n\t\t\t$value = ( pods_v( 'mark', $_REQUEST ) );\n\n\t\t\tif ( $nID && in_array( $value, array( 1, 0 ) ) ) {\n\t\t\t\t$id = ht_dms_notification_class()->viewed( $nID, null, $value );\n\n\t\t\t\tif ( $id == $nID ) {\n\t\t\t\t\twp_die( 1 );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twp_die( 0 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public function setAsProcessTag()\r\n\t{\r\n\t\t$this->process_tag = TRUE;\r\n\t}", "public function setIdp($idp)\n {\n $this->idp = $idp;\n }", "public function setPrivate()\n {\n $this->private = true;\n }", "function receipt ($bool=true) {\n $this->receipt = ($bool);\n }", "public function define()\n {\n $labelUnknown = new DLabel('app\\\\decibel', 'unknown');\n $task = new DQualifiedNameField(self::FIELD_TASK, 'Task');\n $task->setAncestors(array(DScheduledTask::class));\n $task->setRequired(true);\n $this->addField($task);\n $scheduled = new DDateTimeField(self::FIELD_SCHEDULED, 'Scheduled Time');\n $scheduled->setRequired(true);\n $this->addField($scheduled);\n $owner = new DLinkedObjectField(self::FIELD_OWNER, 'Owner');\n $owner->setLinkTo(DUser::class);\n $owner->setNullOption($labelUnknown);\n $this->addField($owner);\n $forced = new DBooleanField(self::FIELD_FORCED, 'Forced');\n $forced->setDefault(false);\n $this->addField($forced);\n $started = new DDateTimeField(self::FIELD_STARTED, 'Started');\n $started->setNullOption('Not Started');\n $this->addField($started);\n $processID = new DIntegerField(self::FIELD_PROCESS_ID, 'Process ID');\n $processID->setNullOption($labelUnknown);\n $this->addField($processID);\n $progress = new DIntegerField(self::FIELD_PROGRESS, 'Progress');\n $progress->setNullOption('Not Started');\n $progress->setSize(2);\n $progress->setRequired(true);\n $this->addField($progress);\n $primaryIndex = new DPrimaryIndex();\n $primaryIndex->addField($task);\n $this->addIndex($primaryIndex);\n }", "public function form_is_available_to_update_a_note()\n {\n\n }", "protected function setAvailableFields() {\r\n\t\t$this->availableFieldsArray = array(\r\n\t\t\t'uid',\r\n\t\t\t'pid',\r\n\t\t\t'tstamp',\r\n\t\t\t'crdate',\r\n\t\t\t'cruser_id',\r\n\t\t\t'deleted',\r\n\t\t\t'hidden',\r\n\t\t\t'name',\r\n\t\t\t'hint',\r\n\t\t\t'image',\r\n\t\t\t'use_arcticle_stock_info'\r\n\t\t);\r\n\t}", "function save($from_outside=true, $prereqs_complete=false)\r\n {\r\n \tparent::save($from_outside, $prereqs_complete=false);\r\n \t//under certain conditions, the scorm_contact should not be set, because no scorm signal was sent\r\n \t$this->aicc_contact = true;\r\n \tif(!$this->aicc_contact){\r\n \t\t//error_log('New LP - was expecting SCORM message but none received',0);\t\r\n \t}\r\n }", "public function setPending($id){\n \t\t$model = Mage::getModel(\"mprmasystem/rmarequest\")->load($id);\n \t\t$model->setStatus(\"Pending\")->save();\n \t}", "public function set_PDI_ID($int_PDI_ID) {\n $this->pdi_id = $int_PDI_ID;\n }", "public function setPaper($paper) {\n\t}", "public function setField(Field $field) {\n\t\t$this->field = $field; \n\t}", "function setCreated() \n {\n $this->setValueByFieldName( 'statevar_isCreated', 1 );\n $this->updateDBTable();\n }", "public function testUpdateExternalShipmentCustomFields()\n {\n }", "public function __construct(Pirep $pirep)\n {\n parent::__construct();\n $this->pirep = $pirep;\n }", "public function updateStatusPartiallyAssigned() : bool\n {\n $this->status = self::STATUS_PARTIALLY_ASSIGNED;\n return $this->save();\n }", "private function approve() {\n\n }", "function set_required_false( $field ){\r\n\r\n\t\tif( isset( $field[ 'status' ] ) && isset( $field[ 'required' ] ) ){\r\n\r\n\t\t\tif( $field[ 'status' ] == 'disabled' && $field[ 'required' ] ) $field[ 'required' ] = false;\r\n\r\n\t\t}\r\n\r\n\t\treturn $field;\r\n\r\n\t}", "function updatePof($pid){\n\t $data = array( \n\t 'pof_id' => $pid,\n 'client_id' => $this->input->post('client_id'),\n\t\t\t'jobtitle' => $this->input->post('jobtitle'),\n\t\t\t'tl' => $this->input->post('tl'),\n\t\t\t'generic_role' => $this->input->post('generic_role'),\n\t\t\t'department' => $this->input->post('department'),\n\t\t\t'job_type' => $this->input->post('job_type'),\n//\t\t\t'worksheet' => $worksheet,\n\t\t\t'jd' => $this->input->post('jd'),\n\t\t\t'candidate_specs' => $this->input->post('candidate_specs'),\n\t \t\t'pos_taken_by' => $this->input->post('pos_taken_by'),\n\t\t\t'pos_given_by' => $this->input->post('pos_given_by'),\n\t \t\t'pos_taken_on' => $this->input->post('pos_taken_on'),\n\t\t\t'pos_sharing_method' => $this->input->post('pos_sharing_method'),\n\t\t\t'transaction_type' => $this->input->post('transaction_type'),\n\t\t\t'client_mgr' => $this->input->post('client_mgr'),\n\t\t\t'hiring_manager' => $this->input->post('hiring_mgr'),\n\t\t\t'vc' => $this->input->post('vc'),\n\t\t\t'group_posting' => $this->input->post('group_posting'),\n\t\t\t'assesment_sheet' => $this->input->post('assesment_sheet'),\n\t\t\t'tracker' => $this->input->post('tracker'),\n\t\t\t'mirus_web' => $this->input->post('mirus_web'),\n\t\t\t'client_web' => $this->input->post('client_web'),\n\t \t\t'client_confi' => $this->input->post('client_confi'),\n\t\t\t// for Location grid\n\t\t\t'location' => $this->input->post('location'),\n\t\t\t'no_of_pos' => $this->input->post('no_of_pos'),\n\t\t\t'grade' => $this->input->post('grade'),\n\t\t\t'designation' => $this->input->post('designation'),\n\t\t\t'level' => $this->input->post('level'),\n\t\t\t'exp_f' => $this->input->post('exp_f'),\n\t\t\t'exp_t' => $this->input->post('exp_t'),\n\t\t\t'sal_f' => $this->input->post('sal_f'),\n\t\t\t'sal_t' => $this->input->post('sal_t'),\n\t\t\t'reports_to_name' => $this->input->post('reports_to_name'),\n\t\t\t'reports_to_level' => $this->input->post('reports_to_level'),\n\t\t\t// for Education grid\n\t\t\t'edu_level' => $this->input->post('edu_level'),\n\t\t\t'batch_f' => $this->input->post('batch_f'),\n\t\t\t'batch_t' => $this->input->post('batch_t'),\n\t\t\t'degree' => $this->input->post('degree'),\n\t\t\t'subject' => $this->input->post('subject'),\n\t\t\t'institute_pref' => $this->input->post('institute_pref'),\n\t\t\t );\n\t\t\t \n\t\t$this->db->where('pof_id', $pid);\n\t\t$this->db->update('pof', $data);\n }", "public function setCanShipPartiallyItem($flag);", "public function setIsRefinable(?bool $value): void {\n $this->getBackingStore()->set('isRefinable', $value);\n }", "function modificarPresupuesto(){\n\t\t$this->procedimiento='pre.ft_presupuesto_ime';\n\t\t$this->transaccion='PRE_PRE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('descripcion','descripcion','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('gestion','gestion','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function setRefFields($val) {\n $this->_refFields = $val;\n }", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "function setComprobantePagoARegistroPago() {\n\t\tglobal $bd;\t\t\n\t\tglobal $x_correlativo_comprobante;\n\t\t$correlatico_comprobante = $x_correlativo_comprobante;\n\t\t$x_array_comprobante = $_POST['p_comprobante'];\n\t\t$id_registro_pago = $_POST['idregistro_pago'];\n\n\t\t$idtipo_comprobante_serie = $x_array_comprobante['idtipo_comprobante_serie'];\n\t\t\n\t\t$sqlrp=\"update registro_pago set idtipo_comprobante_serie=\".$idtipo_comprobante_serie.\" where idregistro_pago=\".$id_registro_pago;\n\t\t$idregistro_pago=$bd->xConsulta_NoReturn($sqlrp);\n\t}", "static function preProcess( &$form )\n {\n $session = CRM_Core_Session::singleton( );\n $contactID = $session->get( 'userID' );\n \n \n \n $form->_profileId = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_UFGroup', 'gift_subscription',\n 'id', 'name' );\n $form->assign( 'profileId', $form->_profileId );\n \n if ( $contactID ) {\n \n $form->assign( 'onBehalfRequired', $form->_onBehalfRequired );\n }\n \n }", "private function setPID($pid)\n {\n $this->log(\"process id is $pid\");\n $this->pid = (int)$pid;\n }", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}" ]
[ "0.5907681", "0.5708308", "0.5506802", "0.54108936", "0.53561044", "0.5336169", "0.52930415", "0.5283455", "0.5282057", "0.5245861", "0.52099305", "0.5190593", "0.51577467", "0.5147509", "0.50662905", "0.50470865", "0.50206405", "0.5018104", "0.50112766", "0.49632365", "0.4954671", "0.49545962", "0.49486428", "0.4936684", "0.49139866", "0.49094644", "0.4909258", "0.49074608", "0.48983598", "0.48973644", "0.48818552", "0.48618123", "0.48601028", "0.4845165", "0.48427644", "0.48426273", "0.48366362", "0.48333102", "0.48324427", "0.48307744", "0.48227668", "0.48183167", "0.4817253", "0.4816012", "0.48003107", "0.47992343", "0.4792834", "0.47904685", "0.4775544", "0.47611457", "0.47611457", "0.4756032", "0.47502735", "0.4740778", "0.47378117", "0.47276393", "0.4723859", "0.4720965", "0.47176328", "0.47111103", "0.4701443", "0.4700448", "0.46964896", "0.46954402", "0.46927777", "0.4678697", "0.46744758", "0.46711457", "0.46685457", "0.46671695", "0.4662497", "0.46537173", "0.46515992", "0.4629752", "0.46248695", "0.46240222", "0.4619843", "0.46187884", "0.46067196", "0.46067023", "0.46032488", "0.45986196", "0.45984614", "0.4595607", "0.4595097", "0.45914954", "0.45837075", "0.45815882", "0.45811373", "0.4578789", "0.4577085", "0.45761472", "0.45634493", "0.45589224", "0.45505336", "0.45485827", "0.45357358", "0.45342755", "0.45291117", "0.45212537", "0.4520985" ]
0.0
-1
Parse this file and run the updates
protected function updatesFromFile(array $files) { /** * @var $flights Collection */ $flights = collect($files)->transform(function ($f) { $file = $f; if (file_exists($file)) { $this->info('Loading '.$file); $contents = file_get_contents($file); $contents = \json_decode($contents); return collect($contents->updates); } $this->error($file.' not found, skipping'); return false; }) // remove any of errored file entries ->filter(function ($value, $key) { return $value !== false; }); $this->info('Starting playback'); /* * File the initial pirep to get a "preflight" status */ $flights->each(function ($updates, $idx) { $update = $updates->first(); $pirep_id = $this->startPirep($update); $this->pirepList[$update->callsign] = $pirep_id; $this->info('Prefiled '.$update->callsign.', ID: '.$pirep_id); }); /* * Iterate through all of the flights, retrieving the updates * from each individual flight. Remove the update. Continue through * until there are no updates left, at which point we remove the flight * and updates. * * Continue until we have no more flights and updates left */ while ($flights->count() > 0) { $flights = $flights->each(function ($updates, $idx) { $update = $updates->shift(); $pirep_id = $this->pirepList[$update->callsign]; $this->postUpdate($pirep_id, $update); // we're done and don't put the "no-submit" option if ($updates->count() === 0 && !$this->option('no-submit')) { $this->filePirep($pirep_id); } })->filter(function ($updates, $idx) { return $updates->count() > 0; }); if (!$this->option('write-all')) { if (!$this->option('manual')) { sleep($this->sleepTime); } else { $this->confirm('Send next batch of updates?', true); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function processUpdates()\n {\n $this->importStaticData();\n }", "public function runUpdateScript()\n {\n $current_schema = get_config('schema');\n if ($current_schema < 2) {\n // 20150727\n $this->schema2();\n $this->updateSchema(2);\n }\n if ($current_schema < 3) {\n // 20150728\n $this->schema3();\n $this->updateSchema(3);\n }\n if ($current_schema < 4) {\n // 20150801\n $this->schema4();\n $this->updateSchema(4);\n }\n if ($current_schema < 5) {\n // 20150803\n try {\n $this->schema5();\n } catch (Exception $e) {\n die($e->getMessage());\n }\n $this->updateSchema(5);\n }\n // place new schema functions above this comment\n $this->cleanTmp();\n $msg_arr = array();\n $msg_arr[] = \"[SUCCESS] You are now running the latest version of eLabFTW. Have a great day! :)\";\n return $msg_arr;\n }", "private function parse()\n {\n $this->info('Start profiles refresh...');\n // Load the file and\n // parse the csv format\n $path = storage_path(config('constants.stations_infos_path'));\n\n if (($pointer = fopen($path, 'r')))\n {\n DB::beginTransaction();\n $first = true;\n $this->info('Parsing CSV profiles...');\n while (($line = fgetcsv($pointer, 0, ';')))\n {\n // Ignore the first header line\n if (! $first)\n {\n $this->refresh($line);\n }\n $first = false;\n }\n fclose($pointer);\n\n if ($this->commit)\n {\n $this->info('Done. Saving changes...');\n DB::commit();\n }\n else\n {\n $this->info('Error, rollback changes!');\n DB::rollBack();\n }\n }\n }", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "public function run()\n {\n $this->loadTextFile($this->text_file);\n }", "public function run()\n {\n try {\n // sets the path to the lock dir.\n $this->_lockPath = $this->getConfig()->databaseManager->tmpDir;\n\n // acquire the exclusive lock\n $this->_acquireLock();\n\n $this->setDeltasToInstall(\n $this->getInstalledDeltas(),\n $this->getAvailableDeltas());\n\n $this->processDeltas();\n\n echo $this->getInstructions();\n\n // catch any parser exceptions\n } catch (MyApp_Database_Parser_Exception $e) {\n echo \"$e\\n\";\n } catch (MyApp_Database_Parser_Update_Exception $e) {\n echo \"$e\\n\";\n } catch (MyApp_Database_Parser_Provider_Exception $e) {\n echo \"$c\\n\";\n }\n\n // release the current exclusive lock\n $this->_releaseLock();\n }", "private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }", "public function update(): void\n {\n $content = $this->getOriginalContent();\n\n $parsed = $this->parseContent($content);\n\n $this->storeList($parsed);\n }", "protected function parseVersionFile(): void\n {\n if (! file_exists($this->version_file)) {\n return;\n }\n\n // Read file in as an array & remove any empty lines\n $version_parts = array_filter(explode(\"\\n\", @file_get_contents($this->version_file)));\n\n // First line is the version\n if (empty($version_parts) or ! $this->parseVersion(array_shift($version_parts))) {\n return;\n }\n\n // Next line is branch/pre release\n $pre_release = array_shift($version_parts);\n\n $this->pre_release = ($pre_release !== 'master') ? $pre_release : null;\n\n // Is there anything left in the file for meta?\n if (empty($version_parts)) {\n return;\n }\n\n // Everything left is the meta, so concatenate it with .'s & replace the spaces with _'s\n $this->meta = preg_replace('/\\\\s+/u', '_', implode('.', $version_parts));\n }", "public function process() {\n $this->migrate_course_files();\n // todo $this->migrate_site_files();\n }", "function update() {\n\t\t$CLI_url = escapeshellarg($this->URL);\n\n\t\t// Update LatestRev\n\t\tif($this->NeedsLatestRev) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn info --xml $CLI_url &> /dev/stdout\", $output, $retVal);\n\t\t\tif($retVal == 0 && preg_match(\"/\\<\\?xml/\", $output[0])) {\n\t\t\t\ttry {\n\t\t\t\t\t$info = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\tif($info->entry->commit['revision']) {\n\t\t\t\t\t\t$this->LatestRevPacked = (string)$info->entry->commit['revision'];\n\t\t\t\t\t\t$this->LatestDatePacked = (string)$info->entry->commit->date;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\tuser_error($e, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// Update ChildDirs\n\t\tif($this->NeedsChildDirs) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn ls --xml $CLI_url\", $output, $retVal);\n\t\t\tif($retVal == 0) {\n\t\t\t\t$subdirs = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\n\t\t\t\tif($subdirs) {\n\t\t\t\t\t$subdirInfo = array();\n\t\t\t\t\tforeach($subdirs->xpath('//entry') as $entry) {\n\t\t\t\t\t\t$name = (string)$entry->name;\n\t\t\t\t\t\t$date = (string)$entry->commit->date;\n\t\t\t\t\t\t$rev = (string)$entry->commit['revision'];\n\t\t\t\t\t\n\t\t\t\t\t\t$subdirInfo[$name] = array('date' => $date, 'rev' => $rev);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->ChildDirsPacked = serialize($subdirInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t$this->write();\n\t\t\n\t}", "public function parse()\n {\n $this->data = parse_ini_file($this->fileName);\n }", "public function main()\n {\n $this->processUpdates();\n return $this->generateOutput();\n }", "public function main()\r\n {\r\n // check supplied attributes\r\n $this->checkFile();\r\n $this->checkProperty();\r\n\r\n // read file\r\n $filecontent = trim(file_get_contents($this->file));\r\n\r\n // get new version\r\n $newVersion = $this->getVersion($filecontent);\r\n\r\n // write new Version to file\r\n file_put_contents($this->file, \"#Build Number for PHING. Do not edit! \\n\" .$newVersion . \"\\n\");\r\n\r\n // publish new version number as property\r\n $this->project->setProperty($this->property, $newVersion);\r\n\r\n }", "public function run()\n {\n// $this->parse();\n }", "public static function update($forceUpdate = false): void\n {\n static::getParser()->update($forceUpdate);\n }", "public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }", "public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }", "public function main()\n {\n $testSuitesDoc = new DOMDocument();\n $testSuitesDoc->load((string) $this->inFile);\n\n $this->fixDocument($testSuitesDoc);\n\n $this->transform($testSuitesDoc);\n }", "public function parse($file);", "public function parse($file);", "protected function processChangedAndNewFiles() {}", "protected function update() {}", "public function apply() {\r\n chdir(APP_PATH . '/tmp/');\r\n\r\n //Get the files whose name begins from 'vdumes_', these files are VDUMES should be updated. If they begins from 'wwoffice_', they mean used by WWOffice.\r\n $array = glob(\"vdumes_*.txt\");\r\n $count = count($array);\r\n\r\n if ($count == 0) {\r\n exit();\r\n }\r\n\r\n //cycle each file for update\r\n foreach ($array as $val) {\r\n //The files's content seperated by semicolon, from left to right is domain,address,quota.\r\n $str = file_get_contents(APP_PATH . '/tmp/' . $val);\r\n $arr = explode(';', $str);\r\n\r\n //The update data\r\n $arr[] = array(\r\n 'quota' => $arr[2]\r\n );\r\n\r\n //The condition for update\r\n $conditions = array(\r\n 'username' => $arr[1],\r\n );\r\n $mx = spClass('lib_mailbox');\r\n $bl = $mx->update($conditions, $arr);\r\n\r\n //Get the affected rows.\r\n $rows = $mx->affectedRows();\r\n\r\n //If the affected rows equal -1, it means update failure, otherwise it means success.\r\n if ($rows == -1) {\r\n $this->spArgs('msg') = 'Update quota failure.';\r\n $this->writelog();\r\n } else {\r\n //If update success, then delete the txt file. If it failed, jump the error message then jump to the index page of mailbox controller.\r\n if (!unlink($val)) {\r\n $this->spArgs('msg') = 'The file is failed by deleting.';\r\n $this->writelog();\r\n }\r\n return TRUE;\r\n }\r\n }\r\n }", "private function parse()\n {\n $handle = fopen($this->filepath, 'r');\n if(! $handle) throw new \\Exception(\"Can't read file $this->filepath\");\n\n $plugin = null;\n\n while(($line = fgets($handle)) !== false) {\n\n /* Remove next line character from end of line */\n $line = str_replace(PHP_EOL, '', $line);\n\n /* Skip comments and empty lines */\n if(starts_with($line, '#') || trim($line) === '') continue;\n\n /* Find description setting */\n else if(starts_with($line, 'description')) $this->parseDescription($line);\n\n /* Find help setting */\n else if(starts_with($line, 'help')) $this->parseHelp($line);\n\n /* Capture commands */\n else if(starts_with_whitespace($line)) $plugin->parseCommand($line);\n\n /* Start plugin capture */\n else {\n $plugin = $this->parseCurrentPlugin($line);\n }\n }\n\n fclose($handle);\n\n /* Set state as parsed */\n $this->isParsed = true;\n }", "public function load()\n\t{\n\t\tif (!$infile = $this->arguments->getOpt(3))\n\t\t{\n\t\t\t$this->output->error('Please provide an input file');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!is_file($infile))\n\t\t\t{\n\t\t\t\t$this->output->error(\"'{$infile}' does not appear to be a valid file\");\n\t\t\t}\n\t\t}\n\n\t\t// First, set some things aside that we need to reapply after the update\n\t\t$params = [];\n\t\t$params['com_system'] = \\Component::params('com_system');\n\t\t$params['com_tools'] = \\Component::params('com_tools');\n\t\t$params['com_usage'] = \\Component::params('com_usage');\n\t\t$params['com_users'] = \\Component::params('com_users');\n\t\t$params['plg_projects_databases'] = \\Plugin::params('projects', 'databases');\n\n\t\t$tables = App::get('db')->getTableList();\n\n\t\t// See if we should drop all tables first\n\t\tif ($this->arguments->getOpt('drop-all-tables'))\n\t\t{\n\t\t\t$this->output->addLine('Dropping all tables...');\n\t\t\tforeach ($tables as $table)\n\t\t\t{\n\t\t\t\tApp::get('db')->dropTable($table);\n\t\t\t}\n\t\t}\n\n\t\t// Craft the command to be executed\n\t\t$infile = escapeshellarg($infile);\n\t\t$cmd = \"mysql -u \" . Config::get('user') . \" -p'\" . Config::get('password') . \"' -D \" . Config::get('db') . \" < {$infile}\";\n\n\t\t$this->output->addLine('Loading data from ' . $infile . '...');\n\n\t\t// Now push the big red button\n\t\texec($cmd);\n\n\t\t$migration = new Migration(App::get('db'));\n\n\t\t// Now load some things back up\n\t\tforeach ($params as $k => $v)\n\t\t{\n\t\t\tif (!empty($v))\n\t\t\t{\n\t\t\t\t$migration->saveParams($k, $v);\n\t\t\t}\n\t\t}\n\n\t\t$this->output->addLine('Load complete!', 'success');\n\t}", "public function scanAndConvert()\n {\n foreach ($this->getFileToConvert() as $file) {\n $output = array();\n $in = $file;\n $out = preg_replace('/.{3}$/', '', $in);\n foreach ($this->getSupportedFormat() as $ext) {\n $cmd = self::FFMPEG . \" -y -i \" . $this->inputDirectory . \"/\" . $in . \" \" . $this->outputDirectory . \"/\" . $out . $ext;\n exec($cmd, $output);\n foreach ($output as $line) {\n $this->logger->info($line);\n }\n }\n $cmd = self::RM . \" -rvf \" . $in;\n exec($cmd, $output);\n foreach ($output as $line) {\n $this->logger->info($line);\n }\n\n // update the entity\n $id = preg_replace('/-.*$/', '', $in);\n $this->updateEntity($id, $out);\n }\n }", "protected function run_updater() {\r\n\r\n\t\t/*\r\n\t\t* Version 1.6\r\n\t\t* add `active` to table categories\r\n\t\t*/\r\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NOT NULL DEFAULT '1' AFTER `order`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\r\n\t\t\t$list_tables = array(\r\n\t\t\t\t'products' => 'color',\r\n\t\t\t\t'products' => 'printings',\r\n\t\t\t);\r\n\r\n\t\t\tforeach ($list_tables as $k => $v) {\r\n\t\t\t\t$columns = $this->main->db->rawQuery(\"SHOW COLUMNS FROM `{$this->main->db->prefix}{$k}` LIKE '{$v}'\");\r\n\t\t\t\tif(count($columns) > 0){\r\n\t\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\t\"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `{$v}` `{$v}` TEXT NOT NULL\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NOT NULL AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\r\n\r\n\t\t\t$this->upgrade_1_7();\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NOT NULL AFTER `stages`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t\t// do the convert old data\r\n\t\t\t// 1. convert colors to attribute\r\n\t\t\t// 2. convert all old attribute structure to new structure\r\n\t\t\t// 3. convert stages\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) > 0){\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\r\n\t\t\t$this->upgrade_1_7_3();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.4') >=0 ) {\r\n\r\n\t\t\t$tables = $this->main->db->rawQuery(\"SHOW TABLES LIKE '{$this->main->db->prefix}sessions'\");\r\n\r\n\t\t\tif (count($tables) === 0) {\r\n\r\n\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\"CREATE TABLE IF NOT EXISTS `{$this->main->db->prefix}sessions` (\r\n\t\t\t\t\t `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t `name` varchar(255) NOT NULL,\r\n\t\t\t\t\t `value` varchar(255) NOT NULL,\r\n\t\t\t\t\t `expires` int(11) NOT NULL,\r\n\t\t\t\t\t `session_id` varchar(255) NOT NULL,\r\n\t\t\t\t\t PRIMARY KEY (`id`)\r\n\t\t\t\t\t) ENGINE=InnoDB AUTO_INCREMENT=1 CHARSET=utf8mb4\"\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'cart_id';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `cart_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `product_id`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.5') >=0 ) {\r\n\t\t\t$this->upgrade_1_7_5();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.2') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'name_desc'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `name_desc` varchar(255) NOT NULL DEFAULT '' AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.3') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'active_description'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `active_description` INT(1) NOT NULL DEFAULT '0' AFTER `description`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.9') >=0 ) {\r\n\t\t\t$this->upgrade_1_9_9();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '2.0') > 0 ) {\r\n\t\t\t$this->upgrade_2_0();\r\n\t\t}\r\n\t\t/*\r\n\t\t*\tCreate subfolder upload\r\n\t\t*/\r\n\r\n\t\t$this->main->check_upload();\r\n\r\n\t}", "function processXML($update, $cmpId) {\n if ($update->getName() == \"MOPComplete\")\n\tclearCompetition($cmpId);\n else if ($update->getName() != \"MOPDiff\")\n die(\"Unknown data\");\n\n foreach ($update->children() as $d) {\n\tif ($d->getName() == \"cmp\")\n\t processCompetitor($cmpId, $d);\n\telse if ($d->getName() == \"tm\")\n\tprocessTeam($cmpId, $d);\n\telse if ($d->getName() == \"cls\")\n\tprocessClass($cmpId, $d);\n\telse if ($d->getName() == \"org\")\n\tprocessOrganization($cmpId, $d);\n\telse if ($d->getName() == \"ctrl\")\n\tprocessControl($cmpId, $d);\n\telse if ($d->getName() == \"competition\")\n\tprocessCompetition($cmpId, $d);\n }\n\n returnStatus('OK');\n}", "public function run()\n\t{\n\t\t$this->upgrade_to_1_1_0();\n\t}", "public function testUpdate(): void {\n $configObject = $this->configUpdateManager->getConfig();\n\n $this->configUpdateManager->update();\n foreach ($configObject->getTargetConfigFilepaths() as $filepath) {\n self::assertFileExists($filepath);\n }\n\n $targetConfigFilepath = $configObject->getTargetConfigFilepath(Config::TARGET_CONFIG_FILENAME);\n /**\n * @var array{\n * draft: array{\n * last_applied_update: int,\n * },\n * } $config\n */\n $config = $configObject->readAndParseConfigFromTheFile($targetConfigFilepath);\n self::assertSame(App::LAST_AVAILABLE_UPDATE_WEIGHT, $config['draft']['last_applied_update']);\n }", "public function update()\n {\n \n foreach($this->feed->sources as $source){\n \n //Find the right source handler.\n switch($source->type->get()){\n \n case 'TWITTER_TIMELINE':\n $handler = new TwitterTimelineSourceHandler($source);\n break;\n \n case 'TWITTER_SEARCH':\n $handler = new TwitterSearchSourceHandler($source);\n break;\n \n }\n \n //Query for new messages.\n $messages = $handler->query();\n \n //Save those messages.\n mk('Logging')->log('Message board', 'New messages', $messages->size());\n foreach($messages as $message){\n $message\n ->save()\n ->save_webpages()\n ->save_images();\n }\n \n }\n \n }", "function ApplyUpdates($update_dir, $update_list)\n\t{\n\t\t$update_files = $this->GetUpdatesFilesList($update_dir);\n\t\t//var_dump($update_files);\n\t\t\n\t\tforeach ($update_list as $update_item) {\n\t\t\t//list($update_rev, $update_type) = explode('-', $update_item);\n\t\t\t//$update_type = strtoupper($update_type);\n\t\t\t\n\t\t\tif (!empty($update_files[$update_item])) {\n\t\t\t\t$itm =& $update_files[$update_item];\n\t\t\t\t\n\t\t\t\t// try to apply update\n\t\t\t\tswitch ($itm['type']) {\n\t\t\t\t\tcase 'SQL':\n\t\t\t\t\t\t$query = file_get_contents($update_dir.$itm['filename']);\n\n\t\t\t\t\t\t$this->db->exception_on_error = false;\n\t\t\t\t\t\t$is_error = !$this->db->script($query);\n\t\t\t\t\t\t$this->db->exception_on_error = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ids = array (\n\t\t\t\t\t\t\t'rev_num' => $itm['rev_num'],\n\t\t\t\t\t\t\t'type' => $itm['type'],\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check db for current update\n\t\t\t\t\t\t$this->db->q('SELECT rev_num, type, status FROM #_PREF_updates', $ids);\n\t\t\t\t\t\t$res = $this->db->fetchAssoc();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// try to apply update\n\t\t\t\t\t\tif (is_array($res)) {\n\t\t\t\t\t\t\tif ($res['status'] != 'ok') {\n\t\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', array ('status' => $is_error ? 'error' : 'ok'), 'UPDATE', $ids);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$ids['status'] = $is_error ? 'error' : 'ok';\n\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', $ids);\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}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t\n\t}", "public function parse(): void\n {\n // TODO: Implement parse() method.\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "protected function UpdateStats() {\n\n $Path= $this->StorageDir.'/Stats.txt';\n // load and parse file\n $Lines= explode(\"\\n\", file_get_contents($Path));\n $Parsed= [];\n foreach($Lines as $Line) {\n $Parts= explode(':', $Line, 2);\n if (count($Parts) > 1) {\n $Parsed[$Parts[0]]= trim(end($Parts));\n }\n }\n // update values\n $Period= $Parsed['Period'] ?: date('r').' - 0';\n $Stats= $Parsed;\n foreach($this->Stats as $k => $v) {\t// transfer values from buffer\n $Stats[$k]= isset($Parsed[$k]) ? intval($Parsed[$k]) + $v : $v;\n }\n // prepare report\n array_walk($Stats, function(&$v, $k){$v= \"$k: $v\";});\n natcasesort($Stats);\n unset($Stats['Period']);\n array_unshift($Stats, 'Period: '.trim(explode(' - ', $Period)[0]).' - '.date('r'), '');\n // save\n file_put_contents($Path, implode(\"\\n\", $Stats));\n }", "private function ParseFile() {\r\n\t\t$this->ini_array = parse_ini_file($this->$results_file, true); //Load the results into a array //\r\n\t}", "private function parseContent()\n {\n $results = [];\n $jsonFiles = $this->parseInputFolders();\n \n $finalManifest = $this->getJobManifestTemplate();\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Processing JSON directory: {$this->inputPath} </info>\");\n\n foreach ($jsonFiles as $file) {\n if (file_exists($file)) {\n $results[] = $this->convertLearnosityInDirectory($file);\n } else {\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Learnosity JSON file \".basename($file). \" Not found in: {$this->inputPath}/items </info>\");\n }\n }\n $resourceInfo = $this->updateJobManifest($finalManifest, $results);\n $finalManifest->setResources($resourceInfo);\n $this->persistResultsFile($results, realpath($this->outputPath) . '/' . $this->rawPath . '/');\n $this->flushJobManifest($finalManifest, $results);\n CopyDirectoreyHelper::copyFiles(realpath($this->inputPath) . '/assets', realpath($this->outputPath) . '/' . $this->rawPath . '/assets');\n $this->createIMSContntPackage(realpath($this->outputPath) . '/' . $this->rawPath . '/');\n }", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "static private function parse_file($path)\n\t{\n\t\t$tokens = token_get_all(file_get_contents($path));\n\t\t$namespace = null;\n\t\t$update_constructors = [];\n\n\t\tfor ($i = 0, $j = count($tokens) ; $i < $j ; $i++)\n\t\t{\n\t\t\t$token = $tokens[$i];\n\n\t\t\tif (!is_array($token))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlist($token_id, $value, $line) = $token;\n\n\t\t\tswitch ($token_id)\n\t\t\t{\n\t\t\t\tcase \\T_NAMESPACE:\n\n\t\t\t\t\t$namespace = self::parser_resolve_namespace($tokens, $i);\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \\T_CLASS:\n\n\t\t\t\t\t$class_name_token = $tokens[$i + 2];\n\t\t\t\t\t$class_name = $class_name_token[1];\n\n\t\t\t\t\t$class_annotation_token = $tokens[$i - 2];\n\n\t\t\t\t\tif (!is_array($class_annotation_token))\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Missing annotation for class $class_name\\n\";\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$class_annotation = $class_annotation_token[1];\n\n\t\t\t\t\t$update_constructors[] = new UpdateDescriptor($namespace . '\\\\' . $class_name, $class_annotation, $path, $line);\n\t\t\t}\n\t\t}\n\n\t\treturn $update_constructors;\n\t}", "function applyCustomUpdates()\n\t{\n\t\tglobal $ilCtrlStructureReader;\n\n\t\t$ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);\n\n\t\tinclude_once \"./Services/Database/classes/class.ilDBUpdate.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacAdmin.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacReview.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacSystem.php\";\n\t\tinclude_once \"./Services/Tree/classes/class.ilTree.php\";\n\t\tinclude_once \"./Services/Xml/classes/class.ilSaxParser.php\";\n\t\tinclude_once \"./Services/Object/classes/class.ilObjectDefinition.php\";\n\n\t\t// referencing db handler in language class\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$this->lng->setDbHandler($ilDB);\n\n\t\t// run dbupdate\n\t\t$dbupdate = new ilDBUpdate($ilDB);\n\t\t$dbupdate->applyCustomUpdates();\n\n\t\tif ($dbupdate->updateMsg == \"no_changes\")\n\t\t{\n\t\t\t$message = $this->lng->txt(\"no_changes\").\". \".$this->lng->txt(\"database_is_uptodate\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sep = \"\";\n\t\t\tforeach ($dbupdate->updateMsg as $row)\n\t\t\t{\n\t\t\t\tif ($row[\"msg\"] == \"update_applied\")\n\t\t\t\t{\n\t\t\t\t\t$a_message.= $sep.$row[\"nr\"];\n\t\t\t\t\t$sep = \", \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$e_message.= \"<br/>\".$this->lng->txt($row[\"msg\"]).\": \".$row[\"nr\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($a_message != \"\")\n\t\t\t{\n\t\t\t\t$a_message = $this->lng->txt(\"update_applied\").\": \".$a_message;\n\t\t\t}\n\t\t}\n\n\t\tilUtil::sendInfo($a_message.$e_message, true);\n\t\tilUtil::redirect(\"setup.php?cmd=displayDatabase\");\n\t}", "public function hookUpdate(): void\n {\n $this->say(\"Executing the Plugin's update hook...\");\n $this->_exec(\"php ./src/hook_update.php\");\n }", "public function run() {\n\t\t$this->preRun();\n\n\t\t$this->changeTags();\n\n\t\t$this->postRun();\n\t}", "public function checkForUpdates()\n\t{\n\t\tif (!is_numeric(BUILD))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// HOOK: proxy module\n\t\tif (Config::get('useProxy')) {\n\t\t\t$objRequest = new \\ProxyRequest();\n\t\t} else {\n\t\t\t$objRequest = new \\Request();\n\t\t}\n\n\t\t$objRequest->send(\\Config::get('liveUpdateBase') . (LONG_TERM_SUPPORT ? 'lts-version.txt' : 'version.txt'));\n\n\t\tif (!$objRequest->hasError())\n\t\t{\n\t\t\t\\Config::set('latestVersion', $objRequest->response);\n\t\t\t\\Config::persist('latestVersion', $objRequest->response);\n\t\t}\n\n\t\t// Add a log entry\n\t\t$this->log('Checked for Contao updates', __METHOD__, TL_CRON);\n\t}", "public function update() {\n\t\t\t$this->output->layout = \"empty\";\n\t\t\t$this->output->set(\"url\", PUBLIC_URL.Settings::get(\"update.air.path\"));\n\t\t\t$this->output->set(\"version\", Settings::get(\"update.air.version\"));\n\t\t\t$this->output->set(\"notes\", Settings::get(\"update.air.notes\"));\n\t\t\t$this->output->view(\"api/xml/update.php\");\n\t\t\t$this->output->header(\"Content-Type: text/xml\");\n\t\t\t$this->output->cache($this->default_cache_timeout);\n\t\t}", "public function runDefaultUpdates()\n {\n }", "public function run()\n {\n // Include everything we will potentially run here.\n // To make sure that old code is executed for this instance.\n include_once 'Libs/FileSystem/FileSystem.inc';\n Channels::includeSystem('Patching');\n Channels::includeSystem('SystemConfig');\n\n if (Channels::systemExists('Log') === TRUE) {\n Channels::includeSystem('Log');\n }\n\n if (Channels::systemExists('SystemConfigSplashScreenWidget') === TRUE) {\n Channels::includeSystem('SystemConfigSplashScreenWidget');\n }\n\n // Let it get the up-to-date Bugzilla login info and update the file.\n if (Channels::systemExists('Bugzilla') === TRUE) {\n Channels::includeSystem('Bugzilla');\n Bugzilla::writeBugzillaLoginInfo();\n }\n\n // Find the first scheduled patch and apply it.\n $config = Patching::getPatchingConfig();\n $patches = Patching::getPendingPatches();\n $info = Patching::getPatchingInfo();\n $oldRev = $config['revision'];\n $reboot = FALSE;\n if (empty($patches) === FALSE) {\n $name = array_shift($patches);\n $parts = explode('_', $name);\n $newRev = $parts[2];\n $status = self::applyPatch($name);\n if ($status === TRUE) {\n // Apply ok, archive it and notify central server.\n Patching::archivePatch($name);\n Patching::wsNotifyApplied($newRev, $oldRev);\n foreach ($info as $i) {\n if ($i['name'] === $name) {\n if (isset($i['reboot']) === TRUE) {\n if ($i['reboot'] === TRUE) {\n // Need to issue a system reboot command.\n $reboot = TRUE;\n break;\n }\n }\n }\n }\n\n // Update the patching config.\n $config['revision'] = $newRev;\n $config['last_updated'] = time();\n } else {\n // Apply fail, unschedule all pending patches.\n $pendingPatches = Patching::getPendingPatches();\n foreach ($pendingPatches as $p) {\n Patching::schedulePatch($p, NULL);\n }\n\n // Send error email and notify central server.\n Patching::sendInternalErrorMessage('ERR_PATCH_FAILED', $name);\n Patching::wsNotifyApplied($newRev, $oldRev, 'Failed to apply '.$name);\n }//end if\n } else {\n // Ask the central server for new updates, if any.\n $now = time();\n if ($now > ($config['last_checked'] + $config['check_interval'])) {\n Patching::wsCheckForUpdates();\n $config['last_checked'] = time();\n SystemConfig::setConfig('Patching', $config);\n }\n }//end if\n\n // No more pending patch, turn off the schedule toggle.\n $pendingPatches = Patching::getPendingPatches();\n if (empty($pendingPatches) === TRUE) {\n $config['schedule'] = FALSE;\n }\n\n SystemConfig::setConfig('Patching', $config);\n // Tells debian where to get operating system updates from.\n Channels::includeSystem('SquizSuite');\n $currProduct = SquizSuite::getProduct();\n $status = Patching::wsReleaseStatus();\n if ($status === 'GA') {\n @FileSystem::filePutContents('/etc/apt/sources.list', 'deb http://aptrepo-stable.squiz.net/ stable main');\n } else {\n @FileSystem::filePutContents('/etc/apt/sources.list', 'deb http://aptrepo-beta.squiz.net/ stable main');\n }\n\n // Issues a system reboot command if required.\n if ($reboot === TRUE) {\n exec('/sbin/reboot');\n }\n\n }", "public function run( array $patchFiles ) {\n\t\tforeach ( $patchFiles as $file ) {\n\t\t\t$matches = $this->processFile($file);\n\t\t}\n\t}", "public function autoupdate() {\n\t\t$uC = new PluginUpdateChecker( $this->autoupdate_endpoint, $this->path . $this->slug . '.php', $this->slug );\n\t}", "protected function parse(): void\n {\n $lines = preg_split('/\\r\\n|\\r|\\n/', $this->content);\n\n foreach ($lines as $line) {\n if (mb_strlen(trim($line)) && ! (mb_strpos(trim($line), '#') === 0)) {\n [$key, $value] = explode('=', (string) $line);\n $this->variables[$key] = $this->formatValue($value);\n }\n }\n }", "public function run()\n {\n $this->runQueriesFromSqlFile('1.3.4.3');\n }", "public function parse()\n {\n $raw = $this->getRaw();\n $count = count($raw);\n for ($i = 7; $i < $count; $i++) {\n $line = $raw[$i];\n\n $process = new Process(\n $line[11],\n $line[0],\n floatval($line[8]),\n floatval($line[9])\n );\n\n $this->processes[] = $process;\n }\n }", "public function update() {\r\n\r\n\t}", "public function analyzeModifications()\n {\n $this->logManager->logMessage(lang('Revision.analyzeModifications'));\n\n foreach ($this->files as $file) {\n // Compare the previous snapshot with the new snapshot from update.\n $oldCopy = $this->workspace . 'oldSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n $project = $this->config->rootPath . $file['destination'];\n $doCopy = true;\n\n // If hashes are different, this can be new or modified.\n if (! FileManager::areIdenticalFiles($oldCopy, $file['origin'])\n || ($this->config->fallThroughToProject && ! FileManager::areIdenticalFiles($project, $file['origin']))\n ) {\n $newCopy = $this->workspace . 'newSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n\n try {\n if (! is_file($oldCopy) || ! is_file($project)) {\n $this->fileManager->createdFiles[] = $file['destination']; // @codeCoverageIgnore\n } elseif (is_file($file['origin'])) {\n $this->fileManager->modifiedFiles[] = $file['destination'];\n } else {\n // @codeCoverageIgnoreStart\n $this->fileManager->deletedFiles[] = $file['destination'];\n $doCopy = false;\n // @codeCoverageIgnoreEnd\n }\n\n if ($doCopy) {\n $this->filesystem->copy($file['origin'], $newCopy, true);\n }\n\n // @codeCoverageIgnoreStart\n } catch (IOExceptionInterface $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n // @codeCoverageIgnoreEnd\n }\n }\n }\n\n // Log the update results\n $cc = \\count($this->fileManager->createdFiles);\n $mc = \\count($this->fileManager->modifiedFiles);\n $dc = \\count($this->fileManager->deletedFiles);\n\n $cs = 1 === $cc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ms = 1 === $mc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ds = 1 === $dc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n\n $this->logManager->logMessage([\n lang('Revision.createdFilesAfterUpdate', [$cc, $cs]),\n lang('Revision.modifiedFilesAfterUpdate', [$mc, $ms]),\n lang('Revision.deletedFilesAfterUpdate', [$dc, $ds]),\n ]);\n }", "public function updater() {\n\n\t\t// Bail if current user cannot manage plugins.\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if plugin updater is not loaded.\n\t\tif ( ! class_exists( 'Puc_v4_Factory' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Setup the updater.\n\t\t// $updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/maithemewp/mai-grid-entries/', __FILE__, 'mai-grid' );\n\t}", "public function run(): void {\n $commandLineOptions = $this->mCommandLineOptions->readCommandLineOptions();\n $optionsAreValid = $this->mCommandLineOptions->validateOptions($commandLineOptions);\n if($optionsAreValid) {\n $filePath = $this->mCommandLineOptions->getFilename();\n $this->mEBNFReader->parseFile($filePath);\n $foodItemsFound = $this->mVendors->findFoodItems($commandLineOptions);\n $this->outputFoodItemsFound($foodItemsFound);\n } else {\n Logger::out('Options input were invalid.');\n Logger::outputHelpText();\n }\n }", "function runParser($filePath) {\n fileParser($filePath);\n\n fileNumberAdder();\n\n formatPrinter();\n}", "protected function run_updater() {\n\t\t\n\t\t/*\n\t\t* Version 1.6\n\t\t* add `active` to table categories\n\t\t*/\n\t\t\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NULL DEFAULT '1' AFTER `order`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `color` `color` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `printings` `printings` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NULL DEFAULT '' AFTER `upload`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\n\t\t\t\n\t\t\t$this->upgrade_1_7();\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NULL DEFAULT '' AFTER `stages`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t\t\n\t\t\t// do the convert old data\n\t\t\t// 1. convert colors to attribute\n\t\t\t// 2. convert all old attribute structure to new structure\n\t\t\t// 3. convert stages\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) > 0){\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'print_files';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `print_files` TEXT NULL DEFAULT '' AFTER `screenshots`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t*\tCreate subfolder upload\t\n\t\t*/\n\t\t\n\t\t$this->main->check_upload();\n\t\t\n\t}", "function process_one()\r\n{\r\n global $debug;\r\n $update_id = 0;\r\n echo \"-\";\r\n \r\n if (file_exists(\"last_update_id\")) \r\n $update_id = (int)file_get_contents(\"last_update_id\");\r\n \r\n $updates = get_updates($update_id);\r\n\r\n // jika debug=0 atau debug=false, pesan ini tidak akan dimunculkan\r\n if ((!empty($updates)) and ($debug) ) {\r\n echo \"\\r\\n===== isi diterima \\r\\n\";\r\n print_r($updates);\r\n }\r\n \r\n foreach ($updates as $message)\r\n {\r\n echo '+';\r\n $update_id = process_message($message);\r\n\t}\r\n \r\n\t// @TODO nanti ganti agar update_id disimpan ke database\r\n // update file id, biar pesan yang diterima tidak berulang\r\n file_put_contents(\"last_update_id\", $update_id + 1);\r\n}", "public function updater() {\n\t\t// Kludge to override capability check when doing cron.\n\t\t$doing_cron = defined( 'DOING_CRON' ) && DOING_CRON;\n\t\tif ( ! current_user_can( 'manage_options' ) && ! $doing_cron ) {\n\t\t\treturn;\n\t\t}\n\n\t\t( new Theme_Updater(\n\t\t\t[\n\t\t\t\t'api_url' => $this->api_url,\n\t\t\t\t'api_data' => $this->api_data,\n\t\t\t\t'version' => $this->version,\n\t\t\t\t'license' => $this->license,\n\t\t\t\t'item_name' => $this->item_name,\n\t\t\t\t'item_id' => $this->item_id,\n\t\t\t\t'author' => $this->author,\n\t\t\t\t'beta' => $this->beta,\n\t\t\t\t'cache_key' => $this->cache_key,\n\t\t\t],\n\t\t\t$this->strings\n\t\t) )->load_hooks();\n\t}", "private function parse ( ) {\n\t\t\t$this->parse_csv();\n\t\t\t\n\t\t\t// parse out the daily html\n\t\t\t$this->parse_html();\n\t\t\t\n\t\t}", "public function update();", "public function update();", "public function update();", "public function update();", "protected function parseXmlFile() {}", "protected function performUpdate() {}", "public function parse()// : void\n\t{\n\t\tforeach( $this -> options[ 'command' ] as $command => $params )\n\t\t{\n\t\t\t//- Parsing -//\n\t\t\t$result = null;\n\t\t\tpreg_match_all(\n\t\t\t\t$params[ 'regex' ], \n\t\t\t\t$this -> text, \n\t\t\t\t$result, \n\t\t\t\tPREG_PATTERN_ORDER\n\t\t\t);\n\n\t\t\t//- Set result -//\n\t\t\t$this -> value[ $command ] = array();\n\t\t\t$this -> errors[ $command ] = array();\n\t\t\tforeach( $params[ 'value' ] as $key => $index )\n\t\t\t{\n\t\t\t\tif( !isset( $result[ $index ][ 0 ] ) )\n\t\t\t\t{\n\t\t\t\t\t$this -> errors[ $command ][ $key ] = \"Command not valid\";//TODO: change\n\t\t\t\t\t\n\t\t\t\t\t$this -> valid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//- Set value -//\n\t\t\t\t$this -> value[ $command ][ $key ] = $result[ $index ][ 0 ];\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public function run()\n {\n $this->updateOrCreate('/(uber)(.*)(help)(?=.*)/gi', 'UBER', 'transportation', true);\n\n $this->updateOrCreate('/(SHOPIFY.COM|SHOPIFYCOM)/g', 'SHOPIFY', 'business/hosting', true);\n\n $this->updateOrCreate('/(FACEBK \\*)([A-Z0-9]+)/g', 'Facebook Ads', 'business/advertising', true);\n\n $this->updateOrCreate('/(Albert Heijn|AH TO GO)\\s+([0-9]+)/g', 'Albert Heijn', 'basic', true, [\n \"supermarket\",\n \"grocery_or_supermarket\",\n \"store\",\n \"food\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n\n $this->updateOrCreate('/(Gall & Gall)\\s+([0-9]+)/g', 'Gall & Gall', 'healthnbeauty', true, [\n \"liquor_store\",\n \"store\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n\n $this->updateOrCreate('/(Wizz Air Hu)\\s+([A-Z_0-9]+)/g', 'Wizz Air', 'travel', true);\n\n $this->updateOrCreate('/(DIRK VAN DEN BROEK)/g', 'DIRK VAN DEN BROEK', 'basic', true, [\n \"supermarket\",\n \"grocery_or_supermarket\",\n \"store\",\n \"food\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n\n $this->updateOrCreate('/(PULL & BEAR)/g', 'PULL & BEAR', 'clothing', true, [\n \"clothing_store\",\n \"store\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n\n $this->updateOrCreate('/(ETOS)\\s+([0-9]+)/g', 'Etos', 'healthnbeauty', true, [\n \"store\",\n \"health\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n\n $this->updateOrCreate('/(Pearle Opticiens)\\s+([0-9]+)/g', 'Pearle Opticiens', 'healthnbeauty', true, [\n \"store\",\n \"health\",\n \"point_of_interest\",\n \"establishment\"\n ]);\n }", "static function process_updates($args=array()){\n\n if (empty($_SESSION['bList_vm_reimbursementRates_rates_updated'])) return;\n \n // recalculate travel/subsistence reimbursement estimates\n foreach(array_keys($_SESSION['bList_vm_reimbursementRates_rates_updated']) as $parent_ID){\n b_debug::xxx(\"parent $parent_ID\");\n locateAndInclude('bForm_vm_Expenses');\n bForm_vm_Expenses::_updateEstimates($parent_ID); \n \n \n //\n // Integrate the change of reimbursement policy into Event and/or Ogranization\n //\n if ($parent_ID == myOrg_ID){\n\t$e = Null;\n\t$reimbursementRates = bList::getListInstance(myOrg_ID,'bList_vm_reimbursementRates');\n\t$visit_types = VM_reimbursable_visits();\n }else{\n\t$e = loader::getInstance_new('bForm_vm_Event',$parent_ID,'fatal');\n\t$reimbursementRates = $e->reimbursementRates();\n\t$visit_types = array(VISIT_TYPE_PROGRAM);\n }\n \n // look for updates\n foreach($visit_types as $type){\n\t$was_p = $now_p = array();\n\t$now = $was = VM_visit_policies($type,$e);\n\tforeach($reimbursementRates->get_policies($type) as $policy=>$is_ON){\n\t if ($is_ON && !in_array($policy,$was)) $now[] = $policy;\n\t if(!$is_ON && in_array($policy,$was)) $now = array_diff($now,array($policy));\n\t}\n\t\n\tforeach($was as $p) $was_p[] = x('li',VM::$v_policies[$p]['d']);\n\tb_debug::xxx(strip_tags(join(', ',$was_p)));\n\t\n\t// Are there any changes?\n\tif ($was !== $now){\n\t \n\t // Save the updated policies in the database\n\t sort($now); // kill association\n\t VM_visit_policies($type,$now,$e);\n\t \n\t // Print a message\n\t foreach($now as $p) $now_p[] = x('li',VM::$v_policies[$p]['d']);\n\t \n\t if ($add = array_diff($now_p,$was_p)) $changes[] = \"Added:\".x('ul', join(\"\\n\",$add));\n\t if ($rem = array_diff($was_p,$now_p)) $changes[] = \"Removed:\".x('ul',join(\"\\n\",$rem));\n\t MSG::INFO($changes,VM::$description[$type]['d'].' visits policy is changed for '.$reimbursementRates->title);\n\t}\n }\n }\n unset($_SESSION['bList_vm_reimbursementRates_rates_updated']);\n }", "public function Check() {\n\t\t/*\n\t\t$local = $this->getLocalVersion();\n\t\t$remote = $this->getRemoteVersion(\"check\", $local[0]['version']);\n\t\t\n\t\t$nightly = true;\n\t\t$archive = Common::getConstant('ARCHIVEURL', $this->archive);\n\t\t$latest = '';\n\t\t\n\t\tforeach ($remote as $tag) {\n\t\t\tif ($latest == '') {\n\t\t\t\t$latest = $tag[\"name\"];\n\t\t\t\t$archive = $tag[\"zipball_url\"];\n\t\t\t}\n\t\t\tif ($local[0]['version'] == $tag[\"commit\"][\"sha\"]) {\n\t\t\t\t$local[0]['version'] = $tag[\"name\"];\n\t\t\t\t$nightly = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search = array(\"\\r\\n\", \"\\n\", \"\\r\");\n\t\t$replace = array(\" \", \" \", \" \");\n\t\t\n\t\t$message = '';\n\t\t$merge = '';\n\t\t$commits = json_decode(file_get_contents(Common::getConstant('COMMITURL', $this->commits)), true);\n\t\tforeach ($commits as $commit) {\n\t\t\tif ($local[0]['version'] != $commit[\"sha\"]) {\n\t\t\t\tif (strpos($commit[\"commit\"][\"message\"], \"Merge\") === false) {\n\t\t\t\t\t$message .= '- '.str_replace($search, $replace, $commit[\"commit\"][\"message\"]).'<br/>';\n\t\t\t\t} else {\n\t\t\t\t\t$merge .= '- '.str_replace($search, $replace, $commit[\"commit\"][\"message\"]).'<br/>';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($message == '') {\n\t\t\t$message = $merge;\n\t\t}\n\t\t*/\n\t\t\n\t\t$archive = $this->archive;\n\t\t$current_version = self::VERSION;\n\t\t$nightly = false;\n\t\t$response = $this->getRemoteVersion(\"check\");\n\t\t\n\t\tif ( $response[\"name\"] > $current_version ) {\n\t\t\t\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $this->update_file);\n\t\t\t//curl_setopt($curl, CURLOPT_POSTFIELDS, \"\");\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); \n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\tcurl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13');\n\t\t\t$content = curl_exec($curl);\n\t\t\tcurl_close($curl);\n\t\t\t\n\t\t\tunlink( \"./update.php\" );\n\t\t\tfile_put_contents( \"./update.php\", $content );\n\t\t}\n\t\t\n\t\t\n\t\t//echo var_dump( $response );\n\t\t//return \"[\".formatJSEND(\"success\", array(\"currentversion\"=>$local[0]['version'],\"remoteversion\"=>$latest,\"message\"=>$message,\"archive\"=>$archive,\"nightly\"=>$nightly,\"name\"=>$local[0]['name'])).\"]\";\n\t\treturn \"[\".formatJSEND(\"success\", array(\"currentversion\"=>$current_version,\"remoteversion\"=>$response[\"name\"],\"message\"=>$response[\"message\"],\"archive\"=>$archive,\"nightly\"=>$nightly,\"name\"=>$response[\"commit\"][\"author_name\"])).\"]\";\n\t}", "public function run()\n {\n News::truncate();\n\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/news')) as $filename)\n {\n // filter out \".\" and \"..\"\n if ($filename->isDir()) continue;\n\n // filter out anything other than \"index.xml\"\n if (strcasecmp($filename->getFilename(), \"index.xml\") != 0) continue;\n\n $sxml = simplexml_load_file($filename->getPathname());\n News::create([\n 'title' => (string)$sxml->title,\n 'content' => (string)$sxml->content,\n 'published_at' => date('Y-m-d', strtotime((string)$sxml->pub_date))\n ]);\n }\n }", "public function parse($file){\n $this->fileReader->open($file);\n $this->registerCallback();\n $this->fileReader->parse($file);\n $this->fileReader->close($file);\n }", "protected function parse() {}", "function update() {\n\n\t\t\t}", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function update() {\n\t\treturn;\n\t}", "abstract public function update();", "abstract public function update();", "public function parse() : void\n\t{\n\t\tif (empty($this->srcPath) || empty($this->destPath))\n\t\t{\n\t\t\tthrow new \\Exception(\\sprintf('Please register source path and destination path before calling this \"%s\" method.', __METHOD__));\n\t\t}\n\n\t\t$srcContent = \\file_get_contents($this->srcPath);\n\n\t\tif (empty($srcContent))\n\t\t{\n\t\t\tthrow new \\Exception(\\sprintf('The \"%s\" is invalid or the file is corrupted!', $this->srcPath));\n\t\t}\n\n\t\t$parsedContent = ComponentHelper::parseContent($srcContent, $this->meta);\n\t\t\\file_put_contents($this->destPath, $parsedContent);\n\n\t\tPrinter::println(Printer::getColorizeMessage(\"Created \" . $this->destPath . \" file.\", 'green'));\n\t}", "function doUpdatesProcess(){\n return $this->doSyncProcess($this->desktopFilePathCopy, true);\n }", "function update()\n {\n // using file from http://data.giss.nasa.gov/gistemp/tabledata_v3/GLB.Ts+dSST.txt\n $lines = explode(\"\\n\", file_get_contents(APP . 'Lib/data/GLB.Ts+dSST.txt'));\n foreach($lines as $line) {\n if (is_numeric(substr($line, 0, 4))) {\n $lineData = explode(' ', preg_replace('/\\s+/', ' ', $line));\n if (($year = array_shift($lineData)) == 1880) continue;\n $anomaly = $lineData[12];\n if (!is_numeric($anomaly)) break;\n $annualMeans[$year] = ($anomaly / 100) + 14; // add Best estimate for absolute global mean for 1951-1980\n }\n }\n\n // reset table and add data\n $this->query('TRUNCATE temperatures');\n foreach($annualMeans as $year => $annualMean) {\n $this->create();\n $this->save(array(\n 'year' => $year,\n 'celsius' => $annualMean,\n ));\n }\n return true;\n }", "public function update()\n {\n }", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }", "public function convert(): void\n {\n // go through files\n foreach ($this->getInFiles() as $file) {\n $bookmarks = $this->parse($file);\n // go through bookmarks\n foreach ($bookmarks as $name => $url) {\n // go through formats\n foreach ($this->formats as $format) {\n switch ($format) {\n case 'url':\n $contents = $this->urlContents($url);\n break;\n case 'webloc':\n $contents = $this->weblocContents($url);\n break;\n case 'desktop':\n $contents = $this->desktopContents($name, $url);\n break;\n default:\n // shouldn't be a case because of constructor validation\n break;\n }\n $this->writeFile($name, $format, $contents);\n }\n }\n }\n }", "protected function _update()\n\t{\n\t}", "public function run() {\n\t\t$this->updateProjectCounterCache();\n\t\t$this->updateUserCounterCache();\n\t}", "public function update()\n {\n if ($GLOBALS['config']['cache_method'] == 'memcached') {\n $this->memcache_obj->flush();\n } elseif ($GLOBALS['config']['cache_method'] == 'apc') {\n apc_clear_cache('user');\n }\n\n $this->removeFiles();\n\n $this->updateDataFormats();\n\n $this->updateSubmitForms();\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n $this->updateSearchForms();\n $this->updateSearchFields();\n\n $this->updateFeaturedFormFields();\n $this->updateTitlesFormFields();\n $this->updateShortFormFields();\n $this->updateSortingFormFields();\n\n $this->updateListingStatistics();\n }", "public function update() {\r\n }", "function GroupPress_update() {\n\t// no PHP timeout for running updates\n\tset_time_limit( 0 );\n\n\tglobal $GroupPress;\n\n\t// this is the current database schema version number\n\t$current_db_ver = get_option( 'GroupPress_db_ver' );\n\n\t// this is the target version that we need to reach\n\t$target_db_ver = GroupPress::DB_VER;\n\n\t// run update routines one by one until the current version number\n\t// reaches the target version number\n\twhile ( $current_db_ver < $target_db_ver ) {\n\t\t// increment the current db_ver by one\n\t\t$current_db_ver ++;\n\n\t\t// each db version will require a separate update function\n\t\t// for example, for db_ver 3, the function name should be solis_update_routine_3\n\t\t$func = \"GroupPress_update_routine_{$current_db_ver}\";\n\t\t\tif ( function_exists( $func ) ) {\n\t\t\t\tcall_user_func( $func );\n\t\t\t}\n\n\t\t//update the option in the database, so that this process can always\n\t\t// pick up where it left off\n\t\tupdate_option( 'GroupPress_db_ver', $current_db_ver );\n\t}\n}", "public function parseRecursive()\n {\n $this->isFileModified = false;\n $inputFile = new PhoreInputFile($this->logger);\n\n $envLoader = self::Config()->environmentLoader;\n if (is_callable($envLoader)) {\n $this->logger->debug(\"Running environment loader (defined in config)\");\n $this->environment = $envLoader();\n if ( ! is_array($this->environment))\n throw new \\InvalidArgumentException(\"environment-loader must return array. It returned \" . gettype($this->environment));\n }\n\n $this->templateDir->walkR(function(PhoreUri $relpath) use ($inputFile) {\n $relpath = phore_uri( substr( $relpath->getUri(), strlen($this->templateDir)));\n\n $this->logger->debug(\"Walking: $this->templateDir / $relpath...\");\n\n $inputFile->rewriteFile($relpath, $this->templateDir, $this->targetDir, $this->environment);\n });\n $this->isFileModified = $inputFile->isModified();\n }", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "public function updateFile(File $file): void;", "public function updater() {\n\t\t// Bail if current user cannot manage plugins.\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if plugin updater is not loaded.\n\t\tif ( ! class_exists( 'Puc_v4_Factory' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Setup the updater.\n\t\t$updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/maithemewp/mai-ads-extra-content/', __FILE__, 'mai-ads-extra-content' );\n\n\t\t// Maybe set github api token.\n\t\tif ( defined( 'MAI_GITHUB_API_TOKEN' ) ) {\n\t\t\t$updater->setAuthentication( MAI_GITHUB_API_TOKEN );\n\t\t}\n\n\t\t// Add icons for Dashboard > Updates screen.\n\t\tif ( function_exists( 'mai_get_updater_icons' ) && $icons = mai_get_updater_icons() ) {\n\t\t\t$updater->addResultFilter(\n\t\t\t\tfunction ( $info ) use ( $icons ) {\n\t\t\t\t\t$info->icons = $icons;\n\t\t\t\t\treturn $info;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "public function update() {\n \n }", "private function processUpdate($delta, $direction, $deltaOriginalBranch = null)\n {\n $deltaNum = $delta['deltaNum'];\n // $update->getSvnRevision() will give the svn revision of the xml file that contains this update\n echo \"- processing update \" . $deltaNum . \", direction: $direction.\\n\";\n\n $parser = $this->getParser($delta);\n\n $branch = 'trunk';\n if ($this->getBranch() != 'trunk') {\n $branch = 'branches/' . $this->getBranch();\n }\n\n if (!is_null($deltaOriginalBranch)) {\n $branch = 'branches/' . $deltaOriginalBranch;\n }\n\n // If the update provider is not specified, get data from local disk,\n // otherwise, retrieve it from version control (svn).\n if ($this->getUpdateParserProvider() == 'XmlLocal') {\n $sqlDirectory = $this->getSqlDirectory();\n } else {\n $sqlDirectory =\n $this->getSvnRepoUri() .\n $branch . '/' . $this->getSqlDirectory();\n }\n\n // the parser needs to know the root directory for packages (definition files) (3rd param)\n $update = $parser->fetchUpdate(\n $deltaNum,\n 'Oracle',\n $sqlDirectory);\n\n // @todo If we ever use more than the 'main' schema, we can modify\n // this method to create separate files for changes to be ran on\n // separate schemas.\n //$this->appendInstructions(\n // \"Installing update #$updateNumber to be installed on schema \" . $update->getSchema() . \"\\n\");\n\n $this->appendInstructions(\n \"Summary for update #$deltaNum: \" . $update->getSummary() . \"\\n\\n\");\n\n if ($direction == 'up') {\n $install = $update->getUpStatement();\n $jobs = $update->getJob()->getUpStatement();\n $schemaVersionChange =\n $this->getSchemaVersionUpStatement($deltaNum,\n $update->getSummary());\n } else if ($direction == 'down') {\n $install = $update->getDownStatement();\n $jobs = $update->getJob()->getDownStatement();\n $schemaVersionChange =\n $this->getSchemaVersionDownStatement($deltaNum);\n }\n\n // append the statements to execute\n $this->appendDatabaseChange($install . \"\\n\\n\");\n\n if ($update->hasPackages()) {\n while (($package = $update->getPackage()))\n {\n // append package definitions and bodies to the database change\n echo \"Retrieving svn revision for: \" . $package->getDefinitionResourcePath() . \"\\n\";\n $this->appendDatabaseChange($package->getDefinition() . \"\\n\");\n echo \"Retrieving svn revision for: \" . $package->getBodyResourcePath() . \"\\n\";\n $this->appendDatabaseChange($package->getBody() . \"\\n\");\n }\n }\n\n // append the jobs creation or removal\n $this->appendDatabaseChange(\"\\n\\n\" . $jobs . \"\\n\");\n\n // append the update of the SCHEMA_VERSION table\n $this->appendDatabaseChange(\"\\n\\n\" . $schemaVersionChange . \"\\n\");\n }", "public function doEditingInPhp() \n {\n\n // get all text files with a .php extension into an array.\n $this->filesArray = glob($this->pathToDir . \"*.php\");\n // foreach loop to iterate each .php file\n // in given directory\n foreach ($this->filesArray as $file) {\n // list down all the .php files in that folder \n echo $file . ' ' . filesize($file) . 'kb ' . PHP_EOL;\n $contents = file_get_contents($file);\n // concatenating user input with the previously present text\n $contents = $this->textInput . PHP_EOL . $contents;\n // writing the new text in file\n file_put_contents($file, $contents);\n }\n\n $this->printDetails();\n }" ]
[ "0.62944806", "0.62204254", "0.6077634", "0.5973444", "0.594975", "0.59250605", "0.5922273", "0.589788", "0.58931446", "0.5861214", "0.5823843", "0.57734215", "0.575002", "0.5730153", "0.57300895", "0.57256615", "0.5704089", "0.5667313", "0.5660619", "0.56539977", "0.56539977", "0.5642928", "0.5630395", "0.56235534", "0.56098986", "0.55979395", "0.5577429", "0.5572959", "0.556352", "0.556163", "0.5548055", "0.5547218", "0.5506842", "0.5503943", "0.5461338", "0.54466915", "0.5443529", "0.54401875", "0.5434406", "0.54246104", "0.54042363", "0.53833", "0.5362749", "0.53606707", "0.5358768", "0.53535956", "0.5341307", "0.53371793", "0.53266394", "0.53252554", "0.5319407", "0.53193945", "0.5298951", "0.5295945", "0.5287499", "0.52868575", "0.5281053", "0.5272872", "0.5269668", "0.5269588", "0.526819", "0.5265835", "0.5265835", "0.5265835", "0.5265835", "0.52489907", "0.52472407", "0.5245665", "0.52421033", "0.5238457", "0.52382255", "0.5221789", "0.52161574", "0.52112144", "0.5209885", "0.52087957", "0.52087957", "0.5207976", "0.5207612", "0.5196181", "0.5189321", "0.5189321", "0.5185981", "0.51835114", "0.5183207", "0.5172472", "0.51720726", "0.5169812", "0.5163605", "0.5161671", "0.5156213", "0.5156014", "0.5154291", "0.51535827", "0.513764", "0.51273334", "0.5123108", "0.5122864", "0.51215774", "0.512049" ]
0.5700572
17
Execute the console command.
public function handle(): void { $files = $this->argument('files'); $manual_mode = $this->option('manual'); if ($this->option('write-all')) { $this->info('In "dump-all" mode, just writing it all in'); } else { /* @noinspection NestedPositiveIfStatementsInspection */ if (!$manual_mode) { $this->info('Going to send updates every 10s'); } else { $this->info('In "manual advance" mode'); } } $this->updatesFromFile(explode(',', $files)); $this->info('Done!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Counts the number items that are available for the values of the given key. The keys of the result array are the values found for the given key (second parameter). The values of these keys are how often an item for this key is found, e.g. // records in table: // first record: domain='text', refid=10 // second record: domain='text', refid=11 // third record: domain='media', refid=11 $listManager>aggregate( $listManager>createSearch(), 'catalog.lists.domain' ); The result in the example will be: array( 'text' => 2, // refid 10 and 11 'media' => 1, // refid 11 ) The items used for aggregation can be filtered before counting the items by adding criteria to the first parameter instaed of handing over a default search object for no further filtering ($listManager>createSearch() in this case). Caution: When using getSlice() to retrieve certain record windows (e.g. from row number 100 to 200) then the number of records can be less than your slice size if records are grouped together an the counts are not always 1. Nevertheless, you have to add the full slice size to the next start. Otherwise, you will perform significantly more queries because the number of returned records will iterate logarithmically (log2) towards 0. // records in table: // first record: domain='text', refid=10 // second record: domain='text', refid=11 // third record: domain='text', refid=12 // fourth record: domain='text', refid=13 $start = 0; $search = $listManager>createSearch(); $search>setSlice( $start, 2 ); $result = $listManager>aggregate( $search, 'catalog.lists.domain' ); $start += count( $result ); $search>setSlice( $start, 2 ); $result = $listManager>aggregate( $search, 'catalog.lists.domain' ); $start += count( $result ); $search>setSlice( $start, 2 ); $result = $listManager>aggregate( $search, 'catalog.lists.domain' ); The problem is to set the value of $start to the number of returned records. That's correct for calls to searchItems() but grouping records with aggregate() is different! The result of the example code would be: array( 'text' => 2 ) // first result set with refid 10 and 11 counted array( 'text' => 2 ) // first result set with refid 11 and 12 counted array( 'text' => 2 ) // first result set with refid 12 and 13 counted Caution: You must add a sortation when using slices to get acceptable results! Even then the results are not guaranteed to be 100% correct because the same key can be in two slices, e.g. // records in table: // first record: domain='text', refid=10 // second record: domain='text', refid=11 // third record: domain='text', refid=12 $search = $listManager>createSearch(); $search>setSlice( 0, 2 ); $listManager>aggregate( $search, 'catalog.lists.domain' ); $search>setSlice( 2, 2 ); $listManager>aggregate( $search, 'catalog.lists.domain' ); The result of the two iterations will be: array( 'text' => 2 ) // first result set with refid 10 and 11 counted array( 'text' => 1 ) // second result set with refid 12 counted
public function aggregate( \Aimeos\MW\Criteria\Iface $search, $key );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalItemCount();", "abstract public function getCount();", "public function getCount();", "public function getCount();", "public function getCount();", "public abstract function get_counts();", "public function countItems();", "public static function record_count()\r\r\n {\r\r\n global $wpdb;\r\r\n $result = false;\r\r\n $totalRecords = 0;\r\r\n $countKey = 'total';\r\r\n $mitambo_json_api = wpsearchconsole::getInstance()->mitambo_json_api;\r\r\n $lastCollectDate = $mitambo_json_api->last_collect_date;\r\r\n $tabName = List_of_Data::getCurrentTabName(isset($_GET['tab']) ? $_GET['tab'] : 1);\r\r\n $type = List_of_Data::getDefaultType($tabName);\r\r\n $type = (isset($_GET['type']) ? $_GET['type'] : $type);\r\r\n\r\r\n $sql = \"SELECT json_value FROM {$wpdb->prefix}wpsearchconsole_data\";\r\r\n\r\r\n $sql .= \" WHERE api_key = '$tabName'\";\r\r\n $sql .= ($tabName == 'keywords' && $type == 0) ? \" AND api_subkey = '$type'\" : \"\";\r\r\n $sql .= ($type && $type != 'all') ? \" AND api_subkey = '$type'\" : \"\";\r\r\n $sql .= \" AND datetime = '\" . substr($lastCollectDate, 0, 10) . \"'\";\r\r\n $sql .= \"GROUP BY api_subkey\";\r\r\n\r\r\n if ($tabName == 'duplication') {\r\r\n $countKey = 'DuplicateGroupsCount';\r\r\n }\r\r\n $response = $wpdb->get_results($sql);\r\r\n foreach ($response as $key => $val) {\r\r\n\r\r\n if (!empty($val) && array_key_exists('json_value', $val)) {\r\r\n\r\r\n $result = json_decode($val->json_value);\r\r\n $totalRecords += ($result && array_key_exists($countKey, $result)) ? $result->$countKey : 0;\r\r\n }\r\r\n }\r\r\n\r\r\n return $totalRecords;\r\r\n }", "private function find_category_amount($arrays, $key, $search) {\n \n $count = 0;\n \n foreach($arrays as $object) {\n if(is_object($object)) {\n $object = get_object_vars($object);\n }\n \n if(array_key_exists($key, $object) && $object[$key] == $search) $this->count++;\n }\n \n return $this->count;\n\n }", "private function _count_records($tag_ids, $search_type, $include_albums) {\n // and return that number.\n\n if (count($tag_ids) == 0) {\n // If no tags were specified, return 0.\n return 0;\n\n } elseif (count($tag_ids) == 1) {\n // if one tag was specified, we can use count_all to get the number.\n $count = ORM::factory(\"item\")\n ->viewable()\n ->join(\"items_tags\", \"items.id\", \"items_tags.item_id\")\n ->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n if ($include_albums == false) {\n $count->and_where(\"items.type\", \"!=\", \"album\");\n }\n return $count->count_all();\n\n } else {\n // If multiple tags were specified, count_all won't work,\n // so we'll have to do count(find_all) instead.\n $items_model = ORM::factory(\"item\");\n if ($search_type == \"AND\") {\n $items_model->select('COUNT(\"*\") AS result_count');\n } else {\n $items_model->select('items.id');\n }\n $items_model->viewable();\n $items_model->join(\"items_tags\", \"items.id\", \"items_tags.item_id\");\t\t\n $items_model->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n $counter = 1;\n while ($counter < count($tag_ids)) {\n $items_model->or_where(\"items_tags.tag_id\", \"=\", $tag_ids[$counter]);\n $counter++;\n }\n if ($include_albums == false) {\n $items_model->and_where(\"items.type\", \"!=\", \"album\");\n }\n $items_model->group_by(\"items.id\");\n if ($search_type == \"AND\") {\n $items_model->having(\"result_count\", \"=\", count($tag_ids));\n }\n\n return count($items_model->find_all());\n }\n }", "public function testAggregateCount() {\n $this->setupTestEntities();\n\n $view = Views::getView('test_aggregate_count');\n $this->executeView($view);\n\n $this->assertCount(2, $view->result, 'Make sure the count of items is right.');\n\n $types = [];\n foreach ($view->result as $item) {\n // num_records is an alias for id.\n $types[$item->entity_test_name] = $item->num_records;\n }\n\n $this->assertEquals(4, $types['name1']);\n $this->assertEquals(3, $types['name2']);\n }", "public function getTotalResults();", "public function count_as_results( $search ){\n\n\t\tif( !empty( $search ) ){\n\n\t\t\t$i = 0;\n\t\t\tforeach( $search as $s_cat => $val ){\n\t\t\t\t$query = \"\";\n\t\t\t\t$j = 0;\n\n\t\t\t\t$size = sizeof($val) - 1;\n\t\t\t\t$title = $s_cat;\n\t\t\t\tforeach ( $val as $sc ){\n\t\t\t\t\tif( $j == 0 ):\n\t\t\t\t\t\t$query .= \" \".$title.\" = '\".$sc.\"'\";\n\t\t\t\t\telse:\n\t\t\t\t\t\t$query .= \" OR \".$title.\" = '\".$sc.\"'\";\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\t\t\t\t$i++;\n\n\t\t\t\t$this->db->where( \"(\".$query.\")\" );\n\t\t\t}\n\t\t}\n\t\t$this->db->from('xx_job_post');\n\t\treturn $this->db->count_all_results();\n\t}", "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 }", "public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}", "function Count($start=0,$slice=0) {\n \n $query=$this->initQuery($start,$slice,\"\",true);\n $this->res_type=\"TABLE\";\n $err = $this->basic_elem->exec_query($query);\n\n //\tprint \"$query $res_type $p_query<BR>\\n\";\n if ($err != \"\") return($err); \n\n $result = $this->basic_elem->fetch_array(0);\n return ($result[\"count\"]); \n }", "function get_var_count_by_surveys($survey_arr,$variable_keywords)\n\t{\n\t\t/*\n\t\tQuery to be executed:\n\n\t\tq= doctype:2 AND text:education AND sid:(590 OR ...)\n\t\t other params: group=true&group.field=sid&group.ngroups=true&group.limit=0\n\n\t\t ?q=doctype%3A2+AND+text%3Aeducation+AND+sid%3A(590)&wt=json&indent=true&group=true&group.field=sid&group.ngroups=true&group.limit=0\n\t\t*/\n\n\t\tif(empty($variable_keywords)){\n\t\t\treturn;\n\t\t}\n\n\n\t\t//get a select query instance\n\t\t$query = $this->solr_client->createSelect();\n\n\t\t//set a query (all prices starting from 12)\n\t\t$query->setQuery(sprintf('doctype:2 AND labl:(%s) AND sid:(%s)',$variable_keywords, implode(\" OR \",$survey_arr)) );\n\n\t\t//set start and rows param (comparable to SQL limit) using fluent interface\n\t\t$query->setStart(0)->setRows(100);\n\n\n\t\tif ($this->debug){\n\t\t\t$debug = $query->getDebug();\n\t\t}\n\n\t\n\t\t//get grouping component and set a field to group by\n\t\t$groupComponent = $query->getGrouping();\n\t\t$groupComponent->addField('sid'); //group by field\n\t\t$groupComponent->setLimit(0); // maximum number of items per group\n\t\t$groupComponent->setNumberOfGroups(true); // get a group count\n\n\t\t//execute search\n\t\t$resultset = $this->solr_client->select($query);\n\n\t\n\t\t//get raw query\n\t\tif($this->debug){\n\t\t\t$request = $this->solr_client->createRequest($query);\n\t\t\techo \"<HR>\";\n\t\t\techo $request->getUri();\n\t\t\techo \"<HR>\";\n\t\t\t//var_dump($resultset->getDebug());\n\t\t}\n\t\n\n\t\t//get groups resultset\n\t\t$groups = $resultset->getGrouping();\n\n\t\t$output=array();\n\n\t\tforeach ($groups as $groupKey => $fieldGroup)\n\t\t{\n\t\t\tforeach ($fieldGroup as $valueGroup)\n\t\t\t{\n\t\t\t\t//format=$output[sid]=num of vars found\n\t\t\t\t$output[(int)$valueGroup->getValue()]=(int)$valueGroup->getNumFound();\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "function count()\n {\n // this catches the situation where OL returned errno 32 = no such object!\n if (!$this->_search) {\n return 0;\n }\n return @ldap_count_entries($this->_link, $this->_search);\n }", "function get_counts( $results, $start, $end ) {\n $count = 0;\n\n foreach ( $results as $result ) {\n if ( $result['facet_value'] >= $start ) {\n if ( is_null( $end ) || $result['facet_value'] <= $end ) {\n $count += 1;\n }\n }\n }\n\n return $count;\n }", "public function _count();", "public function getCount() {}", "public function getCount() {}", "public function getCount() {}", "public function getTotalNumberOfResults();", "function array_counts($arr,$key,$data = 'rows')\n {\n foreach($arr as $item) {\n $item['rows'] =1;\n if (!isset($res[$item[$key]])) {\n $res[$item[$key]] = $item;\n }else{\n $res[$item[$key]][$data] +=$item['rows'] ;\n }\n }\n return $res;\n }", "public function getCatalogObjectCountSearch($search = array()) {\n $this->formedStandartSelect();\n\n $this->formedSearchQuery($search);\n\n $res = $this->db->where('site_catalog.parentid = 0')->get();\n// echo $this->db->last_query();\n// die();\n \n return (int)$res->num_rows();\n }", "public function countKeys();", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "abstract protected function _recordcount($rs);", "public function get_counts() {\n\n\t\t$this->counts = [];\n\n\t\t// Base params with applied filters.\n\t\t$base_params = $this->get_filters_query_params();\n\n\t\t$total_params = $base_params;\n\t\tunset( $total_params['status'] );\n\t\t$this->counts['total'] = ( new EmailsCollection( $total_params ) )->get_count();\n\n\t\tforeach ( $this->get_statuses() as $status => $name ) {\n\t\t\t$collection = new EmailsCollection( array_merge( $base_params, [ 'status' => $status ] ) );\n\n\t\t\t$this->counts[ 'status_' . $status ] = $collection->get_count();\n\t\t}\n\n\t\t/**\n\t\t * Filters items counts by various statuses of email log.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param array $counts {\n\t\t * Items counts by statuses.\n\t\t *\n\t\t * @type integer $total Total items count.\n\t\t * @type integer $status_{$status_key} Items count by status.\n\t\t * }\n\t\t */\n\t\t$this->counts = apply_filters( 'wp_mail_smtp_pro_emails_logs_admin_table_get_counts', $this->counts );\n\t}", "public function countSearchResults($data)\n{\n\t$this->db->select('*');\n\t$this->db->where('sample_field', $data['search_key']);\n\t$count=$this->db->count_all_results('sample_table');\n\treturn $count;\n}", "public function findCount(array $conditions);", "public function numberOfItems();", "public function getQueryCount();", "abstract public function count();", "abstract public function count();", "abstract public function count();", "abstract public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function publicSearchCount(Tinebase_Model_Filter_FilterGroup $_filter, $_action = 'get') \r\n {\r\n $this->checkFilterACL($_filter, $_action);\r\n\r\n $count = $this->_backend->publicSearchCount($_filter);\r\n \r\n return $count;\r\n }", "function getRecordCountBySearchArray($fieldName, $searchKeyword, $searchStatus)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$sqlTotal = $this->getTotalArray($fieldName, $searchKeyword, $searchStatus);\r\n\t\t\t\r\n\t\t\tif ($sqlTotal) {\r\n\t\t\t\treturn $sqlTotal;\r\n\t\t\t}\r\n\t\t\telse if(!$sqlTotal || ($sqlTotal < 1)){\r\n\t\t\t\t return 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function statistics_extended_groups_metadata_value_count($metadata,$value,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}groups_entity ue \";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"JOIN {$dbprefix}metadata m2 ON ue.guid = m2.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings m2v ON m.value_id = m2v.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n $query .= \"AND m2v.string like '$value' \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}", "public static function count ($search)\n {\n $count = 0;\n $n = count(static::$_map);\n for ( $i=0; $i < $n; $i++ ) { \n $row = array_count_values(static::$_map[$i]);\n if ( array_key_exists($search, $row) ) {\n $count += $row[$search];\n }\n }\n return $count;\n }", "public function getSearchResultCount(array $constraints) {\n\t\t\n\t\t$query = $this->getSelectQuery(\"count\", $constraints);\n\t\t$results = $this->sparqlSelect($query);\n\t\t$result = $results[0];\n\t\treturn $result['count'];\n\t}", "public abstract function count();", "public abstract function count();", "private function getCountFilteredResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(distinct ' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setLeftJoin($qb);\n $this->setWhere($qb);\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public static function get_component_count_by_key() {\n\n\t\t$component_keys_count = array(\n\t\t\t'header-button' => 2,\n\t\t\t'footer-button' => 2,\n\t\t\t'header-html' => 2,\n\t\t\t'footer-html' => 2,\n\t\t\t'header-menu' => 2,\n\t\t\t'header-widget' => 4,\n\t\t\t'footer-widget' => 4,\n\t\t\t'header-social-icons' => 1,\n\t\t\t'footer-social-icons' => 1,\n\t\t\t'header-divider' => 3,\n\t\t\t'footer-divider' => 3,\n\t\t);\n\n\t\t$component_keys_count = array_merge(\n\t\t\t$component_keys_count,\n\t\t\tapply_filters(\n\t\t\t\t'astra_builder_elements_count',\n\t\t\t\t$component_keys_count\n\t\t\t)\n\t\t);\n\n\t\t// Buttons.\n\t\t$component_keys_count['header-button'] = ( 10 >= $component_keys_count['header-button'] ) ? $component_keys_count['header-button'] : 10;\n\t\t$component_keys_count['footer-button'] = ( 10 >= $component_keys_count['footer-button'] ) ? $component_keys_count['footer-button'] : 10;\n\n\t\t// HTML.\n\t\t$component_keys_count['header-html'] = ( 10 >= $component_keys_count['header-html'] ) ? $component_keys_count['header-html'] : 10;\n\t\t$component_keys_count['footer-html'] = ( 10 >= $component_keys_count['footer-html'] ) ? $component_keys_count['footer-html'] : 10;\n\n\t\t// Header Menu.\n\t\t$component_keys_count['header-menu'] = ( 5 >= $component_keys_count['header-menu'] ) ? $component_keys_count['header-menu'] : 5;\n\n\t\t// Widgets.\n\t\t$component_keys_count['header-widget'] = ( 10 >= $component_keys_count['header-widget'] ) ? $component_keys_count['header-widget'] : 10;\n\t\t$component_keys_count['footer-widget'] = ( 10 >= $component_keys_count['footer-widget'] ) ? $component_keys_count['footer-widget'] : 10;\n\n\t\t// Social Icons.\n\t\t$component_keys_count['header-social-icons'] = ( 5 >= $component_keys_count['header-social-icons'] ) ? $component_keys_count['header-social-icons'] : 5;\n\t\t$component_keys_count['footer-social-icons'] = ( 5 >= $component_keys_count['footer-social-icons'] ) ? $component_keys_count['footer-social-icons'] : 5;\n\n\t\t// Divider.\n\t\t$component_keys_count['header-divider'] = ( 10 >= $component_keys_count['header-divider'] ) ? $component_keys_count['header-divider'] : 10;\n\t\t$component_keys_count['footer-divider'] = ( 10 >= $component_keys_count['footer-divider'] ) ? $component_keys_count['footer-divider'] : 10;\n\n\t\treturn $component_keys_count;\n\t}", "function getDocumentCountByGroupStatus($search_obj = NULL)\n\t{\n\t\t$output = executeQuery('document.getDocumentCountByGroupStatus', $search_obj);\n\t\tif(!$output->toBool()) return array();\n\n\t\treturn $output->data;\n\t}", "public function searchItems( \\Aimeos\\MW\\Criteria\\Iface $filter, &$total = null );", "public function countBy($criteria);", "protected function _search(array $criteria, array $fields, array $blobFields = array(), $count_only)\n {\n $query = $results = array();\n\n if (!$this->_authenticated) {\n return $query;\n }\n\n /* Get the search criteria. */\n if (count($criteria)) {\n foreach ($criteria as $key => $vals) {\n $names = (strval($key) == 'OR')\n ? $this->_doSearch($vals, 'OR')\n : $this->_doSearch($vals, 'AND');\n }\n }\n\n /* Now we have a list of names, get the rest. */\n $result = $this->_read('name', $names, null, $fields);\n if (is_array($result)) {\n $results = $result;\n }\n\n Horde::log(sprintf('IMSP returned %s results', count($results)), 'DEBUG');\n\n return $count_only ? count($results) : array_values($results);\n }", "function count_search_product_result($conditions_array=array()){\n\t\t$this->db->where($conditions_array);\n\t\t$this->db->like('product', $this->input->post('search_text'));\n\t\t$this->db->or_like('description', $this->input->post('search_text'));\n\t\treturn $this->db->count_all_results('red_support_product as rsp');\n\t}", "public function testQueryGroupCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function countResults($resultsItems)\r\n {\r\n $num_rows=0;\r\n for ($i=0;$i < count($resultsItems); $i++) \r\n {\r\n $num_rows++;\r\n }\r\n return $num_rows;\r\n\r\n }", "public function getCount($filters=array())\n\t{\n\t\t$query = \"SELECT count(*) FROM $this->_tbl AS a\";\n\t\t$where = array();\n\t\tif ($filters['catid'] > 0)\n\t\t{\n\t\t\t$where[] = \"a.catid='\" . intval($filters['catid']) . \"'\";\n\t\t}\n\t\tif ($filters['search'])\n\t\t{\n\t\t\t$where[] = \"LOWER(a.title) LIKE \" . $this->_db->quote('%' . $filters['search'] . '%');\n\t\t}\n\n\t\t//did we pass in a scope id filter\n\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '' && $filters['scope_id'] != 0)\n\t\t{\n\t\t\t$where[] = \"a.scope=\" . $this->_db->quote('group');\n\t\t\t$where[] = \"a.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t}\n\n\t\t$query .= (count($where)) ? \" WHERE \" . implode(' AND ', $where) : \"\";\n\t\t$this->_db->setQuery($query);\n\t\treturn $this->_db->loadResult();\n\t}", "public function DoSearch()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->GetSearchResults_Obj(true);\n \n $ret = $this->GetNumberOfResults();\n \n return $ret;\n }", "public function getCount ()\n {\n return count ( $this->_list ) ;\n }", "public function totalCount();", "public function totalCount();", "function &getAllCount( $search = \"\" )\n {\n $db =& eZDB::globalDatabase();\n\n if ( !empty( $search ) )\n {\n $query = new eZQuery( array( \"Name\", \"Abbreviation\" ), $search );\n $search_arg = \"AND \" . $query->buildQuery();\n// $search_arg = \"WHERE Name like '%$search%'\";\n }\n\n $db->query_single( $region_countries, \"SELECT COUNT( ID ) as Count FROM eZAddress_Region\n WHERE Removed=0 $search_arg\n \" );\n return $region_countries[ $db->fieldName(\"Count\") ];\n }", "public function count_key_usage() {\n\t\t$this->db->from('key_usage');\n\t\treturn $this->db->count_all_results();\n\t}", "public function count($key = null)\n {\n if (null !== $key && is_array($this->items[$key])) {\n return count($this->items[$key]);\n }\n\n return count($this->items);\n }", "public function getCountList(){\n\t\t$select = $this->getListSelect();\n\t\t$stmt = $select->query();\n\t\t$objects = array();\n\t\treturn count($stmt->fetchAll());\n\t}", "public function searchCount() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->searchCount();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "public static function count();", "function getSearchStats( $search_type ) {\n /*\n * !!!NOT IN USE ANYMORE!!!\n * Function used to give result for each search\n * */\n global $mysqli;\n $sql = \"SELECT `$search_type`, COUNT(*) AS `count` FROM `search_history` GROUP BY `$search_type`\";\n $result = $mysqli->query( $sql );\n return $result->fetch_all( MYSQLI_ASSOC );\n}", "abstract public function prepareFilteredCount();", "public function searchCount(Tinebase_Model_Filter_FilterGroup $_filter) {\n return 30;\n }", "function getResultsCounter()\n\t{\n\t\t// Initialize variables\n\t\t$html = null;\n\t\t$fromResult = $this->limitstart + 1;\n\n\t\t// If the limit is reached before the end of the list\n\t\tif ($this->limitstart + $this->limit < $this->total) {\n\t\t\t$toResult = $this->limitstart + $this->limit;\n\t\t} else {\n\t\t\t$toResult = $this->total;\n\t\t}\n\n\t\t// If there are results found\n\t\tif ($this->total > 0) {\n\t\t\t$msg = JText::sprintf('Results of', $fromResult, $toResult, $this->total);\n\t\t\t$html .= \"\\n\".$msg;\n\t\t} else {\n\t\t\t$html .= \"\\n\".JText::_('No records found');\n\t\t}\n\n\t\treturn $html;\n\t}", "public function countDataProvider() {}", "public function testNumberOfSearchCriteria()\n {\n\n $searchCriteria = $this->criteriaCreator->getSearchCriteria($this->getMockedRequestQueryData());\n\n $this->assertEquals(3, count($searchCriteria));\n\n }", "public function setSearchItems($totalItemsCount, $previousItemNumber, $date)\n {\n global $lang, $key, $params, $config;\n \n $item = array();\n \n if ((($key == '') && (preg_match('/^[0-9]{4}-[0-9]{2}/', $date))) ||\n (($key == '') && ($date == 'all'))) {\n if (preg_match('/^[0-9]{4}-[0-9]{2}/', $date)) {\n $yyyy = substr($date, 0, 4);\n $mm = substr($date, 5, 2);\n $dateArray = getdate(mktime(0, 0, 0, $mm, 1, $yyyy));\n $month = $dateArray['month'];\n $mday = $dateArray['mday'];\n $year = $dateArray['year'];\n $archiveTitle = strtotime($mday . ' ' . $month . ' ' . $year);\n } else if ($date == 'all') {\n $archiveTitle = '0'; // All data\n }\n $resultMessage = $lang['show_log'];\n } else if ($key != '') {\n $archiveTitle = ($date != '') ? '2' : '1';\n $resultMessage = $lang['hit_msg'];\n } else {\n $archiveTitle = '0'; // All data\n $resultMessage = $lang['show_log'];\n }\n \n // Get Tag name as key\n if (!empty($_GET['t'])) {\n $sql = 'SELECT ' \n . $params['tag_name'] . ' '\n . 'FROM ' \n . $params['tag_table'] . ' '\n . 'WHERE '\n . 'id = :id';\n $stmt = $this->db->prepare($sql);\n $stmt->execute(\n array(\n ':id' => $key\n )\n );\n $key = $stmt->fetchColumn();\n }\n \n // Create the last row number to display\n $rowsToDisplay = (($previousItemNumber + self::$config['page_max']) > $totalItemsCount)\n ? $totalItemsCount\n : $previousItemNumber + self::$config['page_max'];\n\n // Pesentation of the results\n $item['keyword'] = htmlspecialchars($key);\n $item['date'] = $date;\n $item['archive_title'] = $archiveTitle;\n $item['hits'] = $totalItemsCount;\n $item['disp_page'] = $previousItemNumber + 1;\n $item['disp_rows'] = $rowsToDisplay;\n $item['result_message'] = $resultMessage;\n \n return $item;\n }", "public function fetchData()\r\n {\r\n $this->objectcount = $this->search_obj->getObjectQueryCount($this->extra);\r\n }" ]
[ "0.56900364", "0.56449765", "0.5623215", "0.5623215", "0.5623215", "0.56198406", "0.5558744", "0.54506874", "0.54190314", "0.5321909", "0.5231798", "0.52314055", "0.52237064", "0.51991695", "0.5196239", "0.5183474", "0.51796097", "0.5171364", "0.51614875", "0.51418555", "0.5141037", "0.5140393", "0.5140393", "0.51320654", "0.50859004", "0.5046816", "0.5009778", "0.5008069", "0.5006566", "0.5006566", "0.5006566", "0.50000113", "0.4994093", "0.49933997", "0.49901468", "0.49839318", "0.49727187", "0.4961241", "0.4961241", "0.4961241", "0.4961241", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.49548724", "0.4950414", "0.49394974", "0.4938357", "0.49362513", "0.49351096", "0.49250698", "0.49249196", "0.49249196", "0.49194312", "0.48985815", "0.4891738", "0.4884041", "0.48821014", "0.48679286", "0.48636192", "0.48599577", "0.48523194", "0.48481125", "0.48385262", "0.48374704", "0.4823762", "0.4823762", "0.48103806", "0.4799845", "0.47990942", "0.47988573", "0.4794563", "0.47910857", "0.4788681", "0.47836062", "0.4781928", "0.4780688", "0.4777845", "0.47589043", "0.47504452", "0.4747449" ]
0.6284374
0
Moves an existing list item to a new position. The position is in front of the item with the ID given in $ref or at the end of the list if $ref is null. // item ID list in database: 1, 2, 3, 4 $listManager>moveItem( 2, 4 ); // result: 1, 3, 2, 4 // item ID list in database: 1, 2, 3, 4 $listManager>moveItem( 2, null ); // result: 1, 3, 4, 2 The method updates the position of the record with the given ID in $id and of all records afterwards. The gap left behind by the moved record is closed automatically. To retrive the items according to the new positions, you have to sort them by the '.lists.position' key: $search = $listManager>createSearch(); $search>setSortations( array( $search>sort( '+', 'product.lists.position' ) ) ); $result = $listManager>searchItems( $search );
public function moveItem( $id, $ref = null );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function moveItemAt($currentPosition, $newPosition = 0);", "public function moveItem(Item $item, int $position): Item;", "public function move($id) {\n $item = $this->getItem($id);\n $table_name = \"items\";\n $connection = db_connect();\n if ($connection->connect_error) {\n die(\"Connection failed: \" . $connection->connect_error);\n }\n //prepare statement\n if (!($sql = $connection->prepare(\"UPDATE $table_name SET category=? WHERE id=?\"))) {\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n }\n $current = $item->getCategory();\n $new = $current + 1;\n //bind variables\n if (!($sql->bind_param(\"ii\", $new, $id))) {\n echo \"Binding parameters failed: (\" . $sql->errno . \") \" . $sql->error;\n }\n //run query\n if (!$sql->execute()) {\n echo \"Execute failed: (\" . $sql->errno . \") \" . $sql->error;\n }\n //close\n $sql->close();\n }", "function reorderItem($db, $resource_pk, $item_pk, $new_pos) {\r\n\r\n $item = getItem($db, $resource_pk, $item_pk);\r\n\r\n $ok = !empty($item->item_pk);\r\n if ($ok) {\r\n $old_pos = $item->sequence;\r\n $ok = ($old_pos != $new_pos);\r\n }\r\n if ($ok) {\r\n $prefix = DB_TABLENAME_PREFIX;\r\n if ($new_pos <= 0) {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence - 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence > :old_pos)\r\nEOD;\r\n } else if ($old_pos < $new_pos) {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence - 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence > :old_pos) AND (sequence <= :new_pos)\r\nEOD;\r\n } else {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence + 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence < :old_pos) AND (sequence >= :new_pos)\r\nEOD;\r\n }\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->bindValue('old_pos', $old_pos, PDO::PARAM_INT);\r\n if ($new_pos > 0) {\r\n $query->bindValue('new_pos', $new_pos, PDO::PARAM_INT);\r\n }\r\n\r\n $ok = $query->execute();\r\n\r\n if ($ok && ($new_pos > 0)) {\r\n $item->sequence = $new_pos;\r\n $ok = saveItem($db, $resource_pk, $item);\r\n }\r\n\r\n }\r\n\r\n return $ok;\r\n\r\n }", "function Move(){\n //--get request values\n $move_library = $this->Request->Value(\"move_library\");\n $item_id = $this->Request->Value(\"item_id\");\n $move_id = $this->Request->Value(\"move_id\");\n\n if (intval($move_id) == 0)\n return false;\n //--get move config file and move storage object\n $move_config = Engine::getLibrary($this->Kernel, $move_library, \"move_library_config_\" . $this->move_library);\n $move_Storage = DataFactory::GetStorage($this, $move_config->GetItem(\"MAIN\", \"TABLE\"));\n\n //--get move field\n if ($move_config->HasItem(\"MAIN\", \"MOVE_FIELD\")) {\n $move_field = $move_config->GetItem(\"MAIN\", \"MOVE_FIELD\");\n }\n else {\n if ($move_Storage->HasColumn(\"_priority\") !== false) {\n $move_field = \"_priority\";\n }\n else {\n $inc_column = $move_Storage->GetIncrementalColumn();\n $move_field = $inc_column[\"name\"];\n }\n }\n\n //get key field\n $inc_column = $move_Storage->GetIncrementalColumn();\n $key_field = $inc_column[\"name\"];\n //get current item\n $item = $move_Storage->Get(array(\n $key_field => $item_id));\n $move_item = $move_Storage->Get(array($key_field => $move_id));\n\n //--if near item not found\n if (intval($move_item[$key_field]) == 0) {\n return false;\n }\n\n if ($move_field != $key_field) { //-- change records (if priority field not a key field)\n $upd_array = array(\n $key_field => $item[$key_field] ,\n $move_field => $move_item[$move_field]);\n\n $move_Storage->Update($upd_array);\n $upd_array = array(\n $key_field => $move_item[$key_field] ,\n $move_field => $item[$move_field]);\n $move_Storage->Update($upd_array);\n }\n else { //-- change records (if priority field is a key field)\n $move_Storage->exchangeIncrementals($item_id, $move_id);\n\n //--check if library have a sub-categories\n if ($move_config->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $use_sub_categories = $move_config->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $use_sub_categories = false;\n }\n\n //--if library use subcategories\n if ($use_sub_categories) {\n $sub_categories_count = $move_config->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < sizeof($sub_categories_count); $i ++) {\n $library = $move_config->GetItem(\"sub_category_\" . $i, \"APPLY_LIBRARY\");\n $link_field = $move_config->GetItem(\"sub_category_\" . $i, \"LINK_FIELD\");\n $sub_listSettings = Engine::getLibrary($this->Kernel, $library, \"sub_ListSettings_\" . $library);\n $sub_table = $sub_listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . strtolower($sub_table), $sub_table);\n $sub_Storage = new $sub_table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $sub_table));\n $_sub_column = $sub_Storage->getIncrementalColumn();\n\n $upd_array1 = array();\n $upd_array2 = array();\n\n //move first record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$_sub_column[\"name\"]];\n }\n\n //move second record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$_sub_column[\"name\"]];\n }\n }\n //--move group for second and first record\n if (count($upd_array1))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array1, array(\n $key_field => $move_id));\n if (count($upd_array2))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array2, array(\n $key_field => $item_id));\n\n }\n\n //check if library is multiple\n if ($move_config->HasItem(\"MAIN\", \"IS_MULTILEVEL\")) {\n $is_multilevel = $move_config->GetItem(\"MAIN\", \"IS_MULTILEVEL\");\n if ($is_multilevel) {\n $parent_field = $move_config->GetItem(\"MAIN\", \"PARENT_FIELD\");\n $upd_array1 = array();\n $upd_array2 = array();\n //move first record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$key_field];\n }\n\n //move second record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$key_field];\n }\n if (count($upd_array1))\n $move_Storage->GroupUpdate($key_field, $upd_array1, array(\n $parent_field => $move_id));\n if (count($upd_array2))\n $move_Storage->GroupUpdate($key_field, $upd_array2, array(\n $parent_field => $item_id));\n }\n }\n return true;\n }\n\n }", "function wpcf_custom_types_menu_order_move( &$menu, $item_move, $item_target ) {\n\n // if item move comes after target we have to select the next element,\n // otherwise the $item_move would be added before the target.\n if( $item_move > $item_target )\n $item_target++;\n\n // if $item_target is the last menu item, place $item_move to the end of the array\n if( !isset( $menu[$item_target]) ) {\n $tmp_menu_item = $menu[$item_move];\n unset( $menu[$item_move] );\n $menu[] = $tmp_menu_item;\n\n // $item_target is not the last menu, place $item_move after it\n } else {\n $cut_moving_element = array_splice( $menu, $item_move, 1 );\n array_splice( $menu, $item_target, 0, $cut_moving_element );\n }\n\n}", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public abstract function moveToNext($referenceId = null);", "abstract public function moveLeft($id);", "public function moveAction(){\r\n // get variables from request\r\n $query = $this->getRequest()->getQuery()->toArray();\r\n $blockId = $query['block_id'];\r\n $navId = $query['id'];\r\n $position = $query['position'];\r\n // get navigation block model\r\n $navBlockModel = $this->getServiceLocator()->get('DotsNavBlock\\Db\\Model\\NavigationBlock');\r\n // get an instance of the item that changes position and set the new position\r\n $nav = $navBlockModel->getById($navId);\r\n $nav->position = $position;\r\n // get all other items from the navigation\r\n $items = $navBlockModel->getAllByColumnsOrderByPosition(array(\r\n 'block_id = ?' => $blockId,\r\n 'id != ?' => $navId\r\n ));\r\n\r\n // update positions for all items\r\n $pos = 1;\r\n if ($items){\r\n foreach ($items as $itm){\r\n if ($pos==$position){\r\n $pos++;\r\n }\r\n $itm->position = $pos++;\r\n $navBlockModel->persist($itm);\r\n }\r\n }\r\n $navBlockModel->persist($nav);\r\n // save everything in the DB\r\n $navBlockModel->flush();\r\n\r\n return $this->jsonResponse(array('success' => true));\r\n }", "public static function move($itemid, $new_catid) {\n global $manager;\n\n $itemid = intval($itemid);\n $new_catid = intval($new_catid);\n\n $new_blogid = getBlogIDFromCatID($new_catid);\n\n $param = array(\n 'itemid' => $itemid,\n 'destblogid' => $new_blogid,\n 'destcatid' => $new_catid\n );\n $manager->notify('PreMoveItem', $param);\n\n\n // update item table\n $query = 'UPDATE '.sql_table('item').\" SET iblog=$new_blogid, icat=$new_catid WHERE inumber=$itemid\";\n sql_query($query);\n\n // update comments\n $query = 'UPDATE '.sql_table('comment').\" SET cblog=\" . $new_blogid.\" WHERE citem=\" . $itemid;\n sql_query($query);\n\n $param = array(\n 'itemid' => $itemid,\n 'destblogid' => $new_blogid,\n 'destcatid' => $new_catid\n );\n $manager->notify('PostMoveItem', $param);\n }", "function MoveListItem($udListDefinitionId, $listItemId, $direction)\n\t{\n\t\t$result = $this->sendRequest(\"MoveListItem\", array(\"UdListDefinitionId\"=>$udListDefinitionId, \"ListItemId\"=>$listItemId, \"Direction\"=>$direction));\t\n\t\treturn $this->getResultFromResponse($result, true);\n\t}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "function OnMoveUp(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "public function move() {\n\t\t\tif (!empty($this->params['pass'][0]) && !empty($this->params['pass'][1])) {\n\t\t\t\t/* Get move direction and id of menu item */\n\t\t\t\t$moveDir = Sanitize::escape($this->params['pass'][0]);\n\t\t\t\t$this->menuId = Sanitize::escape($this->params['pass'][1]);\n\t\t\t\t\n\t\t\t\t/* Move menu item up oder down */\n\t\t\t\tif ($moveDir == 'up') {\n\t\t\t\t\t$this->MyMenu->moveup($this->menuId, 1);\n\t\t\t\t} else if ($moveDir == 'down') {\n\t\t\t\t\t$this->MyMenu->movedown($this->menuId, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Get list of menu items */\n\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function move($id)\n\t{\n\t\t$itemId = $this->wishlist->item($id)->get('id');\n\n\t\t$this->delete($id);\n\n\t\treturn Redirect::to(\"cart/$itemId/add\");\n\t}", "public static function move($field_id, $field_move, $field_type)\n\t{\t\t\n\t\t$sql = 'SELECT pf_order\n\t\t\t\tFROM ' . SQL_PREFIX . 'profil_fields\n\t\t\t\tWHERE pf_id = ' . $field_id . '\n\t\t\t\t\tAND pf_type = ' . $field_type;\n\t\t$pf_order = Fsb::$db->get($sql, 'pf_order');\n\t\t\n\t\t$move = intval($pf_order) + $field_move;\n\t\t$sql = 'SELECT pf_order, pf_id\n\t\t\t\tFROM ' . SQL_PREFIX . 'profil_fields\n\t\t\t\tWHERE pf_order = ' . $move . '\n\t\t\t\t\tAND pf_type = ' . $field_type;\n\t\t$result = Fsb::$db->query($sql);\n\t\t$dest = Fsb::$db->row($result);\n\t\tFsb::$db->free($result);\n\t\t\n\t\tif ($dest)\n\t\t{\n\t\t\tFsb::$db->update('profil_fields', array(\n\t\t\t\t'pf_order' =>\t$dest['pf_order'],\n\t\t\t), 'WHERE pf_id = ' . $field_id);\n\t\t\t\n\t\t\tFsb::$db->update('profil_fields', array(\n\t\t\t\t'pf_order' =>\t$pf_order,\n\t\t\t), 'WHERE pf_id = ' . $dest['pf_id']);\n\t\t}\n\t}", "public function moveItemAt($currentPosition, $newPosition = 0)\n {\n // @todo Implement usort() method with TCEforms in mind\n throw new \\RuntimeException('This method is not yet supported.', 1322545626);\n }", "function OnMoveDown(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "abstract public function moveRight($id);", "function moveTo($list,$indexToMove,$toList){\r\n\t\tif($toList==null) $toList=new LinkedList();\r\n\t\tif($toList->searchObject($list->getIndex($indexToMove))) return false; //Metoda nie przeniesie objektu jeśli miałby on kolidować z innym objektem o tej samej wartości\r\n\t\t\t$movingObject=$list->getIndex($indexToMove);\r\n\t\t\t$list->deleteIndex($indexToMove);\t\t\r\n\t\t\t$toList->insertLastObj($movingObject);\r\n\t\treturn true;\t\r\n\t}", "abstract public function moveCard(int $card_id, string $location, int $location_arg = 0);", "public function orderedMove() {\n\t\t$modelName = $this->Controller->modelClass;\n\t\t$this->Controller->{$modelName}->transaction();\n\n\t\tif (!$this->Controller->{$modelName}->Behaviors->attached('Sequence')) {\n\t\t\t$this->Controller->notice(\n\t\t\t\t__d('infinitas', 'A problem occured moving the ordered record.'),\n\t\t\t\tarray(\n\t\t\t\t\t'level' => 'error',\n\t\t\t\t\t'redirect' => true\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$fields = array_values($this->Controller->{$modelName}->sequenceGroupFields());\n\t\t$fields[] = $this->Controller->{$modelName}->alias . '.' . $this->Controller->{$modelName}->primaryKey;\n\t\t$data = $this->Controller->{$modelName}->find('first', array(\n\t\t\t'fields' => $fields,\n\t\t\t'conditions' => array(\n\t\t\t\t$this->Controller->{$modelName}->alias . '.' . $this->Controller->{$modelName}->primaryKey => $this->Controller->request->data[$modelName][$this->Controller->{$modelName}->primaryKey]\n\t\t\t),\n\t\t\t'callbacks' => false\n\t\t));\n\t\t$data[$modelName]['ordering'] = $this->Controller->request->params['named']['position'];\n\n\t\ttry {\n\t\t\tif ($this->Controller->{$modelName}->save($data, array('validate' => false))) {\n\t\t\t\t$this->Controller->{$modelName}->transaction(true);\n\t\t\t\t$this->Controller->notice(\n\t\t\t\t\t__d('infinitas', 'The record was moved'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'redirect' => ''\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->Controller->{$modelName}->transaction(false);\n\t\t\t$this->Controller->notice(\n\t\t\t\t$e->getMessage(),\n\t\t\t\tarray(\n\t\t\t\t\t'level' => 'error',\n\t\t\t\t\t'redirect' => false\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function test_move_item(): void\n {\n // Arrange\n $user = UserFactory::createOne()->object();\n $collectionLevel1 = CollectionFactory::createOne(['owner' => $user]);\n $collectionLevel2 = CollectionFactory::createOne(['parent' => $collectionLevel1, 'owner' => $user]);\n $collectionLevel3 = CollectionFactory::createOne(['parent' => $collectionLevel2, 'owner' => $user]);\n $item = ItemFactory::createOne(['collection' => $collectionLevel3, 'owner' => $user]);\n\n // Act\n $newCollection = CollectionFactory::createOne(['owner' => $user]);\n $item->setCollection($newCollection->object());\n $item->save();\n\n $this->refreshCachedValuesQueue->process();\n\n // Assert\n $this->assertSame(1, $newCollection->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel1->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel2->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel3->getCachedValues()['counters']['items']);\n }", "public static function moveItem($id, $direction, $rubriek, $isTitle)\n\t{\n\t\t// veronderstelling : het sortnr is van 1 tot x genummerd - geordend per rubriek (title) voor elk type\n\t\t// haal nu alles op van de desbetreffende rubriek geordend per type\n\t\t\n\t\t// Haal het item met deze id\n\t\t// bewaar het sortnr --> sortnrDitItem\n\t\t\n\t\t$ditItem = Document::find($id);\n\t\t\n\t\t$sortnrDitItem = $ditItem->sortnr;\n\t\t$ditItemTitel = $ditItem->title;\n\t\t\n\t\t\n\t\t// Als direction == up\n\t\tif ($direction == 'up')\n\t\t{\n\t\t\t\t\n\t\t\t// Als sortnr == 1 --> return (wijzig niets want het staat al vooraan)\n\t\t\tif ($sortnrDitItem == 1) return;\n\t\t\t// Als isTitle --> \n\t\t\tif ($isTitle == 'yes')\n\t\t\t{\n\t\t\t\t// haal vorige titel ( vooral sortnr vorige belangrijk - en let op : is er wel een vorige?)\n\t\t\t\t// haal eerst vorig item\n\t\t\t\t$vorigSortnr = $sortnrDitItem-1;\n\t\t\t\t$vorigItem = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $vorigSortnr))->get();\n\t\t\t\n\t\t\t\t\n\t\t\t\t$vorigeTitel = $vorigItem[0]->title;\n\t\t\t\t$hulpsortnr = $vorigSortnr - 1;\n\t\t\t\t$vorigeTitelItem = $vorigItem;\t\n\t\t\t\t\t\t\n\t\t\t\tdo {\n\t\t\t\t\t$zelfdetitel = true;\n\t\t\t\t\tif ($hulpsortnr <= 0) break;\n\t\t\t\t\t$vorigItem = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $hulpsortnr))->get();\n\t\t\t\t\tif ($vorigItem[0]->title == $vorigeTitel)\n\t\t\t\t\t{\n\t\t\t\t\t\t$vorigeTitelItem = $vorigItem;\n\t\t\t\t\t\t$hulpsortnr--;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$zelfdetitel = false;\n\t\t\t\t\t}\n\t\t\t\t} while ($zelfdetitel);\n\t\t\t\t\n//\t\t\t\tvar_dump($vorigeTitelItem);\n//\t\t\t\tdie(\" vorig item (rubriek = {$rubriek} en sortnr = {$vorigSortnr}) - en $vorigeTitelItem[0]->id\");\n\t\t\t\t// haal volgende titel ( vooral sortnr volgende belangrijk - en let op : is er wel een volgende?)\n\t\t\t\t$maxSortnr = DB::table('documents')->where('type', $rubriek)->max('sortnr');\n\t\t\t\t$huidigeTitel = $ditItem->title;\n\t\t\t\t$hulpsortnr = $sortnrDitItem + 1;\n\t\t\t\t\n\t\t\t\tif ($hulpsortnr > $maxSortnr) $eindeDezeRubriekSortnr = $sortnrDitItem;\n\t\t\t\telse\n\t\t\t\t\tdo{\n\t\t\t\t\t\t$zelfdetitel = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($hulpsortnr >= $maxSortnr) break;\n\t\t\t\t\t\n\t\t\t\t\t\t$volgendItem = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $hulpsortnr))->get();\n\t\t\n\t\t\t\t\t\tif ($volgendItem[0]->title == $huidigeTitel)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$eindeDezeRubriekSortnr = $volgendItem[0]->sortnr;\n\t\t\t\t\t\t\t$hulpsortnr++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$zelfdetitel = false;\n\t\t\t\t\t\t\t$hulpsortnr++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} while ($zelfdetitel);\n\t\t\t\t\t\n\t\t\t\t// hier is vorige reeks en huidige reeks gekend\t\t\n\t\t\t\t// vorige reeks\n\t\t\t\t$startVorigSortnr = $vorigeTitelItem[0]->sortnr;\n\t\t\t\t$eindeVorigSortnr = $sortnrDitItem - 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t// maak nu een array van de id's van beide groepen\n\t\t\t\tfor ($i=$startVorigSortnr; $i <= $eindeVorigSortnr; $i++)\n\t\t\t\t{\n\t\t\t\t\t$item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $i))->get();\n\t\t\t\t\t$vorige[] = $item[0]->id;\n\t\t\t\t}\n\t\t\t\t// Zoek het einde van deze rubriek\n\t\t\t\t$laatste = Document::whereRaw('type= ? and sortnr = ?', array($rubriek, $sortnrDitItem))->max('sortnr');\n\t\t\t\tprint(\"($rubriek, $id)<br />\");\n\t\t\t\tvar_dump($laatste);die(\"dfdsqfdsf\");\n\t\t\t\t// maak nu de array van de id's van volgende\n\t\t\t\tfor ($i=$sortnrDitItem; $i <= $eindeDezeRubriekSortnr; $i++)\n\t\t\t\t{\n\t\t\t\t\t$item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $i))->get();\n\t\t\t\t\t$volgende[] = $item[0]->id;\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t$sortnr = $startVorigSortnr;\n\t\t\t\tforeach($volgende AS $id)\n\t\t\t\t{\n\t\t\t\t\tDB::table('documents')->where('id', $id)->update(array('sortnr'=> $sortnr));\n\t\t\t\t\t$sortnr++;\n\t\t\t\t}\n\t\t\t\tforeach($vorige AS $id)\n\t\t\t\t{\n\t\t\t\t\tDB::table('documents')->where('id', $id)->update(array('sortnr' => $sortnr));\n\t\t\t\t\t$sortnr++;\n\t\t\t\t}\n\n\t\t\t} else { // Anders (als geen isTitle)\n\t\t\t // wissel de huidige met de vorige, als de vorige nog tot deze rubriek behoort \n\t\t\t // het wisselen is enkel de sortnr's wisselen\n\n\t\t\t if ($sortnrDitItem == 1) return;\n\t\t\t $vorigSortnr = $sortnrDitItem - 1;\n\t\t\t $vorigItem = $item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $vorigSortnr))->get();\t\t\t\t \n//\t\t\t if ($vorigItem[0]->title != $ditItemTitel) return;\n\t\t\t DB::table('documents')->where('id', $ditItem->id)->update(array('sortnr' => $vorigSortnr));\n\t\t\t DB::table('documents')->where('id', $vorigItem[0]->id)->update(array('sortnr' => $sortnrDitItem));\t\t\n\t\t\t}\n\t\t} else { // Als direction == down\n\t\t\t// Haal het hoogste sortnr op\n\t\t\t$maxSortnr = DB::table('documents')->where('type', $rubriek)->max('sortnr');\n\t\t\t// Als het sortnr van het huidige item == maxSortnr --> return\n\t\t\tif ($sortnrDitItem == $maxSortnr) return;\t\t\t\n\t\t\tif ($isTitle == 'yes')\n\t\t\t{\n\t\t\t\t// is dit de laatste Titel?\n\t\t\t\t$ditItemTitle = $ditItem->title;\n\t\t\t\t$runningSortnr = $sortnrDitItem+1;\n\t\t\t\t$verderdoen = true;\n\t\t\t\t$huidige[] = $ditItem->id;\n\t\t\t\tdo {\n\t\t\t\t\tif ($runningSortnr > $maxSortnr) break;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $runningSortnr))->get();\t\t\t\t\t\t\n\t\t\t\t\t\tif ($item[0]->title != $ditItemTitle) break;\n\t\t\t\t\t\t$huidige[] = $item[0]->id;\n\t\t\t\t\t\t$runningSortnr++;\n\t\t\t\t\t}\n\t\t\t\t} while ($verderdoen);\n\t\t\t\tif ($runningSortnr >= $maxSortnr) return;\n\t\t\t\t\n\t\t\t\t// zoek nu de items met volgende titel\n\t\t\t\t$volgendeTitel = $item[0]->title;\n\t\t\t\t$volgende[] = $item[0]->id;\n\t\t\t\t$verderdoen = true;\n\t\t\t\tdo{\n\t\t\t\t\t$runningSortnr++;\n\t\t\t\t\tif ($runningSortnr > $maxSortnr) break;\n\t\t\t\t\t\n\t\t\t\t\t$item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $runningSortnr))->get();\n\t\t\t\t\tif ($item[0]->title != $volgendeTitel) break;\n\t\t\t\t\t$volgende[] = $item[0]->id;\n\t\t\t\t} while ($verderdoen);\n\t\t\t\t\n\t\t\t\t// dit is niet de laatste rubriek --> we verwisselen dus\n\t\t\t\t$sortnr = $sortnrDitItem;\n\t\t\t\tforeach($volgende AS $id)\n\t\t\t\t{\n\t\t\t\t\tDB::table('documents')->where('id', $id)->update(array('sortnr' => $sortnr));\n\t\t\t\t\t$sortnr++;\n\t\t\t\t}\n\t\t\t\tforeach($huidige AS $id)\n\t\t\t\t{\n\t\t\t\t\tDB::table('documents')->where('id', $id)->update(array('sortnr' => $sortnr));\n\t\t\t\t\t$sortnr++;\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t} else {\n\t\t\t\t// Hier moeten we gewoon deze verwisselen met de volgende - let op als je aan het einde van deze rubriek bent!\n\t\t\t\t$maxSortnr = DB::table('documents')->where('type', $rubriek)->max('sortnr');\n\t\t\t\t$volgendSortnr = $sortnrDitItem +1;\n\t\t\t\tif ($volgendSortnr > $maxSortnr) return;\n\t\t\t\t$volgendItem = $item = Document::whereRaw('type = ? and sortnr = ?', array($rubriek, $volgendSortnr))->get();\n//\t\t\t\tif ($volgendItem[0]->title != $ditItemTitel) return;\n\t\t\t DB::table('documents')->where('id', $ditItem->id)->update(array('sortnr' => $volgendSortnr));\n\t\t\t DB::table('documents')->where('id', $volgendItem[0]->id)->update(array('sortnr' => $sortnrDitItem));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function moveAction(Request $request, Context $context, EditToken $token, LayoutInterface $layout, int $containerId, int $itemId, int $newPosition)\n {\n $this->ensureLayout($token, $layout);\n\n $container = $layout->findContainer($containerId);\n $parent = $layout->findContainerOf($itemId);\n $item = null;\n $position = null;\n\n if ($containerId) {\n $container = $layout->findContainer($containerId);\n } else {\n $container = $layout->getTopLevelContainer();\n }\n\n /** @var \\MakinaCorpus\\Layout\\Grid\\ItemInterface $item */\n foreach ($parent->getAllItems() as $index => $child) {\n if ($child->getStorageId() == $itemId) {\n $item = $child;\n $position = $index;\n break;\n }\n }\n\n if ($item instanceof ColumnContainer) {\n throw new GenericError(\"you cannot move a column\");\n }\n if (!$parent instanceof TopLevelContainer && !$parent instanceof ColumnContainer) {\n // @codeCoverageIgnoreStart\n // This is an impossible use case with non-broken data\n throw new GenericError(\"you cannot move items from a non-vertical container\");\n // @codeCoverageIgnoreEnd\n }\n if (!$container instanceof TopLevelContainer && !$container instanceof ColumnContainer) {\n throw new GenericError(\"you cannot move items into a non-vertical container\");\n }\n\n $parent->removeAt($position);\n $container->addAt($item, $newPosition);\n $item->toggleUpdateStatus(true);\n\n $context->getTokenStorage()->update($token->getToken(), $layout);\n\n $this->prepareResponse($request, $context, $token);\n\n return $this->handleResponse($request, ['success' => true, 'output' => $this->renderer->renderItemIn($item, $container, $newPosition)]);\n }", "public function move($itemId, $toWarehouseId, $qty)\n {\n $stockClass = config('mojito.stockClass', 'Stock');\n $pivotFrom = $stockClass::where('warehouse_id', '=', $this->id)->where('item_id', '=', $itemId)->first();\n if ($pivotFrom == null) {\n return null;\n }\n\n $pivotTo = $stockClass::where('warehouse_id', '=', $toWarehouseId)->where('item_id', '=', $itemId)->first();\n\n if ($pivotTo != null) {\n $destQty = Unit::convert($qty, $pivotFrom->unit_id, $pivotTo->unit_id);\n } else {\n $destQty = $qty;\n }\n\n if ($pivotTo == null) {\n $stockClass::create([\n 'warehouse_id' => $toWarehouseId,\n 'item_id' => $itemId,\n 'quantity' => $qty,\n 'unit_id' => $pivotFrom->unit_id,\n 'alert' => 0,\n ]);\n } else {\n $pivotTo->update([\"quantity\" => $pivotTo->quantity + $destQty]);\n }\n $pivotFrom->update([\"quantity\" => $pivotFrom->quantity - $qty]);\n\n return StockMovement::create([\n 'item_id' => $itemId,\n 'from_warehouse_id' => $this->id,\n 'to_warehouse_id' => $toWarehouseId,\n 'quantity' => $qty,\n 'action' => Warehouse::ACTION_MOVE\n ]);\n }", "function move($dir=\\Scrivo\\SequenceNo::MOVE_DOWN) {\n\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\n\t\t\\Scrivo\\SequenceNo::position($this->context, \"list_item_definition\",\n\t\t\t\"application_definition_id\", $this->id, $dir);\n\t}", "public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }", "protected function _render_state_move()\n\t{\n\t\t$this->_ci->load->model('admin/grocery_order_model');\n\n\t\t$item_id = intval($this->_ci->input->get('item', TRUE));\n\t\t$previous_id = intval($this->_ci->input->get('previous', TRUE));\n\n\t\t$data['success'] = TRUE;\n\n\t\t// get order previous item\n\t\tif($previous_id == 0)\n\t\t{\n\t\t\t$item_order = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_item = $this->_ci->grocery_order_model->get_item($this->_table, $this->_primary_key_field, $previous_id);\n\t\t\tif(!empty($previous_item))\n\t\t\t{\n\t\t\t\t$item_order = intval($previous_item[$this->_order_field]) + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['success'] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// update items\n\t\tif($data['success'] === TRUE)\n\t\t{\n\t\t\t// update item with new order\n\t\t\t$update_item_success = $this->_ci->grocery_order_model->update_item($this->_table, $this->_primary_key_field, $item_id, array($this->_order_field => $item_order));\n\n\t\t\tif($update_item_success)\n\t\t\t{\n\t\t\t\t// update everything after item order\n\t\t\t\t$this->_ci->grocery_order_model->update_order_items_after($this->_table, $this->_primary_key_field, $item_id, $this->_order_field, $item_order, $this->_where);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['success'] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// set error\n\t\tif($data['success'] === FALSE)\n\t\t{\n\t\t\t$data['message'] = \"Er is iets fout gegaan bij het verplaatsen van het item. Probeer nogmaals.\";\n\t\t}\n\n\t\t// after move callback\n\t\tif(!is_null($this->_callback_after_move))\n\t\t{\n\t\t\t$this->_callback_after_move['class']->{$this->_callback_after_move['method']}($item_id);\n\t\t}\n\n\t\t$this->_json_response($data);\n\t}", "protected function moveContainedElements($uid) {\n\t\t$movedRecord = BackendUtility::getRecord('tt_content', $uid);\n\t\tif (($movedRecord['CType'] === 'list') && ($movedRecord['list_type'] === 'kbnescefe_pi1')) {\n\t\t\t$attachedRecords = BackendUtility::getRecordsByField('tt_content', 'kbnescefe_parentElement',intval($uid), '', '', 'sorting DESC');\n\t\t\tif (is_array($attachedRecords) && count($attachedRecords)) {\n\t\t\t\t$cmd = array();\n\t\t\t\t$data = array();\n\t\t\t\tforeach ($attachedRecords as $row) {\n\t\t\t\t\t$cmd['tt_content'][$row['uid']]['move'] = $movedRecord['pid'];\n\t\t\t\t\tif (intval($row['sys_language_uid']) !== -1) {\n\t\t\t\t\t\t// Only set same language as container if current element has not set \"All languages\"\n\t\t\t\t\t\t$data['tt_content'][$row['uid']]['sys_language_uid'] = $movedRecord['sys_language_uid'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$localDataHandler = $this->getDataHandlerInstance();\n\t\t\t\t$localDataHandler->start($data, $cmd);\n\t\t\t\t$localDataHandler->process_cmdmap();\n\t\t\t\tif (is_array($data) && count($data)) {\n\t\t\t\t\t$localDataHandler->process_datamap();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static final function transfer($id,&$old_parent,$old_pos,&$new_par,$new_pos){\n\t\t$new_parent = $new_par; //in case referred object is removed by calling remove kids.\n\t\tdebug('transfer '.$id.' o.pos '.$old_pos.' n_pos '.$new_pos);\n\t\tif($new_pos >= 0 && $os = $old_parent->remove_kids($id,$old_pos,1)){\n\n\t\t\tnotice('after rmove '.$os[0]->abb.': '.$os[0]->folder_name);\n\t\t\t//notice('new Pos= '.$new_pos);\n\t\t\t//notice('np');\n\t\t\t//print_r($new_parent);\n\t\t\t//notice('extracted');\n\t\t\t//print_r($o);\n\t\t\tif ($new_parent->insert_kids($os,$new_pos))\n\t\t\t{\n\t\t\t\tnotice('after insert '.$os[0]->abb.': '.$os[0]->folder_name);\n\t\t\t\t\n\t\t\t$new_parent->reposition_kids();\n\t\t\t/*\n\t\t\t\tif ($new_parent->id == $old_parent->id && $new_parent->object_type == $old_parent->object_type)\n\t\t\t\t\t\t$new_parent->reposition_kids(min($old_pos,$new_pos));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$old_parent->reposition_kids($old_pos); //update left+right values\n\t\t\t\t\t\t$new_parent->reposition_kids($new_pos);\n\t\t\t\t}\n\t\t\t*/\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Transfer failed!!!');\n\t\t\t}\n\t\t}else\n\t\t\terror('cannot insert => cannot make transfer!');\n\t}", "function reorganizar($ref, $refId) {\n foreach ($this->Lista('WHERE a.ref = :ref AND a.refid = :refid AND a.status != 99 ORDER BY a.position ASC', ['ref' => $ref, 'refid' => $refId]) as $i => $img) {\n $img->setPosition($i + 1);\n $this->Save($img);\n }\n }", "function movePosition($i) {\n global $connection, $user;\n\n $batch_id = $this->getBatchId();\n $username = $_SESSION[\"username\"];\n\n // Check if there is a file at the new position\n $nextposition = $i;\n $sql = 'select position from TR_BATCH_IMAGE where tr_batch_id = ? and position = ?';\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"ii\",$batch_id,$nextposition);\n $statement->execute();\n $statement->bind_result($position2);\n $statement->store_result();\n if ($statement->fetch()) {\n // nothing\n } else {\n // No such position, go back to beginning, set position to 1\n $nextposition = 1;\n }\n $statement->close();\n } else {\n throw new Exception(\"Database connection failed\");\n }\n\n // Update position\n $sql = \"update TR_USER_BATCH set position = ? where username = ? and tr_batch_id = ?\";\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"isi\",$nextposition,$username,$batch_id);\n $statement->execute();\n\n //if (mysql_affected_rows() < 1) {\n // throw new Exception(\"Could not update position [$nextposition] for batch [$batch_id], user [$username]\");\n //}\n\n $statement->close();\n } else {\n throw new Exception(\"Database connection failed\");\n }\n\n return $this->getFile($nextposition);\n }", "public function updateStockMovement($item_id, $quantity,$oldquantity){\n $this->insertStockMovement($item_id, $quantity, false, $oldquantity);\n }", "public function update_position($p_object_id, $p_option = null, $p_insertion = null, $p_pos = null)\n {\n $l_data = $this->m_mptt->get_by_node_id($p_object_id);\n\n if (is_object($l_data))\n {\n $l_array = $l_data->get_row(IDOIT_C__DAO_RESULT_TYPE_ARRAY);\n\n $l_sql = \"UPDATE isys_catg_location_list SET\n\t\t\t\tisys_catg_location_list__pos = \" . $this->convert_sql_int($p_pos) . \",\n\t\t\t\tisys_catg_location_list__insertion = \" . $this->convert_sql_int($p_insertion) . \",\n\t\t\t\tisys_catg_location_list__option = \" . $this->convert_sql_id($p_option) . \"\n\t\t\t\tWHERE isys_catg_location_list__id = \" . $this->convert_sql_id($l_array[\"isys_catg_location_list__id\"]) . \";\";\n\n if ($this->update($l_sql))\n {\n return $this->apply_update();\n } // if\n } // if\n\n return false;\n }", "function itemOrderAction(DocumentParser $modx, DatabaseUtils $db)\n{\n $DIR_UP = 1;\n $DIR_DOWN = 2;\n\n $tableName = $db->getTableName('menu_items');\n $itemId = getIntParam('id');\n $parentId = getIntParam('parentId', 0);\n $menuId = getIntParam('menuId');\n $dir = getIntParam('dir');\n\n if (!$itemId) sendError(__FUNCTION__ . ': itemId undefined');\n if (!$menuId) sendError(__FUNCTION__ . ': menuId undefined');\n if (!$dir) sendError(__FUNCTION__ . ': direction order undefined');\n\n $parentIdWhereCondition = is_null($parentId) ? \"`parent_id` IS NULL\" : \"`parent_id`={$parentId}\";\n\n $result = $modx->db->select(\n '*',\n $tableName,\n \"`menu_id`={$menuId} AND {$parentIdWhereCondition}\",\n \"`order_index`, `id` ASC\"\n );\n\n // check indexes\n $items = [];\n $orderCounter = 1;\n $moveItem = null;\n while ($row = $modx->db->getRow($result)) {\n $item = $db->castTypes('menu_items', $row, true);\n $item['orderIndex'] = $orderCounter;\n $items[$orderCounter] = $item;\n if ($item['id'] == $itemId) $moveItem = $orderCounter;\n $orderCounter++;\n }\n\n if ($dir == $DIR_DOWN and $items[$moveItem]['orderIndex'] < count($items)) {\n $items[$moveItem]['orderIndex']++;\n $items[$moveItem + 1]['orderIndex']--;\n }\n\n if ($dir == $DIR_UP and $items[$moveItem]['orderIndex'] > 1) {\n $items[$moveItem]['orderIndex']--;\n $items[$moveItem - 1]['orderIndex']++;\n }\n\n foreach ($items as $_item) {\n $modx->db->update(['order_index' => $_item['orderIndex']], $tableName, \"`id` = {$_item['id']}\");\n }\n// $forUp = array_splice($items, $moveItem['order_index']-1, 1);\n\n// $nextDecrement = false;\n// foreach ($items as &$_item) {\n// if ($_item['id'] == $itemId && $dir==$DIR_DOWN) {\n// $_item['orderIndex']++;\n// $nextDecrement = true;\n// continue;\n// }\n// if ($nextDecrement && $dir==$DIR_DOWN) {\n// $_item['orderIndex']--;\n// break;\n// }\n// }\n\n// if (!$itemData['id']) {\n//\n// $itemData['id'] = $modx->db->insert($itemData, $tableName);\n// if (!$itemData['id']) sendError(__FUNCTION__ . ': пункт меню не создан');\n//\n// } else {\n//\n// if (!$modx->db->update($itemData, $tableName, \"id = {$itemData['id']}\")) {\n// sendError(__FUNCTION__ . ': menu item is not saved');\n// }\n//\n// }\n\n sendResponse([\n 'itemId' => $itemId,\n // 'forUp' => $forUp,\n 'items' => $items,\n // 'item' => $db->keysConvertToCamelCase($itemData),\n ], 'Пункт меню создан/обновлен');\n}", "public abstract function moveToPrevious($referenceId = null);", "public function move($file_id, $new_name = false, $location = false, $new_location = 'local', $container = '')\n {\n $file = File::find($file_id);\n\n $local_filename = $file->filename;\n\n if (! $file) {\n return $this->result(false, trans('files.item_not_found'), $new_name ? $new_name : $file_id);\n }\n\n // this keeps a long running transaction from stalling the site\n session_write_close();\n\n // this would be used when move() is used during a rackspace or amazon upload as the location in the\n // database is not the actual file location, its location is local temporarily\n if ($location) $file->folder->location = $location;\n\n // if both locations are on the local filesystem then we just rename\n if ($file->folder->location === 'local' and $new_location === 'local') {\n // if they were helpful enough to provide an extension then remove it\n $file_slug = $this->createSlug(str_replace($file->extension, '', $new_name));\n $filename = $file_slug.$file->extension;\n\n // does the source exist?\n if (file_exists($this->path.$file->filename)) {\n $i = 1;\n\n // create a unique filename if the target already exists\n while (file_exists($this->path.$filename)) {\n // Example: test-image2.jpg\n $filename = $file_slug.$i.$file->extension;\n $i++;\n }\n\n $data = array('id' => $file_id,\n 'name' => $new_name,\n 'filename' => $filename,\n 'location' => $new_location,\n 'container' => $container);\n\n $file->filename = $filename;\n $file->name = $new_name;\n $file->save();\n\n @rename($this->path.$file->filename, $this->path.$filename);\n\n return $this->result(true, trans('files.item_updated'), $new_name, $data);\n } else {\n return $this->result(false, trans('files.item_not_found'), $file->name);\n }\n } elseif ($file->folder->location === 'local' and $new_location) {\n // we'll be pushing the file from here to the cloud\n ci()->storage->load_driver($new_location);\n\n $containers = ci()->storage->list_containers();\n\n // if we try uploading to a non-existant container it gets ugly\n if (in_array($container, $containers)) {\n // make a unique object name\n $object = now().'.'.$new_name;\n\n $path = ci()->storage->upload_file($container, $this->path.$file->filename, $object, null, 'public');\n\n if ($new_location === 'amazon-s3') {\n // if amazon didn't throw an error we'll create a path to store like rackspace does\n $url = ci()->parser->parse_string(Setting::get('files_s3_url'), array('bucket'=> $container), true);\n $path = rtrim($url, '/').'/'.$object;\n }\n\n // save its location\n $file->filename = $object;\n $file->path = $path;\n $file->save();\n\n $data = array('filename' => $object, 'path' => $path);\n\n // now we create a thumbnail of the image for the admin panel to display\n if ($file->type == 'i') {\n ci()->load->library('image_lib');\n\n $config['image_library'] = 'gd2';\n $config['source_image'] = $this->path.$file->filename;\n $config['new_image'] = $this->_cache_path.$data['filename'];\n $config['maintain_ratio']\t= false;\n $config['width'] = 75;\n $config['height'] = 50;\n ci()->image_lib->initialize($config);\n ci()->image_lib->resize();\n }\n\n // get rid of the \"temp\" file\n @unlink($this->path.$file->filename);\n @unlink($this->path.$local_filename);\n\n $extra_data = array('id' => $file_id,\n 'name' => $new_name,\n 'location' => $new_location,\n 'container' => $container);\n\n return $this->result(true, trans('files.file_uploaded'), $new_name, $extra_data + $data);\n }\n\n return $this->result(false, trans('files.invalid_container'), $container);\n } elseif ($file->folder->location and $new_location === 'local') {\n // pull it from the cloud to our filesystem\n ci()->load->helper('file');\n ci()->load->spark('curl/1.2.1');\n\n // download the file... dum de dum\n $curl_result = ci()->curl->simple_get($file->path);\n\n if ($curl_result) {\n // if they were helpful enough to provide an extension then remove it\n $file_slug = $this->createSlug(str_replace($file->extension, '', $new_name));\n $filename = $file_slug.$file->extension;\n\n // create a unique filename if the target already exists\n $i = 0;\n while (file_exists($this->path.$filename)) {\n // Example: test-image2.jpg\n $filename = $file_slug.$i.$file->extension;\n $i++;\n }\n\n // ...now save it\n write_file($this->path.$filename, $curl_result, 'wb');\n\n $data = array('id' => $file_id,\n 'name' => $new_name,\n 'location' => $new_location,\n 'container' => $container);\n\n return $this->result(true, trans('files.file_moved'), $file->name, $data);\n } else {\n return $this->result(false, trans('files.unsuccessful_fetch'), $file);\n }\n } elseif ($file->folder->location and $new_location) {\n // pulling from the cloud and then pushing to another part of the cloud :P\n ci()->load->helper('file');\n ci()->storage->load_driver($new_location);\n\n // make a really random temp file name\n $temp_file = $this->path.md5(microtime()).'_temp_'.$new_name;\n\n // and we download...\n $curl_result = ci()->curl->simple_get($file);\n\n if ($curl_result) {\n write_file($temp_file, $curl_result, 'wb');\n } else {\n return $this->result(false, trans('files.unsuccessful_fetch'), $file);\n }\n\n // make a unique object name\n $object = now().'.'.$new_name;\n\n $path = ci()->storage->upload_file($container, $temp_file, $object, null, 'public');\n\n if ($new_location === 'amazon-s3') {\n // if amazon didn't throw an error we'll create a path to store like rackspace does\n $url = ci()->parser->parse_string(Setting::get('files_s3_url'), array('bucket'=> $container), true);\n $path = rtrim($url, '/').'/'.$object;\n }\n\n $data = array('filename' => $object, 'path' => $path);\n\n $file->filename = $object;\n $file->path = path;\n $file->save();\n\n // get rid of the \"temp\" file\n @unlink($temp_file);\n\n $extra_data = array('id' => $file_id,\n 'name' => $new_name,\n 'location' => $new_location,\n 'container' => $container);\n\n return $this->result(true, trans('files.file_moved'), $file->name, $extra_data + $data);\n }\n }", "public function move_node($p_mode,$source_id,$target_id)\n\t\t{\n\t\t\t$item_node_info = $this->get_id_info($source_id); \n\t\t\t\n\t\t\t$parent_source = $item_node_info[0];\n\t\t\t$order_source = $item_node_info[1];\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t\n\t\t\tif($p_mode == 'B') // BROTHER\n\t\t\t{\n\t\t\t\t//==================================================================\n\t\t\t\t$item_node_info = $this->get_id_info($target_id);\n\t\t\t\t\n\t\t\t\tif($target_id == 0 )\n\t\t\t\t{\n\t\t\t\t\t// First item of tree\n\t\t\t\t\t$parent_target = 0;\n\t\t\t\t\t$order_target = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$parent_target = $item_node_info[0];\n\t\t\t\t\t$order_target = $item_node_info[1]+1;\n\t\t\t\t}\n\t\t\t\t//==================================================================\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from target id to prepare place\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` + 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_target.\"\n\t\t\t\t\t\t\tORDER BY `order` desc\";\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// move item !!!!!\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `parent` = \".$parent_target.\",\n\t\t\t\t\t\t\t\t`order` = \".$order_target.\"\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `id` = \".$source_id.\"\n\t\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\t\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order to fill hole\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `MTN`.`order` - 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` > \".$order_source.\" \n\t\t\t\t\t\t\tORDER BY `order` asc\";\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t}\n\t\t\telse // CHILDREN\n\t\t\t{\n\t\t\t\t//==================================================================\n\t\t\t\t// Recover information of target id\n\t\t\t\t//==================================================================\n\t\t\t\t$parent_target = $target_id;\n\t\t\t\t$order_target = 0;\n\t\t\t\t//==================================================================\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from target id to prepare place\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` + 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_target.\"\n\t\t\t\t\t\t\t\tORDER BY `order` desc\";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// move item !!!!!\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `parent` = \".$parent_target.\",\n\t\t\t\t\t\t\t\t`order` = \".$order_target.\"\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `id` = \".$source_id.\"\n\t\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from source id to fill hole\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` - 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_source.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_source.\"\n\t\t\t\t\t\t\t\tORDER BY `order` asc\";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t}\n\t\t\t\n\t\t\t$this->myfocus = $source_id; // Focus on target item\n\t\t\techo $source_id;\n\t\t}", "function move($id, $target_id, $child_num = 0)\n\t{\n\t\tglobal $system, $DBPrefix, $db;\n\t\tif(!is_numeric($id) || !is_numeric($target_id) || !is_numeric($child_num))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif($target_id != 0)\n\t\t{\n\t\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :cat_id OR cat_id = :target_id\";\n\t\t\t// I want the to be returned in order.\n\t\t\t$query .= ' ORDER BY cat_id ' . (($id < $target_id) ? 'ASC' : 'DESC');\n\n\t\t\t$params = array();\n\t\t\t$params[] = array(':cat_id', $id, 'int');\n\t\t\t$params[] = array(':target_id', $target_id, 'int');\n\t\t\t$db->query($query, $params);\n\t\t\tif($db->numrows() != 2)\n\t\t\t{ // Both rows must exist.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$data = $db->fetchall();\n\t\t\t$a = $data[0]; // This is being moved.\n\t\t\t$b = $data[1]; // This is the target.\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :cat_id\";\n\t\t\t$params = array();\n\t\t\t$params[] = array(':cat_id', $id, 'int');\n\t\t\t$db->query($query, $params);\n\n\t\t\tif($db->numrows() != 1)\n\t\t\t{ // Row must exist.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$a = $db->result(); // This is being moved.\n\n\t\t\t// Virtual root element.\n\t\t\t$b = $this->get_virtual_root();\n\t\t}\n\n\t\t// We need to get the children.\n\t\t$children = $this->get_children($b['left_id'], $b['right_id'], $b['level']);\n\n\t\tif(count($children) == 0)\n\t\t{\n\t\t\t$child_num = 0;\n\t\t}\n\t\tif($child_num == 0 || (count($children) - $child_num) <= 0 || (count($children) + $child_num + 1) < 0)\n\t\t{\n\t\t\t// First child.\n\t\t\t$boundry = array('left_id', 'right_id', 'right_id', $b['left_id']);\n\t\t}\n\t\telseif($child_num != 0)\n\t\t{\n\t\t\t// Some other child.\n\t\t\tif($child_num < 0)\n\t\t\t{\n\t\t\t\t$child_num = count($children) + $child_num + 1;\n\t\t\t}\n\t\t\tif($child_num > count($children))\n\t\t\t{\n\t\t\t\t$child_num = count($children);\n\t\t\t}\n\t\t\t$boundry = array('right_id', 'left_id', 'right_id', $children[$child_num - 1]['right_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Math.\n\t\t$diff = $a['right_id'] - $a['left_id'] + 1; // The \"size\" of the tree.\n\n\t\tif($a['left_id'] < $boundry[3])\n\t\t{\n\t\t\t$size = $boundry[3] - $diff;\n\t\t\t$dist = $boundry[3] - $diff - $a['left_id'] + 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$size = $boundry[3];\n\t\t\t$dist = $boundry[3] - $a['left_id'] + 1;\n\t\t}\n\t\t// Level math.\n\t\t$ldiff = ($a['level'] - $b['level'] - 1) * -1;\n\t\t// We have all what we need.\n\n\t\t$query = array();\n\n\t\t// Give the needed rows negative id's.\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id * -1, right_id = right_id * -1 WHERE left_id >= \" . $a['left_id'] . \" AND right_id <= \" . $a['right_id'];\n\t\t$db->direct_query($query);\n\t\t// Remove the hole.\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id - \" . $diff . \" WHERE right_id > \" . $a['right_id'] . \" AND left_id > \" . $a['right_id'];\n\t\t$db->direct_query($query);\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET right_id = right_id - \" . $diff . \" WHERE right_id > \" . $a['right_id'];\n\t\t$db->direct_query($query);\n\t\t// Add hole\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id + \" . $diff . \" WHERE \" . $boundry[0] . \" > \" . $size . \" AND \" . $boundry[1] . \" > \" . $size;\n\t\t$db->direct_query($query);\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET right_id = right_id + \" . $diff . \" WHERE \" . $boundry[2] . \" > \" . $size;\n\t\t$db->direct_query($query);\n\t\t// Fill hole & update rows & multiply by -1\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = (left_id - (\" . $dist . \")) * -1, right_id = (right_id - (\" . $dist . \")) * -1, level = level + (\" . $ldiff . \") WHERE left_id < 0\";\n\t\t$db->direct_query($query);\n\t\treturn true;\n\t}", "public function moveItemToPosition($itemAnchor, $position)\n {\n if ($itemAnchor instanceof MenuItem) {\n $itemAnchor = $itemAnchor->getAnchor();\n }\n\n $item = $this->findMenuItem($itemAnchor);\n if (false === $item) {\n throw new \\InvalidArgumentException(\"Menu item `{$itemAnchor}` does not exist! It's impossible to change position.\");\n }\n\n if (!$item->hasParent()) {\n throw new \\InvalidArgumentException(\"Menu item `{$itemAnchor}` does not have any parent! It's impossible to change position.\");\n }\n\n $parent = $item->getParent();\n $children = $parent->getChildren();\n\n $partBefore = array();\n $partActual = array();\n $partAfter = array();\n $change = false;\n\n $actualPosition = 0;\n foreach ($children as $child) {\n $actualPosition++;\n if ($actualPosition === $position) {\n if ($child->getAnchor() === $itemAnchor) {\n $partActual[$actualPosition] = $child;\n } else {\n $partAfter[$actualPosition] = $child;\n }\n $change = true;\n } else {\n if ($child->getAnchor() === $itemAnchor) {\n $partActual[$actualPosition] = $child;\n } else if (true === $change) {\n $partAfter[$actualPosition] = $child;\n } else {\n $partBefore[$actualPosition] = $child;\n }\n }\n }\n\n $parent->removeChildren();\n\n foreach ($partBefore as $child) {\n $parent->addChild($child);\n }\n foreach ($partActual as $child) {\n $parent->addChild($child);\n }\n foreach ($partAfter as $child) {\n $parent->addChild($child);\n }\n }", "function move_tree($id, $target_id, $pos, $copy = false)\r\n\t{\r\n\t\tif ($id == $target_id && !$copy)\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\t// Get information about source and target\r\n\t\tif (!($source = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\tif (!($target = $this->get_node($target_id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('target_id' => $target_id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock(true);\r\n\r\n\t\t$this->_relations = array(); \r\n\r\n\t\tif (!$copy)\r\n\t\t{ \r\n\t\t\t// We have a recursion - let's stop\r\n\t\t\tif (($target['root_id'] == $source['root_id']) &&\r\n\t\t\t\t\t(($source['l'] <= $target['l']) &&\r\n\t\t\t\t\t\t($source['r'] >= $target['r'])))\r\n\t\t\t{\r\n\t\t\t\t$this->_release_lock(true);\n\t\t\t\t\n\t \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n\t \t);\n\t \treturn false;\r\n\t\t\t} \r\n\t\t\t// Insert/move before or after\r\n\t\t\tif (($source['root_id'] == $source['id']) &&\r\n\t\t\t\t\t($target['root_id'] == $target['id']) && ($pos != NESE_MOVE_BELOW))\r\n\t\t\t{ \r\n\t\t\t\t// We have to move a rootnode which is different from moving inside a tree\r\n\t\t\t\t$nid = $this->_move_root2root($source, $target, $pos);\r\n\t\t\t\t$this->_release_lock(true);\r\n\t\t\t\treturn $nid;\r\n\t\t\t} \r\n\t\t} \n\t\telseif (($target['root_id'] == $source['root_id']) &&\r\n\t\t\t\t\t\t(\t($source['l'] < $target['l']) &&\r\n\t\t\t\t\t\t\t($source['r'] > $target['r'])))\r\n\t\t{\r\n\t\t\t$this->_release_lock(true);\n\t\t\t\r\n \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\t// We have to move between different levels and maybe subtrees - let's rock ;)\r\n\t\t$move_id = $this->_move_across($source, $target, $pos, true);\r\n\t\t$this->_move_cleanup($copy);\r\n\t\t$this->_release_lock(true);\r\n\r\n\t\tif (!$copy)\r\n\t\t{\r\n\t\t\treturn $id;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $move_id;\r\n\t\t} \r\n\t}", "public function page_move_smiley()\n\t{\n\t\t$move = ($this->mode == 'up') ? -1 : 1;\n\n\t\t// Position du smiley courant\n\t\t$sql = 'SELECT smiley_order, smiley_cat\n\t\t\t\tFROM ' . SQL_PREFIX . 'smilies\n\t\t\t\tWHERE smiley_id = ' . intval($this->id);\n\t\t$d = Fsb::$db->request($sql);\n\n\t\tif ($d)\n\t\t{\n\t\t\t// ID du smiley a switcher\n\t\t\t$sql = 'SELECT smiley_id\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies\n\t\t\t\t\tWHERE smiley_cat = ' . $d['smiley_cat'] . '\n\t\t\t\t\t\tAND smiley_order = ' . ($d['smiley_order'] + $move);\n\t\t\t$swap_smiley_id = Fsb::$db->get($sql, 'smiley_id');\n\n\t\t\tif ($swap_smiley_id)\n\t\t\t{\n\t\t\t\t// Mise a jour de la position des deux smilies\n\t\t\t\tFsb::$db->update('smilies', array(\n\t\t\t\t\t'smiley_order' =>\t($d['smiley_order'] + $move),\n\t\t\t\t), 'WHERE smiley_id = ' . intval($this->id));\n\n\t\t\t\tFsb::$db->update('smilies', array(\n\t\t\t\t\t'smiley_order' =>\t$d['smiley_order'],\n\t\t\t\t), 'WHERE smiley_id = ' . $swap_smiley_id);\n\n\t\t\t\tFsb::$db->destroy_cache('smilies_');\n\t\t\t}\n\t\t}\n\t\tHttp::redirect('index.' . PHPEXT . '?p=posts_smiley');\n\t}", "function action_spipbb_move()\n{\n\tglobal $spip_lang_left, $spipbb_fromphpbb, $dir_lang, $time_start;\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t$arg = $securiser_action();\n\n\tlist($objet, $id_item, $statut) = preg_split('/\\W/', $arg);\n\n\t$id_item = intval($id_item);\n\t$redirige = urldecode(_request('redirect'));\n\t$id_rubrique = _request('id_rubrique');\n\n\tif (!empty($id_rubrique)) $redirige = parametre_url($redirige, 'id_rubrique', $id_rubrique, '&') ;\n\tif (!$id_item) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\t$row = sql_fetsel(\"id_\".$objet.\" , titre\", \"spip_\".$objet.\"s\", \"id_\".$objet.\"='$id_item'\");\n\tif (!$row) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\tswitch ($statut) {\n\tcase \"up\" :\n\t\t$move_increment = -15;\n\t\tbreak;\n\tcase 'down' :\n\t\t$move_increment = +15;\n\t\tbreak;\n\tdefault :\n\t\t$move_increment = 0;\n\t\tbreak;\n\t}\n\tif (!function_exists('recuperer_numero')) include_spip('inc/filtres');\n\n\t$ancien_numero = recuperer_numero($row['titre']) ;\n\t$nouveau_numero = $ancien_numero + $move_increment;\n\n\tif ( ($move_increment==0) OR ($nouveau_numero<5)) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\t$titre = supprimer_numero($row['titre']);\n\tif ($nouveau_numero<10) $titre = \"0\" . $nouveau_numero . \". \".trim($titre);\n\telse $titre = $nouveau_numero . \". \".trim($titre);\n\n\t@sql_updateq(\"spip_\".$objet.\"s\", array(\n\t\t\t\t\t'titre'=>$titre\n\t\t\t\t\t),\n\t\t\t\"id_$objet='$id_item'\");\n\n\tspipbb_renumerote();\n}", "public function updateItem( $id, $preparedItem ) {\n\t}", "public function updateItem($_id) {\n\t}", "public function removeItem ( $item ) {\n\n if ( is_object( $item ) ) {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Object: ' . $item->getIdentifier() );\n } else {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Identifier: ' . $item );\n }\n\n\n $item = is_object( $item ) ? $item : $this->getOrder()->getItem( $item );\n\n $orderApi = new OrdersApi( );\n\n\n//\t\tdie(print_r($this->getOrder()->getItems(),true));\n //TODO: Check if the item exists, we have to remove it and add the new one.\n if ( $this->getOrder()->itemExists( $item->getIdentifier() ) ) {\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Item found: ' . $item->getIdentifier() );\n\n $orderApi->removeItem( $this->order, $item );\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Updating order after item removed: ' . $item->getIdentifier() );\n $this->update();\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item removed sucessfully', $this->order );\n }\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item not found', $this->order );\n }", "public function element_move($id, $id_target, $inherit_childs = true) {\n global $db;\n\n $source = $this->element_read($id);\n $target = $this->element_read($id_target);\n if ((!$target) || $this->element_is_child($id_target, $id)) {\n $this->error = \"ERR_INVALID_TARGET\";\n return false;\n }\n if (($source[\"KAT_TABLE\"] != $target[\"KAT_TABLE\"]) && ($id_target != $this->tree_get_parent())) {\n $this->error = \"ERR_TABLE_MISMATCH\";\n return false;\n }\n\n $new = array(\"ID_KAT\" => $id, \"PARENT\" => $id_target);\n if ($this->updateid = $db->update($this->table, $new)) {\n unset($this->cache_nodes[$this->updateid]);\n if (!$inherit_childs) {\n // Kind-Elemente eine Ebene aufwärts verschieben\n $db->querynow(\"UPDATE `\".$this->table.\"` SET PARENT=\".$source[\"PARENT\"].\"\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$source[\"ID_KAT\"]);\n } else {\n $this->undo_add_action(\"MOVE\", $id, $id_target, $source[\"PARENT\"]);\n }\n $this->reload = true;\n return true;\n } else {\n $this->error = \"ERR_INSERT_FAILED\";\n return false;\n }\n }", "public function move(&$key, &$record, $flags) {\n return null;\n }", "function components_move()\n\t{\n\t\t//--------------------------------------------\n\t\t// INIT\n\t\t//--------------------------------------------\n\n\t\t$com_id \t= intval($this->ipsclass->input['com_id']);\n\t\t$move \t= trim($this->ipsclass->input['move']);\n\t\t$components = array();\n\t\t$final_coms = array();\n\t\t$used_pos = array();\n\t\t$max_pos = 0;\n\n\t\t//--------------------------------------------\n\t\t// Checks...\n\t\t//--------------------------------------------\n\n\t\tif ( ! $com_id OR ! $move )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"No ID was passed, please try again\";\n\t\t\t$this->components_list();\n\t\t\treturn;\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t// Get components from database\n\t\t//--------------------------------------------\n\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->exec_query();\n\n\t\twhile( $c = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$max_pos += 1;\n\n\t\t\tif ( in_array( $c['com_position'], $used_pos ) )\n\t\t\t{\n\n\t\t\t\t$c['com_position'] = $max_pos;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$used_pos[] = $c['com_position'];\n\t\t\t}\n\n\t\t\t$components[ $c['com_id'] ] = $c['com_position'];\n\t\t}\n\n\t\tasort($components);\n\n\t\t$i \t\t = 0;\n\t\t$did_move = 0;\n\n\t\tforeach( $components as $k => $v )\n\t\t{\n\t\t\t$i++;\n\n\t\t\tif( $k == $com_id )\n\t\t\t{\n\t\t\t\tif( $move == 'up' )\n\t\t\t\t{\n\t\t\t\t\t// Move up (lower #)\n\t\t\t\t\t$last = array_pop( $final_coms );\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\n\t\t\t\t\tforeach( $components as $k2 => $v2 )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $v2 == $last )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$final_coms[ $k2 ] = $i;\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}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Move down (higher #)\n\n\t\t\t\t\t$final_coms[ $k ] = $i + 1;\n\t\t\t\t\t$did_move = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $did_move == 1 )\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\t\t\t\t\t$did_move = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*echo \"<pre>\";\n\t\tprint_r($final_coms);\n\t\texit;*/\n\n\t\tforeach( $final_coms as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_update( 'components', array( 'com_position' => $v ), 'com_id='.$k );\n\t\t}\n\n\t\t$this->components_rebuildcache();\n\n\t\t$this->ipsclass->main_msg = \"Component item repositioned\";\n\t\t$this->components_list();\n\t}", "public function MoveToCart($item){\n\n $cart=Cart::instance('saveForLater')->get($item);\n\n Cart::instance('saveForLater')->remove($item);\n\n\n $item=Cart::instance('default')->search(function ($cartItem, $rowId) use($cart){\n return $cartItem->id === $cart->id;\n });\n\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','This item is already added in your cart!');\n }\n Cart::instance('default')->add($cart->id,$cart->name,$cart->qty,$cart->price)\n ->associate('App\\Models\\Product');\n\n return back()->with('success_message','Item has been Moved to your Cart!');\n }", "function _relocate_children($old_ID, $new_ID)\n {\n }", "public function moveRecord_firstElementPostProcess($table, $uid, $destPid, $moveRec, $updateFields, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parentObject) {\n\t\tif ($table === 'tt_content') {\n\t\t\t$currentRecord = BackendUtility::getRecord('tt_content', $uid);\n\t\t\t$parentObject->moveInfo[$uid] = 'element';\n\t\t\tif (($currentRecord['CType'] === 'list') && ($currentRecord['list_type'] === 'kbnescefe_pi1')) {\n\t\t\t\t// Remember container records which have been moved\n\t\t\t\t$parentObject->moveInfo[$uid] = 'container';\n\t\t\t}\n\t\t}\n\t}", "function move($myHomeManager) {\n $homeManager = $myHomeManager;\n $homeManager->retrieveItems();\n if (isset($_POST['id'])) {\n $id = $_POST['id'];\n $homeManager->move($id);\n }\n header('Location: ../Views/index.php');\n}", "public function move($key, $before)\n {\n $element = $this->offsetGet($key);\n\n if ($element) {\n $this->offsetUnset($key);\n\n if ($before) {\n $before = $this->offsetGet($before->getKey());\n $this->add($before, $element->getKey(), $element->getValue());\n } else {\n $this->unshift($element->getKey(), $element->getValue());\n }\n }\n }", "public function shift() { \n $item = $this->offsetGet(0);\n \n $this->itemsCollection()->update(array(), array('$pop' => array(\n self::ITEMS_OBJECT_NAME => -1\n )));\n \n $this->decrementLength();\n \n return $item;\n }", "public static function move_up($id = 0, $page = '', $sql_cond = '') {\n global $database;\n global $session;\n //get this sort id\n $obj = static::find_by_id($id, $sql_cond);\n //get prev sort id\n $obj_prev = static::find_prev_sort_id($obj->sort_id, $sql_cond);\n if (!isset($obj_prev->sort_id)) {\n $session->message(read_xmls('/site/msg/cantmoveup'));\n return redirect_to(search_for_flag($page, 'checked_row', $id));\n } else {\n\n // update query\n //update prev sort_id -- NULL\n $sql1 = \"UPDATE \" . static::$table_name . \" SET sort_id=0 WHERE sort_id = \" . $database->escape_value($obj_prev->sort_id) . \" {$sql_cond} \";\n //update curr sort_id = prev sort_id\n $sql2 = \"UPDATE \" . static::$table_name . \" SET sort_id=\" . $database->escape_value($obj_prev->sort_id) . \" WHERE sort_id = \" . $obj->sort_id . \" {$sql_cond} \";\n //update prev sort_id = curr sort_id\n $sql3 = \"UPDATE \" . static::$table_name . \" SET sort_id=\" . $database->escape_value($obj->sort_id) . \" WHERE sort_id = 0 {$sql_cond} \";\n //echo $sql1 .\"<br />\". $sql2.\"<br />\". $sql3; exit;\n // Run Queries\n $database->query($sql1);\n $database->query($sql2);\n $database->query($sql3);\n $session->message(read_xmls('/site/msg/donesort'));\n\n return redirect_to(search_for_flag($page, 'checked_row', $id));\n }\n }", "public function update_sortorder($cardid, $cardtarget) {\n global $DB;\n\n $cards = $this->getcards();\n\n // Remove the moving card from array.\n $movingcard = false;\n foreach ($cards as $card) {\n if ($card->record->id == $cardid) {\n $movingcard = $card;\n unset($cards[$card->record->id]);\n }\n }\n\n // Reverse the array, then add the movingcard after the targetcard.\n $cardsreversed = array_reverse($cards);\n\n $reverseneworder = [];\n foreach ($cardsreversed as $card) {\n $reverseneworder[] = $card;\n if ($card->record->id == $cardtarget) {\n $reverseneworder[] = $movingcard;\n }\n }\n\n $neworder = array_reverse($reverseneworder);\n\n $order = 1;\n foreach ($neworder as $card) {\n $DB->set_field('swipe_item', 'sortorder', $order++, array('id' => $card->record->id));\n }\n }", "function move($source, $destination);", "function updateItem($item) {\n\t\tglobal $dbh;\n\t\t$stmt = $dbh->prepare('UPDATE ITEM SET (NULL, ?, ?, ?, ?, ?) WHERE itemID = ?');\n\t\t$success = $stmt->execute(array($item['content'],\n\t\t\t\t\t\t\t\t\t\t$item['image'],\n\t\t\t\t\t\t\t\t\t\t$item['checked'],\n\t\t\t\t\t\t\t\t\t\t$item['listID'],\n\t\t\t\t\t\t\t\t\t\t$list['itemID']));\n\t\treturn $success;\n\t}", "public function editItem($id,$item)\n\t{\n $this->db->trans_start();\n\t\t$this->db->where('id',$id);\n\t\t$this->db->update('item',$item);\n $this->db->trans_complete();\n\t}", "private function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n unset($this->items[$id]);\n }", "public function moveItemToLastPosition($itemAnchor)\n {\n if ($itemAnchor instanceof MenuItem) {\n $itemAnchor = $itemAnchor->getAnchor();\n }\n\n $item = $this->findMenuItem($itemAnchor);\n if (false === $item) {\n throw new \\InvalidArgumentException(\"Menu item `{$itemAnchor}` does not exist! It's impossible to change position.\");\n }\n if (!$item->hasParent()) {\n throw new \\InvalidArgumentException(\"Menu item `{$itemAnchor}` does not have any parent! It's impossible to change position.\");\n }\n\n $parent = $item->getParent();\n $children = $parent->getChildren();\n\n $partBefore = array();\n $actualPosition = 0;\n foreach ($children as $child) {\n $actualPosition++;\n if ($child->getAnchor() !== $itemAnchor) {\n $partBefore[$actualPosition] = $child;\n }\n }\n $parent->removeChildren();\n foreach ($partBefore as $child) {\n $parent->addChild($child);\n }\n $parent->addChild($item);\n }", "public function repositionMenuItem()\n {\n $menuId = \\Request::get('menu_id');\n $action = \\Request::get('action');\n $affectedItemId = \\Request::get('affected_item_id');\n $targetItemId = \\Request::get('target_item_id');\n\n // Prepare affected menu item\n $affectedNode = $this->menuItemRepository->find($affectedItemId, $this->menuItemGateway);\n\n if (!$affectedNode) {\n throw new PhotonException('MENU_ITEM_NOT_FOUND', ['affected_item_id' => $affectedItemId]);\n }\n\n // Second node placeholder\n $secondNode = null;\n\n // Prepare scope node\n if ($menuId && $action === 'setScope') {\n $scopeNode = $this->menuRepository->find($menuId, $this->menuGateway);\n\n if (!$scopeNode) {\n throw new PhotonException('MENU_NOT_FOUND', ['menu_id' => $menuId]);\n }\n\n $secondNode = $scopeNode;\n }\n\n // Prepare targeted node\n if ($targetItemId) {\n $targetNode = $this->menuItemRepository->find($targetItemId, $this->menuItemGateway);\n\n if (!$targetNode) {\n throw new PhotonException('MENU_ITEM_NOT_FOUND', ['target_item_id' => $targetItemId]);\n }\n\n $secondNode = $targetNode;\n }\n\n $affectedNode = $this->nodeRepository->performNodeAction($affectedNode, $action, $secondNode);\n\n return $this->responseRepository->make('REPOSITION_NODE_SUCCESS', ['affected_node' => $affectedNode]);\n }", "public function reorder($ids)\n {\n foreach ($ids as $position => $id) {\n DB::table('menu_page')\n ->where('menu_id', '=', $this->id)\n ->where('page_id', '=', $id)\n ->update(['position' => $position]);\n }\n }", "public function element_move_before($id, $id_target, $inherit_childs = true) {\n global $db;\n\n $source = $this->element_read($id);\n $target = $this->element_read($id_target);\n if ((!$target) || $this->element_is_child($id_target, $id)) {\n $this->error = \"ERR_INVALID_TARGET\";\n return false;\n }\n $target_parent = $this->element_read($target[\"PARENT\"]);\n if (!empty($target_parent[\"KAT_TABLE\"]) && ($source[\"KAT_TABLE\"] != $target_parent[\"KAT_TABLE\"]) &&\n \t\t($target[\"PARENT\"] != $this->tree_get_parent())) {\n $this->error = \"ERR_TABLE_MISMATCH\";\n return false;\n }\n\n $new = array(\n \t\"ID_KAT\" => $id,\n \t\"PARENT\" => $target_parent[\"ID_KAT\"],\n \t\"ORDER_FIELD\" => ($target[\"ORDER_FIELD\"]-1)\n );\n if ($this->updateid = $db->update($this->table, $new)) {\n unset($this->cache_nodes[$this->updateid]);\n if (!$inherit_childs) {\n // Kind-Elemente eine Ebene aufwärts verschieben\n $db->querynow(\"UPDATE `\".$this->table.\"` SET PARENT=\".$source[\"PARENT\"].\", ORDER_FIELD=\".$source[\"ORDER_FIELD\"].\"\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$source[\"ID_KAT\"]);\n } else {\n $this->undo_add_action(\"MOVE\", $id, $target_parent[\"ID_KAT\"], $source[\"PARENT\"]);\n }\n $this->reload = true;\n return true;\n } else {\n $this->error = \"ERR_INSERT_FAILED\";\n return false;\n }\n }", "public function switchItemPositions(Item $item1, Item $item2): void;", "public function MoveItem($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function move($id, $parentId = 0, $nearId = 0)\n {\n $row = $this->db->findOne([$this->db->primaryKey() => (int)$id]);\n if ($row) {\n $left = $row['left'];\n $right = $row['right'];\n $level = $row['level'];\n } else {\n return false;\n }\n\n $parent = $this->db->findOne([$this->db->primaryKey() => (int)$parentId]);\n if ($parent) {\n $levelUp = $parent['level'];\n } else {\n $levelUp = 0;\n }\n\n // define right key node for which we insert a node (branch)\n // transfer to the root\n if ($parent == 0) {\n $ret = $this->db->find([], ['sort' => ['right' => -1], 'limit' => 1]);\n if (!empty($ret)) {\n foreach ($ret as $row) {\n $nearRight = $row['right'];\n }\n }\n } else {\n // moved to another node\n $parent = $this->db->findOne([$this->db->primaryKey() => (int)$parent]);\n $nearRight = $parent['right'] - 1;\n\n if (!empty($nearId)) {\n $near = $this->db->findOne([$this->db->primaryKey() => (int)$nearId]);\n if ($near) {\n $nearRight = $near['right'];\n } else {\n $nearRight = $parent['right'];\n }\n }\n }\n\n // define the offset\n $skewLevel = $levelUp - $level + 1; // level offset variable node\n $skewTree = $right - $left + 1; // shift keys tree\n //We get the id nodes movable branch\n $ids = [];\n $rows = $this->db->find(\n [\n 'left' =>\n [\n '$lte' => $left\n ]\n ,\n 'right' =>\n [\n '$gte' => $right\n ]\n ]\n );\n foreach ($rows as $row) {\n $ids[] = $row[$this->db->primaryKey()];\n }\n // move to higher units\n if ($right < $nearRight) {\n $skewEdit = $nearRight - $left + 1;\n $this->db->update(\n [\n 'right' =>\n [\n '$lt' => $left,\n '$gt' => $nearRight\n ]\n ],\n ['$inc' => [\n 'right' => $skewTree\n ]\n ]\n );\n $this->db->update(\n [\n 'left' =>\n [\n '$lt' => $left,\n '$gt' => $nearRight\n ]\n ],\n ['$inc' => [\n 'left' => $skewTree\n ]\n ]\n );\n // move the entire branch\n $this->db->update(\n [\n $this->db->primaryKey() =>\n [\n '$in' => $ids\n ]\n ],\n ['$inc' => [\n 'left' => $skewEdit,\n 'right' => $skewEdit,\n 'level' => $skewLevel,\n ]\n ]\n );\n } // move to lower-level units\n else {\n $skewEdit = $nearRight - $left + 1 - $skewTree;\n $this->db->update(\n [\n 'right' =>\n [\n '$lte' => $nearRight,\n '$gt' => $right\n ]\n ],\n ['$inc' => [\n 'right' => -$skewTree\n ]\n ]\n );\n $this->db->update(\n [\n 'left' =>\n [\n '$lt' => $nearRight,\n '$gt' => $left\n ]\n ],\n ['$inc' => [\n 'left' => -$skewTree\n ]\n ]\n );\n // move the entire branch\n $this->db->update(\n [\n $this->db->primaryKey() =>\n [\n '$in' => $ids\n ]\n ],\n ['$inc' => [\n 'left' => $skewEdit,\n 'right' => $skewEdit,\n 'level' => $skewLevel,\n ]\n ]\n );\n }\n return true;\n }", "public static function move_down($id = 0, $page = '', $sql_cond = '') {\n global $database;\n global $session;\n //get this sort id\n $obj = static::find_by_id($id, $sql_cond);\n\n //get prev sort id\n $obj_next = static::find_next_sort_id($obj->sort_id, $sql_cond);\n if (!isset($obj_next->sort_id)) {\n $session->message(read_xmls('/site/msg/cantmovedown'));\n return redirect_to(search_for_flag($page, 'checked_row', $id));\n } else {\n\n // update query\n $sql1 = \"UPDATE \" . static::$table_name . \" SET sort_id=0 WHERE sort_id = \" . $database->escape_value($obj_next->sort_id) . \" {$sql_cond} \";\n //update curr sort_id = prev sort_id\n $sql2 = \"UPDATE \" . static::$table_name . \" SET sort_id=\" . $database->escape_value($obj_next->sort_id) . \" WHERE sort_id = \" . $database->escape_value($obj->sort_id) . \" {$sql_cond} \";\n //update prev sort_id = curr sort_id\n $sql3 = \"UPDATE \" . static::$table_name . \" SET sort_id=\" . $database->escape_value($obj->sort_id) . \" WHERE sort_id = 0 {$sql_cond} \";\n // Run Queries\n $database->query($sql1);\n $database->query($sql2);\n $database->query($sql3);\n $session->message(read_xmls('/site/msg/donesort'));\n return redirect_to(search_for_flag($page, 'checked_row', $id));\n }\n }", "function remove($item)\r\n {\r\n //Finds the pointer\r\n $index=$this->indexof($item);\r\n\r\n //Deletes the index if it exists\r\n if ($index>=0)\r\n {\r\n $this->delete($index);\r\n }\r\n\r\n return($index);\r\n }", "function remove($item) {\n\t\t\t$numItems = count($this->items);\n\n\t\t\tfor($i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$_item = $this->items[$i];\n\n\t\t\t\t// grab the last item's value, overwrite it \n\t\t\t\t// to the found item, then pop it off the stack\n\t\t\t\tif($_item->equals($item)) {\n\t\t\t\t\t$this->items[$i] = $this->items[$numItems - 1];\n\t\t\t\t\tarray_pop($this->items);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function moveDashlet(\n\t $id,\n\t $group,\n\t $position\n\t )\n\t{\n\t}", "protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "public function element_move_into($id, $id_target, $inherit_childs = true) {\n global $db;\n\n $source = $this->element_read($id);\n $target = $this->element_read($id_target);\n if ((!$target) || $this->element_is_child($id_target, $id)) {\n $this->error = \"ERR_INVALID_TARGET\";\n return false;\n }\n if (($source[\"KAT_TABLE\"] != $target[\"KAT_TABLE\"]) && ($id_target != $this->tree_get_parent())) {\n $this->error = \"ERR_TABLE_MISMATCH\";\n return false;\n }\n\n $new = array(\n \t\"ID_KAT\" => $id,\n \t\"PARENT\" => $id_target,\n \t\"ORDER_FIELD\" => 0\n );\n if ($this->updateid = $db->update($this->table, $new)) {\n unset($this->cache_nodes[$this->updateid]);\n if (!$inherit_childs) {\n // Kind-Elemente eine Ebene aufwärts verschieben\n $db->querynow(\"UPDATE `\".$this->table.\"` SET PARENT=\".$source[\"PARENT\"].\", ORDER_FIELD=\".$source[\"ORDER_FIELD\"].\"\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$source[\"ID_KAT\"]);\n } else {\n $this->undo_add_action(\"MOVE\", $id, $id_target, $source[\"PARENT\"]);\n }\n $this->reload = true;\n return true;\n } else {\n $this->error = \"ERR_INSERT_FAILED\";\n return false;\n }\n }", "function _recursiveMoveMenuItem($result)\n\t{\n\t\t$i = 0;\n\t\twhile(count($result->child))\n\t\t{\n\t\t\tunset($node);\n\t\t\t$node = array_shift($result->child);\n\n\t\t\t$this->moveMenuItem($this->menuSrl, $node->parent_node, $i, $node->node, 'move');\n\t\t\t$this->_recursiveMoveMenuItem($node);\n\t\t\t$i = $node->node;\n\t\t}\n\t}", "public function moveTop($id)\n {\n return $this->sendrequest('movetop', $id);\n }", "function update_list( $id, $name, $can_delete, $items )\n\t{\n\t\t$this->db->set('name', $name );\n if( $can_delete !== NULL ) {\n $this->db->set('can_delete', $can_delete );\n } \n $this->db->where( 'id', $id );\n\t\t$this->db->update('lists');\n\t\t\n // Save the list items\n\t\t$this->db->where( 'list_id', $id );\n\t\t$this->db->delete( 'list_items' );\n\t\tfor( $i = 0; $i < count($items); $i++ ) {\n $this->db->set('list_id', $id );\n $this->db->set('data_id', $items[$i]['id']);\n\t\t\t$this->db->set('title', $items[$i]['title']);\n\t\t\t$this->db->set('type', $items[$i]['type']);\n\t\t\t$this->db->set('sort_order', $i + 1);\n\t\t\t$this->db->insert('list_items');\n }\n\t}", "public function move_up($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$above = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order < ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order desc',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($above)\n\t\t{\n\t\t\t$top_order = $above['SurveyInstanceObject']['order'];\n\t\t\t$bottom_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$above['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($above);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "public function setSortNewItemsPosition($a_position)\n\t{\n\t\t$this->new_items_position = (int)$a_position;\n\t}", "public function moveItem($sourcePath, $destinationPath, $options = [])\n {\n rename($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath));\n }", "function updateById($item_id, $parent_id=null, $group_id=null, $title=null,\n $description=null, $create_date=null, $update_date=null, \n $user_id=null, $rank=null, $item_type=null, $link_url=null,\n $wiki_page=null, $file_is_embedded=null) { \n \n $argArray = array();\n\t\t\n if($parent_id !== null) {\n $argArray[] = 'parent_id='.((int) $parent_id);\n }\n\n if($group_id !== null) {\n $argArray[] = 'group_id='.((int) $group_id);\n }\n\n if($title !== null) {\n $argArray[] = 'title='.$this->da->quoteSmart($title);\n }\n\n if($description !== null) {\n $argArray[] = 'description='.$this->da->quoteSmart($description);\n }\n\n if($create_date !== null) {\n $argArray[] = 'create_date='.((int) $create_date);\n }\n\n if($update_date !== null) {\n $argArray[] = 'update_date='.((int) $update_date);\n }\n\n if($user_id !== null) {\n $argArray[] = 'user_id='.((int) $user_id);\n }\n\n if($rank !== null) {\n $argArray[] = 'rank='.((int) $rank);\n }\n\n if($item_type !== null) {\n $argArray[] = 'item_type='.((int) $item_type);\n }\n\n if($link_url !== null) {\n $argArray[] = 'link_url='.$this->da->quoteSmart($link_url);\n }\n\n if($wiki_page !== null) {\n $argArray[] = 'wiki_page='.$this->da->quoteSmart($wiki_page);\n }\n\n if($file_is_embedded !== null) {\n $argArray[] = 'file_is_embedded='.((int) $file_is_embedded);\n }\n \n $sql = 'UPDATE plugin_docman_item'\n .' SET '.implode(', ', $argArray)\n .' WHERE item_id='.((int) $item_id);\n\n $inserted = $this->update($sql);\n if ($inserted) {\n $this->_updateUpdateDateOfParent($this->da->quoteSmart($item_id));\n }\n return $inserted;\n }", "function update_list($id, $name, $default = \"false\", $sort_order = 99)\n\t{\n\t\t// build the XML put data\n\t\t$url = $this->get_list_url($id);\n\n\t\t$xml_data = '\n<entry xmlns=\"http://www.w3.org/2005/Atom\">\n <id>'.$url.'</id>\n <title type=\"text\">'.$name.'</title>\n <author />\n <updated>2008-04-16T18:39:35.710Z</updated>\n <content type=\"application/vnd.ctct+xml\">\n <ContactList xmlns=\"http://ws.constantcontact.com/ns/1.0/\"\n id=\"'.$url.'\">\n <OptInDefault>'.$default.'</OptInDefault>\n <Name>'.$name.'</Name>\n <ShortName>'.$name.'</ShortName>\n <SortOrder>'.$sort_order.'</SortOrder>\n </ContactList>\n </content>\n <link href=\"/ws/customers/'.$this->api_username.'/lists/'.$id.'\" rel=\"update\" />\n</entry>\n';\n\n\t\t$this->http_set_content_type('application/atom+xml');\n\t\t$xml = $this->load_url(\"lists/$id\", 'put', $xml_data, 204);\n\n\t\tif(intval($this->http_response_code) === 204):\n\t\t\treturn true;\n\t\tendif;\n\t\treturn false;\n\t}", "public function move($action, $id) {\n Diagram::move($action, $id);\n url::admin_redirect(\"/diagram_manage/index/$id/move_done/#diagram_$id\");\n }", "public function updateItem($id, $qty) {\n if ($qty === 0) {\n $this->deleteItem($id);\n } else if ( ($qty > 0) && ($qty != $this->items[$id])) {\n $this->items[$id] = $qty;\n }\n }", "function carr_move_media_menu() {\n\tglobal $menu;\n\n\t$menu[24] = $menu[10];\n\tunset( $menu[10] );\n}", "function _changeSiblingRanking($parentId, $ordering, $item_id = false) {\n $rank = 0;\n switch ($ordering) {\n case 'beginning':\n case 'end':\n $_select = $ordering == 'end' ? 'MAX(rank)+1' : 'MIN(rank)-1';\n $sql = sprintf('SELECT %s AS rank'.\n ' FROM plugin_docman_item'.\n ' WHERE parent_id = %d',\n $_select,\n $parentId);\n $dar = $this->retrieve($sql);\n if ($dar && $dar->valid()) {\n $row = $dar->current();\n $rank = $row['rank'];\n }\n break;\n case 'down':\n case 'up':\n if($item_id !== false) {\n if ($ordering == 'down') {\n $op = '>';\n $order = 'ASC';\n } else {\n $op = '<';\n $order = 'DESC';\n }\n $sql = sprintf('SELECT i1.item_id as item_id, i1.rank as rank'.\n ' FROM plugin_docman_item i1'.\n ' INNER JOIN plugin_docman_item i2 USING(parent_id)'.\n ' WHERE i2.item_id = %d'.\n ' AND i1.rank %s i2.rank'.\n ' ORDER BY i1.rank %s'.\n ' LIMIT 1', \n $item_id,\n $op,\n $order);\n $dar = $this->retrieve($sql);\n if ($dar && $dar->valid()) {\n $row = $dar->current();\n \n $sql = sprintf('UPDATE plugin_docman_item i1, plugin_docman_item i2'.\n ' SET i1.rank = i2.rank, i2.rank = %d'.\n ' WHERE i1.item_id = %d '.\n ' AND i2.item_id = %d',\n $row['rank'],\n $row['item_id'],\n $item_id);\n $res = $this->update($sql);\n //$can_update = false;\n // Message for setNewParent function\n $rank = -1;\n }\n }\n break;\n default:\n $rank = $ordering?$ordering:0;\n $sql = sprintf('UPDATE plugin_docman_item'.\n ' SET rank = rank + 1 '.\n ' WHERE parent_id = %d '.\n ' AND rank >= %d',\n $parentId,\n $rank);\n $this->update($sql);\n break;\n }\n\n return $rank;\n }", "protected function _move($id, $table, $mode = 'up', array $where = array())\n\t{\n\t\t$dbo = JFactory::getDbo();\n\n\t\tif (!is_array($table))\n\t\t{\n\t\t\t// if the table is a string we need to push\n\t\t\t// it in an associative array\n\t\t\t$table = array('table' => $table);\n\t\t}\n\n\t\t// get database requirements\n\t\t$ordcol = isset($table['ordering']) ? $table['ordering'] \t: 'ordering';\n\t\t$idcol \t= isset($table['pk']) \t\t? $table['pk'] \t\t\t: 'id';\n\t\t$table \t= isset($table['table'])\t? $table['table']\t\t: '';\n\n\t\t// get selected record\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn(array($idcol, $ordcol)))\n\t\t\t->from($dbo->qn($table))\n\t\t\t->where($dbo->qn($idcol) . ' = ' . $dbo->q($id));\n\t\t\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif (!$dbo->getNumRows())\n\t\t{\n\t\t\t// row not found\n\t\t\treturn;\n\t\t}\n\n\t\t$data = $dbo->loadObject();\n\n\t\t// get next/prev record\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn(array($idcol, $ordcol)))\n\t\t\t->from($dbo->qn($table))\n\t\t\t->where($dbo->qn($ordcol) . ' ' . ($mode == 'up' ? '<' : '>') . ' ' . $data->{$ordcol})\n\t\t\t->order($dbo->qn($ordcol) . ' ' . ($mode == 'up' ? 'DESC' : 'ASC'));\n\n\t\t// create WHERE statement with custom claus\n\t\tforeach ($where as $column => $values)\n\t\t{\n\t\t\tif (is_array($values) && count($values) > 1)\n\t\t\t{\n\t\t\t\t$values = array_map(array($dbo, 'q'), $values);\n\t\t\t\t$q->where($dbo->qn($column) . ' IN (' . implode(',', $values) . ')');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$values = is_array($values) ? array_shift($values) : $values;\n\t\t\t\t$q->where($dbo->qn($column) . ' = ' . $dbo->q($values));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif (!$dbo->getNumRows())\n\t\t{\n\t\t\t// the row is probably the first/last\n\t\t\treturn;\n\t\t}\n\n\t\t$next = $dbo->loadObject();\t\n\n\t\t// swap orderings\n\t\t$tmp \t\t\t = $data->{$ordcol};\n\t\t$data->{$ordcol} = $next->{$ordcol};\n\t\t$next->{$ordcol} = $tmp;\n\n\t\t// update the records\n\t\t$dbo->updateObject($table, $data, $idcol);\n\t\t$dbo->updateObject($table, $next, $idcol);\n\t}", "public function treeMove($direction) {\n\t\t$model = $this->Controller->modelClass;\n\t\t$check = $this->Controller->{$model}->find('first', array(\n\t\t\t'fields' => array($model . '.id'),\n\t\t\t'conditions' => array($model . '.id' => $this->Controller->data[$model]['id']),\n\t\t\t'recursive' => -1,\n\t\t\t'callbacks' => false\n\t\t));\n\n\t\tif (empty($check[$model]['id'])) {\n\t\t\t$this->Controller->notice(__d('libs', 'Nothing found to move'), array(\n\t\t\t\t'redirect' => false\n\t\t\t));\n\t\t\treturn false;\n\t\t}\n\n\t\t$message = __d('libs', 'Error occured reordering the records');\n\t\tswitch(strtolower($direction)) {\n\t\t\tcase 'up':\n\t\t\t\t$message = __d('libs', 'The record was moved up');\n\t\t\t\tif (!$this->Controller->{$model}->moveUp($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record up');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'down':\n\t\t\t\t$message = __d('libs', 'The record was moved down');\n\t\t\t\tif (!$this->Controller->{$model}->moveDown($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record down');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->Controller->notice($message, array('redirect' => false));\n\n\t\treturn true;\n\t}", "function set_position($newposition) {\n\t\t$this->position = $newposition;\n\t}", "protected function _processPositions($menuitem, $newParent, $afterMenuitemId){\n\t\t$table = $this->getMainTable();\n\t\t$adapter= $this->_getWriteAdapter();\n\t\t$positionField = $adapter->quoteIdentifier('position');\n\t\t\n\t\t$bind = array(\n\t\t\t'position' => new Zend_Db_Expr($positionField . ' - 1')\n\t\t);\n\t\t$where = array(\n\t\t\t'parent_id = ?' => $menuitem->getParentId(),\n\t\t\t$positionField . ' > ?' => $menuitem->getPosition()\n\t\t);\n\t\t$adapter->update($table, $bind, $where);\n\t\t\n\t\t/**\n\t\t * Prepare position value\n\t\t */\n\t\tif ($afterMenuitemId) {\n\t\t\t$select = $adapter->select()\n\t\t\t\t->from($table,'position')\n\t\t\t\t->where('entity_id = :entity_id');\n\t\t\t$position = $adapter->fetchOne($select, array('entity_id' => $afterMenuitemId));\n\t\t\t$bind = array(\n\t\t\t\t'position' => new Zend_Db_Expr($positionField . ' + 1')\n\t\t\t);\n\t\t\t$where = array(\n\t\t\t\t'parent_id = ?' => $newParent->getId(),\n\t\t\t\t$positionField . ' > ?' => $position\n\t\t\t);\n\t\t\t$adapter->update($table, $bind, $where);\n\t\t} \n\t\telseif ($afterMenuitemId !== null) {\n\t\t\t$position = 0;\n\t\t\t$bind = array(\n\t\t\t\t'position' => new Zend_Db_Expr($positionField . ' + 1')\n\t\t\t);\n\t\t\t$where = array(\n\t\t\t\t'parent_id = ?' => $newParent->getId(),\n\t\t\t\t$positionField . ' > ?' => $position\n\t\t\t);\n\t\t\t$adapter->update($table, $bind, $where);\n\t\t} \n\t\telse {\n\t\t\t$select = $adapter->select()\n\t\t\t\t->from($table,array('position' => new Zend_Db_Expr('MIN(' . $positionField. ')')))\n\t\t\t\t->where('parent_id = :parent_id');\n\t\t\t$position = $adapter->fetchOne($select, array('parent_id' => $newParent->getId()));\n\t\t}\n\t\t$position += 1;\n\t\treturn $position;\n\t}", "function moveGroup() {\n\t\t$groupId = (int) Request::getUserVar('id');\n\t\t$this->validate($groupId);\n\n\t\t$group =& $this->group;\n\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t$direction = Request::getUserVar('d');\n\n\t\tif ($direction != null) {\n\t\t\t// moving with up or down arrow\n\t\t\t$group->setSequence($group->getSequence() + ($direction == 'u' ? -1.5 : 1.5));\n\n\t\t} else {\n\t\t\t// Dragging and dropping\n\t\t\t$prevId = Request::getUserVar('prevId');\n\t\t\tif ($prevId == null)\n\t\t\t\t$prevSeq = 0;\n\t\t\telse {\n\t\t\t\t$journal =& Request::getJournal();\n\t\t\t\t$prevGroup =& $groupDao->getById($prevId, ASSOC_TYPE_JOURNAL, $journal->getId());\n\t\t\t\t$prevSeq = $prevGroup->getSequence();\n\t\t\t}\n\n\t\t\t$group->setSequence($prevSeq + .5);\n\t\t}\n\n\n\t\t$groupDao->updateObject($group);\n\t\t$groupDao->resequenceGroups($group->getAssocType(), $group->getAssocId());\n\n\t\t// Moving up or down with the arrows requires a page reload.\n\t\t// In the case of a drag and drop move, the display has been\n\t\t// updated on the client side, so no reload is necessary.\n\t\tif ($direction != null) {\n\t\t\tRequest::redirect(null, null, 'groups');\n\t\t}\n\t}", "public function remove($item) {\n $index = self::IndexOf($item);\n self::RemoveAt($index);\n }", "public function moveUp($id)\n {\n return $this->sendrequest('moveup', $id);\n }", "private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type, $include_albums) {\n\n // Convert ASC/DESC to < or > characters.\n if (!strcasecmp($sort_direction, \"DESC\")) {\n $comp = \">\";\n } else {\n $comp = \"<\";\n }\n\n // Figure out how many items are _before the current item.\n $items_model = ORM::factory(\"item\");\n if ($search_type == \"AND\") {\n $items_model->select('COUNT(\"*\") AS result_count');\n } else {\n $items_model->select(\"items.id\");\n }\n $items_model->viewable();\n $items_model->join(\"items_tags\", \"items.id\", \"items_tags.item_id\");\t\t\n $items_model->open();\n $items_model->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n $counter = 1;\n while ($counter < count($tag_ids)) {\n $items_model->or_where(\"items_tags.tag_id\", \"=\", $tag_ids[$counter]);\n $counter++;\n }\n $items_model->close();\n if ($include_albums == false) {\n $items_model->and_where(\"items.type\", \"!=\", \"album\");\n }\n $items_model->and_where($sort_field, $comp, $item_title);\n $items_model->order_by($sort_field, $sort_direction);\n $items_model->group_by(\"items.id\");\n if ($search_type == \"AND\") {\n $items_model->having(\"result_count\", \"=\", count($tag_ids));\n }\n $position = count($items_model->find_all());\n\n // In case multiple items have identical sort criteria, query for\n // everything with the same criteria, and increment the position\n // one at a time until we find the right item.\t\n $items_model = ORM::factory(\"item\");\n if ($search_type == \"AND\") {\n $items_model->select(\"items.id\");\n $items_model->select('COUNT(\"*\") AS result_count');\n } else {\n $items_model->select(\"items.id\");\n }\n $items_model->viewable();\n $items_model->join(\"items_tags\", \"items.id\", \"items_tags.item_id\");\t\t\n $items_model->open();\n $items_model->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n $counter = 1;\n while ($counter < count($tag_ids)) {\n $items_model->or_where(\"items_tags.tag_id\", \"=\", $tag_ids[$counter]);\n $counter++;\n }\n $items_model->close();\n if ($include_albums == false) {\n $items_model->and_where(\"items.type\", \"!=\", \"album\");\n }\n $items_model->and_where($sort_field, \"=\", $item_title);\n $items_model->order_by($sort_field, $sort_direction);\n $items_model->group_by(\"items.id\");\n if ($search_type == \"AND\") {\n $items_model->having(\"result_count\", \"=\", count($tag_ids));\n }\n $match_items = $items_model->find_all();\n foreach ($match_items as $one_item) {\n $position++;\n if ($one_item->id == $item_id) {\n break;\n }\n }\n\n return ($position);\n }", "public function move( $args, $assoc_args ) {\n\n\t\tlist( $widget_id ) = $args;\n\t\tif ( ! $this->validate_sidebar_widget( $widget_id ) ) {\n\t\t\tWP_CLI::error( \"Widget doesn't exist.\" );\n\t\t}\n\n\t\tif ( empty( $assoc_args['position'] ) && empty( $assoc_args['sidebar-id'] ) ) {\n\t\t\tWP_CLI::error( 'A new position or new sidebar must be specified.' );\n\t\t}\n\n\t\tlist( $name, $option_index, $current_sidebar_id, $current_sidebar_index ) = $this->get_widget_data( $widget_id );\n\n\t\t$new_sidebar_id = ! empty( $assoc_args['sidebar-id'] ) ? $assoc_args['sidebar-id'] : $current_sidebar_id;\n\t\t$this->validate_sidebar( $new_sidebar_id );\n\n\t\t$new_sidebar_index = ! empty( $assoc_args['position'] ) ? $assoc_args['position'] - 1 : $current_sidebar_index;\n\t\t// Moving between sidebars adds to the top.\n\t\tif ( $new_sidebar_id !== $current_sidebar_id && $new_sidebar_index === $current_sidebar_index ) {\n\t\t\t// Human-readable positions are different than numerically indexed array.\n\t\t\t$new_sidebar_index = 0;\n\t\t}\n\n\t\t$this->move_sidebar_widget( $widget_id, $current_sidebar_id, $new_sidebar_id, $current_sidebar_index, $new_sidebar_index );\n\n\t\tWP_CLI::success( 'Widget moved.' );\n\n\t}", "public function updateItem($item) {\n\t\tif(isset($item['id'])){\n\t\t\t$id = $item['id'];\n\t\t\tunset($item['id']);\n\t\t\t\n\t\t\t$params['set'] =$item;\n\t\t\t$params['condition'] = array('id' => $id); \n\t\t\treturn tdb::update(self::$tablename,$params);\n\t\t}\n\t\treturn false;\n\t}", "public function testMove()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // move\n $this->rlpMapper->move('/products/news/content1-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }", "public function moveRecord_afterAnotherElementPostProcess($table, $uid, $destPid, $origDestPid, $moveRec, $updateFields, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parentObject) {\n\t\tif ($table === 'tt_content') {\n\n\t\t\t// As we are moving after another element kbnescefe parameters wont be set but have to get set at this place (aqui!)\n\t\t\t$updateData = array();\n\t\t\tif (is_array($afterElement = BackendUtility::getRecord('tt_content', abs($origDestPid)))) {\n\t\t\t\t$this->sanitizePasteUpdate($updateData, $afterElement);\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_content', 'uid='.intval($uid), $updateData);\n\n\t\t\t// Remember container records which have been moved\n\t\t\t$currentRecord = BackendUtility::getRecord('tt_content', $uid);\n\t\t\t$parentObject->moveInfo[$uid] = 'element';\n\t\t\tif (($currentRecord['CType'] === 'list') && ($currentRecord['list_type'] === 'kbnescefe_pi1')) {\n\t\t\t\t$parentObject->moveInfo[$uid] = 'container';\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.68663216", "0.6846594", "0.6497256", "0.6324369", "0.5946858", "0.587347", "0.5845341", "0.5823462", "0.5803777", "0.57702416", "0.56238693", "0.56192786", "0.5615383", "0.55051905", "0.54752904", "0.5465182", "0.54567224", "0.54193634", "0.5408741", "0.53931135", "0.53856057", "0.5384543", "0.5378307", "0.5377163", "0.53473014", "0.5318353", "0.5304258", "0.52693784", "0.5264342", "0.5254106", "0.5191499", "0.51866937", "0.51789933", "0.5160325", "0.51486903", "0.5148062", "0.5131861", "0.5128152", "0.5125697", "0.50945514", "0.5092103", "0.50901675", "0.49897945", "0.49709278", "0.4967871", "0.4964051", "0.49518347", "0.49363256", "0.49237856", "0.49209672", "0.4917034", "0.49131167", "0.49085584", "0.4895044", "0.48938963", "0.48929194", "0.48924986", "0.48734513", "0.487145", "0.4860512", "0.484511", "0.48431173", "0.48287696", "0.48016825", "0.47966605", "0.47931683", "0.47906792", "0.478543", "0.47711593", "0.4762765", "0.47624522", "0.47551703", "0.4752572", "0.4746255", "0.4730657", "0.47236592", "0.47192368", "0.47003186", "0.46919537", "0.46845382", "0.46715268", "0.4669481", "0.46652037", "0.46564642", "0.46558172", "0.46528643", "0.46504262", "0.46457627", "0.46451515", "0.46402192", "0.46369806", "0.46364346", "0.46302307", "0.46289763", "0.46287704", "0.46223798", "0.4615407", "0.46145266", "0.4614373", "0.46102983" ]
0.8479897
0
Search for all referenced items from the list based on the given critera. Only criteria from the list and list type can be used for searching and sorting, but no criteria from the referenced items. $search = $listManager>createSearch( true ); $expr = array( $search>compare( '==', 'product.lists.domain', array( 'attribute', 'product' ), $search>getConditions(), ); $search>setConditions( $search>combine( '&&', $expr ) ); $total = 0; $result = $listManager>searchRefItems( $search, array( 'text', 'media' ) ); The result in the example will be: array( 'attribute' => array( => , ... ), 'product' => array( => , ... ), ) The list of domains used in the compare() method will be the domains that are available as keys in the result array if at least one active referenced item is found in that domain. The list of domains in the searchRefItems() method are the items that will be included in the referenced items and are available via the $item>getRefItems() method. Please be aware that the value in $total will be the total number of list items. The number of referenced items returned can be lower if multiple list items in one slice point to the same referenced item. In this case the referenced item is only returned once in that slice.
public function searchRefItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function searchItems( \\Aimeos\\MW\\Criteria\\Iface $search, array $ref = [], &$total = null )\n\t{\n\t\t$items = [];\n\n\t\ttry\n\t\t{\n\t\t\t$max = $this->getContext()->getConfig()->get( 'mshop/common/manager/maxdepth', 2 );\n\n\t\t\tif( $this->level++ < $max ) {\n\t\t\t\t$items = $this->getManager()->searchItems( $search, $ref, $total );\n\t\t\t}\n\n\t\t\t$this->level--;\n\t\t}\n\t\tcatch( \\Exception $e )\n\t\t{\n\t\t\t$this->level--;\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $items;\n\t}", "function searchDocmanItem($sessionKey, $group_id, $item_id, $criterias) {\n $params = array('id' => $item_id);\n foreach($criterias as $criteria) {\n $params[$criteria->field_name] = $criteria->field_value;\n }\n return _makeDocmanRequest($sessionKey, $group_id, 'search', $params);\n}", "public function searchItems( \\Aimeos\\MW\\Criteria\\Iface $filter, &$total = null );", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "private function search_items()\n\t\t{\n\t\t\t$inputsearch = str_replace(\"\\\\\",\"\\\\\\\\\",$this->inputsearch); // SRX_BACKSLASH_FIX_ISSUE\n\t\t\tif(substr($this->inputsearch,0,1) == \"\\\\\")\n\t\t\t{\n\t\t\t\t$pre_jocker = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pre_jocker = '%';\n\t\t\t}\n\t\t\t\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`id` AS 'id'\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`,\n\t\t\t\t\t\t\t`\".$this->tree_caption.\"` `MTC`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`id` = `MTC`.`id`\n\t\t\t\t\t\t\tAND `MTN`.`application_release` = `MTC`.`application_release`\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTC`.`language` = '\".$this->language.\"'\n\t\t\t\t\t\t\tAND `MTC`.`title`\t\tlike '\".$pre_jocker.$this->mysql_protect($inputsearch).\"%'\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\n\t\t\t// Clear list\n\t\t\t$this->listexpand = ''; \n\t\t\t$this->listhighlight = '';\n\t\t\t\n\t\t\t$this->count_item_found = 0;\n\t\t\t\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC))\n\t\t\t{\n\t\t\t\t// Prepare array for full expansion\n\t\t\t\t$this->listexpand[$row['id']] = true;\n\t\t\t\t\n\t\t\t\t// Build array to highlight item\n\t\t\t\t$this->listhighlight[$row['id']] = true;\n\t\t\t\t\n\t\t\t\t$this->count_item_found = $this->count_item_found + 1; // Count number of entries in current search\n\t\t\t}\n\n\t\t\tif(!$this->count_item_found)\n\t\t\t{\n\t\t\t\t// Search launched but no item found\n\t\t\t\t$this->count_item_found = 'NoItemFound';\n\t\t\t}\n\t\t\t\n\t\t\t$this->build_full_array_expansion();\n\t\t\t\n\t\t\t//$_SESSION[$this->ssid]['MT'][$this->internal_id][\"expandlist\"] = $this->listexpand;\n\t\t}", "public function getList(SearchCriteriaInterface $criteria): NoteSearchResultsInterface\n {\n $collection = $this->noteCollectionFactory->create();\n $this->collectionProcessor->process($criteria, $collection);\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($criteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n return $searchResults;\n }", "public function getList(SearchCriteriaInterface $searchCriteria): DonationSearchResultsInterface;", "public function getList(SearchCriteriaInterface $criteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $criteria)\n {\n /** @var \\Baguette\\Bakery\\Model\\ResourceModel\\Bakery\\Collection $collection */\n $collection = $this->bakeryCollectionFactory->create();\n\n /** @var Data\\BakerySearchResultsInterface $searchResults */\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($criteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n\n return $searchResults;\n }", "function ecc_query_feat_listing_items( $params = array() ) {\n\t\tglobal $search_params;\n\t\t$search_params = $params;\n\n\t\t$args = array(\n\t\t\t'post_type' => 'listing-item',\n\t\t\t'post_status' => 'publish'\n\t\t);\n\n\t\tif ( $params ) {\n\t\t\textract($params);\n\n\t\t\tif ( isset( $keywords ) ) {\n\t\t\t\t$args['s'] = $keywords;\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($number) ) {\n\t\t\t\t$args['posts_per_page'] = $number;\n\t\t\t}\n\t\t\tif ( isset($type) ) {\n\t\t\t\tif($type !== '' && $type !=='all' ){\n\t\t\t\t\t$args['meta_key'] = 'eltd_listing_item_type';\n\t\t\t\t\t$args['meta_value'] = $type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$args['tax_query'] = array(\n\t\t\t\t'relation' => 'AND'\n\t\t\t);\n\n\t\t\tif ( isset( $category ) ) {\n\t\t\t\tif($category !== '' && $category !=='all' ){\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'listing-item-category',\n\t\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t\t'terms' => (int)$category\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset($location) ) {\n\t\t\t\tif($location !== '' && $location !=='all' ){\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'listing-item-location',\n\t\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t\t'terms' => (int)$location\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset($tag) ) {\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'listing-item-tag',\n\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t'terms' => (int)$tag\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\techo \"ecc args: <pre>\"; var_dump($args); echo \"</pre>\";\n\t\t$fquery = new WP_Query($args);\n\t\techo \"SQL for featured listings: {$fquery->request}\";\n\t\t//add_filter('search_and_go_elated_multiple_map_variables', 'search_and_go_elated_return_search_map_data');\n\t\treturn ($fquery);\n\t\t//return $fquery;\n\n\t}", "function _search($criteria, $fields)\n {\n $results = array();\n $results = $this->_getAddressBook($fields);\n if (is_a($results, 'PEAR_Error')) {\n return $results;\n }\n\n foreach ($results as $key => $contact) {\n $found = !isset($criteria['OR']);\n foreach ($criteria as $op => $vals) {\n if ($op == 'AND') {\n foreach ($vals as $val) {\n if (isset($contact[$val['field']])) {\n switch ($val['op']) {\n case 'LIKE':\n if (stristr($contact[$val['field']], $val['test']) === false) {\n continue 4;\n }\n $found = true;\n break;\n }\n }\n }\n } elseif ($op == 'OR') {\n foreach ($vals as $val) {\n if (isset($contact[$val['field']])) {\n switch ($val['op']) {\n case 'LIKE':\n if (empty($val['test']) ||\n stristr($contact[$val['field']], $val['test']) !== false) {\n $found = true;\n break 3;\n }\n }\n }\n }\n }\n }\n if ($found) {\n $results[$key] = $contact;\n }\n }\n return $results;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n\n }", "public function getQuotesList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "function search(){\n include($GLOBALS[\"draw_includes_path\"].\"/Reference/.ReferenceSearchTop.html\");\n\n //begin searching\n $get_types = Reference::get_types();\n $filters = Reference::get_filters();\n $counter = count($get_types);\n\n //interpret the search needle (into phrases etc) \n if(strlen($_POST[\"search_needles\"]) > 0){\n $needles = get_needles($_POST[\"search_needles\"]);\n } else {\n $needles = array();\n }\n\n $dark = TRUE;\n\n //get the users reference\n $reference_links = Link::get_links(ANY, $_SESSION[\"user_id\"], LINK_REFERENCE_OF_USER);\n\n for($i = 0; $i < count($reference_links); $i++){\n\n DB::db_query(\"get\", \"SELECT * FROM reference WHERE id='\".$reference_links[$i][\"from_id\"].\"';\");\n if(DB::db_check_result(\"get\") > 0){\n\n //check that its in the gets_type list\n if($counter > 0 && ($data = DB::db_get_array(\"get\")) != FALSE){\n\n if($get_types[$data[\"reference_type\"]]){\n //continue checking\n //change this data variable to an instance of the appropriate class \n\n switch($data[\"reference_type\"]){\n\n case get_type_as_string(TYPE_ARTICLE): \n $ref = new Article;\n break;\n\n case get_type_as_string(TYPE_INPROCEEDINGS):\n $ref = new InProceedings;\n break;\n\n case get_type_as_string(TYPE_INCOLLECTION):\n $ref = new InCollection;\n break;\n\n case get_type_as_string(TYPE_INBOOK):\n $ref = new InBook;\n break;\n\n case get_type_as_string(TYPE_BOOKLET):\n $ref = new Booklet;\n break;\n\n case get_type_as_string(TYPE_THESIS):\n $ref = new Thesis;\n break;\n\n case get_type_as_string(TYPE_TECHREPORT):\n $ref = new TechReport;\n break;\n\n case get_type_as_string(TYPE_MANUAL):\n $ref = new Manual;\n break;\n\n case get_type_as_string(TYPE_UNPUBLISHED):\n $ref = new Unpublished;\n break;\n\n case get_type_as_string(TYPE_MISC):\n $ref = new Misc;\n break;\n }\n\n $ref->load_array($data);\n if($ref->match_string($needles) &&\n $ref->match_states($filters)){\n if($dark){\n $bgcolour = \"search_item_dark\";\n } else {\n $bgcolour = \"search_item_light\";\n }\n $dark = (!$dark);\n\n $ref->search_overview($bgcolour);;\n }\n\n }\n }\n \n } else {\n error(\"No references in database\\n\");\n return FALSE;\n }\n \n }\n\n //print the bottom bit\n include($GLOBALS[\"draw_includes_path\"].\"/Reference/.ReferenceSearchBottom.html\");\n\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n $criteria=new CDbCriteria(array('with'=>array('rcampaign')));\n /*\n if ($this->client_id) {\n\t\t $criteria=new CDbCriteria(array('with'=>array('rcampaign')));\n } else {\n\t\t $criteria=new CDbCriteria;\n }\n */\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('inventory_id',$this->inventory_id);\n if ($this->duty_campaign_ids && empty($this->campaign_id)) {\n\t\t $criteria->compare('campaign_id',$this->duty_campaign_ids);\n } else {\n if (is_numeric($this->campaign_id) || is_array($this->campaign_id)) {\n $criteria->compare('campaign_id',$this->campaign_id);\n } else {\n $criteria->compare('rcampaign.name',$this->campaign_id, true);\n }\n }\n\t\t$criteria->compare('domain',$this->domain,true);\n\t\t$criteria->compare('domain_id',$this->domain_id,true);\n\t\t$criteria->compare('anchortext',$this->anchortext,true);\n\t\t$criteria->compare('targeturl',$this->targeturl,true);\n\t\t$criteria->compare('sourceurl',$this->sourceurl,true);\n\t\t$criteria->compare('sourcedomain',$this->sourcedomain,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('tasktype',$this->tasktype);\n\t\t$criteria->compare('taskstatus',$this->taskstatus);\n\t\t$criteria->compare('iostatus',$this->iostatus);\n\t\t$criteria->compare('assignee',$this->assignee);\n\t\t$criteria->compare('optional_keywords',$this->optional_keywords,true);\n\t\t$criteria->compare('mapping_id',$this->mapping_id,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\t\t$criteria->compare('t.duedate',$this->duedate);\n\t\t$criteria->compare('content_article_id',$this->content_article_id);\n\t\t$criteria->compare('content_campaign_id',$this->content_campaign_id);\n\t\t$criteria->compare('content_category_id',$this->content_category_id);\n\t\t$criteria->compare('send2cpdate',$this->send2cpdate);\n\t\t$criteria->compare('checkouted',$this->checkouted);\n\t\t$criteria->compare('created',$this->created,true);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('modified',$this->modified,true);\n\t\t$criteria->compare('modified_by',$this->modified_by);\n\n\t\t$criteria->compare('iodate',$this->iodate,true);\n\t\t//$criteria->compare('livedate',$this->livedate,true);\n\n if(!empty($this->livedate) && !empty($this->livedate_end)) {\n $criteria->addBetweenCondition('livedate', $this->livedate, $this->livedate_end, \"AND\");\n //$criteria->params[':lstart'] = $this->livedate;\n //$criteria->params[':lend'] = $this->livedate_end;\n //$criteria->addCondition('livedate BETWEEN :lstart AND :lend');\n //$criteria->addCondition('(livedate >= :lstart AND livedate <= :lend)');\n } else {\n\t\t $criteria->compare('livedate',$this->livedate,true);\n }\n\n\t\t$criteria->compare('tierlevel',$this->tierlevel);\n\t\t$criteria->compare('qa_comments',$this->qa_comments,true);\n\t\t$criteria->compare('channel_id',$this->channel_id);\n if (is_numeric($this->desired_domain_id)) {\n\t\t $criteria->compare('desired_domain_id',$this->desired_domain_id);\n } else {\n\t\t $criteria->compare('desired_domain',$this->desired_domain_id, true);\n }\n\t\t$criteria->compare('desired_domain',$this->desired_domain,true);\n\t\t$criteria->compare('rewritten_title',$this->rewritten_title,true);\n\t\t$criteria->compare('blog_title',$this->blog_title,true);\n\t\t$criteria->compare('blog_url',$this->blog_url,true);\n\t\t$criteria->compare('progressstatus',$this->progressstatus);\n\n if ($this->client_id) {\n\t\t $criteria->compare('rcampaign.client_id',$this->client_id);\n }\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('REF_EMP_ID',$this->REF_EMP_ID);\n\t\t$criteria->compare('REF_ACT_CREDITS',$this->REF_ACT_CREDITS);\n\t\t$criteria->compare('REF_ACT_EMP_IDS',$this->REF_ACT_EMP_IDS,true);\n\t\t$criteria->compare('REF_ACT_MAIL_LIST',$this->REF_ACT_MAIL_LIST,true);\n\t\t$criteria->compare('REF_TOT_CREDITS',$this->REF_TOT_CREDITS);\n\t\t$criteria->compare('REF_ALL_EMP_IDS',$this->REF_ALL_EMP_IDS,true);\n\t\t$criteria->compare('REF_ALL_MAIL_LIST',$this->REF_ALL_MAIL_LIST,true);\n\t\t$criteria->compare('REF_UTILIZED_CREDITS',$this->REF_UTILIZED_CREDITS);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList(SearchCriteriaInterface $searchCriteria)\n {\n $collection = $this->auctionItemCollectionFactory->create();\n\n $this->collectionProcessor->process($searchCriteria, $collection);\n\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($searchCriteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n return $searchResults;\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "function search_items($query, $custID, $limit, $page, $debug = false) {\n\t\t$search = '%'.str_replace(' ', '%', $query).'%';\n\t\t$q = (new QueryBuilder())->table('itemsearch');\n\n\t\tif (empty($custID)) {\n\t\t\t$q->where('origintype', ['I', 'V']);\n\t\t\t$q->where(\n\t\t $q\n\t\t ->orExpr()\n\t\t ->where($q->expr(\"UCASE(CONCAT(itemid, ' ', originid, ' ', desc1, ' ', desc2))\"), 'like', $q->expr(\"UCASE([])\",[$search]))\n\t\t ->where($q->expr(\"UCASE(CONCAT(itemid, ' ', refitemid, ' ', desc1, ' ', desc2))\"), 'like', $q->expr(\"UCASE([])\",[$search]))\n\t\t );\n\t\t} else {\n\t\t\t$q->where('origintype', ['I', 'V', 'C']);\n\t\t\t$q->where($q->expr(\"UCASE(CONCAT(itemid, ' ', refitemid, ' ', desc1, ' ', desc2))\"), 'like', $q->expr(\"UCASE([])\",[$search]));\n\t\t}\n\t\t$q->order($q->expr(\"itemid LIKE UCASE([]) DESC\", [$search]));\n\t\t$q->group('itemid');\n\t\t$q->limit($limit, $q->generate_offset($page, $limit));\n\n\t\t$sql = Processwire\\wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'XRefItem');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getList(\n \\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria\n );", "public function getSearchResults($keywords, $maxResults, $fixedPriceOnly = false)\n\t{\n\t\t$keywords = urlencode(htmlentities(strip_tags(trim($keywords)))); //remove html from query\n\t\t$priceRangeMax = 500;\n\t\t$priceRangeMin = 0.0;\n\t\t$itemType = \"\";\n\t\t\n\t\tif($fixedPriceOnly)\n\t\t{\n\t\t\t$itemType = \"FixedPricedItem\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$itemType = \"AllItems\";\n\t\t}\n\t\t\n\t\t// Construct the FindItems call \n $apicall = $this->endPoint.\"?callname=FindItemsAdvanced\"\n . \"&version=537\"\n . \"&siteid=\". SITE_ID\n . \"&appid=\". APP_ID\n . \"&QueryKeywords=$keywords\"\n . \"&MaxEntries=$maxResults\"\n . \"&ItemSort=EndTime\"\n . \"&ItemType=\". $itemType\t\t// AllItemTypes or AllItems\n . \"&PriceMin.Value=$priceRangeMin\"\n . \"&PriceMax.Value=$priceRangeMax\"\n . \"&IncludeSelector=SearchDetails\" \n . \"&trackingpartnercode=9\"\n . \"&trackingid=\". TRACKING_ID\n . \"&affiliateuserid=\".USER_ID\n . \"&CategoryID=\". CATEGORY_ID\n . \"&responseencoding=\". RESPONSE_ENCODING;\n \n //try:\n //SortOrder=Ascending&MaxEntries\n \n $this->xmlResponse = simplexml_load_file($apicall);\n \n //print_r($this->xmlResponse);\n \n if ($this->xmlResponse && $this->xmlResponse->TotalItems > 0)\n {\n \tforeach($this->xmlResponse->SearchResult->ItemArray->Item as $item)\n \t{\n \t\t$link = $item->ViewItemURLForNaturalSearch;\n \t\t$title = $item->Title;\n \t\t\n \t\tif($item->GalleryURL) \n \t\t{\n \t\t$thumbURL = $item->GalleryURL;\n \t\t} \n \t\telse \n \t\t{\n \t\t$thumbURL = \"img/pic.gif\";\n \t\t\t}\n \t\t\t\n \t\t\t$price = sprintf(\"%01.2f\", $item->ConvertedCurrentPrice);\n \t\t\t\n \t\t\t/*\n \t\t$ship = sprintf(\"%01.2f\", $item->ShippingCostSummary->ShippingServiceCost);\n \t\t$total = sprintf(\"%01.2f\", ((float)$item->ConvertedCurrentPrice \n + (float)$item->ShippingCostSummary->ShippingServiceCost));\n */\n \t\t\t \n\t\t\t\t\t\t// Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others\n \t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$priceCurr = (string) $item->ConvertedCurrentPrice['currencyID'];\n \t\t$shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID'];\n \t\t\n \t\tif ($priceCurr == $shipCurr) \n \t\t{\n \t\t$curr = $priceCurr;\n \t\t} \n \t\telse \n \t\t{\n \t\t$curr = \"$priceCurr / $shipCurr\"; // potential case where price/ship currencies differ\n \t\t}\n \t\t\t\t\t*/\n \t\t\n\t\t\t\t\t\t$timeLeft = $this->getPrettyTimeFromEbayTime($item->TimeLeft); \n \t\t//$endTime = strtotime($item->EndTime); // returns Epoch seconds\n \t\t//$endTime = $item->EndTime;\n \t\t\n \t\t/**\n \t\t * Here you echo out the info for each result /////////////////////////////////////\n \t\t */\n \t\techo 'Price: ' .$price;\n\t\t\t\t\t\techo 'Title: ' .$title;\n\t\t\t\t\t\techo 'url: ' .$link;\n \t\t\n \t}//foreach\n }\n else\n {\n \t//echo \"Sorry, No Results.\";\n }\n \n\t}", "public function findItem( $code, array $ref = [], $domain = 'product', $type = null, $default = false );", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n \n\t\t$criteria->compare('ESUB_ID',$this->ESUB_ID);\n\t\t$criteria->compare('ESUB_EMP_ID',$this->ESUB_EMP_ID);\n//\t\t$criteria->compare('ESUB_SUBSCRS_ID',$this->ESUB_SUBSCRS_ID);\n// $criteria->together=true;\n\t\t\n//\t\t$criteria->compare('ESUB_PAYMENT_ID',$this->ESUB_PAYMENT_ID);\n $criteria->with = array( 'eSUBSUBSCRS' );\n $criteria->compare('eSUBSUBSCRS.SUBSCR_RATE', $this->ESUB_PAYMENT_ID,true);\n $criteria->compare('eSUBSUBSCRS.SUBSCR_DESC', $this->ESUB_SUBSCRS_ID,true);\n\t\t$criteria->compare('ESUB_STATUS',$this->ESUB_STATUS,true);\n $criteria->compare('ESUB_PURCHASE_DATE',$this->ESUB_PURCHASE_DATE,true);\n\t\t$criteria->compare('ESUB_EXPIRY_DATE',$this->ESUB_EXPIRY_DATE,true);\n\t\t$criteria->compare('ESUB_UTILIZED_COUNT',$this->ESUB_UTILIZED_COUNT,true);\n\t\t$criteria->compare('ESUB_REMAIN_COUNT',$this->ESUB_REMAIN_COUNT,true);\n// $criteria->compare('date(ESUB_PURCHASE_DATE)',$this->ESUB_PURCHASE_DATE,true);\n////\n// $criteria->compare('date(ESUB_EXPIRY_DATE)',$this->ESUB_EXPIRY_DATE,true);\n// $criteria->compare(\"DATE_FORMAT(date,'%yy-%mm-%dd')\",$this->ESUB_PURCHASE_DATE,true);\n// $criteria->compare(\"DATE_FORMAT(date,'%yy-%mm-%dd')\",$this->ESUB_EXPIRY_DATE,true);\n// if($this->ESUB_SUBSCRS_ID)\n// {\n// $criteria->together = true;\n// $criteria->with = ( 'eSUBSUBSCRS' );\n// $criteria->compare('eSUBSUBSCRS.SUBSCR_DESC', $model->ESUB_SUBSCRS_ID,true);\n// }\n// if(strlen($this->ESUB_PURCHASE_DATE) && strlen($this->ESUB_EXPIRY_DATE)) {\n// $criteria->params[':ESUB_PURCHASE_DATE'] = date('Y-m-d', strtotime($this->ESUB_PURCHASE_DATE));\n// \n// $criteria->params[':ESUB_EXPIRY_DATE'] = date('Y-m-d', strtotime($this->ESUB_EXPIRY_DATE));\n//// (strlen($this->ESUB_EXPIRY_DATE)) ? date('Y-m-d', strtotime($this->ESUB_EXPIRY_DATE)) : $criteria->params[':post_date'];\n// $criteria->addCondition('DATE(ESUB_PURCHASE_DATE) BETWEEN :ESUB_PURCHASE_DATE AND :ESUB_EXPIRY_DATE');\n// }\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n \n\t\t));\n\t}", "private function _apply_search_parameters(&$items = array(), &$sequence = 0) {\n\n /*\n * Valid input?\n */\n if (!is_array($items) || !array_key_exists(0, $items)) {\n return FALSE;\n }\n\n /*\n * Init response container\n */\n $search_conditions = new stdClass();\n $search_conditions->additional_joins = array();\n $search_conditions->additional_where_conditions = '';\n $search_conditions->needs_physmessages = FALSE;\n\n /*\n * Not keyword supplied? (reverse search)\n */\n $is_not = FALSE;\n if ($items[0] == 'NOT') {\n\n $is_not = TRUE;\n\n /*\n * Remove 'NOT' clause from operator\n */\n $items = array_slice($items, 1);\n }\n\n\n /*\n * Operators management\n */\n switch ($items[0]) {\n case 'ANSWERED':\n\n /*\n ANSWERED\n Messages with the \\Answered flag set.\n */\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.answered_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.answered_flag <> 1\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'BCC':\n\n /*\n BCC <string>\n Messages that contain the specified string in the envelope\n structure's BCC field.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('bcc');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'BEFORE':\n\n /*\n BEFORE <date>\n Messages whose internal date (disregarding time and timezone)\n is earlier than the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date < '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date >= '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'BODY':\n\n /*\n BODY <string>\n Messages that contain the specified string in the body of the\n message.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_partlists_alias = \"dbmail_partlists_{$sequence}\";\n\n $sequence++;\n $dbmail_mimeparts_alias = \"dbmail_mimeparts_{$sequence}\";\n \n $sequence++;\n $dbmail_mimeparts_fts_alias = \"dbmail_mimeparts_fts_{$sequence}\";\n\n $full_text_search = $this->rcubeInstance->config->get('full_text_search', null);\n $full_text_table_fts = $this->rcubeInstance->config->get('full_text_table_fts', null);\n \n if(!is_null($full_text_table_fts) && $full_text_table_fts === true){\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_partlists AS {$dbmail_partlists_alias} ON dbmail_physmessage.id = {$dbmail_partlists_alias}.physmessage_id\",\n \"INNER JOIN dbmail_mimeparts_fts AS {$dbmail_mimeparts_fts_alias} ON {$dbmail_partlists_alias}.part_id = {$dbmail_mimeparts_fts_alias}.id\",\n ); \n if(!is_null($full_text_search) && $full_text_search === true){\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"MATCH ({$dbmail_mimeparts_fts_alias}.data) AGAINST ('{$this->dbmail->escape($search_value)}' IN BOOLEAN MODE)\";\n } else {\n $search_conditions->additional_where_conditions = \"NOT MATCH ({$dbmail_mimeparts_fts_alias}.data) AGAINST ('{$this->dbmail->escape($search_value)}' IN BOOLEAN MODE)\";\n }\n } else {\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_mimeparts_fts_alias}.data LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_mimeparts_fts_alias}.data NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n }\n }else{\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_partlists AS {$dbmail_partlists_alias} ON dbmail_physmessage.id = {$dbmail_partlists_alias}.physmessage_id\",\n \"INNER JOIN dbmail_mimeparts AS {$dbmail_mimeparts_alias} ON {$dbmail_partlists_alias}.part_id = {$dbmail_mimeparts_alias}.id\"\n ); \n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_partlists_alias}.is_header = 0 AND {$dbmail_mimeparts_alias}.data LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_partlists_alias}.is_header = 0 AND {$dbmail_mimeparts_alias}.data NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n }\n \n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'CC':\n\n /*\n CC <string>\n Messages that contain the specified string in the envelope\n structure's CC field.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('cc');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'DELETED':\n\n /*\n DELETED\n Messages with the \\Deleted flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.deleted_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.deleted_flag <> 1\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'DRAFT':\n\n /*\n DRAFT\n Messages with the \\Draft flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.draft_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.draft_flag <> 1\";\n }\n\n $items = array_slice($items, 1);\n\n break;\n case 'FLAGGED':\n\n /*\n FLAGGED\n Messages with the \\Flagged flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.flagged_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.flagged_flag <> 1\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'FROM':\n\n /*\n FROM <string>\n Messages that contain the specified string in the envelope\n structure's FROM field.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('from');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'HEADER':\n\n /*\n HEADER <field-name> <string>\n Messages that have a header with the specified field-name (as\n defined in [RFC-2822]) and that contains the specified string\n in the text of the header (what comes after the colon). If the\n string to search is zero-length, this matches all messages that\n have a header line with the specified field-name regardless of\n the contents.\n */\n\n if (!array_key_exists(1, $items) || !array_key_exists(2, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name(strtolower($items[1]));\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[2]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 3);\n\n break;\n case 'KEYWORD':\n\n /*\n KEYWORD <flag>\n Messages with the specified keyword flag set.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_keywords_alias = \"dbmail_keywords{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_keywords AS {$dbmail_keywords_alias} on dbmail_messages.message_idnr = {$dbmail_keywords_alias}.message_idnr\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_keywords_alias}.keyword = '{$this->dbmail->escape($search_value)}'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_keywords_alias}.keyword <> '{$this->dbmail->escape($search_value)}'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'LARGER':\n\n /*\n LARGER <n>\n Messages with an [RFC-2822] size larger than the specified\n number of octets.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.rfcsize > '{$this->dbmail->escape($search_value)}'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.rfcsize <= '{$this->dbmail->escape($search_value)}'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'NEW':\n\n /*\n NEW\n Messages that have the \\Recent flag set but not the \\Seen flag.\n This is functionally equivalent to \"(RECENT UNSEEN)\".\n */\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag = 1 AND dbmail_messages.seen_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag = 1 AND dbmail_messages.seen_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'OLD':\n\n /*\n OLD\n Messages that do not have the \\Recent flag set. This is\n functionally equivalent to \"NOT RECENT\" (as opposed to \"NOT\n NEW\").\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'ON':\n\n /*\n ON <date>\n Messages whose internal date (disregarding time and timezone)\n is within the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date BETWEEN '{$datetime_value->format('Y-m-d')} 00:00:00' AND '{$datetime_value->format('Y-m-d')} 23:59:59'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date < '{$datetime_value->format('Y-m-d')} 00:00:00' OR dbmail_physmessage.internal_date > '{$datetime_value->format('Y-m-d')} 23:59:59'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n break;\n\n case 'RECENT':\n\n /*\n RECENT\n Messages that have the \\Recent flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.recent_flag <> 1\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'SEEN':\n\n /*\n SEEN\n Messages that have the \\Seen flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.seen_flag = 1\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.seen_flag <> 1\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'SENTBEFORE':\n\n /*\n SENTBEFORE <date>\n Messages whose [RFC-2822] Date: header (disregarding time and\n timezone) is earlier than the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('date');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield < '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield >= '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'SENTON':\n\n /*\n SENTON <date>\n Messages whose [RFC-2822] Date: header (disregarding time and\n timezone) is within the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('date');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield = '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield <> '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n break;\n case 'SENTSINCE':\n\n /*\n SENTSINCE <date>\n Messages whose [RFC-2822] Date: header (disregarding time and\n timezone) is within or later than the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('date');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield >= '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.datefield < '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n break;\n case 'SINCE':\n\n /*\n SINCE <date>\n Messages whose internal date (disregarding time and timezone)\n is within or later than the specified date.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $datetime_value = date_create_from_format('j-M-Y', $search_value);\n if (!$datetime_value) {\n /*\n * Malformed datetime\n */\n return FALSE;\n }\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date >= '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.internal_date < '{$datetime_value->format('Y-m-d')} 00:00:00'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'SMALLER':\n\n /*\n SMALLER <n>\n Messages with an [RFC-2822] size smaller than the specified\n number of octets.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.rfcsize < '{$this->dbmail->escape($search_value)}'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_physmessage.rfcsize >= '{$this->dbmail->escape($search_value)}'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'SUBJECT':\n\n /*\n SUBJECT <string>\n Messages that contain the specified string in the envelope\n structure's SUBJECT field.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('subject');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n break;\n case 'TEXT':\n\n /*\n TEXT <string>\n Messages that contain the specified string in the header or\n body of the message.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_partlists_alias = \"dbmail_partlists_{$sequence}\";\n\n $sequence++;\n $dbmail_mimeparts_alias = \"dbmail_mimeparts_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_partlists AS {$dbmail_partlists_alias} ON dbmail_physmessage.id = {$dbmail_partlists_alias}.physmessage_id\",\n \"INNER JOIN dbmail_mimeparts AS {$dbmail_mimeparts_alias} ON {$dbmail_partlists_alias}.part_id = {$dbmail_mimeparts_alias}.id\"\n );\n\n $full_text_search = $this->rcubeInstance->config->get('full_text_search', null);\n if(!is_null($full_text_search) && $full_text_search === true){\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"MATCH ({$dbmail_mimeparts_alias}.data) AGAINST ('{$this->dbmail->escape($search_value)}' IN BOOLEAN MODE)\";\n } else {\n $search_conditions->additional_where_conditions = \"NOT MATCH ({$dbmail_mimeparts_alias}.data) AGAINST ('{$this->dbmail->escape($search_value)}' IN BOOLEAN MODE)\";\n }\n } else {\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_mimeparts_alias}.data LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_mimeparts_alias}.data NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'TO':\n\n /*\n TO <string>\n Messages that contain the specified string in the envelope\n structure's TO field.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $header_name_id = $this->get_header_id_by_header_name('to');\n if (!$header_name_id) {\n /*\n * Missing lookup value - return empty string (this is NON an error!)\n */\n return array();\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Physmessages table needed!!!!\n */\n $search_conditions->needs_physmessages = TRUE;\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_header_alias = \"dbmail_header_{$sequence}\";\n\n $sequence++;\n $dbmail_headervalue_alias = \"dbmail_headervalue_{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"INNER JOIN dbmail_header AS {$dbmail_header_alias} ON dbmail_physmessage.id = {$dbmail_header_alias}.physmessage_id\",\n \"INNER JOIN dbmail_headervalue AS {$dbmail_headervalue_alias} ON {$dbmail_header_alias}.headervalue_id = {$dbmail_headervalue_alias}.id\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue LIKE '%{$this->dbmail->escape($search_value)}%'\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_header_alias}.headername_id = {$header_name_id} AND {$dbmail_headervalue_alias}.headervalue NOT LIKE '%{$this->dbmail->escape($search_value)}%'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'UID':\n\n /*\n UID <sequence set>\n Messages with unique identifiers corresponding to the specified\n unique identifier set. Sequence set ranges are permitted.\n */\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.unique_id = '{$this->dbmail->escape($search_value)}'\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.unique_id <> '{$this->dbmail->escape($search_value)}'\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'UNANSWERED':\n\n /*\n UNANSWERED\n Messages that do not have the \\Answered flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.answered_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.answered_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'UNDELETED':\n\n /*\n UNDELETED\n Messages that do not have the \\Deleted flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.deleted_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.deleted_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'UNDRAFT':\n\n /*\n UNDRAFT\n Messages that do not have the \\Draft flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.draft_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.draft_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'UNFLAGGED':\n\n /*\n UNFLAGGED\n Messages that do not have the \\Flagged flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.flagged_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.flagged_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n case 'UNKEYWORD':\n\n /*\n UNKEYWORD <flag>\n Messages that do not have the specified keyword flag set.\n */\n\n if (!array_key_exists(1, $items)) {\n /*\n * Error - Missing parameters\n */\n return FALSE;\n }\n\n $search_value = $this->_cleanup_search_parameter($items[1]);\n\n /*\n * Set tables alias\n */\n $sequence++;\n $dbmail_keywords_alias = \"dbmail_keywords{$sequence}\";\n\n $search_conditions->additional_joins = array(\n \"LEFT JOIN dbmail_keywords AS {$dbmail_keywords_alias} on dbmail_messages.message_idnr = {$dbmail_keywords_alias}.message_idnr AND {$dbmail_keywords_alias}.keyword = '{$this->dbmail->escape($search_value)}'\"\n );\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"{$dbmail_keywords_alias}.message_idnr IS NULL\";\n } else {\n $search_conditions->additional_where_conditions = \"{$dbmail_keywords_alias}.message_idnr IS NOT NULL\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 2);\n\n break;\n case 'UNSEEN':\n\n /*\n UNSEEN\n Messages that do not have the \\Seen flag set.\n */\n\n $search_conditions->additional_joins = array();\n\n if (!$is_not) {\n $search_conditions->additional_where_conditions = \"dbmail_messages.seen_flag = 0\";\n } else {\n $search_conditions->additional_where_conditions = \"dbmail_messages.seen_flag <> 0\";\n }\n\n /*\n * Unset managed items\n */\n $items = array_slice($items, 1);\n\n break;\n default:\n\n /*\n * Invalid operand!\n */\n $this->rc->console('_apply_search_parameters - Invalid operand!');\n\n return FALSE;\n }\n\n /*\n * Reorder items array\n */\n $items = array_values($items);\n\n\n return $search_conditions;\n }", "function rdf_get_resources(array $rdf_index, array $conditions) {\n $output = array();\n foreach ($rdf_index as $subject => $resource) {\n $match = TRUE;\n foreach ($conditions as $predicate => $object) {\n $match &= isset($resource[$predicate]) && in_array($object, $resource[$predicate]);\n }\n if ($match) {\n $output[] = $subject;\n }\n }\n return $output;\n}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('replacement_id',$this->replacement_id);\n\t\t$criteria->with=array('itemForReplacement', 'itemStocksForRepl', 'itemReplaced', 'itemStocksReplaced');\n\t\t\n\t\t//$criteria->compare('item_for_replacement_id',$this->item_for_replacement_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemForReplacement.item_description',$this->item_for_replacement_id, true);\n\t\t\n\t\t//$criteria->compare('item_stocks_for_repl_id',$this->item_stocks_for_repl_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemStocksForRepl.item_stocks_serial_no',$this->item_stocks_for_repl_id, true);\n\t\t\n\t\t//$criteria->compare('item_replaced_id',$this->item_replaced_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemReplaced.item_description',$this->item_replaced_id, true);\n\t\t\n\t\t//$criteria->compare('item_stocks_replaced_id',$this->item_stocks_replaced_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemStocksReplaced.item_stocks_serial_no',$this->item_stocks_replaced_id, true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id_product', $this->id_product, true);\n $criteria->compare('id_supplier_default', $this->id_supplier_default, true);\n $criteria->compare('id_manufacturer', $this->id_manufacturer, true);\n $criteria->compare('id_category_default', $this->id_category_default, true);\n $criteria->compare('id_tax', $this->id_tax, true);\n $criteria->compare('on_sale', $this->on_sale);\n $criteria->compare('quantity', $this->quantity);\n $criteria->compare('minimal_quantity', $this->minimal_quantity, true);\n $criteria->compare('price', $this->price, true);\n $criteria->compare('wholesale_price', $this->wholesale_price, true);\n $criteria->compare('unity', $this->unity, true);\n $criteria->compare('unit_price_ratio', $this->unit_price_ratio, true);\n $criteria->compare('additional_shipping_cost', $this->additional_shipping_cost, true);\n $criteria->compare('reference', $this->reference, true);\n $criteria->compare('supplier_reference', $this->supplier_reference, true);\n $criteria->compare('width', $this->width);\n $criteria->compare('height', $this->height);\n $criteria->compare('depth', $this->depth);\n $criteria->compare('weight', $this->weight);\n $criteria->compare('out_of_stock', $this->out_of_stock, true);\n $criteria->compare('customizable', $this->customizable);\n $criteria->compare('text_fields', $this->text_fields);\n $criteria->compare('active', $this->active);\n $criteria->compare('available_for_order', $this->available_for_order);\n $criteria->compare('available_date', $this->available_date, true);\n $criteria->compare('condition', $this->condition, true);\n $criteria->compare('show_price', $this->show_price);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('slug', $this->slug, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('description_short', $this->description_short, true);\n $criteria->compare('meta_title', $this->meta_title, true);\n $criteria->compare('meta_keywords', $this->meta_keywords, true);\n $criteria->compare('meta_description', $this->meta_description, true);\n $criteria->compare('stock_management', $this->stock_management, true);\n $sort = new CSort;\n $sort->defaultOrder = 'date_add, name, active ASC';\n $sort->attributes = array(\n 'name' => 'name',\n 'date_add' => 'date_add',\n 'active' => 'active',\n );\n\n $sort->applyOrder($criteria);\n $uni_id = ImageHelper::encrypt_text(Yii::app()->controller->id . '@' . Yii::app()->controller->action->id . '@' . get_class($this));\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => $sort,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState($uni_id . lcfirst(get_class($this)) . 'PageSize', 20),\n 'currentPage' => Yii::app()->user->getState(get_class($this) . '_page', 0),\n ),\n )\n );\n }", "public function Search($criteria);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('ID', $this->ID, true);\n $criteria->compare('IntentionName', $this->IntentionName, true);\n $criteria->compare('RentPrice', $this->RentPrice, true);\n $criteria->compare('RentUnit', $this->RentUnit, true);\n $criteria->compare('SalePrice', $this->SalePrice, true);\n $criteria->compare('SaleUnit', $this->SaleUnit, true);\n $criteria->compare('IsNegotiable', $this->IsNegotiable);\n $criteria->compare('StuctureArea', $this->StuctureArea);\n $criteria->compare('StuctureAreaUnit', $this->StuctureAreaUnit, true);\n $criteria->compare('UsedArea', $this->UsedArea);\n $criteria->compare('UsedAreaUnit', $this->UsedAreaUnit, true);\n $criteria->compare('CategoryName', $this->CategoryName, true);\n $criteria->compare('FloorHeight', $this->FloorHeight);\n $criteria->compare('StructureName', $this->StructureName, true);\n $criteria->compare('FunctionName', $this->FunctionName, true);\n $criteria->compare('RentPeriodA', $this->RentPeriodA, true);\n $criteria->compare('RentPeriodB', $this->RentPeriodB, true);\n $criteria->compare('Contact', $this->Contact, true);\n $criteria->compare('Phone', $this->Phone, true);\n $criteria->compare('RentalType', $this->RentalType, true);\n $criteria->compare('MinArea', $this->MinArea);\n $criteria->compare('Height', $this->Height);\n $criteria->compare('Width', $this->Width);\n $criteria->compare('LandLincense', $this->LandLincense, true);\n $criteria->compare('CertificateProperty', $this->CertificateProperty, true);\n $criteria->compare('LeftYears', $this->LeftYears);\n $criteria->compare('ProtocolUrl', $this->ProtocolUrl, true);\n $criteria->compare('Details', $this->Details, true);\n $criteria->compare('InfoValidPeriod', $this->InfoValidPeriod, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function getReferencedItems($pm_table_num_or_name, $pm_list_name_or_id=null, $pa_reference_limit_ids=null, $ps_ref_table_fieldname=null, $pn_access=null) {\n\t\tif (is_numeric($pm_table_num_or_name)) {\n\t\t\t$vs_table_name = $this->getAppDataModel()->getTableName($pm_table_num_or_name);\n\t\t} else {\n\t\t\t$vs_table_name = $pm_table_num_or_name;\n\t\t}\n\t\t\n\t\tif (!($t_ref_table = $this->getAppDatamodel()->getInstanceByTableName($vs_table_name, true))) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\tif($pm_list_name_or_id) {\n\t\t\t$vn_list_id = $this->_getListID($pm_list_name_or_id);\n\t\t} else {\n\t\t\t$vn_list_id = $this->getPrimaryKey();\n\t\t}\n\t\tif (!$vn_list_id || !$vs_table_name) { return null; }\n\t\t\n\t\t$o_db = $this->getDb();\n\t\t\n\t\tif (!$ps_ref_table_fieldname) {\n\t\t\t$va_path = $this->getAppDatamodel()->getPath('ca_list_items', $vs_table_name);\n\t\t\tarray_shift($va_path); // remove 'ca_list_items' from path\n\t\t\t\n\t\t\t$vs_last_table = 'ca_list_items';\n\t\t\t$va_joins = array();\n\t\t\tforeach($va_path as $vs_rel_table_name => $vn_rel_table_num) {\n\t\t\t\t$va_rels = $this->getAppDatamodel()->getRelationships($vs_last_table, $vs_rel_table_name);\n\t\t\t\t$va_rel = $va_rels[$vs_last_table][$vs_rel_table_name][0];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$va_joins[] = \"INNER JOIN {$vs_rel_table_name} ON {$vs_last_table}.\".$va_rel[0].\" = {$vs_rel_table_name}.\".$va_rel[1];\n\t\t\t\t\n\t\t\t\t$vs_last_table = $vs_rel_table_name;\n\t\t\t}\n\t\t} else {\n\t\t\t$va_joins[] = \"INNER JOIN {$vs_table_name} ON {$vs_table_name}.{$ps_ref_table_fieldname} = ca_list_items.item_id\";\n\t\t}\n\t\t\n\t\t$va_sql_wheres = array();\n\t\tif (is_array($pa_reference_limit_ids) && sizeof($pa_reference_limit_ids)) {\n\t\t\t$va_sql_wheres[] = \"({$vs_table_name}.\".$t_ref_table->primaryKey().\" IN (\".join(',', $pa_reference_limit_ids).\"))\";\n\t\t}\n\t\t\n\t\tif (!is_null($pn_access)) {\n\t\t\t$va_sql_wheres[] = \"({$vs_table_name}.access = \".intval($pn_access).\")\";\n\t\t}\n\t\t\n\t\t// get counts\n\t\t$vs_sql = \"\n\t\t\tSELECT ca_list_items.item_id, count(*) cnt\n\t\t\tFROM ca_list_items\n\t\t\t\".join(\"\\n\", $va_joins).\"\n\t\t\tWHERE\n\t\t\t\t(ca_list_items.deleted = 0) AND (ca_list_items.list_id = ?)\n\t\t\t\t\".(sizeof($va_sql_wheres) ? \" AND \".join(' AND ', $va_sql_wheres) : \"\").\"\n\t\t\tGROUP BY\n\t\t\t\tca_list_items.item_id\n\t\t\";\n\t\t$qr_items = $o_db->query($vs_sql, (int)$vn_list_id);\n\t\t\n\t\t$va_item_counts = array();\n\t\twhile($qr_items->nextRow()) {\n\t\t\t$va_item_counts[$qr_items->get('item_id')] = $qr_items->get('cnt');\n\t\t}\n\t\t\n\t\t$vs_sql = \"\n\t\t\tSELECT ca_list_items.item_id, ca_list_item_labels.*\n\t\t\tFROM ca_list_items\n\t\t\tINNER JOIN ca_list_item_labels ON ca_list_item_labels.item_id = ca_list_items.item_id\n\t\t\t\".join(\"\\n\", $va_joins).\"\n\t\t\tWHERE\n\t\t\t\t(ca_list_items.deleted = 0) AND (ca_list_items.list_id = ?) AND (ca_list_item_labels.is_preferred = 1)\n\t\t\t\t\".(sizeof($va_sql_wheres) ? \" AND \".join(' AND ', $va_sql_wheres) : \"\").\"\n\t\t\t\t\n\t\t\tGROUP BY\n\t\t\t\tca_list_item_labels.label_id\n\t\t\";\n\t\t\n\t\t$qr_items = $o_db->query($vs_sql, (int)$vn_list_id);\n\t\t\n\t\t$va_items = array();\n\t\twhile($qr_items->nextRow()) {\n\t\t\t$vn_item_id = $qr_items->get('item_id');\n\t\t\t$va_items[$vn_item_id][$qr_items->get('locale_id')] = array_merge($qr_items->getRow(), array('cnt' => $va_item_counts[$vn_item_id]));\n\t\t}\n\t\t\n\t\treturn caExtractValuesByUserLocale($va_items);\n\t}", "function get_item_list_search($terms)\n {\n $this->company_db->select(\"i.*\");\n $this->company_db->from('tbl_inventory i');\n //$this->company_db->where('i.void', 'No');\n $column_search = array(\"CONVERT(i.description USING utf8)\", \"i.item_number\");\n\n if(isset($terms) && !empty($terms)) // if datatable send POST for search\n {\n $i = 0;\n foreach ($column_search as $item) // loop column \n { \n if($i===0) // first loop\n {\n $this->company_db->group_start(); // open bracket. query Where with OR clause better with bracket. because maybe can combine with other WHERE with AND.\n $this->company_db->like($item, $terms);\n }\n else\n {\n $this->company_db->or_like($item, $terms);\n }\n \n if(count($column_search) - 1 == $i) //last loop\n $this->company_db->group_end(); //close bracket\n \n $i++;\n }\n }\n\n $query = $this->company_db->get();\n \n if($query->num_rows() >= 1)\n {\n foreach ($query->result() as $key => $value) {\n $value->description = strtolower($value->description);\n }\n return $query->result_array();\n }\n else\n {\n return array();\n }\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('refno',$this->refno);\n\t\t$criteria->compare('customercode',$this->customercode);\n\t\t$criteria->compare('locationcode',$this->locationcode);\n\t\t$criteria->compare('projectcode',$this->projectcode);\n\t\t$criteria->compare('blockrefnumber',$this->blockrefnumber);\n\t\t$criteria->compare('payplanrefno',$this->payplanrefno);\n\t\t$criteria->compare('nofinstallments',$this->nofinstallments);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('installamount',$this->installamount);\n\t\t$criteria->compare('totalpayable',$this->totalpayable);\n\t\t$criteria->compare('paymentduedate',$this->paymentduedate);\n\t\t$criteria->compare('agrementstartdate',$this->agrementstartdate,true);\n\t\t$criteria->compare('agrementfinishdate',$this->agrementfinishdate,true);\n\t\t$criteria->compare('saletype',$this->saletype);\n\t\t$criteria->compare('salerightoff_amt',$this->salerightoff_amt);\n\t\t$criteria->compare('salerightoff_status',$this->salerightoff_status);\n\t\t$criteria->compare('salerightoff_comment',$this->salerightoff_comment,true);\n\t\t$criteria->compare('deleted',$this->deleted);\n\t\t$criteria->compare('addedby',$this->addedby);\n\t\t$criteria->compare('addeddate',$this->addeddate,true);\n\t\t$criteria->compare('addedtime',$this->addedtime,true);\n\t\t$criteria->compare('lastmodifiedby',$this->lastmodifiedby);\n\t\t$criteria->compare('lastmodifieddate',$this->lastmodifieddate,true);\n\t\t$criteria->compare('lastmodifiedtime',$this->lastmodifiedtime,true);\n\t\t$criteria->compare('deletedby',$this->deletedby);\n\t\t$criteria->compare('deleteddate',$this->deleteddate,true);\n\t\t$criteria->compare('deletedtime',$this->deletedtime,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function resolveReferences($items);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function 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 function searchForList($criteria = null)\n {\n if (is_null($criteria)) {\n $criteria = new CDbCriteria;\n }\n\n $criteria->select = \"t.*,ccgr_name,ccxg_ccgr_id\";\n $criteria->compare('ccmp_id', $this->ccmp_id);\n $criteria->compare('ccmp_name', $this->ccmp_name, true);\n $criteria->compare('ccmp_ccnt_id', $this->ccmp_ccnt_id);\n $criteria->compare('ccmp_registrtion_no', $this->ccmp_registrtion_no, true);\n $criteria->compare('ccmp_vat_registrtion_no', $this->ccmp_vat_registrtion_no, true);\n $criteria->compare('ccmp_registration_date', $this->ccmp_registration_date);\n $criteria->compare('ccmp_registration_address', $this->ccmp_registration_address, true);\n $criteria->compare('ccmp_official_ccit_id', $this->ccmp_official_ccit_id);\n $criteria->compare('ccmp_official_address', $this->ccmp_official_address, true);\n $criteria->compare('ccmp_official_zip_code', $this->ccmp_official_zip_code, true);\n $criteria->compare('ccmp_office_ccit_id', $this->ccmp_office_ccit_id);\n $criteria->compare('ccmp_office_address', $this->ccmp_office_address, true);\n $criteria->compare('ccmp_office_zip_code', $this->ccmp_office_zip_code, true);\n $criteria->compare('ccmp_statuss', $this->ccmp_statuss);\n $criteria->compare('ccmp_description', $this->ccmp_description, true);\n $criteria->compare('ccmp_office_phone', $this->ccmp_office_phone, true);\n $criteria->compare('ccmp_office_email', $this->ccmp_office_email, true);\n $criteria->compare('ccmp_agreement_nr', $this->ccmp_agreement_nr, true);\n $criteria->compare('ccmp_agreement_date', $this->ccmp_agreement_date);\n $criteria->compare('ccmp_sys_ccmp_id', $this->ccmp_sys_ccmp_id); \n $criteria->compare('ccxg_ccgr_id', $this->ccxg_ccgr_id); \n\n $criteria->join = \" \n LEFT OUTER JOIN ccxg_company_x_group \n ON ccxg_ccmp_id = ccmp_id \n LEFT OUTER JOIN ccgr_group \n ON ccxg_ccgr_id = ccgr_id \n \n \";\n\n return new CActiveDataProvider('CcmpCompany', array(\n 'criteria' => $criteria,\n 'sort'=>array('defaultOrder'=>'ccmp_name'),\n 'pagination'=>array('pageSize'=>50),\n\n )); \n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\tif(isset($this->searchText) && !empty($this->searchText))\n\t\t{\n\t\t\t$this->productId = $this->searchText;\n\t\t\t$this->supplierId = $this->searchText;\n\t\t\t$this->brandId = $this->searchText;\n\t\t\t$this->brandModelId = $this->searchText;\n\t\t\t$this->categoryId = $this->searchText;\n\t\t\t$this->categoryId2 = $this->searchText;\n\t\t\t$this->code = $this->searchText;\n\t\t\t$this->name = $this->searchText;\n\t\t\t$this->isbn = $this->searchText;\n\t\t\t$this->sku = $this->searchText;\n\t\t\t$this->upc = $this->searchText;\n\t\t\t$this->location = $this->searchText;\n\t\t\t$this->quantity = $this->searchText;\n\t\t\t$this->productUnits = $this->searchText;\n\t\t\t$this->stockStatusId = $this->searchText;\n\t\t\t$this->image = $this->searchText;\n\t\t\t$this->shipping = $this->searchText;\n\t\t\t$this->price = $this->searchText;\n\t\t\t$this->priceGroupId = $this->searchText;\n\t\t\t$this->points = $this->searchText;\n\t\t\t$this->taxClassId = $this->searchText;\n\t\t\t$this->dateAvailable = $this->searchText;\n\t\t\t$this->weight = $this->searchText;\n\t\t\t$this->length = $this->searchText;\n\t\t\t$this->width = $this->searchText;\n\t\t\t$this->height = $this->searchText;\n\t\t\t$this->dimensionUnits = $this->searchText;\n\t\t\t$this->metricUnits = $this->searchText;\n\t\t\t$this->subtract = $this->searchText;\n\t\t\t$this->minimum = $this->searchText;\n\t\t\t$this->sortOrder = $this->searchText;\n\t\t\t$this->status = $this->searchText;\n\t\t\t$this->createDateTime = $this->searchText;\n\t\t\t$this->updateDateTime = $this->searchText;\n\t\t\t$this->viewed = $this->searchText;\n\t\t\t$this->marginId = $this->searchText;\n\t\t\t$this->description = $this->searchText;\n\t\t}\n\n\t\t$criteria->compare('productId',$this->productId,true, 'OR');\n\t\t$criteria->compare('supplierId',$this->supplierId,true, 'OR');\n\t\t$criteria->compare('brandId',$this->brandId,true, 'OR');\n\t\t$criteria->compare('brandModelId',$this->brandModelId,true, 'OR');\n\t\t$criteria->compare('categoryId',$this->categoryId,true, 'OR');\n\t\t$criteria->compare('categoryId2',$this->categoryId2,true, 'OR');\n\t\t$criteria->compare('code',$this->code,true, 'OR');\n\t\t$criteria->compare('name',$this->name,true, 'OR');\n\t\t$criteria->compare('isbn',$this->isbn,true, 'OR');\n\t\t$criteria->compare('sku',$this->sku,true, 'OR');\n\t\t$criteria->compare('upc',$this->upc,true, 'OR');\n\t\t$criteria->compare('location',$this->location,true, 'OR');\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('productUnits',$this->productUnits,true, 'OR');\n\t\t$criteria->compare('stockStatusId',$this->stockStatusId);\n\t\t$criteria->compare('image',$this->image,true, 'OR');\n\t\t$criteria->compare('shipping',$this->shipping);\n\t\t$criteria->compare('price',$this->price,true, 'OR');\n\t\t$criteria->compare('priceGroupId',$this->priceGroupId,true, 'OR');\n\t\t$criteria->compare('points',$this->points,true, 'OR');\n\t\t$criteria->compare('taxClassId',$this->taxClassId,true, 'OR');\n\t\t$criteria->compare('dateAvailable',$this->dateAvailable,true, 'OR');\n\t\t$criteria->compare('weight',$this->weight,true, 'OR');\n\t\t$criteria->compare('length',$this->length,true, 'OR');\n\t\t$criteria->compare('width',$this->width,true, 'OR');\n\t\t$criteria->compare('height',$this->height,true, 'OR');\n\t\t$criteria->compare('dimensionUnits',$this->dimensionUnits,true, 'OR');\n\t\t$criteria->compare('metricUnits',$this->metricUnits,true, 'OR');\n\t\t$criteria->compare('subtract',$this->subtract);\n\t\t$criteria->compare('minimum',$this->minimum,true, 'OR');\n\t\t$criteria->compare('sortOrder',$this->sortOrder);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('createDateTime',$this->createDateTime,true, 'OR');\n\t\t$criteria->compare('updateDateTime',$this->updateDateTime,true, 'OR');\n\t\t$criteria->compare('viewed',$this->viewed,true, 'OR');\n\t\t$criteria->compare('marginId',$this->marginId,true, 'OR');\n\t\t$criteria->compare('description',$this->description,true, 'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\n\t\tif(isset($this->cSn)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.cSn', $this->cSn, true);\n\t\t}\n\t\tif(isset($this->sn)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.sn', $this->sn, true);\n\t\t}\n\t\tif(isset($this->status)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.status', $this->status);\n\t\t}\n\n\t\tif(isset($this->orderStatus)){\n\t\t\t$criteria->with[]='sfExpress';\n\t\t\t$criteria->compare('sfExpress.orderStatus', $this->orderStatus, true);\n\t\t}\n\n\t\tif(isset($this->mobile)){\n\t\t\t$criteria->with[]='sfExpress';\n\t\t\t$criteria->compare('sfExpress.receivedMobile', $this->mobile, true);\n\t\t}\n\n\t\t$criteria->compare('t.id',$this->id);\n\t\t$criteria->compare('t.expressSn',$this->expressSn,true);\n\t\t$criteria->compare('t.subExpressSn',$this->subExpressSn,true);\n\t\t$criteria->compare('t.subOrderStatus',$this->subOrderStatus);\n\t\t$criteria->compare('t.subOrderAmount',$this->subOrderAmount,true);\n\t\t$criteria->compare('t.subProductName',$this->subProductName,true);\n\t\t$criteria->compare('t.subProductNum',$this->subProductNum,true);\n\t\t$criteria->compare('t.subProductPrice',$this->subProductPrice,true);\n\t\t$criteria->compare('t.subRefundAmount',$this->subRefundAmount,true);\n\t\t$criteria->compare('t.subRefundId',$this->subRefundId,true);\n\t\t$criteria->compare('t.createTime',$this->createTime);\n\t\t$criteria->compare('t.updateTime',$this->updateTime);\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>10,\n\t\t\t),\n\t\t));\n\t}", "protected function _doSearch($criteria, $glue)\n {\n $results = array();\n foreach ($criteria as $vals) {\n if (!empty($vals['OR'])) {\n $results[] = $this->_doSearch($vals['OR'], 'OR');\n } elseif (!empty($vals['AND'])) {\n $results[] = $this->_doSearch($vals['AND'], 'AND');\n } else {\n /* If we are here, and we have a ['field'] then we\n * must either do the 'AND' or the 'OR' search. */\n if (isset($vals['field'])) {\n $results[] = $this->_sendSearch($vals);\n } else {\n foreach ($vals as $test) {\n if (!empty($test['OR'])) {\n $results[] = $this->_doSearch($test['OR'], 'OR');\n } elseif (!empty($test['AND'])) {\n $results[] = $this->_doSearch($test['AND'], 'AND');\n } else {\n $results[] = $this->_doSearch(array($test), $glue);\n }\n }\n }\n }\n }\n\n return ($glue == 'AND')\n ? $this->_getDuplicated($results)\n : $this->_removeDuplicated($results);\n }", "function search( $searchText, $params = array(), $searchTypes = array() )\n {\t\n \n $cl = new SphinxClient();\n\t \t$cl->SetServer( $this->SphinxServerHost, $this->SphinxServerPort );\n\t \t\n\t \t// Match mode\n\t \t$matchModes = array(\n\t \t\t'SPH_MATCH_ANY' => SPH_MATCH_ANY,\n\t \t\t'SPH_MATCH_ALL' => SPH_MATCH_ALL,\n\t \t\t'SPH_MATCH_PHRASE' => SPH_MATCH_PHRASE,\n\t \t\t'SPH_MATCH_BOOLEAN' => SPH_MATCH_BOOLEAN,\n\t \t\t'SPH_MATCH_EXTENDED' => SPH_MATCH_EXTENDED,\n\t \t\t'SPH_MATCH_FULLSCAN' => SPH_MATCH_FULLSCAN,\n\t \t\t'SPH_MATCH_EXTENDED2' => SPH_MATCH_EXTENDED2,\n\t \t);\t \t\n\t \t$cl->SetMatchMode((isset($params['MatchType']) and key_exists($params['MatchType'],$matchModes)) ? $matchModes[$params['MatchType']] : SPH_MATCH_ANY);\n\t \t\n\t \t \n\t \t// Perhaps anyone have an idea how to implement this type checking in Sphinx ?\n\t \t// (ezcontentobject.section_id in (1)) OR (ezcontentobject.contentclass_id in (1, 19, 20, 27, 29, 30, 31, 32, 33, 34, 40, 44, 47, 48, 50, 51, 52, 57, 59, 61) AND ezcontentobject.section_id in (3))\n\t \t// At this moment it can be implemented directly in sphinx configuration query.\n\t \t/*$limitation = false;\n if ( isset( $params['Limitation'] ) )\n {\n $limitation = $params['Limitation'];\n }\n $limitationList = eZContentObjectTreeNode::getLimitationList( $limitation );\n $sqlPermissionChecking = eZContentObjectTreeNode::createPermissionCheckingSQL( $limitationList );*/\n \n\t \t\n\t \t// Set limit, offset\t \t\n\t\t$cl->SetLimits((int)$params['SearchOffset'],(int)$params['SearchLimit']);\n\t\t\t \n\t\t// Language filter, eZFind copied and changed a little bit :D\n\t\t$ini = eZINI::instance();\n $languages = $ini->variable( 'RegionalSettings', 'SiteLanguageList' );\n $mainLanguage = $languages[0]; \n $cl->SetFilter( 'language_code',array(abs(crc32($mainLanguage))));\n \n // Fetch only not deleted records\n\t\t$cl->SetFilter( 'is_deleted',array(0));\n\t\t\n\t\t\t\n\t \t// Build section filter\n\t \t$searchSectionID = $params['SearchSectionID'];\n\t \tif ( is_numeric( $searchSectionID ) and $searchSectionID > 0 )\n { \n $cl->SetFilter( 'section_id', array( (int)$searchSectionID ) );\n }\n else if ( is_array( $searchSectionID ) )\n {\n \t$cl->SetFilter( 'section_id',$searchSectionID);\n }\n \n // Build class filter \n $searchContentClassID = isset($params['SearchContentClassID']) ? $params['SearchContentClassID'] : 0 ; \n if ( is_numeric( $searchContentClassID ) and $searchContentClassID > 0 )\n {\n \t $cl->SetFilter( 'contentclass_id', array((int)$searchContentClassID));\n }\n else if ( is_array( $searchContentClassID ) )\n { \n $cl->SetFilter( 'contentclass_id',$searchContentClassID);\n }\n \n // Build parent node filter\n $searchParentNodeID = isset($params['ParentNodeID']) ? $params['ParentNodeID'] : 0 ; \n if ( is_numeric( $searchParentNodeID ) and $searchParentNodeID > 0 )\n {\n \t $cl->SetFilter( 'parent_node_id', array((int)$searchParentNodeID));\n }\n else if ( is_array( $searchParentNodeID ) )\n { \n $cl->SetFilter( 'parent_node_id',$searchParentNodeID);\n }\n \n // Build subtree filter\n $searchSubtreeNodeID = isset($params['SearchSubTreeArray']) ? $params['SearchSubTreeArray'] : 0 ; \n if ( is_numeric( $searchSubtreeNodeID ) and $searchSubtreeNodeID > 0 )\n {\n \t $cl->SetFilter( 'pathnodes', array((int)$searchSubtreeNodeID));\n }\n else if ( is_array( $searchSubtreeNodeID ) and count( $searchSubtreeNodeID ) )\n { \n $cl->SetFilter( 'pathnodes',$searchSubtreeNodeID);\n }\n \n \n // Visibility check\n $ignoreVisibility = $params['IgnoreVisibility'] == 'true' ? true : false;\n if (!$ignoreVisibility)\n {\n \t\t$cl->SetFilter( 'is_invisible',array(0));\n } \n \n // Publish date,timestamp date filter, borrowed from ezsearchengine plugin. :) \n if ( isset( $params['SearchDate'] ) )\n \t$searchDate = $params['SearchDate'];\n\t else\n\t\t $searchDate = -1;\n\t\t\n\t if ( isset( $params['SearchTimestamp'] ) )\n\t\t $searchTimestamp = $params['SearchTimestamp'];\n\t else\n\t\t $searchTimestamp = false;\n \t\t \n \n if ( ( is_numeric( $searchDate ) and $searchDate > 0 ) or\n $searchTimestamp )\n {\n $date = new eZDateTime();\n $timestamp = $date->timeStamp();\n $day = $date->attribute('day');\n $month = $date->attribute('month');\n $year = $date->attribute('year');\n $publishedDateStop = false;\n if ( $searchTimestamp )\n {\n if ( is_array( $searchTimestamp ) )\n {\n $publishedDate = $searchTimestamp[0];\n $publishedDateStop = $searchTimestamp[1];\n }\n else\n $publishedDate = $searchTimestamp;\n }\n else\n {\n switch ( $searchDate )\n {\n case 1:\n {\n $adjustment = 24*60*60; //seconds for one day\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 2:\n {\n $adjustment = 7*24*60*60; //seconds for one week\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 3:\n {\n $adjustment = 31*24*60*60; //seconds for one month\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 4:\n {\n $adjustment = 3*31*24*60*60; //seconds for three months\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 5:\n {\n $adjustment = 365*24*60*60; //seconds for one year\n $publishedDate = $timestamp - $adjustment;\n } break;\n default:\n {\n $publishedDate = $date->timeStamp();\n }\n }\n }\n \n if ($publishedDateStop)\n {\n \t$cl->SetFilterRange('published', $publishedDate, $publishedDateStop); // Range type\n } else {\n \t$cl->SetFilterRange('published', 0, $publishedDate, true); // > type\n }\n }\n \n if ( isset( $params['SortBy'] ) )\n $sortArray = $params['SortBy'];\n else\n $sortArray = array(); \n \n // Build sort params \n \t$sortString = $this->buildSort($sortArray); \t\n \tif ($sortString != '')\n \t{\n \t\t$cl->SetSortMode(SPH_SORT_EXTENDED, $sortString); // During sorting we set extended sort mode\n \t}\n \n \n \t\n // Filter , Partly based on ezpersistenobject eZPersistentObject::conditionTextByRow() method \t\n\t\t$fitlerRanges = isset($params['Filter']) ? $params['Filter'] : null;\n\t\tif ( is_array( $fitlerRanges ) and\n count( $fitlerRanges ) > 0 )\n {\n \t\n \tforeach ($fitlerRanges as $id => $cond)\n \t{ \t\t\n \t\tif ( is_array( $cond ) )\n {\n if ( is_array( $cond[0] ) ) // = operator behaviour\n {\n \t$cl->SetFilter( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) , (int)$cond[0] ); \n }\n else if ( is_array( $cond[1] ) ) // Betweeen range\n { \n $range = $cond[1];\n $cl->SetFilterRange('attr_srch_int_pos'.$this->getPositionClassAttribute($id), (int)$range[0], (int)$range[1], $cond[0] == 'true' ); \t\n }\n else\n {\n switch ( $cond[0] )\n {\n case '>=': \n case '>': \n {\n \t $cl->SetFilterRange( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) ,0, (int)$cond[1], true );\n \n } break;\n \n case '<=': \n case '<': \n {\n \t $cl->SetFilterRange( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id),0, (int)$cond[1], false );\n \n } break;\n \n \n default:\n {\n eZDebug::writeError( \"Conditional operator '$cond[0]' is not supported.\",'eZSphinx::search()' );\n } break;\n }\n\n }\n } else {\n \t$cl->SetFilter( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) , array($cond) ); \t\n }\n \t}\n }\n\t\t\n // Sphinx field weightning\n if (isset($params['FieldWeight']) and is_array($params['FieldWeight']) and count($params['FieldWeight']) > 0)\n {\n \t$tmpFields = array();\n \tforeach ($params['FieldWeight'] as $classAttributeID => $weight)\n \t{\n \t\t$tmpFields['attr_srch_pos'.$this->getPositionClassAttribute($classAttributeID)] = $weight;\n \t} \n \t$cl->SetFieldWeights($tmpFields);\n \tunset($tmpFields);\n }\n \n \n // this will work only if SPH_MATCH_EXTENDED mode is set\n $AppendExtendQuery = '';\n if (isset($params['MatchType']) and key_exists($params['MatchType'],$matchModes) and $matchModes[$params['MatchType']] == SPH_MATCH_EXTENDED)\n {\n \t$searchClassAttributeID = isset($params['SearchClassAttributeID']) ? $params['SearchClassAttributeID'] : 0 ; \n\t if ( is_numeric( $searchClassAttributeID ) and $searchClassAttributeID > 0 )\n\t {\n\t \t $AppendExtendQuery = '@attr_srch_pos'.$this->getPositionClassAttribute((int)$searchClassAttributeID).' ';\n\t }\n\t else if ( is_array( $searchClassAttributeID ) )\n\t { \n\t \n\t $SubElements = array();\n\t foreach ($searchClassAttributeID as $ClassAttributeID)\n\t {\n\t \t$SubElements[] = 'attr_srch_pos'.$this->getPositionClassAttribute($ClassAttributeID);\n\t }\n\t \t$AppendExtendQuery = '@('.implode(',',$SubElements).') ';\t \n\t }\n }\n \n // Transofrm without special characters like i understood. Actualy in sphinx it's not needed. But like indexing converts them to normalized text, it will be changed in futher versions..\n $trans = eZCharTransform::instance();\n $searchText = $trans->transformByGroup( $searchText, 'search' ); \n\t \t$result = $cl->Query( $AppendExtendQuery.trim($searchText) , isset($params['IndexName']) ? $params['IndexName'] : $this->SphinxIndexName );\n\t \t\t\n\t \t// If nothing found return immediately \t\n\t \tif ($result['total_found'] == 0)\n\t \t{\t \t\n\t\t \treturn array( \"SearchResult\" => array(),\n\t \"SearchCount\" => 0,\n\t \"StopWordArray\" => array() );\n\t \t} \n\t \t\n\t \t$NodeIDList = array();\n\t \n\t \t$SingleNodeID = null;\n\t \t\n\t \tif ($result['total_found'] > 1)\n\t \t{\n\t\t \t// Build nodes ID's\n\t\t \tforeach ($result['matches'] as $match)\n\t\t \t{ \t\t\n\t\t \t\t$NodeIDList[$match['attrs']['node_id']] = $match['attrs']['node_id'];\n\t\t \t}\n\t \t} else {\n\t \t\t\tforeach ($result['matches'] as $match)\n\t\t\t \t{\t \t\t\n\t\t\t \t\t$NodeIDList = $match['attrs']['node_id'];\n\t\t\t \t\t$SingleNodeID = $match['attrs']['node_id'];\n\t\t\t \t}\n\t \t}\n\t \t\n\t \t\n\t \t$nodeRowList = array();\n \t\t$tmpNodeRowList = eZContentObjectTreeNode::fetch( $NodeIDList, false, isset($params['AsObjects']) ? $params['AsObjects'] : true );\n \t\t \t\n // Workaround for eZContentObjectTreeNode::fetch behaviour\n if ( count( $tmpNodeRowList ) === 1 )\n {\n $tmpNodeRowList = array( $tmpNodeRowList ); \n unset($NodeIDList); \n $NodeIDList = array();\n $NodeIDList[$SingleNodeID] = $SingleNodeID;\n }\n \n // If fetched objects, keeps fetched sorting as Sphinx returned it\n if (!isset($params['AsObjects']) || $params['AsObjects'] === true)\n { \n\t\t\tforeach ($tmpNodeRowList as $node)\n\t\t\t{\n\t\t\t\t$NodeIDList[$node->attribute('node_id')] = $node;\n\t\t\t}\n } else { // If fetched array\n \tforeach ($tmpNodeRowList as $node)\n\t\t\t{\n\t\t\t\t$NodeIDList[$node['node_id']] = $node;\n\t\t\t}\n } \n \tunset($tmpNodeRowList);\n \t \t\n\t \t$searchResult = array(\n\t \t\t'SearchCount' => $result['total_found'],\n\t \t\t'SearchResult' => $NodeIDList,\n\t \t\t'SearchTook' => $result['time'],\n\t \t\t\"StopWordArray\" => array() // Perhaps anyone nows how to set this ? :)\n\t \t);\n \n return $searchResult; \n }", "public static function search($search, $replace = null, $languageID = null, $useRegex = 0, $searchVariableName = 0) {\n\t\t$results = array();\n\t\t\n\t\t// build condition\n\t\t$conditionBuilder = new PreparedStatementConditionBuilder();\n\t\t\n\t\t\n\t\t// search field\n\t\t$statementParameters = array();\n\t\tif ($searchVariableName) $searchCondition = 'languageItem ';\n\t\telse $searchCondition = 'languageItemValue ';\n\t\t\n\t\t// regex\n\t\tif ($useRegex) {\n\t\t\t$searchCondition .= \"REGEXP ?\";\n\t\t\t$statementParameters[] = $search;\n\t\t}\n\t\telse {\n\t\t\t$searchCondition .= \"LIKE ?\";\n\t\t\t$statementParameters[] = '%'.$search.'%';\n\t\t}\n\t\t\n\t\tif (!$searchVariableName) {\n\t\t\t$searchCondition .= ' OR languageCustomItemValue ';\n\t\t\t// regex\n\t\t\tif ($useRegex) {\n\t\t\t\t$searchCondition .= \"REGEXP ?\";\n\t\t\t\t$statementParameters[] = $search;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$searchCondition .= \"LIKE ?\";\n\t\t\t\t$statementParameters[] = '%'.$search.'%';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$conditionBuilder->add($searchCondition, $statementParameters);\n\t\t$conditionBuilder->add(\"packageID IN (?)\", array(PackageDependencyHandler::getDependencies()));\n\t\tif ($languageID !== null) $conditionBuilder->add(\"languageID = ?\", array($languageID));\n\t\t\n\t\t// search\n\t\t$updatedItems = array();\n\t\t$sql = \"SELECT\t\t*\n\t\t\tFROM\t\twcf\".WCF_N.\"_language_item\n\t\t\t\".$conditionBuilder;\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute($conditionBuilder->getParameters());\n\t\t\n\t\twhile ($row = $statement->fetchArray()) {\n\t\t\tif ($replace !== null) {\n\t\t\t\t// search and replace\n\t\t\t\t$matches = 0;\n\t\t\t\tif ($useRegex) {\n\t\t\t\t\t$newValue = preg_replace('~'.$search.'~s'.(!$caseSensitive ? 'i' : ''), $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), -1, $matches);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($caseSensitive) $newValue = StringUtil::replace($search, $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), $matches);\n\t\t\t\t\telse $newValue = StringUtil::replaceIgnoreCase($search, $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), $matches);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($matches > 0) {\n\t\t\t\t\t// update value\n\t\t\t\t\tif (!isset($updatedItems[$row['languageID']])) $updatedItems[$row['languageID']] = array();\n\t\t\t\t\tif (!isset($updatedItems[$row['languageID']][$row['languageCategoryID']])) $updatedItems[$row['languageID']][$row['languageCategoryID']] = array();\n\t\t\t\t\t$updatedItems[$row['languageID']][$row['languageCategoryID']][$row['languageItem']] = $newValue;\n\t\t\t\t\t\n\t\t\t\t\t// save matches\n\t\t\t\t\t$row['matches'] = $matches;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$results[] = $row;\n\t\t}\n\t\t\n\t\t// save updates\n\t\tif (count($updatedItems) > 0) {\n\t\t\tforeach ($updatedItems as $languageID => $categories) {\n\t\t\t\t$language = new LanguageEditor($languageID);\n\t\t\t\t\n\t\t\t\tforeach ($categories as $categoryID => $items) {\n\t\t\t\t\t$useCustom = array();\n\t\t\t\t\tforeach (array_keys($items) as $item) {\n\t\t\t\t\t\t$useCustom[$item] = 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$category = new LanguageCategory($categoryID);\n\t\t\t\t\t$language->updateItems($items, $category, PACKAGE_ID, $useCustom);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "function resourcesSearch($args)\n {\n if(!array_key_exists('search', $args))\n {\n throw new Exception('Parameter search is not defined', MIDAS_INVALID_PARAMETER);\n }\n $userDao = $this->_getUser($args);\n\n $order = 'view';\n if(isset($args['order']))\n {\n $order = $args['order'];\n }\n return $this->Component->Search->searchAll($userDao, $args['search'], $order);\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('property_detail_id',$this->property_detail_id);\n\t\t$criteria->compare('property_id',$this->property_id);\n\t\t$criteria->compare('stories',$this->stories,true);\n\t\t$criteria->compare('spa',$this->spa);\n\t\t$criteria->compare('apt_suite',$this->apt_suite,true);\n\t\t$criteria->compare('amenities_stove_id',$this->amenities_stove_id);\n\t\t$criteria->compare('amenities_refrigerator',$this->amenities_refrigerator);\n\t\t$criteria->compare('amenities_dishwasher',$this->amenities_dishwasher);\n\t\t$criteria->compare('amenities_washer_id',$this->amenities_washer_id);\n\t\t$criteria->compare('amenities_fireplace_id',$this->amenities_fireplace_id);\n\t\t$criteria->compare('amenities_parking_id',$this->amenities_parking_id);\n\t\t$criteria->compare('amenities_microwave',$this->amenities_microwave);\n\t\t$criteria->compare('amenities_gated_community',$this->amenities_gated_community);\n\t\t$criteria->compare('photo2',$this->photo2,true);\n\t\t$criteria->compare('caption2',$this->caption2,true);\n\t\t$criteria->compare('photo3',$this->photo3,true);\n\t\t$criteria->compare('caption3',$this->caption3,true);\n\t\t$criteria->compare('photo4',$this->photo4,true);\n\t\t$criteria->compare('caption4',$this->caption4,true);\n\t\t$criteria->compare('photo5',$this->photo5,true);\n\t\t$criteria->compare('caption5',$this->caption5,true);\n\t\t$criteria->compare('interior_features',$this->interior_features,true);\n\t\t$criteria->compare('exterior_features',$this->exterior_features,true);\n\t\t$criteria->compare('first_sale_type',$this->first_sale_type);\n\t\t$criteria->compare('second_sale_type',$this->second_sale_type);\n\t\t$criteria->compare('property_repair_price',$this->property_repair_price);\n\t\t$criteria->compare('reference',$this->reference,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "function onIndexSearch(&$field, &$post, &$item)\n\t{\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\n\t\tif ( !$field->issearch ) return;\n\t\t\n\t\tFlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array('url'), $search_properties=array('title','author','description','videotype'), $properties_spacer=' ', $filter_func=null);\n\t\treturn true;\n\t}", "protected function saveListItems( \\Aimeos\\MShop\\Common\\Item\\ListRef\\Iface $item, $domain, $fetch = true )\n\t{\n\t\t$context = $this->getContext();\n\t\t$rmListIds = $rmIds = $refManager = [];\n\t\t$listManager = \\Aimeos\\MShop\\Factory::createManager( $context, $domain . '/lists' );\n\n\n\t\tforeach( $item->getListItemsDeleted() as $listItem )\n\t\t{\n\t\t\t$rmListIds[] = $listItem->getId();\n\n\t\t\tif( ( $refItem = $listItem->getRefItem() ) !== null ) {\n\t\t\t\t$rmIds[$listItem->getDomain()][] = $refItem->getId();\n\t\t\t}\n\t\t}\n\n\n\t\ttry\n\t\t{\n\t\t\tforeach( $rmIds as $refDomain => $ids )\n\t\t\t{\n\t\t\t\t$refManager[$refDomain] = \\Aimeos\\MShop\\Factory::createManager( $context, $refDomain );\n\t\t\t\t$refManager[$refDomain]->begin();\n\n\t\t\t\t$refManager[$refDomain]->deleteItems( $ids );\n\t\t\t}\n\n\t\t\t$listManager->deleteItems( $rmListIds );\n\n\n\t\t\tforeach( $item->getListItems( null, null, null, false ) as $listItem )\n\t\t\t{\n\t\t\t\tif( ( $refItem = $listItem->getRefItem() ) !== null )\n\t\t\t\t{\n\t\t\t\t\t$refDomain = $listItem->getDomain();\n\n\t\t\t\t\tif( !isset( $refManager[$refDomain] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$refManager[$refDomain] = \\Aimeos\\MShop\\Factory::createManager( $context, $refDomain );\n\t\t\t\t\t\t$refManager[$refDomain]->begin();\n\t\t\t\t\t}\n\n\t\t\t\t\t$refItem = $refManager[$refDomain]->saveItem( $refItem );\n\t\t\t\t\t$listItem->setRefId( $refItem->getId() );\n\t\t\t\t}\n\n\t\t\t\tif( $listItem->getParentId() != $item->getId() ) {\n\t\t\t\t\t$listItem->setId( null ); //create new list item if copied\n\t\t\t\t}\n\n\t\t\t\t$listItem->setParentId( $item->getId() );\n\t\t\t\t$listManager->saveItem( $listItem, $fetch );\n\t\t\t}\n\n\n\t\t\tforeach( $refManager as $manager ) {\n\t\t\t\t$manager->commit();\n\t\t\t}\n\t\t}\n\t\tcatch( \\Exception $e )\n\t\t{\n\t\t\tforeach( $refManager as $manager ) {\n\t\t\t\t$manager->rollback();\n\t\t\t}\n\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $item;\n\t}", "public abstract function search_items(\\WP_REST_Request $request);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description_short',$this->description_short,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\t\t$criteria->compare('friendly_url',$this->friendly_url,true);\n\t\t$criteria->compare('friendly_url_path',$this->friendly_url_path,true);\n\t\t$criteria->compare('friendly_url_path_hash',$this->friendly_url_path_hash,true);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('small_image_url',$this->small_image_url,true);\n\t\t$criteria->compare('large_image_url',$this->large_image_url,true);\n\t\t$criteria->compare('hidden',$this->hidden);\n\t\t$criteria->compare('closed',$this->closed);\n\t\t$criteria->compare('no_follow',$this->no_follow);\n\t\t$criteria->compare('display_columns',$this->display_columns);\n\t\t$criteria->compare('count',$this->count,true);\n\t\t$criteria->compare('count_total',$this->count_total,true);\n\t\t$criteria->compare('level',$this->level);\n\t\t$criteria->compare('left_',$this->left_);\n\t\t$criteria->compare('right_',$this->right_);\n\t\t$criteria->compare('parent_id',$this->parent_id,true);\n\t\t$criteria->compare('impressions',$this->impressions,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('import_id',$this->import_id);\n\t\t$criteria->compare('header_template_file',$this->header_template_file,true);\n\t\t$criteria->compare('footer_template_file',$this->footer_template_file,true);\n\t\t$criteria->compare('wrapper_template_file',$this->wrapper_template_file,true);\n\t\t$criteria->compare('results_template_file',$this->results_template_file,true);\n\t\t$criteria->compare('child_row_id',$this->child_row_id,true);\n\t\t$criteria->compare('impressions_search',$this->impressions_search,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('columns',$this->columns);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchItems( \\Aimeos\\MW\\Criteria\\Iface $filter, &$total = null )\n\t{\n\t\treturn $this->controller->searchItems( $filter, $total );\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('itemId',$this->itemId,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('itemParentId',$this->itemParentId,true);\n\t\t$criteria->compare('priority',$this->priority);\n\t\t$criteria->compare('ProductRelease',$this->ProductRelease,true);\n\t\t$criteria->compare('projectId',$this->projectId);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('deadlineDate',$this->deadlineDate,true);\n\t\t$criteria->compare('deadlinePrefix',$this->deadlinePrefix,true);\n\t\t$criteria->compare('expectedDuration',$this->expectedDuration);\n\t\t$criteria->compare('showInCalendar',$this->showInCalendar);\n\t\t$criteria->compare('showPrivate',$this->showPrivate);\n\t\t$criteria->compare('memberId',$this->memberId);\n\t\t$criteria->compare('authorId',$this->authorId);\n\t\t$criteria->compare('context',$this->context,true);\n\t\t$criteria->compare('product',$this->product,true);\n\t\t$criteria->compare('startDate',$this->startDate,true);\n\t\t$criteria->compare('designReview',$this->designReview,true);\n\t\t$criteria->compare('conceptReview',$this->conceptReview,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList(SearchCriteriaInterface $searchCriteria)\n {\n // TODO: Implement getList() method.\n }", "public function search($criteria='')\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\tif($criteria ===''){\n\t\t\t$criteria=new CDbCriteria;\n\t\t\t$criteria->compare('status','<>-1');\n\t\t\tif($this->search_time_type != '' && isset($this->__search_time_type[$this->search_time_type]))\n\t\t\t{\n\t\t\t\tif($this->search_start_time !='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->addBetweenCondition($this->__search_time_type[$this->search_time_type],strtotime($this->search_start_time),strtotime($this->search_end_time)+3600*24-1);\n\t\t\t\telseif($this->search_start_time !='' && $this->search_end_time =='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'>='.strtotime($this->search_start_time));\n\t\t\t\telseif($this->search_start_time =='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'<=' . (strtotime($this->search_end_time)+3600*24-1));\n\t\t\t}\t\t\t\n\t\t\t$criteria->compare('id',$this->id,true);\n\t\t\t$criteria->compare('items_id',$this->items_id,true);\n\t\t\t$criteria->compare('c_id',$this->c_id,true);\n\t\t\t$criteria->compare('agent_id',$this->agent_id,true);\n\t\t\t$criteria->compare('store_id',$this->store_id,true);\n\t\t\t$criteria->compare('img',$this->img,true);\n\t\t\t$criteria->compare('litimg',$this->litimg,true);\n\t\t\t$criteria->compare('sort',$this->sort);\n\t\t\t$criteria->compare('title',$this->title,true);\n\t\t\t$criteria->compare('alt',$this->alt,true);\n\t\t\t$criteria->compare('height',$this->height,true);\n\t\t\t$criteria->compare('with',$this->with,true);\n\t\t\tif($this->add_time != '')\n\t\t\t\t$criteria->addBetweenCondition('add_time',strtotime($this->add_time),(strtotime($this->add_time)+3600*24-1));\n\t\t\tif($this->up_time != '')\n\t\t\t\t$criteria->addBetweenCondition('up_time',strtotime($this->up_time),(strtotime($this->up_time)+3600*24-1));\n\t\t\t$criteria->compare('status',$this->status);\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n\t\t\t\t\t'pageSize'=>Yii::app()->params['admin_pageSize'],\n\t\t\t),\n\t\t\t'sort'=>array(\n\t\t\t\t\t'defaultOrder'=>'t.add_time desc', //设置默认排序\n\t\t\t),\n\t\t));\n\t}", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "function _sendSearch($criteria)\n {\n $names = '';\n $imspSearch = array();\n $searchkey = $criteria['field'];\n $searchval = $criteria['test'];\n $searchop = $criteria['op'];\n $hasName = false;\n $this->_noGroups = false;\n $cache = $GLOBALS['injector']->getInstance('Horde_Cache');\n $key = implode(\".\", array_merge($criteria, array($this->_bookName)));\n\n /* Now make sure we aren't searching on a dynamically created\n * field. */\n switch ($searchkey) {\n case 'fullname':\n if (!$hasName) {\n $searchkey = 'name';\n $hasName = true;\n } else {\n $searchkey = '';\n }\n break;\n\n case '__owner':\n if (!$this->params['contact_ownership']) {\n $searchkey = '';\n $hasName = true;\n }\n break;\n }\n\n /* Are we searching for only Turba_Object_Groups or Turba_Objects?\n * This is needed so the 'Show Lists' and 'Show Contacts'\n * links work correctly in Turba. */\n if ($searchkey == '__type') {\n switch ($searchval) {\n case 'Group':\n $searchkey = $this->_groupField;\n $searchval = $this->_groupValue;\n break;\n\n case 'Object':\n if (!$hasName) {\n $searchkey = 'name';\n $searchval = '';\n $hasName = true;\n } else {\n $searchkey = '';\n }\n $this->_noGroups = true;\n break;\n }\n }\n\n if (!$searchkey == '') {\n // Check $searchval for content and for strict matches.\n if (strlen($searchval) > 0) {\n if ($searchop == 'LIKE') {\n $searchval = '*' . $searchval . '*';\n }\n } else {\n $searchval = '*';\n }\n $imspSearch[$searchkey] = $searchval;\n }\n if (!count($imspSearch)) {\n $imspSearch['name'] = '*';\n }\n\n /* Finally get to the command. Check the cache first, since each\n * 'Turba' search may consist of a number of identical IMSP\n * searchaddress calls in order for the AND and OR parts to work\n * correctly. 15 Second lifetime should be reasonable for this. This\n * should reduce load on IMSP server somewhat.*/\n $results = $cache->get($key, 15);\n\n if ($results) {\n $names = unserialize($results);\n }\n\n if (!$names) {\n try {\n $names = $this->_imsp->search($this->_bookName, $imspSearch);\n $cache->set($key, serialize($names));\n return $names;\n } catch (Horde_Imsp_Exception $e) {\n $GLOBALS['notification']->push($names, 'horde.error');\n }\n } else {\n return $names;\n }\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('sample_id', $this->sample_id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('case_id', $this->case_id);\n $criteria->compare('date_rec', $this->date_rec, true);\n $criteria->compare('ext_inst_id', $this->ext_inst_id);\n $criteria->compare('ext_label', $this->ext_label, true);\n if (strlen($this->sample_preserve) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_preserve', $this->sample_preserve, true);\n }\n if (strlen($this->status) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('status', $this->status, true);\n }\n if ($this->researcher) {\n $criteria->compare('researcher', $this->researcher, true);\n }\n if (strlen($this->sample_type) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_type', $this->sample_type, true);\n }\n $criteria->compare('tissue_mion', $this->tissue_mion);\n $criteria->compare('tissue_loc_mion', $this->tissue_loc_mion);\n if (strlen($this->exp_design_sdb) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('exp_design_sdb', $this->exp_design_sdb, true);\n }\n $criteria->compare('tissue_sdb', $this->tissue_sdb, true);\n $criteria->compare('lib_id_sdb', $this->lib_id_sdb, true);\n if (strlen($this->sample_use) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_use', $this->sample_use, true);\n }\n $criteria->compare('note', $this->note, true);\n $criteria->compare('status_sdb', $this->status_sdb, true);\n $criteria->compare('antibody', $this->antibody, true);\n $criteria->compare('treatment', $this->treatment, true);\n $criteria->compare('knockdown', $this->knockdown, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => 25,\n ),\n ));\n }", "public function SearchCombatItems() {\n\t\t\t// Declare Classes\n\t\t\t$RepItem\t\t\t= new RepItem();\n\t\t\t$ModItem\t\t\t= new ModItem();\n\t\t\t// Intialize variables\n\t\t\t$return\t\t\t\t= '<br />(no Combat Items found)';\n\t\t\t// Get first 20 entries\n\t\t\t$result\t\t\t\t= $RepItem->getAllCombatItems(20);\n\t\t\t// If there are entries\n\t\t\tif ($result) {\n\t\t\t\t// Get Field names\n\t\t\t\t$RepQuestion\t= new RepQuestion();\n\t\t\t\t$fields\t\t\t= $RepQuestion->getAllFields();\n\t\t\t\t// Separate returned data an paging info\n\t\t\t\t$rows\t\t\t= $result[0];\n\t\t\t\t$paging_info\t= $result[1];\n\t\t\t\t// Model Result\n\t\t\t\t$return\t\t\t= $ModItem->listCombatItems($rows, $fields, 'i.id', 'ASC');\n\t\t\t\t// Define Pager info\n\t\t\t\t$pager\t\t\t= Pager::pagerOptions($paging_info, 'items', 'partialCombatResult');\n\t\t\t}\n\t\t\t// Define sub menu selection\n\t\t\t$GLOBALS['menu']['items']['opt2_css'] = 'details_item_on';\n\t\t\t// Prepare info to be displayed\n\t\t\tView::set('pager', $pager);\n\t\t\tView::set('return', $return);\n\t\t\t// render view\n\t\t\tView::render('usersSearch');\n \t\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\tif(isset($this->cSn)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.cSn', $this->cSn, true);\n\t\t}\n\t\tif(isset($this->sn)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.sn', $this->sn, true);\n\t\t}\n\t\tif(isset($this->status)){\n\t\t\t$criteria->with[]='thirdFees';\n\t\t\t$criteria->compare('thirdFees.status', $this->status);\n\t\t}\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('Uid',$this->Uid);\n\t\t$criteria->compare('colourSn',$this->colourSn,true);\n\t\t$criteria->compare('orderId',$this->orderId,true);\n\t\t$criteria->compare('receiver',$this->receiver,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact',$this->contact,true);\n\t\t$criteria->compare('addTime',$this->addTime,true);\n\t\t$criteria->compare('totalFee',$this->totalFee,true);\n\t\t$criteria->compare('voucherPrice',$this->voucherPrice,true);\n\t\t$criteria->compare('voucherCode',$this->voucherCode,true);\n\t\t$criteria->compare('statusTxt',$this->statusTxt,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('payPrice',$this->payPrice,true);\n\t\t$criteria->compare('totalPrice',$this->totalPrice,true);\n\t\t$criteria->compare('num',$this->num,true);\n\t\t$criteria->compare('createTime',$this->createTime,true);\n\t\t$criteria->compare('updateTime',$this->updateTime,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('service_general',$this->service_general,true);\n\t\t$criteria->compare('service_share',$this->service_share,true);\n\t\t$criteria->compare('service_business',$this->service_business,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\t\t$criteria->compare('create_user_id',$this->create_user_id);\n\t\t$criteria->compare('update_user_id',$this->update_user_id);\n\t\t$criteria->compare('image_header_1',$this->image_header_1,true);\n\t\t$criteria->compare('image_header_2',$this->image_header_2,true);\n\t\t$criteria->compare('image_header_3',$this->image_header_3,true);\n\t\t$criteria->compare('image_header_4',$this->image_header_4,true);\n\t\t$criteria->compare('image_header_5',$this->image_header_5,true);\n\t\t$criteria->compare('products_on_sales',$this->products_on_sales,true);\n\t\t$criteria->compare('less_than_1000',$this->less_than_1000,true);\n\t\t$criteria->compare('for_rent',$this->for_rent,true);\n\t\t$criteria->compare('for_options',$this->for_options,true);\n\t\t$criteria->compare('baby_products',$this->baby_products,true);\n\t\t$criteria->compare('groceries',$this->groceries,true);\n\t\t$criteria->compare('fashion_and_beauty',$this->fashion_and_beauty,true);\n\t\t$criteria->compare('office_products',$this->office_products,true);\n\t\t$criteria->compare('books_and_learning',$this->books_and_learning,true);\n\t\t$criteria->compare('smartphones',$this->smartphones,true);\n\t\t$criteria->compare('computers',$this->computers,true);\n\t\t$criteria->compare('wholesales_and_commodity',$this->wholesales_and_commodity,true);\n\t\t$criteria->compare('home_services',$this->home_services,true);\n\t\t$criteria->compare('advert_mini_header',$this->advert_mini_header,true);\n\t\t$criteria->compare('primary_books_and_learning',$this->primary_books_and_learning,true);\n\t\t$criteria->compare('secondary_books_and_learning',$this->secondary_books_and_learning,true);\n\t\t$criteria->compare('tertiary_books_and_learning',$this->tertiary_books_and_learning,true);\n\t\t$criteria->compare('professional_books_and_learning',$this->professional_books_and_learning,true);\n\t\t$criteria->compare('other_books_and_learning',$this->other_books_and_learning,true);\n\t\t$criteria->compare('learning_tools_and_learning',$this->learning_tools_and_learning,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_inmobiliaria',$this->id_inmobiliaria);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('title_header',$this->title_header,true);\n\t\t$criteria->compare('content',$this->content,true);\n\t\t$criteria->compare('title_footer',$this->title_footer,true);\n\t\t$criteria->compare('legales',$this->legales,true);\n\t\t$criteria->compare('img_background',$this->img_background,true);\n\t\t$criteria->compare('img_1',$this->img_1,true);\n\t\t$criteria->compare('img_2',$this->img_2,true);\n\t\t$criteria->compare('imag_3',$this->imag_3,true);\n\t\t$criteria->compare('color_head',$this->color_head,true);\n\t\t$criteria->compare('color_foot',$this->color_foot,true);\n\t\t$criteria->compare('color_legales',$this->color_legales,true);\n\t\t$criteria->compare('font1',$this->font1,true);\n\t\t$criteria->compare('font2',$this->font2,true);\n\t\t$criteria->compare('color_msg',$this->color_msg,true);\n\t\t$criteria->compare('adwords',$this->adwords,true);\n\t\t$criteria->compare('facebook',$this->facebook,true);\n\t\t$criteria->compare('font_header_google',$this->font_header_google,true);\n\t\t$criteria->compare('font_family_header',$this->font_family_header,true);\n\t\t$criteria->compare('font_footer_google',$this->font_footer_google,true);\n\t\t$criteria->compare('font_family_footer',$this->font_family_footer,true);\n\t\t$criteria->compare('font_content_google',$this->font_content_google,true);\n\t\t$criteria->compare('font_family_content',$this->font_family_content,true);\n\t\t$criteria->compare('allow_select',$this->allow_select,true);\n\t\t$criteria->compare('lbl_select',$this->lbl_select,true);\n\t\t$criteria->compare('content_select',$this->content_select,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('show_states',$this->show_states,true);\n\t\t$criteria->compare('url_landing_name',$this->url_landing_name,true);\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pageSize'=>20),\n\t\t));\n\t}", "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{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cdos',$this->cdos,true);\n\t\t$criteria->compare('cus',$this->cus,true);\n\t\t$criteria->compare('nam',$this->nam,true);\n\t\t$criteria->compare('sur',$this->sur,true);\n\t\t$criteria->compare('mid',$this->mid,true);\n\t\t$criteria->compare('otn',$this->otn,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('telephone',$this->telephone,true);\n\t\t$criteria->compare('dbir',$this->dbir,true);\n\t\t$criteria->compare('mna',$this->mna,true);\n\t\t$criteria->compare('fna',$this->fna,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('res',$this->res,true);\n\t\t$criteria->compare('tcus',$this->tcus,true);\n\t\t$criteria->compare('resnam',$this->resnam,true);\n\t\t$criteria->compare('rso',$this->rso,true);\n\t\t$criteria->compare('breg',$this->breg,true);\n\t\t$criteria->compare('tpc',$this->tpc,true);\n\t\t$criteria->compare('qua',$this->qua,true);\n\t\t$criteria->compare('sal',$this->sal);\n\t\t$criteria->compare('ca',$this->ca);\n\t\t$criteria->compare('town',$this->town,true);\n\t\t$criteria->compare('tbir',$this->tbir,true);\n\t\t$criteria->compare('pro',$this->pro,true);\n\t\t$criteria->compare('sec',$this->sec,true);\n\t\t$criteria->compare('sta',$this->sta,true);\n\t\t$criteria->compare('proc',$this->proc,true);\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('idis',$this->idis,true);\n\t\t$criteria->compare('idid',$this->idid,true);\n\t\t$criteria->compare('ided',$this->ided,true);\n\t\t$criteria->compare('psp',$this->psp,true);\n\t\t$criteria->compare('pspis',$this->pspis,true);\n\t\t$criteria->compare('pspid',$this->pspid,true);\n\t\t$criteria->compare('psped',$this->psped,true);\n\t\t$criteria->compare('dcre',$this->dcre,true);\n\t\t$criteria->compare('uti',$this->uti,true);\n\t\t$criteria->compare('utimo',$this->utimo,true);\n\t\t$criteria->compare('dou',$this->dou,true);\n\t\t$criteria->compare('dmo',$this->dmo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList(SearchCriteriaInterface $searchCriteria)\n {\n /**\n * @var \\Inchoo\\NewsWithComments\\Model\\ResourceModel\\News\\Collection $collection\n*/\n $collection = $this->newsCollectionFactory->create();\n\n $this->collectionProcessor->process($searchCriteria, $collection);\n\n /**\n * @var Data\\NewsSearchResultsInterface $searchResults\n*/\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($searchCriteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n return $searchResults;\n }", "public function get_criteria() { return $this->criteria_list; }", "public function search() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->search();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function search($criteria='')\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\tif($criteria ===''){\n\t\t\t$criteria=new CDbCriteria;\n\t\t\t$criteria->compare('status','<>-1');\n\t\t\tif($this->search_time_type != '' && isset($this->__search_time_type[$this->search_time_type]))\n\t\t\t{\n\t\t\t\tif($this->search_start_time !='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->addBetweenCondition($this->__search_time_type[$this->search_time_type],strtotime($this->search_start_time),strtotime($this->search_end_time)+3600*24-1);\n\t\t\t\telseif($this->search_start_time !='' && $this->search_end_time =='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'>='.strtotime($this->search_start_time));\n\t\t\t\telseif($this->search_start_time =='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'<=' . (strtotime($this->search_end_time)+3600*24-1));\n\t\t\t}\t\t\t\n\t\t\t$criteria->compare('id',$this->id,true);\n\t\t\t$criteria->compare('store_id',$this->store_id,true);\n\t\t\t$criteria->compare('agent_id',$this->agent_id,true);\n\t\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t\t$criteria->compare('c_id',$this->c_id,true);\n\t\t\t$criteria->compare('name',$this->name,true);\n\t\t\t$criteria->compare('info',$this->info,true);\n\t\t\t$criteria->compare('number',$this->number,true);\n\t\t\t$criteria->compare('price',$this->price,true);\n\t\t\tif($this->add_time != '')\n\t\t\t\t$criteria->addBetweenCondition('add_time',strtotime($this->add_time),(strtotime($this->add_time)+3600*24-1));\n\t\t\tif($this->up_time != '')\n\t\t\t\t$criteria->addBetweenCondition('up_time',strtotime($this->up_time),(strtotime($this->up_time)+3600*24-1));\n\t\t\t$criteria->compare('status',$this->status);\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n\t\t\t\t\t'pageSize'=>Yii::app()->params['admin_pageSize'],\n\t\t\t),\n\t\t\t'sort'=>array(\n\t\t\t\t\t'defaultOrder'=>'t.add_time desc', //设置默认排序\n\t\t\t),\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->with = \"customer\";\n\n $criteria->compare('item_id', $this->item_id);\n $criteria->compare('customer_id', $this->customer_id);\n $criteria->compare('item_name', $this->item_name, true);\n $criteria->compare('item_seo_name', $this->item_seo_name, true);\n $criteria->compare('item_ingredients', $this->item_ingredients, true);\n $criteria->compare('item_image', $this->item_image, true);\n $criteria->compare('item_description', $this->item_description, true);\n $criteria->compare('item_created_at', $this->item_created_at, true);\n\n //Add search function to related\n $criteria->compare('customer.customer_name', $this->customer_search, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(//add sorting to related model\n 'attributes' => array(\n 'customer_search' => array(\n 'asc' => 'customer.customer_name',\n 'desc' => 'customer.customer_name DESC',\n ),\n '*', //* means treat other fields normally\n ),\n ),\n ));\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n /** @var \\Mageplaza\\Productslider\\Model\\ResourceModel\\Slider\\Collection $collection */\n $collection = $this->sliderCollectionFactory->create();\n\n $this->collectionProcessor->process($searchCriteria, $collection);\n\n /** @var Data\\SliderSearchResultsInterface $searchResults */\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($searchCriteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n\n return $searchResults;\n }", "public function onIndexSearch(&$field, &$post, &$item)\n\t{\n\t\tif (!in_array($field->field_type, static::$field_types)) return;\n\t\tif (!$field->issearch) return;\n\n\t\tif ($post === null)\n\t\t{\n\t\t\t$values = null;\n\t\t\t$field->field_valuesselect = ' fi.value_integer AS value_id, ct.title AS value';\n\t\t\t$field->field_valuesjoin = ' JOIN #__content AS ct ON ct.id = fi.value_integer';\n\t\t\t$field->field_groupby = ' GROUP BY fi.value_integer ';\n\t\t}\n\t\telse if (!empty($post))\n\t\t{\n\t\t\t$_ids = array();\n\t\t\tforeach ($post as $_id) $_ids[] = (int) $_id; // convert itemID:catID to itemID\n\t\t\t$db = Factory::getDbo();\n\t\t\t$query = 'SELECT i.id AS value_id, i.title AS value FROM #__content AS i WHERE i.id IN (' . implode(',', $_ids) . ')';\n\t\t\t$_values = $db->setQuery($query)->loadAssocList();\n\t\t\t$values = array();\n\t\t\tforeach ($_values as $v) $values[$v['value_id']] = $v['value'];\n\t\t}\n\n\t\t//Factory::getApplication()->enqueueMessage('BAS: '.print_r($values, true), 'notice');\n\t\tFlexicontentFields::onIndexSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func = null);\n\n\t\treturn true;\n\t}", "public function lstCursoDocente_GetItems() {\n\t\t\t$a = array();\n\t\t\t$objCondition = $this->objCursoDocenteCondition;\n\t\t\tif (is_null($objCondition)) $objCondition = QQ::All();\n\t\t\t$objCursoDocenteCursor = CursoDocente::QueryCursor($objCondition, $this->objCursoDocenteClauses);\n\n\t\t\t// Iterate through the Cursor\n\t\t\twhile ($objCursoDocente = CursoDocente::InstantiateCursor($objCursoDocenteCursor)) {\n\t\t\t\t$objListItem = new QListItem($objCursoDocente->__toString(), $objCursoDocente->CursoDocenteId);\n\t\t\t\tif (($this->objListaCurso->CursoDocente) && ($this->objListaCurso->CursoDocente->CursoDocenteId == $objCursoDocente->CursoDocenteId))\n\t\t\t\t\t$objListItem->Selected = true;\n\t\t\t\t$a[] = $objListItem;\n\t\t\t}\n\t\t\treturn $a;\n\t\t }", "function onIndexSearch(&$field, &$post, &$item)\r\n\t{\r\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\r\n\t\tif ( !$field->issearch ) return;\r\n\t\t\r\n\t\tFlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func='strip_tags');\r\n\t\treturn true;\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('staff_id',$this->staff_id);\n\t\t$criteria->compare('recruitment_id',$this->recruitment_id);\n\t\t$criteria->compare('staff_inspur_id',$this->staff_inspur_id,true);\n\t\t$criteria->compare('staff_name',$this->staff_name,true);\n\t\t$criteria->compare('staff_en_name',$this->staff_en_name,true);\n\t\t$criteria->compare('staff_age',$this->staff_age);\n\t\t$criteria->compare('staff_contact_number',$this->staff_contact_number,true);\n\t\t$criteria->compare('staff_id_card',$this->staff_id_card,true);\n\t\t$criteria->compare('staff_work_status',$this->staff_work_status);\n\t\t$criteria->compare('source_types',$this->source_types);\n\t\t$criteria->compare('source',$this->source,true);\n\t\t$criteria->compare('bank_card',$this->bank_card,true);\n\t\t$criteria->compare('avatar_path',$this->avatar_path,true);\n\t\t$criteria->compare('educational_level',$this->educational_level);\n\t\t$criteria->compare('graduated_school',$this->graduated_school,true);\n\t\t$criteria->compare('hometown',$this->hometown,true);\n\t\t$criteria->compare('hometown_address',$this->hometown_address,true);\n\t\t$criteria->compare('emergency_contact',$this->emergency_contact,true);\n\t\t$criteria->compare('emergency_telephone',$this->emergency_telephone,true);\n\t\t$criteria->compare('other',$this->other,true);\n\t\t$criteria->compare('create_user_id',$this->create_user_id);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_user_id',$this->update_user_id);\n\t\t$criteria->compare('update_time',$this->update_time);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "protected function getListQuery()\t{\n\t\t\n\t\t\n\t\t// Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t\n\t\t// Select all fields from the table.\n\t\t$query->select($this->getState('list.select', 'ct.*'));\n\t\t$query->from($db->quoteName('#__content').' AS ct');\n\t\t\n\t\t$query->join('INNER', $db->quoteName('#__jbusinessdirectory_company_articles').' AS ca on ct.id = ca.article_id');\n\t\t\n\t\t$query->select(\"c.name as company_name\");\n\t\t$query->join('INNER', $db->quoteName('#__jbusinessdirectory_companies').' AS c on c.id = ca.company_id');\n\t\t\n\t\t// Join over the users for the author.\n\t\t$query->select('ua.name AS author_name')\n\t\t->join('LEFT', '#__users AS ua ON ua.id = ct.created_by');\n\t\t\n\t\t$user = JFactory::getUser();\n\t\t$query->where(\"c.userId = \".$user->id);\n\t\t\n\t\t// Filter by search in title.\n\t\t$search = $this->getState('filter.search');\n\t\tif (!empty($search)) {\n\t\t $query->where(\"ct.title LIKE '%\".trim($db->escape($search)).\"%' or c.name LIKE '%\".trim($db->escape($search)).\"%'\");\n\t\t}\n\t\t\n\t\t$query->group('ct.id');\n\t\t\n\t\t// Add the list ordering clause.\n\t\t$query->order($db->escape($this->getState('list.ordering', 'ct.id')).' '.$db->escape($this->getState('list.direction', 'DESC')));\n\t\t\n\t\treturn $query;\n\t}", "public function setItems(array $items): ExportEntitySearchResultsInterface;", "public function search_all($type=\"*\",$attr=\"*\",$val=\"*\"){\n\t\t$data=array();\n\t\tif ($this->is_eligable($type, $attr, $val)){\n\t\t\tarray_push($data,$this);\n\t\t}\n\t\t//region for weather to add self or not end^^\n\t\t$local_data=$data;\n\t\t\n\t\tforeach($this->content as $item){\n\t\t\tif(isset($item->content)){\n\t\t\t\t$retrived_content=$item->search_all($type,$attr,$val);\n\t\t\t\tif (isset($retrived_content)){\n\t\t\t\t\t$local_data=array_merge($local_data,$retrived_content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (sizeof($local_data)!=0){\n\t\t\treturn $local_data;\n\t\t}\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\n\t\t$criteria->compare('process_id',$this->process_id,true);\n\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\n\t\t$criteria->compare('functionality',$this->functionality,true);\n\n\t\t$criteria->compare('user_interface',$this->user_interface,true);\n\n\t\t$criteria->compare('external_interfaces',$this->external_interfaces,true);\n\n\t\t$criteria->compare('reliability',$this->reliability,true);\n\n\t\t$criteria->compare('efficiency',$this->efficiency,true);\n\n\t\t$criteria->compare('maintenance',$this->maintenance,true);\n\n\t\t$criteria->compare('portability',$this->portability,true);\n\n\t\t$criteria->compare('limitations',$this->limitations,true);\n\n\t\t$criteria->compare('interoperability',$this->interoperability,true);\n\n\t\t$criteria->compare('reuse',$this->reuse,true);\n\n\t\t$criteria->compare('legal',$this->legal,true);\n\n\t\t$criteria->compare('sent',$this->sent);\n\n\t\t$criteria->compare('project_manager_validated',$this->project_manager_validated);\n\n\t\t$criteria->compare('technical_leader_validated',$this->technical_leader_validated);\n\n\t\t$criteria->compare('change_request',$this->change_request);\n\n\t\t$criteria->compare('change_request_details',$this->change_request_details,true);\n\n\t\treturn new CActiveDataProvider('software_requirements', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchItems( \\Aimeos\\MW\\Criteria\\Iface $search, array $ref = [], int &$total = null ) : \\Aimeos\\Map\n\t{\n\t\t$dbm = $this->getContext()->getDatabaseManager();\n\t\t$dbname = $this->getResourceName();\n\t\t$conn = $dbm->acquire( $dbname );\n\t\t$map = [];\n\n\t\ttry\n\t\t{\n\t\t\t$level = \\Aimeos\\MShop\\Locale\\Manager\\Base::SITE_ALL;\n\t\t\t$cfgPathSearch = 'mshop/customer/manager/laravel/search';\n\t\t\t$cfgPathCount = 'mshop/customer/manager/laravel/count';\n\t\t\t$ref[] = 'customer/group';\n\t\t\t$required = ['customer'];\n\n\t\t\t$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );\n\n\t\t\twhile( ( $row = $results->fetch() ) !== null ) {\n\t\t\t\t$map[(string) $row['customer.id']] = $row;\n\t\t\t}\n\n\t\t\t$dbm->release( $conn, $dbname );\n\t\t}\n\t\tcatch( \\Exception $e )\n\t\t{\n\t\t\t$dbm->release( $conn, $dbname );\n\t\t\tthrow $e;\n\t\t}\n\n\t\t$addrItems = [];\n\t\tif( in_array( 'customer/address', $ref, true ) ) {\n\t\t\t$addrItems = $this->getAddressItems( array_keys( $map ), 'customer' );\n\t\t}\n\n\t\t$propItems = []; $name = 'customer/property';\n\t\tif( isset( $ref[$name] ) || in_array( $name, $ref, true ) )\n\t\t{\n\t\t\t$propTypes = isset( $ref[$name] ) && is_array( $ref[$name] ) ? $ref[$name] : null;\n\t\t\t$propItems = $this->getPropertyItems( array_keys( $map ), 'customer', $propTypes );\n\t\t}\n\n\t\treturn $this->buildItems( $map, $ref, 'customer', $addrItems, $propItems );\n\t}", "function elggx_get_containing_lists($entity, array $options = array()) {\n\tif ($entity instanceof ElggEntity) {\n\t\t$entity = $entity->guid;\n\t}\n\n\t$entity = (int)$entity;\n\n\t$relationship_prefix = Elggx_Lists_List::RELATIONSHIP_PREFIX;\n\t$len_relationship_prefix = strlen($relationship_prefix);\n\n\t$relationship_prefix_escaped = \"'\" . sanitize_string($relationship_prefix) . \"'\";\n\n\t$options = array_merge(array(\n\t\t'limit' => 50,\n\t\t'offset' => 0,\n\t\t'count' => false,\n\t), $options);\n\n\t$limit_expression = \"\";\n\tif ($options['count']) {\n\t\t$select_values = \"COUNT(*) AS cnt\";\n\t\t$order_by_expression = \"\";\n\t} else {\n\t\t$select_values = \"SUBSTRING({KEY}, 1 + $len_relationship_prefix) AS coll_name, {ENTITY_GUID} AS coll_entity_guid\";\n\t\t$order_by_expression = \"ORDER BY {TIME} DESC, {KEY}\";\n\n\t\tif ($options['limit']) {\n\t\t\t$limit = sanitise_int($options['limit'], false);\n\t\t\t$offset = sanitise_int($options['offset'], false);\n\t\t\t$limit_expression = \"LIMIT $offset, $limit\";\n\t\t}\n\t}\n\n\t$sql = \"\n\t\tSELECT $select_values\n\t\tFROM {TABLE}\n\t\tWHERE {ITEM} = $entity\n\t\t AND LEFT({KEY}, $len_relationship_prefix) = $relationship_prefix_escaped\n\t\t$order_by_expression\n\t\t$limit_expression\n\t\";\n\n\t$sql = strtr($sql, array(\n\t\t'{TABLE}' => elgg_get_config('dbprefix') . Elggx_Lists_List::TABLE_UNPREFIXED,\n\t\t'{PRIORITY}' => Elggx_Lists_List::COL_PRIORITY,\n\t\t'{ITEM}' => Elggx_Lists_List::COL_ITEM,\n\t\t'{KEY}' => Elggx_Lists_List::COL_KEY,\n\t\t'{TIME}' => Elggx_Lists_List::COL_TIME,\n\t\t'{ENTITY_GUID}' => Elggx_Lists_List::COL_ENTITY_GUID,\n\t));\n\n\tif ($options['count']) {\n\t\t$row = get_data_row($sql);\n\t\treturn $row ? $row->cnt : 0;\n\t} else {\n\t\t$colls = array();\n\t\tforeach ((array)get_data($sql) as $row) {\n\t\t\t$colls[] = new Elggx_Lists_List($row->coll_entity_guid, $row->coll_name);\n\t\t}\n\t\treturn $colls;\n\t}\n}", "function getSearchTerms(ProductInterface $product);" ]
[ "0.5818856", "0.58165693", "0.57581705", "0.5684947", "0.5327979", "0.5296521", "0.5296521", "0.5296521", "0.52946943", "0.52834517", "0.52496", "0.5202791", "0.5162375", "0.5162375", "0.5162375", "0.5162375", "0.5162375", "0.5162375", "0.5162375", "0.5162375", "0.5159801", "0.51233685", "0.5122787", "0.50261354", "0.5013819", "0.496222", "0.49144146", "0.4904935", "0.48992342", "0.48694277", "0.48533347", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48437452", "0.48381424", "0.48255056", "0.48247644", "0.48246285", "0.48224437", "0.47923902", "0.4776263", "0.47724319", "0.47707117", "0.47668946", "0.47646567", "0.4750105", "0.47373262", "0.47007355", "0.4699447", "0.46787873", "0.46763036", "0.46621916", "0.46523273", "0.4649925", "0.46441075", "0.46328798", "0.46325356", "0.46240297", "0.46192685", "0.46179312", "0.4615161", "0.4603013", "0.4595466", "0.45903102", "0.45877987", "0.4581678", "0.4569096", "0.45635208", "0.45614105", "0.4543921", "0.45419276", "0.45411608", "0.45390448", "0.45359012", "0.45354515", "0.45342934", "0.45324853", "0.452458", "0.4524451", "0.45137838", "0.45112014", "0.45105165", "0.45081902", "0.44999263", "0.44988984", "0.44982007", "0.4496747", "0.44925418", "0.4491154", "0.44901782", "0.4489479" ]
0.65504795
0
fetch all pictures from db
function get_all_pics(){ $all_pics = $this->db->get('pictures'); return $all_pics->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getImages()\n {\n $res=array();\n $this->objTable = new Model($this->getLangAndID['lang'].'_slide_image');\n $select = array('id','title','description','slide_id','src_link','order_by','avatar');\n $this->objTable->where('slide_id',$this->id);\n $this->objTable->where('idw',$this->idw);\n $data = $this->objTable->get(null,null,$select);\n \n return $data; \n }", "protected function fetchAllImages(){\n $this->fetchImagesInContent();\n $this->fetchFullTextImage();\n $this->fetchIntroImage();\n $this->fetchFirstImageInContent();\n }", "function getImages() {\n $bdd = getBdd();\n $users = $bdd->query('select IMG_PATH as path,'\n . ' USER_ID as user_id, REV_ID as rev_id'\n . ' from T_IMAGES')->fetchAll(PDO::FETCH_ASSOC);\n return $users;\n}", "function get_all_pictures(){\n\t\tglobal $con;\n\t\n\t\t$query = \"SELECT * FROM picture\";\n\t\t$result = mysqli_query($con, $query);\n\t\t$pictures = array();\n\t\t\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\t$picture = array();\n\t\t\t$picture['link'] = $row['link'];\n\t\t\t$picture['title'] = $row['title'];\n\t\t\t$picture['description'] = $row['description'];\n\t\t\t$pictures[$row['id']] = $picture;\n\t\t}\n\t\t\n\t\treturn $pictures;\n\t}", "public function getAllPhotos();", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function get_imgs(){\n\t\treturn $this->db->select()->from(\"slide\")->get()->result();\n\t}", "public function showAll()\n {\n $query = \"SELECT * FROM $this->tableName ORDER BY id DESC\";\n $statement = ConnectionHandler::getConnection()->prepare($query);\n $statement->execute();\n $statement->store_result();\n $statement->bind_result($id, $title, $type, $description, $calender, $owner, $rating);\n\n $query2 = \"SELECT count(id) FROM $this->tableName\";\n $statement2 = ConnectionHandler::getConnection()->prepare($query2);\n $statement2->execute();\n $statement2->store_result();\n $statement2->bind_result($idcount);\n $statement2->fetch();\n\n $view = new View('picture_all');\n $view->header();\n echo'<h2>All pictures</h2>';\n\n for ($i=0; $i < $idcount; $i++)\n {\n $statement->fetch();\n $_POST['id'] = $id;\n $_POST['type'] = $type;\n $_POST['title'] = $title;\n $_POST['description'] = $description;\n $_POST['calender'] = $calender;\n $_POST['ownerid'] = $owner;\n $userModel = new UserModel();\n $owner=($userModel->owner($owner));\n $_POST['owner'] = $owner;\n $pictureModel = new PictureModel();\n $rating=($pictureModel->rating($id));\n $_POST['rating'] = $rating;\n\n $userModel = new UserModel();\n $_POST['user'] = ($userModel->userid());\n \n $view = new View('picture_all');\n $view->content();\n }\n }", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function getAll() {\r\n $statement = \"\r\n SELECT * FROM bookillustrator;\r\n \";\r\n\r\n try {\r\n $statement = $this->db->query($statement);\r\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\r\n return $result;\r\n }\r\n catch(\\PDOException $e) {\r\n exit($e->getMessage());\r\n }\r\n }", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "public function getPhotos();", "function newstImages($db){\r\n\t\t$sql_newstImages = \"SELECT * FROM galery_photos ORDER BY ID DESC LIMIT 0,5\";\r\n\t\t$sql_newstImages_cmd = $db->prepare($sql_newstImages);\r\n\t\t$sql_newstImages_cmd->execute();\r\n\r\n\t\t$newstImages = $sql_newstImages_cmd->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\timageCard($newstImages);\r\n\t}", "public function cargar_imgs($anu){\n\n try{\n \n \n $pdo = AccesoDB::getCon();\n\n \n $sql = \"select img from img_anuncio where fk_id_anuncio = :anu\";\n \n \n \n\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":anu\", $anu, PDO::PARAM_INT);\n $stmt->execute();\n\n $response = $stmt->fetchAll();\n return $response;\n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); window.location='index.php';</script>\";\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 }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function findImages($page)\n {\n $username = \"root\";\n $password = \"root\";\n $url = \"localhost:3306\";\n $page = $page - 1;\n $start = $page * 10;\n\n $conn = new mysqli($url, $username, $password, \"eten\");\n\n if ($conn->connect_error) {\n echo \"<script>alert('数据库链接失败')</script>\";\n }\n $sCount = \"select count(gallery_id) from gallery\";\n $sql = \"select * from gallery LIMIT \" . $start . \",10\";//查找数据库\n\n $rsCount = $conn->query($sCount);\n if ($rsCount->num_rows > 0) {\n GalleryImpl::$nums=$rsCount->fetch_row()[0];\n }\n $rs = $conn->query($sql);\n if ($rs->num_rows > 0) {\n $rows = $rs->fetch_all();\n\n $rs->close();\n $conn->close();\n\n return $rows;\n }\n $rs->close();\n return null;\n }", "function get_all_photos($db, $idx, $batch, $cond='1') {\n\t $allphotos = array();\n\n\t $query = \"SELECT * FROM cards WHERE $cond and active=1 ORDER by id DESC LIMIT $idx, $batch\";\n\t \n\t \n\t $result = mysqli_query($db, $query) or die (\"Error Error! \" . mysqli_error($db). \" in query<br>$query\");\n\t \n\t while ($row = mysqli_fetch_array($result)) {\n \t$allphotos[] = $row;\n }\n\t\n return ($allphotos);\n}", "public function index()\n {\n return ImageEntity::all();\n }", "public function getImage($id){\n $id = strip_tags($id);\n\n $sql = \"SELECT * FROM image WHERE id = :id LIMIT 1\";\n $query = $this->db->prepare($sql);\n $parameters = array(':id' => $id);\n\n $query->execute($parameters);\n\n return $query->fetchAll();\n }", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "public function listImage()\n {\n $data = Image::all();\n return response()->json($data);\n return $this->showAll($image);\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "static public function getImagesfromCollectionID($theCollectionId){\n \n if ( ! Logger::isInitialized()){\n Logger::configure($_SERVER['DOCUMENT_ROOT'].'/log/LogConfig.xml');\n }\n $logger=Logger::getLogger(__CLASS__);\n $logger->trace(\"Enter\");\n $logger->trace(\"Get the images that belong to the collection id [ \" . $theCollectionId .\" ]\");\n $conn = new MySqlDAO(serverC, userC, pwdC, ddbbC);\n $conn->connect();\n \n if($conn->isConnected()){\n $logger->trace(\"The connection with the database was done with successfully\");\n \n $query = sprintf(\"select %s.%s as ImageId,\n %s.%s as CollectionId,\n %s.%s as CollectionName,\n %s.%s as ImageName,\n %s, %s from %s,%s,%s where\n %s.%s=%s.%s and %s.%s=%s.%s and\n %s.%s= %d order by ImageId desc\"\n ,TableImageC,TB_Image_IdC\n ,TableCollectionC,TB_Collection_IdCollectionC\n ,TableCollectionC,TB_Collection_CollectionNameC\n ,TableImageC,TB_Image_NameC\n ,TB_Image_PathC\n ,TB_Image_DescC\n ,TableImageC\n ,TableCollectionC\n ,TableImageCollectionC\n ,TableImageC,TB_Image_IdC\n ,TableImageCollectionC,TB_ImageCollection_idImageC\n ,TableImageCollectionC,TB_ImageCollection_idCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,$theCollectionId);\n \n $logger->trace(\"Execute query [ \" . $query . \" ]\");\n \n $result = $conn->query($query);\n if ($result != null){\n $rows;\n $numRows = count($result);\n $logger->trace(\"The query has [ \" . $numRows .\" ] rows\");\n for ($idx = 0;$idx < $numRows; $idx++){\n $rows[$idx] = new TB_IMAGE_COLLECTION($result[$idx][\"ImageId\"],\n $result[$idx][\"CollectionId\"],\n $result[$idx][\"CollectionName\"],\n $result[$idx][TB_Image_PathC],\n $result[$idx][\"ImageName\"],\n $result[$idx][TB_Image_DescC]);\n }\n }\n $conn->closeConnection();\n }else{\n \n $logger->error(\"An error was produced in the connection [ \" .\n $conn->getConnectError() . \" ]\");\n \n }\n $logger->trace(\"Exit\");\n return new DBIterator($rows);\n \n }", "public function getPictures($num, $count)\n {\n\n $select;\n\n if(!isset($count) && !isset($num)){\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->limit(8)\n ;\n }\n else{\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->offset($num)\n ->limit($count)\n ;\n }\n\n $query = $this->sql->buildSqlString($select);\n\n return $this->adapter->query($query)->execute();\n }", "public function getAll(){\n\t\t$FocusList = new Image();\n\t\t$FocusLists = $FocusList->select('path')->where('category_id','=',1)->orderBy(\"id\", \"desc\")->limit(5)->get();\n return $FocusLists;\n\t}", "public function getImages($idAnuncio){\n\t\t$query = \"SELECT fi.idImagen, fi.small, fi.medium, fi.big FROM final_imagen fi WHERE idAnuncio = '\".$idAnuncio.\"'\"; \n\t\treturn $this->con->action($query);\n\t}", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function getPictureById($id)\n\t{\n\t\t$sql = \"SELECT id,file FROM photo WHERE id=:id LIMIT 1\";\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute(array(\":id\"=>$id));\n\t\treturn $query->fetchAll();\n\t}", "public function index()\n {\n return Image::all();\n }", "public function fetchCategoriesWithImages() {\n try {\n\t$sql = \"SELECT c.id AS catId, c.category, \"\n\t . \"SUBSTRING_INDEX(GROUP_CONCAT(i.id, '-', i.name ORDER BY RAND() SEPARATOR ','), ',', 6) AS images, \"\n\t . \"COUNT(ic.image_id) AS countImages FROM category c \"\n\t . \"JOIN image_category ic ON c.id = ic.cat_id \"\n\t . \"JOIN image i ON i.id = ic.image_id \"\n\t . \"GROUP BY(ic.cat_id) HAVING countImages > 4 \"\n\t . \"ORDER BY RAND()\";\n\treturn $this->getAllColumns($sql, 'catId');\n } catch (PDOException $e) {\n\treturn $this->returnPdoErrors($e);\n }\n }", "public static function getAll($offset = 0){\n $conn = static::connect();\n $stmt = $conn->prepare(\"SELECT a.id, a.path, SUBSTRING_INDEX(a.title, '&', 1) as title, a.user, b.email as email \n from images a\n inner join user b\n on a.user = b.id\n ORDER BY id DESC\n LIMIT :limit\n OFFSET :offset\");\n $stmt->bindValue(\"limit\", Config::LIMIT_IMAGES, PDO::PARAM_INT);\n $stmt->bindValue(\"offset\", $offset, PDO::PARAM_INT);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return self::convertPath($result);\n }", "function obtener_datos_imagenes($idProfile, $conexion){\n $statement = $conexion->prepare('SELECT * FROM imagenes WHERE idUser = :idUser');\n $statement->execute(array(':idUser' => $idProfile));\n $datosImagenes = $statement->fetchAll();\n\n return $datosImagenes;\n}", "private static function get_media_images($table){\n $database = Database::instance();\n $sql = \"SELECT DISTINCT image FROM \" . $table . \" WHERE image IS NOT NULL\";\n $query = $database->prepare($sql);\n $query->execute();\n $result = $query->fetchAll(\\PDO::FETCH_ASSOC);\n $query->closeCursor();\n if( $result === false || $result === null) {\n APIService::response_fail(HttpFailCodes::http_response_fail()->get_media_images);\n }\n $media_images = array();\n foreach ($result as $image){\n array_push($media_images, $image[\"image\"]);\n }\n return $media_images;\n }", "function getUserImages($user_id) {\n\n \n $sql = \"select name from images where user_id = :user_id\";\n try {\n $stmnt = $this->conn->prepare($sql);\n $params = [\n 'user_id' => $user_id\n ];\n $stmnt->execute($params);\n\n while ($row = $stmnt->fetch()) {\n echo <<<HTM\n \n <div class=\"gallery_product col-lg-4 col-md-4 col-sm-4 col-xs-6 filter hdpe\">\n <img src=\"img/{$row['name']}\" class=\"img-responsive\">\n </div>\n \nHTM;\n \n }\n \n }\n \n Catch (PDOException $e) {\n $e = new ErrorView([\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ]);\n }\n }", "function getAllMedia() \n\t\t{\n\t\t\t\n\t\t\ttry{\n\n\t\t\t\t$query = $this->_db->prepare( \"SELECT * FROM media ORDER BY media_date DESC\" );\n\n\t\t\t\t$query->execute();\n\n\t\t\t\t$data = $query->fetchAll();\n\t\t\t\t\n\t\t\t\treturn $data;\n\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\t\t\t\n\t\t}", "public function getPictures($id){\n\t\t$app = \\Slim\\Slim::getInstance();\n\n\t\t$game = Game::find($id);\n\n\t\t//verif token and id\n\t\t$token = null;\n\t\tif(isset($_GET['apiKey']))\n\t\t$token = filter_var($_GET['apiKey'], FILTER_SANITIZE_STRING);\n\t\tif (!self::checkToken($id, $token)){\n\t\t\t$app->response->headers->set('Content-type','application/json') ;\n\t\t\t$app->halt(401, json_encode(array(\"erreur_message\"=>'invalide APIKey')));\n\t\t}\n\n\t\t$ville = $game->ville;\n\t\t$images = $ville->images()->orderByRaw('RAND()')->get(); //rajouter un champs description photo dans la BDD?\n\n\t\t$imageAndLinks = array();\n\n\t\t$rootUri = $app->request->getUrl();\n\t\t$rootUri .= $app->request->getRootUri();\n\n\t\tforeach ($images as $image){\n\t\t\t$path = \"$rootUri/src/img/\".$image->titre.$image->extension; //ou le foutre direct dans la BDD, au choix\n\t\t\t$imageAndLinks[] = array(\"image\"=>$image, \"href\"=>$path);\n\t\t}\n \n\t\t$app->response->setStatus(200) ;\n\t\t$app->response->headers->set('Content-type','application/json') ;\n\t\techo json_encode($imageAndLinks);\n\t}", "function getImageByImageId() {\n if($this->image_id == '') return;\n\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE image_id = \".$this->image_id;\n return $this->db->query($sql)->row_array();\n\t}", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function index()\n {\n return ImageResource::collection(Image::all());\n }", "private function getImages() {\n global $wpdb;\n $query = \"select * from `\" . $wpdb->prefix . \"roni_images` where image_status = 1;\";\n $results = $wpdb->get_results( $query );\n if( !empty( $results ) ) {\n return $results;\n }\n\n return false;\n }", "protected function loadImages() {\r\n $this->images = new \\App\\Table\\ImagesTable(App::getInstance()->getDb());\r\n }", "public function queryAllImageByUserId($userID){\n try{\n $object=array();\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT ImgID,ImgDate,ImgPathWithPrimalUrl,ImgPathWithResizeUrl,ImgPathWithIconUrl FROM ImageDataSet WHERE userID=?\")){\n $stmt->bind_param('s',$userID);\n $stmt->execute();\n $stmt->bind_result($ImgID, $ImgDate,$ImgPathWithPrimalUrl,$ImgPathWithResizeUrl,$ImgPathWithIconUrl);\n while ($stmt->fetch())\n {\n $array =array('imgID'=>$ImgID, 'imgDate'=>$ImgDate,'imgPathWithPrimalUrl'=>$ImgPathWithPrimalUrl, 'imgPathWithResizeUrl'=>$ImgPathWithResizeUrl,'imgPathWithIconUrl'=>$ImgPathWithIconUrl);\n array_push($object,$array);\n }\n $stmt -> close();\n return $object;\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "function get_mediaImages()\n\t\t{\n\t\t\t$query = $this -> db -> get('MediaSlider');\n\n\n\t\t\treturn $query->result();\n\t\t}", "public function getImageContent($imageid){\n $stmt = $this->con->prepare(\"SELECT image FROM list_student WHERE id = ?\");\n $stmt->bind_param(\"i\", $imageid);\n $stmt->execute();\n $stmt->bind_result($image);\n $stmt->fetch();\n return $image; \n }", "function imagenes_disponibles($id_palabra) {\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function listar_tipos_imagen() {\n\t\t/*$query = \"SELECT tipos_imagen.*\n\t\tFROM tipos_imagen\";*/\n\n\t\t$query = \"SELECT tipos_imagen.*\n\t\tFROM tipos_imagen\n\t\tWHERE activo=1\n\t\tORDER BY orden asc\";\n\t\t\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "static public function getImageFromCollection($theCollection){\n \n $logger=Logger::getLogger(__CLASS__);\n $logger->trace(\"Enter\");\n \n $logger->trace(\"Get the images which to belong to collection [ \" . \n $theCollection .\" ]\");\n \n $conn = new MySqlDAO(serverC, userC, pwdC, ddbbC);\n $conn->connect();\n \n if($conn->isConnected()){\n $logger->trace(\"The connection with the database was done with successfully\");\n \n $collectionId = 0;\n if (TB_IMAGE_COLLECTION::getCollectionIdByName($conn,\n $theCollection, $collectionId)){\n $logger->trace(\"The collection [ \" . $theCollection . \" ] has the id [ \" .\n $collectionId . \" ]\");\n \n $query = sprintf(\"select %s.%s as ImageId,\n %s.%s as CollectionId, \n %s.%s as CollectionName,\n %s.%s as ImageName,\n %s, %s from %s,%s,%s where \n %s.%s=%s.%s and %s.%s=%s.%s and\n %s.%s= '%s'\"\n ,TableImageC,TB_Image_IdC\n ,TableCollectionC,TB_Collection_IdCollectionC\n ,TableCollectionC,TB_Collection_CollectionNameC\n ,TableImageC,TB_Image_NameC\n ,TB_Image_PathC\n ,TB_Image_DescC\n ,TableImageC\n ,TableCollectionC\n ,TableImageCollectionC\n ,TableImageC,TB_Image_IdC\n ,TableImageCollectionC,TB_ImageCollection_idImageC\n ,TableImageCollectionC,TB_ImageCollection_idCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,TableCollectionC, TB_Collection_CollectionNameC\n ,$theCollection);\n \n $logger->trace(\"Execute query [ \" . $query . \" ]\");\n \n $result = $conn->query($query);\n if ($result != null){\n $rows;\n $numRows = count($result);\n $logger->trace(\"The query has [ \" . $numRows .\" ] rows\");\n for ($idx = 0;$idx < $numRows; $idx++){\n $rows[$idx] = new TB_IMAGE_COLLECTION($result[$idx][\"ImageId\"], \n $result[$idx][\"CollectionId\"], \n $result[$idx][\"CollectionName\"], \n $result[$idx][TB_Image_PathC], \n $result[$idx][\"ImageName\"], \n $result[$idx][TB_Image_DescC]);\n }\n }\n }\n $conn->closeConnection();\n }else{\n $logger->error(\"An error was produced in the connection [ \" .\n $conn->getConnectError() . \" ]\");\n }\n $logger->trace(\"Exit\");\n return new DBIterator($rows);\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}", "public function Index(){\r\n\t\tif (isset($_POST['q'])) {\r\n\t\t\t$q = trim($_POST['q']);\r\n\t\t\t$q = strtolower($q);\r\n\t\t$this->query(\"SELECT * FROM images WHERE img_title LIKE '%\".$q.\"%'\");\r\n\t\t$rows = $this->resultSet();\r\n\t\treturn $rows;\r\n\t\t}\r\n\t}", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public abstract function fetchAllObjects();", "public function getAllPictureInfo($p_pet_id){\n $stmt = $this->adapter->conn->prepare(\n \"SELECT * \".\n \"FROM PICTURES \".\n \"WHERE pet_id=?;\");\n $stmt->bindParam(1,$p_pet_id);\n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result; \n }", "public function index()\n {\n //\n $id = Auth()->user()->id;\n $photos = Picture::where('user_id', '=', $id )->latest()->get();\n\n $result = $photos->map(function($photo){\n return [\n \"user_id\" => $photo->user_id,\n \"title\" => $photo->title,\n \"photos\" => $photo->photos\n ];\n });\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Records fetched successfully\",\n \"data\" => $result\n ],StatusCodes::SUCCESS);\n }", "function getFilesByObject() {\n if($this->object_id == '') return ;\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE object_id = $this->object_id \";\n return $this->db->query($sql)->result('array');\n\t}", "public abstract function fetchAll();", "public function index()\n {\n $images = $this->images->all();\n\n return ImageResource::collection($images);\n }", "function show_images() {\n global $app;\n $images = new entities\\Image();\n $cursor = $images->getRange($app, 0);\n $posts = array();\n \n foreach ($cursor->toArray() as $post) {\n $posts[] = $post;\n }\n return $app['twig']->render('admin/admin_images.twig', array('images' => $posts));\n}", "function getImagesRecords($limitImages=0) {\n \t\t//prepare query\n \t\t$sort = 'sorting';\n \t\t$fields = 'title,image,description,l18n_parent';\n \t\t$tables = 'tx_rgsmoothgallery_image';\n \t\t$temp_where='pid IN ('. $this->config['startingpointrecords'] . ') AND hidden=0 AND deleted=0 AND sys_language_uid = '.$GLOBALS['TSFE']->sys_language_content;\n \t\n $content.=$this->beginGallery($this->cObj->data['uid'],$limitImages);\n \n // add the images\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where,'', 'rand()',$limitImages);\n } else {\n \t\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where,'', $sort,$limit);\n \t\t}\n \t\t$this->sys_language_mode = $this->conf['sys_language_mode']?$this->conf['sys_language_mode'] : $GLOBALS['TSFE']->sys_language_mode;\n \t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n \t \n \tif ($GLOBALS['TSFE']->sys_language_content) {\n \t\t\t$OLmode = ($this->sys_language_mode == 'strict' ? 'hideNonTranslated' : '');\n \t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_rgsmoothgallery_image',$row, $GLOBALS['TSFE']->sys_language_content, $OLmode);\n \t\t} \t\n\n if ($row['image']=='') {\n $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('image', $tables, 'uid='.$row['l18n_parent']);\n $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2); \n $row['image'] = $row2['image']; \n }\n\n $path = 'uploads/tx_rgsmoothgallery/'.$row['image'];\n \n // add element to slideshow\n $content.=$this->addImage(\n\t\t\t $path,\n $row['title'], \n $row['description'], \n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n \n \t$i++;\n } # end foreach file\n \n\t\t$content.=$this->endGallery();\n \t\treturn $content;\n }", "public function viewMultiple(){\n // Default configuration\n $orderBy = Input::get('orderBy') ? Input::get('orderBy') : 'created_at';\n $limit = Input::get('limit') ? Input::get('limit') : 30;\n \n if(!Cache::has('maxStartAt')){\n Cache::add('maxStartAt', DB::table('images')->count() - $limit, 10);\n }\n \n if(Input::has('startAt')){\n $startAt = Input::get('startAt');\n }else{\n if(Cache::get('maxStartAt') > 0){\n $startAt = rand(1, Cache::get('maxStartAt'));\n }else{\n $startAt = 0;\n }\n }\n \n // Take rates relation\n $images = Image::with('ratees')->take($limit)->skip($startAt)->orderBy($orderBy)->get();\n \n\tif($images->count() == 0){\n\t\treturn $this->jsonResponse(\"error\", \"No images found with given parameters\", Input::get('callback'));\n\t}\n\t\t\n\treturn $this->jsonResponse(\"ok\", \"Images found\", Input::get('callback'), $images);\n }", "public function imagesAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n \n \n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\") || $logedUser[\"idCompany\"] == 1) {\n $request = $this->getRequest();\n }\n \n $images = $this->getImageTable()->fetchAll($logedUser[\"idWebsite\"]);\n $this->layout(\"layout/images.phtml\");\n return array(\n \"images\" => $images,\n \"idWebsite\" => $logedUser[\"idWebsite\"]\n );\n } else {\n return $this->redirect()->toRoute(\"noPermission\");\n }\n }", "function get_hotel_pictures($hotel_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('hotel_id',$hotel_id);\n\t\t$query=$this->db->get('sb_hotel_album');\n\t\treturn $query->result_array();\n\t}", "public function getImages()\n {\n return $this->hasMany(self::class, ['file_id' => 'file_id']);\n }", "public static function getList($currentPage=0, $order=\"uploadDate DESC\") {\n\t\t\n\t\t$x = $currentPage * NUM_PER_PAGE;\n\t\t$y = $x+NUM_PER_PAGE;\n\n\t\t$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\t\t$sql = \"SELECT * FROM images WHERE published = 1 ORDER BY uploadDate DESC LIMIT :x, :y\";\n\n\t\t$st = $conn->prepare($sql);\n\t\t$st->bindValue(\":x\", $x, PDO::PARAM_INT);\n\t\t$st->bindValue(\":y\", $y, PDO::PARAM_INT);\n\t\t$st->execute();\n\t\t$list = array();\n\t\t\n\t\twhile ($row = $st->fetch()) {\n\t\t\t$image = new Image($row);\n\t\t\t$list[] = $image;\n\t\t}\n\t\t\n\t\t$sql = \"SELECT FOUND_ROWS() AS totalRows\";\n\t\t$totalRows = $conn->query($sql)->fetch();\n\t\t$conn = null;\n\t\t//$row = $st->fetch();\n\t\t//return json_encode($row);\n\t\treturn(array(\"results\"=>$list, \"totalRows\"=>$totalRows[0]));\n\t}", "public function index()\n {\n $image = Image::all();\n return $this->showAll($image);\n }", "public function pictures()\n {\n return $this->hasMany(Picture::class);\n }", "function getAllFiles() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` FROM `file`');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "function obtener_post_profile($post_por_pagina, $conexion) {\n $sentencia = $conexion->prepare(\"SELECT * FROM imagenes WHERE idUser = :idUser ORDER BY idImg DESC\" );\n $sentencia->execute(array(':idUser' => $_GET['id']));\n return $sentencia->fetchAll();\n}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "public function index()\n {\n return Photo::get();\n }", "function get_single_image($pid) {\n $sql = \"SELECT * FROM photos WHERE album_id='$pid'\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "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 }", "function getContentImages($content_id=null){\r\n\t\tif($content_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from(TBL_CONTENT_IMAGES);\t\t\t\r\n\t\t$this->db->where(array('content_id'=>$content_id));\t\t\r\n\t\t$recordSet = $this->db->get();\r\n\t\t$data=$recordSet->result();\r\n\t\tif(count($data) > 0){\r\n\t\t\treturn $data;\r\n\t\t}else{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}", "protected function getImageWithId($id){\n $conn = static::connect();\n $stmt = $conn->prepare(\"SELECT * FROM images where id=:id\");\n $stmt->bindValue('id', $id, PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function get_all_img_byID($id) {\n $sql = \"select * from advertisement_image where AdsID=? and StatusID <>3\";\n $data = $this->db->query($sql, array($id));\n return $data->result();\n }", "public function images(){\n $images = DB::table('images')->simplePaginate(15);\n return view('admin.images')->with('images', $images);\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Images Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}", "public function show_column_photos(){\n $sql=\"SELECT * FROM photos WHERE img_navigacija_id=3\";\n $result=self::$connect->query($sql);\n $rows=array();\n while($row=$result->fetch(PDO::FETCH_ASSOC)){\n $rows[]=$row;\n $this->name=array_column($rows, 'name');\n $this->id=array_column($rows, 'id');\n }\n\n }", "public function getImages( $id_album = 0 )\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` WHERE `id_album`='.$id_album);\n\t}", "function getAll()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $return_array = array();\r\n $category_array = array();\r\n\r\n $db->array_query( $category_array, \"SELECT ID, Name FROM eZImageCatalogue_Category ORDER BY Name\" );\r\n\r\n for ( $i = 0; $i < count( $category_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImageCategory( $category_array[$i][$db->fieldName( \"ID\" )] );\r\n }\r\n\r\n return $return_array;\r\n }", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function images()\n {\n return $this->hasMany(Image::class, 'owner_id')->whereHas('type', function ($q) {\n return $q->where('type', static::class);\n });\n }", "public function import_images()\r\n\t{\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE `enabled`>='1'\";\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t$query = \"SELECT `id` FROM `#__wpl_properties` WHERE `pic_numb` = '0' AND `mls_query_id` = '{$mls_query->id}' LIMIT {$mls_query->import_limit}\";\r\n\t\t\t$pids = wpl_db::select($query, 'loadColumn');\r\n\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\r\n\t\t\t/** download images **/\r\n\t\t\tif(trim($mls_query->images)) $wplrets->import_properties_images($pids, $mls_query->mls_server_id, $mls_query->images, false);\r\n\r\n\t\t\t/** finalizing properties **/\r\n\t\t\tforeach($pids as $pid) $mls->finalize($pid);\r\n\t\t}\r\n\r\n\t\tif(wpl_request::getVar('rets_import_images_cron_job') == 1) exit;\r\n\t}", "function obtener_datos_idImg($idImg, $conexion){\n $statement = $conexion->prepare('SELECT * FROM imagenes WHERE idImg = :idImg');\n $statement->execute(array(':idImg' => $idImg));\n $datosIdImg = $statement->fetchAll();\n\n return $datosIdImg;\n}", "public function all_userPost_picture_for_footer(){\r\n $query = \"SELECT car_image FROM tbl_user_post WHERE publication_status = 1 ORDER BY user_post_id DESC LIMIT 12\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public final function findAll(){\n\n //Récupère la méthode de connection à la Base de donnée\n $dbc = Application::getInstance()->getDBConnection();\n\n //Variable où la requête est enregistrée\n $query = \"select * from Album\";\n\n //Requête en dur, prends la bdd et y exécute la requête\n $stmt = $dbc->query($query);\n\n /*Récupère tout les tuples de Album, et les transpose dans des instances de classe Album\n Et fini par enregistrer le résultat dans $results, FALSE est retourné s'ya erreur */\n $results = $stmt->fetchALL(PDO::FETCH_CLASS, 'Album');\n\n //Retourne le résultat de $results\n return $results;\n }", "function getImageByFilename() {\n\t\tif($this->file_name == '') return ;\n\t\t\n\t\t$sql = \"SELECT * FROM \".$this->tableImages().\" WHERE path_image = '$this->file_name'\";\n\t\treturn $this->db->query($sql)->row_array();\n\t}" ]
[ "0.79711396", "0.7686944", "0.7564832", "0.7480706", "0.7413774", "0.74034935", "0.74012125", "0.7396253", "0.73864216", "0.731774", "0.7087878", "0.7084268", "0.7070541", "0.70383614", "0.6903817", "0.68948597", "0.6857338", "0.6833286", "0.68183637", "0.6814184", "0.6809268", "0.68011415", "0.6796361", "0.6790692", "0.67649627", "0.6742175", "0.6714827", "0.6698857", "0.6695897", "0.6687934", "0.66729957", "0.6672397", "0.6650074", "0.66445637", "0.6607617", "0.6581358", "0.6579749", "0.6572618", "0.6550459", "0.65482485", "0.65429705", "0.65190566", "0.65093297", "0.6496591", "0.64933527", "0.6490017", "0.6481333", "0.6474286", "0.6473056", "0.6464071", "0.646186", "0.64601654", "0.64600426", "0.6459663", "0.644319", "0.64212286", "0.64202744", "0.6413744", "0.6413744", "0.6413744", "0.6413744", "0.6387126", "0.6386558", "0.6385519", "0.6376026", "0.63754195", "0.63748753", "0.6374267", "0.63705665", "0.6359963", "0.63595337", "0.6353356", "0.63516116", "0.6334626", "0.6331731", "0.63288814", "0.63197446", "0.6316064", "0.6311168", "0.6291132", "0.62826854", "0.6259961", "0.6257007", "0.6249936", "0.6248107", "0.624194", "0.6238412", "0.6237293", "0.6235094", "0.6218082", "0.6217279", "0.6214969", "0.6209333", "0.62084913", "0.6206801", "0.6189704", "0.6189033", "0.6187955", "0.61852527", "0.61738694" ]
0.75790906
2
save picture data to db
function store_pic_data($data){ $insert_data['pic_title'] = $data['pic_title']; $insert_data['pic_desc'] = $data['pic_desc']; $insert_data['pic_file'] = $data['pic_file']; $query = $this->db->insert('pictures', $insert_data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertImageToDb() \n {\n }", "public function save(Photo $photo);", "public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}", "public function saveImage($data)\n\t{\n if (!empty($data)) {\n return $this->imagesModel->create($data);\n }\n\t}", "public function store_in_database(){\n\tif(isset($_POST['submit'])){\n\t\t$image_path = $_POST['path'];\n\t\tupdate_option('pochomaps_map_image', $image_path);\n\t}\n}", "function savePicture($filepath,$data)\n {\n $file = fopen($filepath,\"w+\");\n fwrite($file,$data);\n fclose($file);\n }", "public function save()\n\t{\n\t\t\tif($this->youser_id===null)\n\t\t\t{\n\t\t\t\t$this->youser_id = md5(uniqid(\"device_pictures\", true).\"/\".time());\n\t\t\t}\n\t\t\t$db = DBManager::Get(\"devices\");\n\t\t\t$db->query(\"INSERT INTO device_pictures (device_pictures_id, device_id, device_id_int, master_image, device_pictures_type, angle, situation, position, original_filename, youser_id, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW()) ON DUPLICATE KEY UPDATE device_pictures_id=VALUES(device_pictures_id), device_id=VALUES(device_id), device_id_int=VALUES(device_id_int), master_image=VALUES(master_image), device_pictures_type=VALUES(device_pictures_type), angle=VALUES(angle), situation=VALUES(situation), position=VALUES(position), original_filename=VALUES(original_filename), youser_id=VALUES(youser_id), timestamp=VALUES(timestamp)\",$this->device_pictures_id, $this->device_id, $this->device_id_int, $this->master_image, $this->device_pictures_type, $this->angle, $this->situation, $this->position, $this->original_filename, $this->youser_id);\n\t\t\t\n\t\t\treturn $db->affected_rows()>0;\n\t}", "public function save(){\n\n // Authenticate as admin\n $user = User::fetch_by_session();\n if($user === false) return $this->zajlib->json(['status'=>'error', 'message'=>'Your user session has expired!']);\n if($user->data->admin != 'admin') return $this->zajlib->json(['status'=>'error', 'message'=>'Your user account does not have rights to perform this action!']);\n\n // Fetch the photo\n $photo = Photo::fetch($_POST['id']);\n $photo->set_with_data($_POST, ['name', 'alttext', 'caption']);\n $photo->save();\n\n return $this->zajlib->json(['status'=>'ok']);\n }", "private function __writeDbImageToFile($image_data, $filepath) {\n\n $image_string = base64_decode($image_data);\n $image = imagecreatefromstring($image_string);\n imagejpeg($image, $filepath);\n }", "public function upload_photo(){\n $sql=\"INSERT INTO photos \";\n $sql.=\"(name,size,type,date,img_navigacija_id) VALUES ('{$this->name}',$this->size,'{$this->type}',NOW(),2)\";\n self::$connect->query($sql);\n\n\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }", "function saveImage()\n\t{\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t/* store a interlaced gif image */\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagegif($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t/* store a progressive jpeg image (with default quality value)*/\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagejpeg($this->ImageStream, $this->sFileLocation, $this->jpegquality);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t/* store a png image */\n\t\t\t\timagepng($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\n\t\t\t\tif (!file_exists($this->sFileLocation)) {\n\t\t\t\t\t$this->printError('file not stored');\n\t\t\t\t}\n\t\t}\n\t}", "function save_image(array $image)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n INSERT INTO product_images\n (product_id, src, description)\n VALUES\n (:product_id, :src, :description)\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':product_id' => $image['product_id'],\n ':src' => $image['src'],\n ':description' => $image['description'],\n ]);\n}", "public function Save()\n {\n $required = array(\n \"title\" => \"Título\",\n \"src\" => \"Imagem\"\n );\n $this->validateData($required);\n parent::Save();\n }", "public function save()\n {\n // save the new Promo data table //\n $cropimg_data = $_POST['cropimg'];\n // smth like:- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array1 = explode(\";\", $cropimg_data);\n // smth like:- base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array2 = explode(\",\", $cropimg_remove_array1[1]);\n // smth like:- iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg = base64_decode($cropimg_remove_array2[1]);\n\n $imageName = 'promo_'.time() . '.png';\n\n $dir_to_save = \"./assets/jollof_banners/fashionhompage_banner/\";\n if (!is_dir($dir_to_save)) {\n mkdir($dir_to_save);\n }\n file_put_contents($dir_to_save.$imageName, $cropimg);\n \n \n \n $input_date=$_POST['promo_date'];\n $date_start=date(\"Y-m-d H:i:s\",strtotime($input_date));\n \n $promo_duration = $this->promo->promodurationinfo($_POST['promo_duration']);\n \n if($promo_duration->durationname == '1 Day'){$date_end= date('Y-m-d H:i:s',strtotime('+1 day',$input_date));}\n else if($promo_duration->durationname == '1 Week') {$date_end= date('Y-m-d H:i:s',strtotime('+1 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+1 month',strtotime($input_date)));}\n else if($promo_duration->durationname == '3 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+3 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '6 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+6 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Year') {$date_end= date('Y-m-d H:i:s',strtotime('+1 year',strtotime($input_date)));}\n \n $data_New = array( \n 'imageurl' => $_POST['promo_url'],\n 'imagename' => $imageName,\n 'bannertypeid' => $_POST[\"promotype\"],\n 'promodurationid'=> $_POST[\"promo_duration\"],\n 'usertype' => $this->session->Type,\n 'merchantid' => $this->session->merchant_id,\n 'userid' => $this->session->User_id,\n 'username' => $this->session->companyname,\n 'payment' => 'FREE',\n 'startdate' => $date_start,\n 'enddate' => $date_end,\n 'status' => 0\n );\n $insert_data = $this->Generic->add($data_New, $tablename=\"img_ads\");// insert to db\n\n if($insert_data) \n {\n $this->session->set_flashdata('success','success');\n $this->session->set_flashdata('message', 'Promo Saved');\n $Json_resultSave = array (\n 'status' => '1',\n 'content' => $imageName\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n else \n { \n $this->session->set_flashdata('error','error');\n $this->session->set_flashdata('message', 'An error occur when Adding New Promo');\n $Json_resultSave = array (\n 'status' => '0',\n 'content' => 'There was a problem!! Pls Try Again.....'\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n }", "function saveData(){\r\n require_once('Database.php');\r\n $database = new Database(\"localhost\", \"root\", \"\", \"practica\");\r\n $database->connect();\r\n\r\n //Take input and test it for special characters\r\n $firstname = test_input($_POST['firstname']);\r\n $lastname = test_input($_POST['lastname']);\r\n $email = test_input($_POST['email']);\r\n $number = test_input($_POST['number']);\r\n\r\n $age = test_input($_POST['age']);\r\n $address = test_input($_POST['address']);\r\n $sex = test_input($_POST['sex']);\r\n $sizes = test_input($_POST['size']);\r\n\r\n $image = test_input($_POST['image']);\r\n\r\n //Prepare and execute statement, returning 1 for success and 0 for failure\r\n if($stmt = $database->conn->prepare(\"INSERT INTO form (firstname, lastname, email, phoneNumber, age, address, gender, sizes, image)\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\")){\r\n $stmt->bind_param('sssiissss', $firstname, $lastname, $email,\r\n $number, $age, $address, $sex, $sizes, $image);\r\n\r\n $stmt->execute();\r\n\r\n $stmt->close();\r\n echo 1;\r\n }\r\n else{\r\n echo 0;\r\n }\r\n\r\n $database->disconnect();\r\n }", "public function saveAction()\n {\n $data = $this->getRequest()->getPost();\n if ($data) {\n try {\n if (isset($data['image']['delete'])) {\n $data['image'] = '';\n } else {\n unset($data['image']);\n\n if (isset($_FILES)) {\n if ($_FILES['image']['name']) {\n if ($this->getRequest()->getParam('id')) {\n $model = Mage::getModel('pugnet_uploader/images')->load($this->getRequest()->getParam('id'));\n if ($model->getData('image')) {\n $io = new Varien_Io_File();\n $io->rm(Mage::getBaseDir('media') . DS . implode(DS, explode('/', $model->getData('image'))));\n }\n }\n $path = Mage::getBaseDir('media') . DS . 'uploader' . DS . 'images' . DS;\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(['jpg', 'png', 'gif']);\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n $destFile = $path . $_FILES['image']['name'];\n $filename = $uploader->getNewFileName($destFile);\n $uploader->save($path, $filename);\n\n $data['image'] = 'uploader/images/' . $filename;\n }\n }\n }\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirectReferer();\n }\n\n try {\n $model = Mage::getModel('pugnet_uploader/images')\n ->addData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image was successfully saved'));\n Mage::getSingleton('adminhtml/session')->setItemsData(false);\n $this->_redirectReferer();\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setItemsData($this->getRequest()->getPost());\n $this->_redirectReferer();\n }\n }\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image has not been saved'));\n $this->_redirectReferer();\n }", "private function SaveSingleImage()\n\t{\n\t\t//Abfragen und überprüfen der ID\n\t\t$id = functions::GetVar($_GET, 'id');\n\t\tif(!is_numeric($id))\n\t\t{\n\t\t\tfunctions::Output_fehler('Es wurde keine g&uuml;ltige ID &uuml;bergeben!');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Initialisieren des Datenspeichers\n\t\t$daten = array();\n\t\t\n\t\t//ISO-Wert auslesen und kontrollieren\n\t\t$daten['iso'] = functions::GetVar($_POST, 'iso');\n\t\tif(!is_numeric($daten['iso']))\n\t\t{\n\t\t\tfunctions::Output_warnung('Es wurde kein g&uuml;ltiger ISO-Wert angegeben!');\n\t\t\t$daten['iso'] = 0;\n\t\t}\n\t\t\n\t\t//Auslesen des Kommentars\n\t\t$daten['comment'] = Functions::GetVar($_POST, 'comment');\n\t\t//Auslesen der verwendeten Kamera\n\t\t$daten['kamera'] = Functions::GetVar($_POST, 'kamera');\n\t\t\n\t\t\n\t\tswitch ($_POST['originalChoice'])\n\t\t{\n\t\t\tcase 'delete':\n\t\t\t\t//Es soll kein Bild vorhanden sein, das bestehende Bild wird gelöscht\n\t\t\t\t$daten['pfad_sg'] = $this -> GetPathSg($id);\n\t\t\t\tFilebase::RemoveFileById($daten['pfad_sg']);\n\t\t\t\t$daten['pfad_sg'] = null;\n\t\t\t\tbreak;\n\t\t\tcase 'filesystem':\n\t\t\t\t//Es soll ein Bild aus der Filebase angezeigt werden\n\t\t\t\t$filebasePath = FILEBASE . Functions::GetVar($_POST, 'originalPath');\n\t\t\t\t$daten['pfad_sg'] = '';\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$daten['pfad_sg'] = Filebase::GetFileId($filebasePath);\n\t\t\t\t}\n\t\t\t\tcatch (Exception $ex)\n\t\t\t\t{\n\t\t\t\t\tfunctions::Output_fehler('Die angegebene Datei konnte nicht in der Filebase gefunden werden!');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'upload':\n\t\t\t\t//Es soll ein Bild über den Browser geuploaded werden\n\t\t\t\t$up = Functions::Upload(FILEBASE . 'galerie/originalimages/', 'newOriginalImage');\n\t\t\t\tif(!$up)\n\t\t\t\t{\n\t\t\t\t\tfunctions::Output_fehler('Die Datei konnte nicht auf dem Server gespeichert werden!');\n\t\t\t\t}\n\t\t\t\t$daten['pfad_sg'] = Filebase::AddFile($up);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Auslesen der Datumsinformationen\n\t\t$date = array();\n\t\t$date['year'] = functions::GetVar($_POST, 'datumYear');\n\t\t$date['month'] = functions::GetVar($_POST, 'datumMonth');\n\t\t$date['day'] = functions::GetVar($_POST, 'datumDay');\n\t\t$date['hour'] = functions::GetVar($_POST, 'datumHour');\n\t\t$date['minute'] = functions::GetVar($_POST, 'datumMinute');\n\t\t$date['second'] = functions::GetVar($_POST, 'datumSecond');\n\n\t\t//Prüfen ob das Datum korrekt ist\n\t\tif(!checkdate($date['month'], $date['day'], $date['year']))\n\t\t{\n\t\t\tFunctions::Output_fehler('Es wurde ein ung&uuml;ltiges Datum eingegeben!');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Zusammensetzend es Datumstrings\n\t\t$dateString = $date['year'] . '-' . $date['month'] . '-' . $date['day'] . ' ' . $date['hour'] . ':' . $date['minute'] . ':' . $date['second'];\n\t\t\n\t\n\t\t//Galerie-ID auslesen und prüfen\n\t\t$gid = functions::GetVar($_POST, 'galerie');\n\t\tif(!is_numeric($gid))\n\t\t{\n\t\t\tfunctions::Output_fehler('Es wurde keine g&uuml;ltige Galerie-ID ¨&uuml;bergeben!');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Speichern der Informationen\n\t\ttry \n\t\t{\n\t\t\tSqlManager::GetInstance() -> Update('modgaleriebilder', array('gallerieId' => $gid , 'datum' => $dateString, 'iso' => $daten['iso'], 'comment' => $daten['comment'], 'kamera' => $daten['kamera'], 'path_sg' => $daten['pfad_sg']), 'id=\\''. $id .'\\'');\n\t\t}\n\t\tcatch (SqlManagerException $ex)\n\t\t{\n\t\t\tFunctions::Output_fehler('Die Eigenschaften des Bildes konnten nicht gespeichert werden: ' . $ex);\n\t\t\treturn;\n\t\t}\n\t\tfunctions::Output_bericht('Eigenschaften wurden erfolgreich gespeichert!');\n\t}", "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 savePhoto( $f_name, $file_data_to_store)\n {\n $this->logger->info('DBService : savePhoto');\n \n $sql = \"INSERT INTO minstagram(photo_name, photo)\" . \"VALUES(:p_name, :p_data)\";\n\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindParam(':p_name', $f_name);\n $stmt->bindParam(':p_data', $file_data_to_store, \\PDO::PARAM_LOB);\n \n $stmt->execute();\n }", "function image_record() {\n\t\t$picIMEI = $_POST['picIMEI'];\n\t\t$time_stamp = $_POST['time_stamp'];\n\t\t$piclat = $_POST['piclat'];\n\t\t$piclon = $_POST['piclon'];\n\t\t$image_name = $_POST['image_name'];\n\t\t$accel_x = $_POST['accel_x'];\n\t\t$accel_y = $_POST['accel_y'];\n\t\t$accel_z = $_POST['accel_z'];\n\n\t\t$insert = $this -> conn -> insertnewrecords('image_record', 'imei_number, reading_timesamp,lat,log,accel_x,accel_y,accel_z,image_filename', '\"' . $picIMEI . '\",\"' . $time_stamp . '\",\"' . $piclat . '\",\"' . $piclon . '\",\"' . $accel_x . '\",\"' . $accel_y . '\",\"' . $accel_z . '\",\"' . $image_name . '\"');\n\t\tif (!empty($insert)) {\n\t\t\t$post = array('status' => \"true\", \"message\" => \"Thanks for your feedback\");\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"error\");\n\t\t}\n\n\t\techo $this -> json($post);\n\t}", "public function writeimg() {\n\t\t$data = Input::all();\n\t\t$img = $data['imgdata'];\n\t\t$student_id = $data['student_id'];\n\t\t$img = str_replace('data:image/png;base64,', '', $img);\n\t\t$img = str_replace(' ', '+', $img);\n\t\t$imgdat = base64_decode($img);\n\t\t$myPublicFolder = public_path();\n\t\t$savePath = $myPublicFolder.\"/photo\";\n\t\t$path = $savePath.\"/$student_id.png\";\n\t\tFile::delete($path);\n\t\tFile::put($path , $imgdat);\n\t\t$last_add = Student::orderby('id', 'desc')->first();\n\t\tStudent::where('student_id', '=', $student_id)->update(array('pic' => \"$student_id.png\"));\n\t\treturn View::make('finish', array('imgid' => Student::where('student_id', '=', $student_id)->firstOrFail()->group));\n\t}", "function imageSave($property, UploadedFile $file);", "private function saveToDatabse($data) {\n global $wpdb;\n $query = \"insert into `\" . $wpdb->prefix . \"roni_images` (`attachment_id`, `title`, `description`, `image_path`, `image_thumb_path`, `author_name`, `author_email`, `number_of_votes`, `created`) values ('\" . $data['attachment_id'] . \"', '\" . $data['title'] . \"' , '\" . $data['description'] . \"', '\" . $data['image_path'] . \"', '\" . $data['image_thumb_path'] . \"', '\" . $data['author_name'] . \"', '\" . $data['author_email'] . \"', '\" . $data['number_of_votes'] . \"', '\" . date(\"Y-m-d H:i:s\") . \"'); \";\n\n if ( $wpdb -> query( $query ) ) {\n return true;\n } else {\n return false;\n }\n }", "function save_camp_image(){\n\t\n\t\n\t$data = $_POST['data'];\n\tlist($type, $data) = explode(';', $data);\n\tlist(, $data) = explode(',', $data);\n\t$data = base64_decode($data);\t\t\n\t$img_name = 'tshirt'.time().'.png';\n\t\n\t$upload_dir = wp_upload_dir();\t\n\t\n\t$target_path_image = $upload_dir['path'].'/'.$img_name;\n\t\n\tfile_put_contents($target_path_image, $data);\n\t\n\techo json_encode(array('action'=>'done','img'=>$img_name));\t\n\tdie();\n}", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "private function save()\n {\n $this->collage->setImageFormat('jpeg');\n return $this->collage->writeImage($this->name);\n }", "public function saveImageToUser($image, $user);", "public function savePhoto(){\n if($this->imageFile && $this->photo = $this->upload($this->user_id, $this->getPrimaryKey())) {\n //off the events to avoid infinite loop\n $this->off(self::EVENT_AFTER_INSERT, [$this, 'savePhoto']);\n $this->off(self::EVENT_AFTER_UPDATE, [$this, 'savePhoto']);\n \n return $this->save(false);\n } \n return true;\n }", "public function saveData()\r\n {\r\n \r\n }", "function save(&$image) {\r\r\n\t\treturn $this->__write($image);\r\r\n\t\t}", "public function images_save($data_images = array()) \n {\n $query = $this->db->insert($this->program_images,$data_images);\n if($query)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "abstract public function save($img, $filename);", "function image_record(){\n\t\t\t$picIMEI=$_POST['picIMEI'];\n\t\t\t$time_stamp=$_POST['time_stamp'];\n\t\t\t$piclat=$_POST['piclat'];\n\t\t\t$piclon=$_POST['piclon'];\n\t\t\t$image_name=$_POST['image_name'];\n\t\t\t$accel_x=$_POST['accel_x'];\n\t\t\t$accel_y=$_POST['accel_y'];\n\t\t\t$accel_z=$_POST['accel_z'];\n\t\t\n\t\t\t\t$insert = $this -> conn -> insertnewrecords('image_record','imei_number, reading_timesamp,lat,log,accel_x,accel_y,accel_z,image_filename', '\"' . $picIMEI . '\",\"' . $time_stamp . '\",\"' . $piclat . '\",\"' . $piclon . '\",\"' . $accel_x . '\",\"' . $accel_y . '\",\"' . $accel_z . '\",\"' . $image_name . '\"');\n\t\t\t\tif(!empty($insert)){\n\t\t\t\t\t$post = array('status' => \"true\",\"message\" => \"Thanks for your feedback\");\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"error\");\n\t\t\t\t}\n\t\t\t\n\t\t\techo $this -> json($post);\n\t\t}", "public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }", "public function saveToDatabase($data)\n {\n }", "private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function store()\n\t{\n\t\t$review = new Review;\n\t\t$review->title = Input::get('title');\n\t\t$review->body = Input::get('body');\n\t\t//$review->picture = Input::file('picture');\n\t\t$review->review = Input::get('review');\n\t\t$review->place = Input::get('place');\n\t\t$review->lat = Input::get('lat');\n\t\t$review->lng = Input::get('lng');\n\t\t$review->category = Input::get('category');\n\t\t$review->picture = Input::has('picture');\n\t\t$review->save();\n\t\t//Review::create(Input::all());\n\n\t\tFile::put('img/review'.$review->id.\".jpg\", base64_decode(Input::get('picture')));\n\n\n\t}", "private function _saveData($vars){\n\n /**\n * @var $images \\Vg\\Images\n */\n $images = new Images();\n\n try{\n $images->setName($vars['filename'])\n ->setPath($vars['path'])\n ->setCreatedAt($vars['created_at'])\n ->save();\n return $images->getId();\n\n }catch(\\PropelException $e){\n throw new Error('ERROR: '. $e->getMessage());\n }\n }", "public function store()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n if($this->crop())\n {\n try {\n $this->_propertyImage->pid = $this->_pid;\n $this->_propertyImage->image_full_path = $this->_imageOut;\n $this->_propertyImage->save();\n }catch(Exception $e) {\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'success',\n 'url' => $this->_imageOut\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function save()\n\t{\n\t\t$database\t= new database();\n\t\tif ( isset($this->_properties['planning_gallery_id']) && $this->_properties['planning_gallery_id'] > 0) \n\t\t{\n\t\t\t$sql\t= \"UPDATE planning_gallery SET title = '\". $database->real_escape_string($this->title) .\"', alt = '\". $database->real_escape_string($this->alt) .\"', image_name = '\". $database->real_escape_string($this->image_name) .\"', description = '\". $database->real_escape_string($this->description) .\"' WHERE planning_gallery_id = '$this->planning_gallery_id'\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$order_id\t= self::get_max_order_id() + 1;\n\t\t\t//$order_id\t= self::get_default_image($planning_id);\n\t\t\t$sql\t\t= \"INSERT INTO planning_gallery \n\t\t\t\t\t\t(planning_id, title, alt, image_name, description, added_date, order_id, status) \n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->planning_id) . \"',\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->title) . \"',\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->alt) . \"',\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->image_name) . \"',\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->description) . \"',\n\t\t\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($order_id) . \"',\n\t\t\t\t\t\t\t\t'Y'\n\t\t\t\t\t\t\t\t)\";\n\t\t}\n\t\t//print $sql; \n\t\t//exit;\n\t\t$result\t\t\t= $database->query($sql);\n\t\t\n\t\tif($database->affected_rows == 1)\n\t\t{\n\t\t\t// $this->check_exists_in_temp_table($this->image_name);\n\t\t\tif($this->planning_gallery_id == 0)\n\t\t\t{\n\t\t\t\t$this->planning_gallery_id\t= $database->insert_id;\n\t\t\t\tif($_SESSION['inserted_ids'] != '')\n\t\t\t\t{\n\t\t\t\t $inserted_ids\t= $_SESSION['inserted_ids']. ','. $database->insert_id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['inserted_ids']\t= $database->insert_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->initialize($this->planning_gallery_id);\n\t\t}\n\t\n\t\t$this->message = cnst11;\n\t\treturn true;\n\t}", "public function store(Request $request)\n {\n $picture=new picture();\n //投稿した画像とコメントをDBに格納させる\n $picture->user_name=$request->user_name;\n $picture->content=$request->content;\n $filename=$request->file('thefile')->store('public'); //storageフォルダに投稿した画像を保存しファイルパスを格納\n $picture->image=str_replace('public/','',$filename); //ファイル名から「public/」を取り除く\n $picture->save();\n //tinkerコマンドと同じ\n return redirect()->route('picture.show',['id'=>$picture->id]);\n }", "protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }", "public function save($file = NULL)\n {\n if($file === NULL && $this->storage)\n {\n $this->storage->save($this);\n }\n elseif($file !== NULL)\n {\n $this->savePicture($file);\n }\n else\n {\n trigger_error('Image file to save is not defined', E_USER_WARNING);\n }\n }", "function save ($input) {\r\n // Do your processing\r\n // Save to database of something\r\n //processin here cuz\r\n\r\n// $fp = fopen('images/test.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $input); \r\n// fclose($fp);\r\n\r\n// $fp = fopen('images/len.txt', 'w');//opens file in append mode \r\n// fwrite($fp, strlen($input)); \r\n// fclose($fp);\r\n\r\n $img = str_replace('data:image/png;base64,', '', $input);\r\n $img = str_replace(' ', '+', $img);\r\n\r\n// $fp = fopen('images/img2.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $img); \r\n// fclose($fp);\r\n\r\n $fileData = base64_decode($img);\r\n file_put_contents('images/photo.png',$fileData);\r\n return true;\r\n}", "public function saveToDB()\n {\n }", "public function saveGame($name, $data, $imageData) {\n $savedGames = fopen(\"../../../ressources/savedGames/\".$name.\".json\", \"wb\");\n $savedGamesImg = fopen(\"../../../ressources/savedGames/\".$name.\".txt\", \"wb\");\n\tfwrite($savedGames, $data);\n\tfwrite($savedGamesImg, $imageData);\n\tfclose($savedGames);\n\tfclose($savedGamesImg);\n }", "public function store(){\n $validateactualite = $this->validate([\n 'titre'=>'required',\n 'sous_titre'=>'required',\n 'descri'=>'required'\n ]);\n $this->validate([\n 'photo'=>'required'\n ]);\n $record = actualite::create($validateactualite);\n $this->photo->storePubliclyAs('public/actualite/', $record->id.'.png');\n //$this->photos[$index]->storePubliclyAs('public/galleries/', $data->id.'.png' );\n session()->flash('message', 'actualite enregistré avec succès');\n $this->emit('Added');\n $this->dispatchBrowserEvent('Added');\n $this->resetFields();\n }", "public function save_to_db() {\r\n if ($this->id) {\r\n $stmt = $this->pdo->prepare(\"UPDATE contract SET\r\n companyName=:companyName,\r\n Signature=:Signature\r\n WHERE id=:identity\r\n \");\r\n $input_parameters = array(\r\n ':identity' => $this->id,\r\n ':companyName' => $this->companyName,\r\n ':sygnatura' => $this->signature,\r\n );\r\n $upload = $stmt->execute(\r\n $input_parameters\r\n );\r\n }\r\n//po��czenie z baz� i sprawdzenie czy ju� jest taka umowa\r\n else {\r\n $stmt = $this->pdo->prepare(\"SELECT * FROM contract WHERE Signature=:signature\");\r\n $stmt->bindParam(':signature', $this->signature, PDO::PARAM_STR);\r\n\r\n if ($stmt->rowCount() > 0)\r\n return self::SAVE_ERROR_DUPLICATE_SIGNATURE;\r\n $stmt = $this->pdo->prepare(\"INSERT INTO contract VALUES (NULL, :companyName, :signature,NULL, NULL )\");\r\n $upload = $stmt->execute(\r\n array(\r\n ':signature' => $this->signature,\r\n ':companyName' => $this->companyName\r\n )\r\n );\r\n }\r\n// komunikat o zapisie\r\n if ($upload)\r\n return self::SAVE_OK;\r\n else\r\n return self::SAVE_ERROR_DB;\r\n }", "public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "public function picture()\n\t\t{\n\t\t\tif(!Auth::check())\n\t\t\t\treturn 'fail';\n\n\t\t\t$user = Auth::user();\n\t\t\t$profile = Profile::find($user->id);\n\t\t\t$profile->picture = Input::get('picture');\n\n\t\t\tif ($profile->save())\n\t\t\t\treturn 'success';\n\t\t}", "abstract public function save( $data );", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "private function _getDataImg(){\n $this->Photo->createDirectoryIfNotExist(REPO_PHOTO, 0755);\n $idUser = $this->User->getIdUser($_SESSION['login']);\n\t\t$this->Photo->createDirectoryIfNotExist(REPO_PHOTO.$idUser.DS, 0755);\n $this->Photo->createDirectoryIfNotExist(REPO_PHOTO.$idUser.DS.'min'.DS, 0755);\n\n if (isset($_SESSION['filter']) && $_SESSION['filter'] !== 'none'){\n $filter = $_SESSION['filter'];\n } else {\n $filter = 'none';\n }\n if (!empty($_SESSION['objFilter']) && $_SESSION['objFilter'] !== null){\n $filterObj = $_SESSION['objFilter'];\n } else {\n $filterObj = 'noneObj';\n }\n $tabPathId = $this->Photo->savePhotoTmpToDb($idUser, $_POST['img64'], REPO_PHOTO.DS.$idUser, $filter, $filterObj);\n $_POST['img64'] = \"\";\n return $tabPathId;\n\t}", "public abstract function save();", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "public function save($data);", "public function save($data);", "public function save($data);", "public function saveWithPhoto($data)\n {\n //Inicia la transacción\n $this->begin();\n //Intenta crear el usuario con los datos pasados\n if ($this->create($data)) {\n //Intenta subit y actualizar la foto\n if ($this->updatePhoto()) {\n //Se confirma la transacción\n $this->commit();\n return true;\n }\n }\n\n //Si alga falla se regresa la transacción\n $this->rollback();\n return false;\n }", "public function postPicture(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n// $path,$desc,$tag\r\n $path=$_POST['path'];\r\n $desc=$_POST['content'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addPicture($path,$desc,$tag);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function save($value){\n $target_path = IMG_PATH.DS.$this->file_name;\n try {\n //move the uploaded file to target path\n move_uploaded_file($value, $target_path);\n return $this->_add_photo();\n } catch (Exception $e) {\n throw $e;\n }\n }", "function savephoto ($path,$thumb=true) {\n $req = new IMDB_Request(\"\");\n $photo_url = $this->photo ($thumb);\n if (!$photo_url) return FALSE;\n $req->setURL($photo_url);\n $req->sendRequest();\n if (strpos($req->getResponseHeader(\"Content-Type\"),'image/jpeg') === 0\n || strpos($req->getResponseHeader(\"Content-Type\"),'image/gif') === 0\n || strpos($req->getResponseHeader(\"Content-Type\"), 'image/bmp') === 0 ){\n\t$fp = $req->getResponseBody();\n }else{\n\t$this->debug_scalar(\"<BR>*photoerror* \".$photo_url.\": Content Type is '\".$req->getResponseHeader(\"Content-Type\").\"'<BR>\");\n\treturn false;\n }\n $fp2 = fopen ($path, \"w\");\n if ((!$fp) || (!$fp2)){\n $this->debug_scalar(\"image error...<BR>\");\n return false;\n }\n fputs ($fp2, $fp);\n return TRUE;\n }", "function uploadImageIntoDB($file)\n {\n $pfad = $file[tmp_name];\n $typ = GetImageSize($pfad);\n // Bild hochladen\n $filehandle = fopen($pfad,'r');\n $filedata = base64_encode(fread($filehandle, filesize($pfad)));\n $dbtype = $typ['mime'];\n return array(\"bild\"=>$filedata,\"typ\"=>$dbtype);\n }", "public function save(array $options = []) {\n/* if (preg_match('/image/', $this->mime_type)) {\n $this->isImage = true;\n $manager = new ImageManager(array('driver' => 'gd'));\n $image = Storage::disk('public')->get($this->myFile);\n $imageOrig = $manager->make($image); \n //Get width and height of the image\n $this->img_width = $imageOrig->width();\n $this->img_height = $imageOrig->height();\n }*/\n parent::save($options);\n $this->createThumbs();\n }", "function save();", "function save();", "function SaveImage($con, $image, $caption){\n\t\tmysqli_select_db($con, \"image_db\");\n\t\t$qry = \"INSERT INTO image_db (image,caption) values ('$image', '$caption')\";\n\t\t\n\t\t$result = mysqli_query($con, $qry) or die (\"Error: \".mysqli_error($con));\n\t\t\n\t\tif($result){\n\t\t\techo \"<br/>Image Uploaded<br/><br/><br/>\";\n\t\t}\n\t\telse{\n\t\t\techo \"<br/>Image NOT Uploaded\";\n\t\t}\n\t}", "public function save() {}", "public function save() {}", "public function save() {}", "function guardarImagen($name, $tipo, $path, $id){\n\t\n\t$path=\"img\\modelos\\\\\".$id.\"_\".$path;\n\t//Si reemplaza la imagen\n\t$existeImagen= sprintf(\"SELECT * FROM imagenes WHERE modelo_idmodelo = '%s' AND\n\t\t\ttipo = '%s' \", $id,$tipo);\n\t$result = mysql_query( $existeImagen);\n\t//Borrar la imagen antigua\n\tif($data=mysql_fetch_array($result)){\n\t\t\n\t\t//unlink('..\\\\'.$data['path']);\n\t\t//mysql_query(\"DELETE FROM imagenes WHERE idimagenes='\".$data[\"idimagenes\"].\"'\");\n\t}\t\n\t$insertImagen= sprintf(\"INSERT INTO imagenes (tipo, path, modelo_idmodelo)\n\t\t\tVALUES ('%s','%s','%s');\",$tipo, mysql_real_escape_string($path), $id);\n\t//Guardar la imagen nueva\n\tmove_uploaded_file($_FILES[$name][\"tmp_name\"],\n\t\t\t\"..\\img\\modelos\\\\\" .$id.\"_\". $_FILES[$name][\"name\"]);\n\t$result = mysql_query( $insertImagen);\n}", "function imageAllSave(Request $request);", "public function guardar(Request $request)\n {\n $salon= new salon;\n // $salon->foto=$request->foto;\n $salon->nombre=$request->nombre;\n $salon->descripcion=$request->descripcion;\n $salon->ubicacion=$request->ubicacion;\n $salon->estado=$request->estado;\n $salon->precio=$request->precio;\n\n if($request->foto==null)\n {//si no tiene imagen entonces se le asigna una imagen por defecto\n $salon->foto ='defecto.png';\n }else\n {\n /*guardando la super imagen */\n $explode=explode(',',$request->foto);\n $decoded=\\base64_decode($explode[1]);\n if(str_contains($explode[0],'jpeg')){\n $extension='jpg';\n }else{\n $extension='png';\n }\n $fileName = \\Str::random().'.'.$extension;\n $path= 'img'.'/'.$fileName;\n \\file_put_contents($path,$decoded);\n /*terminando de guardar la superImagen */\n $salon->foto=$fileName; \n }\n\n\n $salon->save();\n\n /*REGISTRA EL MOVIMIENTO EN LA BITACORA */\n $objdate = new DateTime();\n $fechaactual= $objdate->format('Y-m-d');\n $horaactual=$objdate->format('H:i:s');\n $bitacora = new bitacora();\n $bitacora->idEmpleado = session('idemp');\n $bitacora->fecha = $fechaactual;\n $bitacora->hora = $horaactual;\n $bitacora->tabla = 'salon';\n $bitacora->codigoTabla = $salon->id;\n $bitacora->transaccion = 'crear';\n $bitacora->save();\n }", "function save_img() {\n imagejpeg($this->img, 'captcha.jpg');\n\n // Libération de la mémoire\n imagedestroy($this->img);\n \n }" ]
[ "0.7369128", "0.70571727", "0.6836592", "0.676557", "0.67205864", "0.6650237", "0.663833", "0.652806", "0.65073305", "0.6482809", "0.6481554", "0.64766437", "0.64660317", "0.64202", "0.6417862", "0.64090043", "0.6383119", "0.6353745", "0.63455117", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6327706", "0.6317963", "0.63062936", "0.62995", "0.6285018", "0.6284257", "0.62721413", "0.62682897", "0.6252942", "0.6251622", "0.62468666", "0.62198496", "0.62139225", "0.6210886", "0.621", "0.62039715", "0.61974484", "0.61943907", "0.619202", "0.6185144", "0.6185144", "0.6185144", "0.6185144", "0.6185144", "0.61663485", "0.6159701", "0.61522865", "0.6128152", "0.6128", "0.611679", "0.6115169", "0.61108303", "0.61041015", "0.6098948", "0.609377", "0.6085746", "0.60799295", "0.6075536", "0.6075412", "0.6073208", "0.60432094", "0.60414654", "0.60377574", "0.60308534", "0.6030234", "0.602665", "0.602665", "0.602665", "0.6003795", "0.6000399", "0.59989387", "0.5996541", "0.5991389", "0.59807223", "0.59769976", "0.59769976", "0.5976186", "0.59684813", "0.59684813", "0.5967243", "0.5954598", "0.59521073", "0.59473896", "0.5941855" ]
0.7265487
1
Action for the creation of a new room
public function createRoomAction(WampConnection $connection, WampRequest $request, $parameters) { $parameters = json_decode($parameters[0]); if (!isset($parameters->room->name)) { throw new Exception("missing_roomname"); } elseif (!isset($parameters->room->schema)) { throw new Exception("missing_schema"); } else { $this->nameValidator->validate($parameters->room->name); $this->schemaValidator->validate($parameters->room->schema); } $room = $this->roomService->createRoom($parameters); return $this->serializer->serialize($room, "json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Rooms();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('admin.room.create');\n }", "public function actionCreate() {\n $model = new Rooms();\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n $transection = Yii::$app->db->beginTransaction();\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'บันทึกข้อมูลสำเร็จ');\n $transection->commit();\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'เกิดข้อผิดพลาด. กรุณาลองใหม่อีกครั้ง');\n $transection->rollBack();\n return $this->redirect(['create']);\n }\n } catch (Exception $ex) {\n Yii::$app->session->setFlash('error', 'เกิดข้อผิดพลาด. กรุณาลองใหม่อีกครั้ง');\n return $this->redirect(['create']);\n }\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('room.create');\n }", "public function create()\n {\n return view('room.create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new MainRoom;\n\n\t\t// update/create section\n\t\tif (isset($_POST['MainRoom'])) {\n\t\t\t$model->attributes = $_POST['MainRoom'];\n\t\t\tif ($model->validate()) {\n\t\t\t\t$model->save(false);\n\t\t\t\t$model->position = $model->id;\n\t\t\t\t$model->save(false);\n\n\t\t\t\t$this->redirect(array('index'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function addRoomAction()\n\t{\n\t\t$data = $this -> facade -> getArray();\n\t\t$this -> view -> showRoomForm($data);\n\t\tif(isset($_POST['room']))\n\t\t{\n\t\t\t$this -> facade -> addRoom($_POST['room']);\n\t\t}\n\t\treturn true;\n\t}", "public function create()\n {\n return view('app.room.add'); //\n }", "public function create()\n {\n return view('add-room');\n }", "public function create_room(){\n\t$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n\t$config = array(\n array(\n 'field' => 'room_name', \n 'label' => 'Room Name',\n 'rules' => 'trim|required',\n ),\n array(\n 'field' => 'room_number',\n 'label' => 'Room number',\n 'rules' => 'trim|required',\n ), \n );\n $this->form_validation->set_rules($config);\n if ($this->form_validation->run() === TRUE)\n {\t\t\n \n\t\t\t$cdata = array(\n\t\t\t\t \n\t\t\t 'room_name' => $this->input->post('room_name'),\n\t\t\t 'room_number' => $this->input->post('room_number'),\n\t\t\t 'room_status' => 'a',\n\t\t\t 'room_created' => date('Y-m-d H:i:s'),\n\t\t\t 'room_updated' => date('Y-m-d H:i:s'),\n\t\t\t);\n\t\t\t\n\t\t\t$this->db->insert('rooms', $cdata);\n\t\t\t$this->data['message'] = \"room added successfully\";\n }\n\n $this->data['page_name'] = 'create_room';\n $this->data['page_title'] = get_phrase('create_room');\n $this->load->view('backend/index.php', $this->data);\n\t\t//$this->template->adminTemplate($this->data);\n\t}", "public function create()\n {\n $room = new Room();\n return view('crud.room.create',compact('room'));\n }", "public function create()\n {\n return view('admin.rooms.create');\n }", "public function create()\n {\n abort_unless(\\Auth::check() && \\Auth::User()->isAdmin(), 403);\n \n return view('rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function createRoom($apartment_id){\n $apartment = Apartment::findOrFail($apartment_id);\n $this->authorize('update',$apartment);\n $room_types = Room::$room_types;\n array_push($room_types,\"EXTRA\");\n array_push($room_types,\"EXTRA2\");\n return view('apartments.create-room',[\n 'apartment'=> $apartment,\n 'room_types' => $room_types\n ]);\n }", "public function create()\n {\n return view('user.add_roomer');\n }", "public function create()\n {\n // $bookings = Room::get();\n // return view('rooms.create',['rooms' => (new Booking())]);\n }", "public function create()\n {\n $roomtypes = RoomType::all();\n return view('backend.rooms.create',compact('roomtypes'));\n }", "public function create()\n {\n //\n if (Auth::user()->can('hotel-admin')) {\n $rooms = Room::all();\n $types = Type::all();\n return view('admin.hotel.create', compact('rooms', 'types'));\n }\n\n else return redirect(route('admin.home'));\n\n }", "public function create()\n {\n $buildings = Building::where('user_id',Auth::User()->id)->get();\n return view('owner.room.create',compact('buildings'));\n }", "public function create()\n {\n if (! Gate::allows('hostelroom_create')) {\n return abort(401);\n }\n \n $blocks = Hostelblock::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('hostel.room.create', compact('blocks'));\n }", "public function create_room ( $data ) {\n\t\t$room_slug = str_replace(\" \", \"-\", strtolower($data['name']));\n\t\t$new_slug = $data['trainer_id'] . \"-\" . $room_slug;\n\t\tif ($this->check_room($new_slug)) {\n\t\t\treturn array('success' => false, 'msg' => 'room exist' );\n\t\t}\n\t\telse {\n\t\t\tif ( $this->deactivate_rooms( $data['trainer_id'] ) == true ) {\n\t\t\t\tif ( $data['banner_type'] == 1 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, mc_api, mc_list, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['mc_api'].\"', '\".$data['mc_list'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse if ( $data['banner_type'] == 2 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, banner_url, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['banner_url'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\n\t\t\t\tif ($this->conn->query($sql) === TRUE) {\n\t\t\t\t return array('success' => true, 'slug' => $new_slug );\n\t\t\t\t} else {\n\t\t\t\t\treturn array('success' => false, 'msg' => 'database error', 'sql' => $sql );\n\t\t\t\t //echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function addRoom(\\pl\\dagguh\\buildings\\Room $room);", "public function create()\n {\n $rooms = Room::all();\n return view('dashboard.device.create-edit',compact('rooms'));\n }", "public function create()\n {\n $roomfeatures = RoomFeature::all();\n \n $this->layout = View::make('roomtypes.new-roomtype', array('roomfeatures' => $roomfeatures));\n $this->layout->title = trans('syntara::rooms.features.new');\n $this->layout->breadcrumb = Config::get('syntara::breadcrumbs.create_room_feature');\n }", "public function create()\n {\n return view('admin.room-types.create');\n }", "public function create()\n {\n //$room_no = \\DB::table('room_info')->lists('room_no', 'id');\n }", "public function actionAdd($room) {\n $model = new Energies();\n $model->scenario = 'add_data';\n $model->rooms_id = $room;\n $model->users_id = Yii::$app->user->identity->id;\n\n $dataProvider = Energies::find()->where(['rooms_id' => $room])->orderBy('peroid DESC')->limit(5)->all();\n if ($model->load(Yii::$app->request->post())) {\n $transection = \\Yii::$app->db->beginTransaction();\n try {\n //$model->users_id = Yii::$app->user->identity->id;\n $model->record_date = date('Y-m-d H:i:s');\n //die(var_dump($model));\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'บันทึกข้อมูลสำเร็จ');\n $transection->commit();\n return $this->redirect(['rooms/index']);\n }\n } catch (Exception $ex) {\n Yii::$app->session->setFlash('error', $ex);\n }\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionCreate() {}", "public function actionCreate() {}", "public function store()\n {\n Room::create(request()->validate([\n 'name'=>['required', 'min:3'],\n 'slug'=>['required', 'min:3'],\n 'description'=>['required', 'min:3'],\n 'available_seats'=>['required'],\n 'is_active'=>['required'],\n 'can_teleconference'=>['required'],\n ]));\n\n // $rooms= new Rooms;\n // $rooms->name=request('name');\n // $rooms->slug=request('slug');\n // $rooms->description=request('description');\n // $rooms->available_seats=request('available_seats');\n // $rooms->is_active=request('is_active');\n // $rooms->can_teleconference=request('can_teleconference');\n \n // $rooms->save();\n\n return redirect('/')->with('success', 'Room created successfully.');\n }", "public function create()\n {\n //return view('book_room');\n $room_types = Room_Type::all();\n\n return view('book_room')->with([\n 'room_types' => $room_types \n ]);\n }", "public function create()\n {\n return view('admin.room_types.add_room_type');\n }", "public function create(Request $request)\n {\n return view('painel.rooms.create');\n }", "public function create()\n\t{\n\t\t$categories = Category::pluck('name', 'id');\t\n\t\treturn view('maintenance.room.create', compact('categories'));\n\t}", "public static function create_room($roomName) {\n\t\treturn self::runCommand(\"create_room \" . escapeshellarg($roomName) . \" conference.\" . self::$ejabberdHost . \" \" . self::$ejabberdHost);\n\t}", "public function create(Request $request)\n {\n\n $type = $request->get('type');\n $room_id = $request->get('room_id');\n\n $title = '';\n\n switch ($type) {\n case Room::TYPE_AFFORDABLE:\n $title = 'Small Room';\n break;\n case Room::TYPE_MIDDLE_CLASS:\n $title = 'Big Class Room';\n break;\n case Room::TYPE_VIP:\n $title = 'V.I.P';\n break;\n }\n\n return view('reservations.create')->with('title', $title)->with('room_id', $room_id);\n }", "public function store(RoomRequest $request)\n {\n Room::create($request->all());\n return redirect('room')->with('A room has been created successfull!');\n }", "public function create(){\n $roomPrice=RoomPrice::max('room_price_id')+1;\n $roomType=RoomType::max('room_type_id')+1;\n $roomDesc=RoomBand::max('room_band_id')+1;\n\n\n return view('rooms.create',[\n 'roomprice' => $roomPrice,\n 'roomtype' => $roomType,\n 'roomdesc' => $roomDesc\n ]);\n }", "public function create()\n {\n $roomList = Room::all();\n return view('computers.create',\n array(\"roomList\" => $roomList));\n }", "public function create()\n {\n return view('admin.pictureRoom.create');\n }", "private function create_new_room($entity_id){\n //Create a new room object for the entity id\n $new_room = new \\App\\Room($entity_id);\n //Add to the list of currently open rooms\n array_push($this->open_rooms, $new_room);\n //Get the resource index\n $new_room->set_resource_index(sizeof($this->open_rooms) - 1);\n echo \"Created a new room for entity: \" . $entity_id . \"\\n\";\n return $new_room;\n }", "public function create()\n {\n $chatroom = ChatRoom::all();\n return view('superadmin::autochat.create', compact('chatroom'));\n }", "public function actionCreate()\n {\n $model = new Tournament();\n\n if ($model->load(Yii::$app->request->post()) && $model->createNewTournament()) {\n\n return $this->redirect(['view', 'id' => $model->id_t]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function create()\n {\n $rooms = Room::all();\n $types = Equipmenttype::all();\n $users = User::all();\n return view('equipment.create', compact('rooms', 'types', 'users'));\n }", "public function action_create()\n {\n if (Valid::not_empty($_POST)) \n {\n if(Model::factory('level')->create_level($_POST))\n $this->request->redirect('sadmin/levels/list');\n }\n $data = $this->data;\n $data['sidebar']->set('sidebar_index', 'create_levels');\n $data['year'] = $this->request->param('id');\n Helper_Output::factory()\n ->link_js('js/level/index')\n ->link_js('js/class/templates') ;\n $this->setTitle('Create Level')\n ->view('levels/create', $data)\n ->render();\n }", "function createRoom(){\n\t\t$roomid = (int)$_POST['roomid'];\n\t\tif($roomid < 0){ throw new Exception('Invalid player');}\n\t\t$session = @mt_rand(0,99999999999);\n\t\tglobal $db;\n\t\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t\t$q->execute(array($roomid));\n\t\t$r = $q->fetch();\n\t\tif($r == null){\n\t\t\t$q = $db -> prepare(\"INSERT INTO game (sessionid,roomid,cardnorth,cardeast,cardsouth,cardwest) VALUES(?,?,?,?,?,?)\");\n\t\t\t$q->execute(array($session,$roomid,'0','0','0','0'));\n\t\t\t$q = $db -> prepare(\"INSERT INTO session (roomid, timer, hand, done, ready) VALUES(?,?,?,?,?)\");\n\t\t\t$q->execute(array($roomid,'0','0','0','0'));\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "public function actionCreate()\n {\n $model = new ReservationDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'reservation_id' => $model->reservation_id, 'goods_id' => $model->goods_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createAction(){\n $action = \"new\";\n $actionText = \"Create Book\";\n // create empty book...\n $book = new Book();\n require_once('views/bookForm.php');\n }", "public function actionCreate() {\n $model = new MissionCarers;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['MissionCarers'])) {\n $model->attributes = $_POST['MissionCarers'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Reservation();\n $model->user_id = \\Yii::$app->user->id;\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(){\n\n $rooms = Room::pluck('room_number', 'room_id');\n return view('tenants.tenant-create',['rooms'=>$rooms]);\n }", "public function newAction(Request $request)\n {\n $bedRoom = new Bedroom();\n $form = $this->createForm('AppBundle\\Form\\BedRoomType', $bedRoom);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($bedRoom);\n $em->flush();\n\n return $this->redirectToRoute('bedroom_show', array('id' => $bedRoom->getId()));\n }\n\n return $this->render('bedroom/new.html.twig', array(\n 'bedRoom' => $bedRoom,\n 'form' => $form->createView(),\n ));\n }", "public function create(Request $request)\n {\n if(!isset($request['roomId'])){\n return redirect()->back();\n }\n\n $roomId = $request['roomId'];\n\n $room = Room::where('id',$roomId)->first();\n \n if($room == null)\n return redirect()->back()->with('alert','Ruangan tidak ditemukan');\n\n $viewdata = array(\n 'room_id' => $room->id,\n 'room_name' => $room->room_name,\n 'room_capacity' => $room->room_capacity,\n 'room_photo' => $room->photo,\n 'booking_time' => null,\n 'total_person' =>'',\n 'noted' => '',\n );\n\n return response()->json(['success'=> $this-> success,'data' => $viewdata ], $this->successStatus);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Route();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->save();\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function addRoom($room = null){\n $client = Yii::$app->roomService;\n $data = $client->add(['sid'=>$this->sid,'room'=>$room]);\n $this->room_id = $data->return->id;\n return $data;\n }", "public function actionCreate()\n {\n $model = new ArsBooking();\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 create()\n {\n $user = Auth::user();\n //$role = User::find($id)->role;\n if ($user->can('create', Classroom::class))\n {\n return view('Classroom.ClassroomCreate');\n }\n return response('Unauthorized.', 401);\n }", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'id' => $this->input->post('id'),\n\t\t\t\t'hotel_id' => $this->input->post('hotel_id'),\n\t\t\t\t'category_id' => $this->input->post('category_id'),\n\t\t\t\t'room_no' => $this->input->post('room_no'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'capacity' => $this->input->post('capacity'),\n\t\t\t\t'created_at' => $this->input->post('created_at'),\n\t\t\t\t'updated_at' => $this->input->post('updated_at'),\n );\n \n $room_id = $this->Room_model->add_room($params);\n redirect('room/index');\n }\n else\n { \n $data['_view'] = 'room/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function createAction() {\n\t}", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create()\n\t{\n\t\t$customers = Customer::lists('company_name', 'id');\n\t\t$manufacturers = Manufacturer::lists('manufacturer_name', 'id');\n\n\t\t//if(Auth::user()->hasRole('Manager')){\n\t\t\treturn view('equipments.create', compact('customers','manufacturers'));\n\t\t//}else{\n\t\t\t//return Redirect::to('equipments')->with('alert', 'You do not have permission to create a equipment');\n\t\t//}\n\t}", "public function create()\n {\n $title = \"Add New Loom\";\n $branches = Branch::all();\n $villages = Village::all();\n $tehsils = Tehsil::all();\n return view('looms.addNew', compact('title', 'branches', 'villages', 'tehsils'));\n }", "public function store(RoomRequest $request)\n {\n $data = $request->only(array_keys($request->rules()));\n Room::create($data);\n return redirect()->route('rooms.index')\n ->with('message','Sala cadastrada com sucesso!');\n }", "public function create(Request $request): View\n {\n $this->authorize('create', Room::class);\n\n $hotels = Hotel::pluck('name', 'id');\n\n return view('app.rooms.create', compact('hotels'));\n }", "public function create()\n {\n\n $hr = array();\n for($i=0;$i<=23;$i++){\n if($i<=9){\n $hr['0'.$i] ='0'.$i ;\n }else{\n $hr[$i] = $i ;\n }\n\n }\n $min = array();\n for($i=0;$i<=59;$i++){\n if($i<=9){\n $min['0'.$i] ='0'.$i ;\n }else{\n $min[$i] = $i ;\n }\n\n }\n\n $hotel = DB::table('group_hotel as gp')->join('hotels as h','gp.hotel_id','=','h.hotel_id')->where('is_deleted','=',0)->where('agent_id','=',$this->groupId)->select('hotel_name','h.hotel_id')->lists('hotel_name','hotel_id');\n return view('roomingList.create',compact('hr','min','hotel'));\n }", "public function create($room_no)\n\t{\n\t\t$inspectors = Inspector::lists('name', 'id');\n\n\t\treturn View('d_checks.create',compact('room_no','inspectors'));\n\t}", "public function create() {\n $facilities = $this->facilitiesRepo->readFacilitiesByParentAdmin();\n $options1 = $this->productRepo->allProduct(\\App\\Product::TYPE_PRODUCT);\n $product_html = \\App\\Helpers\\StringHelper::getSelectOptions($options1);\n $type = \\Auth::user()->user_type_id;\n if($type == 3){\n $item = $this->productRepo->allProduct();\n }\n else if($type == 1){\n $item = $this->productRepo->allProductByUser();\n }\n return view('backend/room/create', compact('product_html', 'facilities','item'));\n }", "public function create()\n\t{\n\t\t$data['title'] = \"Level Admin\";\n\t\t// $data['level'] = $this->level->getAll();\n\t\t$data['action'] = \"level/insert\";\n\t\t$this->template->admthemes('level/formCreate',$data);\n\t}", "public function testRoomMembershipCreatedWithRoom()\n {\n $user = factory(User::class)->create();\n\n $this->assertTrue(RoomMembership::count() == 0);\n $this->actingAs($user)->withHeaders([\n 'Authorization' => 'Bearer '.$user->api_token\n ])->json('POST', '/api/rooms', [\n 'name' => 'Test Room'\n ]);\n $this->assertTrue(RoomMembership::count() == 1);\n\n $room = Room::first();\n $room_membership = RoomMembership::first();\n $this->assertEquals($room->id, $room_membership->room_id);\n $this->assertEquals($user->id, $room_membership->user_id);\n }", "public function createAction()\n {\n }", "public function actionCreate()\n {\n $model = new HospitalForm();\n if ($model->load(Yii::$app->request->post())) {\n $model->groupid=Groups::GROUP_HOSPITAL;\n $model->admin_user_id=Yii::$app->user->id;\n if($res = $model->signup()){\n return $this->redirect(['details', 'id' => $res->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }", "public function create()\n {\n $op = Auth::user()->authorizeRoles(['CREATE', 'ADMIN']);\n if($op)\n return view('equipo.create');\n else\n return redirect()->back();\n }", "public function create()\n\t{\n\t\t//\n return View::make('admin.cargo.create');\n\t}", "public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //abort, if user is not admin (-> ID = 1)\n abort_if(auth()->user()->id !== 1, 403);\n return view('game.create');\n }", "public function create()\n {\n //\n return view('turnos.create');\n }", "public function create()\n\t{\n\t\t//\n\t\techo'create';\n\t}", "public function postNew(Request $request)\n {\n $floor = new Floor();\n $floor->name = $request->name;\n $floor->floor_code = $request->code;\n $floor->level_no = $request->floor_level;\n $floor->description = $request->description;\n $floor->active = $request->available == \"on\" ? 1 : 0;\n $floor->save();\n\n $emp = new EmployeeActivity();\n $emp->emp_name = Auth::user()->firstname . ' ' . Auth::user()->middlename . ' ' . Auth::user()->lastname;\n $emp->emp_info = Auth::user()->email . ' ' . Auth::user()->phone . ' ' . Auth::user()->address;\n $emp->operation = \"New Floor Added<br/>Floor Code: \" . $request->code;\n $emp->save();\n\n return back()->with('success', ' New Floor has been added.!');\n\n }", "public function create()\n {\n //\n return view('cargo.create');\n }", "public function create()\n\t{\n\t\t// handled by backbone routes\n\t}", "public function store(RoomStoreRequest $request)\n\t{\n\t\t$this->dispatch(new AddRoom($request));\n\t\treturn redirect('room')->with('success-message', __('tasks.success'));\n\t}", "protected function post() {\n // Get data form request body\n $request_data = $this->get_request_body();\n if ($request_data->room_name == \"\" || $request_data->username == \"\") {\n $this->write_error(\"Request Error!\");\n }\n $this->room_name = addslashes(htmlentities($request_data->room_name));\n $this->username = addslashes(htmlentities($request_data->username));\n $this->options = $request_data->options;\n\n if (!$this->db->check_row(\"rooms\", array(\"room_name\" => $this->room_name))) {\n $access = $this->options->access;\n $tags = $this->options->tags;\n $add_room_qr = \"INSERT INTO rooms (room_ID, session_ID, room_name, access, tags)\n VALUES ('$this->room_ID', '$this->session_ID', '$this->room_name', '$access', '$tags')\";\n $add_room = $this->db->query($add_room_qr);\n if ($add_room) {\n $user = new users(null);\n $result = $user->join_room($this->username, $this->room_ID);\n return $result;\n }else {\n $this->write_error(\"Error creating room!\");\n }\n }else {\n $this->write_error(\"Room already exist!\");\n }\n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function store(RoomRequest $request)\n {\n logger()->info(__METHOD__);\n $this->model->storeRoom();\n return $this->getView();\n }", "function add($tab = 'details'){\n\t\t\n\t\t$this->auth->check('rooms.add');\n\t\t$body['tab'] = ($this->session->flashdata('tab')) ? $this->session->flashdata('tab') : $tab;\n\t\t$body['room'] = NULL;\n\t\t$body['room_id'] = NULL;\n\t\t\n\t\t$body['users'] = $this->security->get_users_dropdown(TRUE);\n\t\t$body['cats'] = $this->rooms_model->get_categories_dropdown(TRUE);\n\t\t$body['cats'][-2] = 'Add new ...';\n\t\t\n\t\t$tpl['subnav'] = $this->rooms_model->subnav();\n\t\t$tpl['title'] = 'Add room';\n\t\t$tpl['pagetitle'] = 'Add a new room';\n\t\t$tpl['body'] = $this->load->view('rooms/addedit', $body, TRUE);\n\t\t$this->load->view($this->tpl, $tpl);\n\t\t\n\t}", "public function create()\n {\n return view('actor.create');\n }", "public function actionCreate()\n {\n $model = new Rents();\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 create()\n {\n //Not Used because using API Route\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required|unique:rooms'\n \n ]);\n\n $room = Room::create([\n 'title' => $request->input('title'),\n 'slug' => Str::random(8)\n ]);\n\n if($room){\n //redirect dengan pesan sukses\n return redirect()->route('admin.room.index')->with(['success' => 'Data Berhasil Disimpan!']);\n }else{\n //redirect dengan pesan error\n return redirect()->route('admin.room.index')->with(['error' => 'Data Gagal Disimpan!']);\n }\n }", "public function create()\n {\n return view('manager.game.create');\n }", "function addHotelRoom(Request $request){\n $oUser = Auth::user();\n $is_organizer=false;\n\n if($oUser->role!='admin'){\n foreach($oUser->traveller->travellersPerTrip as $travellersPerTrip) {\n $is_organizer=$travellersPerTrip->is_organizer;\n }\n }\n if (($oUser->role == 'guide'&& $is_organizer)||($oUser->role=='admin'))\n {\n $oRoom=new RoomsPerHotelPerTrip();\n $oRoom->hotels_per_trip_id=$request->post('hotels_per_trip_id');\n $oRoom->size=$request->post('AantalPersonen');\n $oRoom->save();\n\n return redirect()->back();\n }\n else{\n return redirect()->back();\n }\n }", "public function actionCreate()\n {\n $model = new WechatMenu();\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 run()\n {\n RoomType::create([\n 'name' => 'Standard'\n ]);\n RoomType::create([\n 'name' => 'Especial'\n ]);\n RoomType::create([\n 'name' => 'Pro'\n ]);\n RoomType::create([\n 'name' => 'Deluxe'\n ]);\n }", "public function actionCreate()\n {\n $model = new Role();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function onRoomsAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }" ]
[ "0.8020905", "0.75252527", "0.7455774", "0.7438222", "0.7438222", "0.7421939", "0.73802525", "0.73505247", "0.7342222", "0.7280407", "0.7273646", "0.72405326", "0.7185449", "0.7178064", "0.7178064", "0.7178064", "0.71716064", "0.7098121", "0.7076161", "0.70568204", "0.68615556", "0.68477553", "0.6821143", "0.68146324", "0.6758701", "0.67454076", "0.66668326", "0.6663373", "0.66285396", "0.66240263", "0.6602688", "0.6602688", "0.6597368", "0.65946835", "0.6556584", "0.6520851", "0.651513", "0.64932257", "0.645154", "0.6409979", "0.63922125", "0.6377701", "0.63738143", "0.6339078", "0.63361007", "0.6325053", "0.6320309", "0.6319524", "0.631519", "0.62790084", "0.62751573", "0.6253216", "0.620408", "0.6202303", "0.62012184", "0.6194589", "0.6190457", "0.61787444", "0.6177752", "0.6152507", "0.614176", "0.6138771", "0.61368465", "0.6136171", "0.6127323", "0.61044425", "0.6089065", "0.60886127", "0.6068584", "0.606133", "0.6057992", "0.6055066", "0.60527456", "0.6043431", "0.6032666", "0.60309327", "0.6026049", "0.6023328", "0.6022578", "0.60023624", "0.59987736", "0.5991578", "0.5990881", "0.5987017", "0.5979023", "0.597258", "0.5970083", "0.59685135", "0.59668404", "0.59586185", "0.59568375", "0.5952499", "0.59440726", "0.593481", "0.5932543", "0.5932363", "0.5930484", "0.5929327", "0.592402", "0.59221613", "0.592108" ]
0.0
-1
Adds a developer to the room
public function addDeveloperAction(WampConnection $connection, WampRequest $request, $parameters) { $parameters = json_decode($parameters[0]); if (!isset($parameters->room->id)) { throw new Exception("missing_roomid"); } elseif (!isset($parameters->user->id)) { throw new Exception("missing_userid"); } else { $this->identifierValidator->validate($parameters->room->id); } $room = $this->roomService->addDeveloper($parameters); return $this->serializer->serialize($room, "json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDeveloper($developer)\n {\n $data = array(\n 'GBID' => $developer->id,\n 'Name' => $developer->name,\n 'API_Detail' => $developer->api_detail_url,\n 'GBLink' => $developer->site_detail_url,\n 'Image' => is_object($developer->image) ? $developer->image->small_url : null,\n 'ImageSmall' => is_object($developer->image) ? $developer->image->icon_url : null,\n 'Deck' => $developer->deck\n );\n\n return $this->db->insert('developers', $data); \n }", "function setDeveloper($dev)\n {\n if (strlen($dev) > 64) {\n throw new InvalidArgumentException(\"Input must be 64 characters or less\n in length!\");\n }\n $this->_developer = $dev;\n }", "public function getDeveloper_id()\n {\n return $this->developer_id;\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "abstract function is_developer();", "public function addDevice($dev){\n try{\n $this->validateDevice($dev);\n }catch (Exception $e){\n $this->processException($e);\n }\n\n $devDisplayName=$this->getDisplayNameForDevice($dev);\n $devUnits=$this->getUnitsForDevice($dev);\n $devColor=$this->getColorForDevice($dev);\n\n $this->report[\"devices\"][$dev]=array(\n \"displayName\"=>$devDisplayName,\n \"units\"=>$devUnits,\n \"color\"=>$devColor,\n \"data\"=>array()\n );\n }", "public function addProfessional()\n {\n }", "function getDeveloper() \n {\n return $this->_developer;\n }", "public function addUser(){}", "public function hasdeveloper()\n {\n return $this->hasuser() && $this->user()->isdeveloper();\n }", "public function insertContributor($data){\r\n $this->insert($data);\r\n }", "public function addUser(){\n\t}", "public function add($user){\n\n $this->builder->insert($user);\n\n }", "public function developer()\n {\n return $this->belongs_to('Developer');\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function ajouter()\n {\n $ajout_return = $this->loadModel('SallesManagerModel')->add_item('salles');\n $this->quit( '/gestionsalles', 'events.gestionsalles.msg', $ajout_return );\n }", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "final public function addAdmin() {\n $eventclass = $this->event;\n $admin_data = $eventclass::getAdminData();\n\n if ($admin_data) {\n if (!isset($admin_data['usertype'])) {\n $admin_data['usertype'] = self::getDefaultUserType();\n }\n $this->addToRecipientsList($admin_data);\n }\n }", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function mustbedeveloper()\n {\n if (!$this->hasdeveloper())\n {\n $this->web()->noaccess();\n }\n }", "function setDevId($value)\n {\n $this->_props['DevId'] = $value;\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "public function getDeveloper($uuid)\n {\n }", "function getOrAddDeveloper($gbDeveloper)\n {\n // get developer from db\n $developer = $this->getDeveloperByGBID($gbDeveloper->id);\n\n // if developer isn't in db\n if($developer == null)\n {\n // developer was not found, get from Giant Bomb\n $this->load->model('GiantBomb');\n $result = $this->GiantBomb->getMeta($gbDeveloper->id, \"company\");\n\n // if developer was returned\n if ($result != null && $result->error == \"OK\" && $result->number_of_total_results > 0) {\n // add developer to database\n $this->addDeveloper($result->results);\n\n } else {\n // developer was not found\n return false;\n }\n\n // get developer from db\n $developer = $this->getDeveloperByGBID($gbDeveloper->id);\n }\n\n return $developer;\n }", "public function is_developer() {\n\t\treturn $this->user->exists() && in_array(self::DEVELOPER_ROLE_NAME, $this->user->roles);\n\t}", "public function addVendor(Vendor $vendor): void\n {\n $this->vendors[] = $vendor;\n }", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}", "public function add($team);", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\t$users = $this->ShopList->User->find('list');\n\t\t$shopShippingMethods = $this->ShopList->ShopShippingMethod->find('list');\n\t\t$shopPaymentMethods = $this->ShopList->ShopPaymentMethod->find('list');\n\t\t$this->set(compact('users', 'shopShippingMethods', 'shopPaymentMethods'));\n\t}", "public function add() {\n\n\t\t//Initializing variables\n\t\t$titles = ''; $farmerGroups = '';\n\n\t\tif ($this->request->is('post')) {\n\n\t\t\t//i am manually setting the 'users.user_category_id' field to a value equivalent to farmers in the 'user_category' table\n\t\t\t$this->request->data['User']['user_category_id'] = 3;\n\n\t\t\t//i am setting the entry person of this record to the currently logged in user.\n\t\t\t$this->request->data['User']['entered_by'] = $this->Auth->user('id');\n\n\t\t\t//i am setting the buying station of the farmer to that of the currently logged in Field-Officer\n\t\t\t$this->request->data['User']['buying_station_id'] = $this->Auth->user('buying_station_id');\n\n\t\t\t$this->User->create();\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Information has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The info about the farmer could not be saved. Please, review your entry & try again!'));\n\t\t\t}\n\t\t}\n\n\t\t$titles = $this->User->Title->find('list');\n\t\t$farmerGroups = $this->User->FarmerGroup->find('list', array(\n\t\t\t'conditions' => array('FarmerGroup.buying_station_id' => $this->Auth->user('buying_station_id')),\n\t\t));\n\t\t$this->set(compact('titles', 'genders', 'farmerGroups'));\n\n\t}", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "function add(){\n\t\t\tif(!is_super_admin_login())\n\t\t\t\treturn $this->vista->acceso_restringido();\n if(!empty($this->params['programa'])){\n TPrograma::add($this->params['programa']);\n }\n }", "public function setDeveloperName($developerName)\n {\n $this->developerName = $developerName;\n return $this;\n }", "public function setDeveloperName($developerName)\n {\n $this->developerName = $developerName;\n return $this;\n }", "public function register_with_tyk() {\n\t\ttry {\n\t\t\t$tyk = new Tyk_API();\n\t\t\t$user_id = $tyk->post('/portal/developers', array(\n\t\t\t\t'email' => $this->user->user_email,\n\t\t\t\t));\n\t\t\t$this->set_tyk_id($user_id);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\ttrigger_error(sprintf('Could not register user for API: %s', $e->getMessage()), E_USER_WARNING);\n\t\t}\n\t}", "function cmst_vendor_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"mst_vendor\"] = new cmst_vendor();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'mst_vendor', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "function add_roster($data) {\n\n\t\t$query = $this -> db -> insert('Roster', $data);\n\n\t\treturn true;\n\t}", "public function add()\n {\n\n //Log::write('debug',$this->request);\n\n $clientIdentifier = '1234567890';\n //$clientIdentifier = $this->request->query['client_id'];\n if(!$clientIdentifier){\n throw new UnauthorizedException('Client Identifier not found');\n }\n \n /*if(empty($data['email'])){\n throw new BadRequestException(__('Email is required','email'));\n }*/\n\n //$ref_code = 'ref12';\n //$ref_code = $this->request->query['ref_code'];\n /*validate vendor on basis of client identifier*/\n $this->loadModel('Vendors');\n $getVendorId = $this->Vendors->find()->where(['client_identifier'=>$clientIdentifier])->first()->id;\n if (!$getVendorId) {\n throw new UnauthorizedException('This Vendor is not linked to upwardly');\n }\n // Generate username _suggestUsername function\n // $first_name = $this->request->data()['first_name'];\n // $last_name = $this->request->data()['last_name'];\n // $this->request->data['username'] = $this->_suggestUsername($first_name.$last_name);\n\n // $this->request->data['username'] = $username;\n // Create vendor players data\n $this->request->data['vendor_players'][0]['vendor_id'] = $getVendorId;\n // $this->request->data['vendor_players'][0]['ref_code'] = $ref_code;\n $this->request->data['vendor_players'][0]['created'] = '2017-09-06 06:27:24';\n $this->request->data['vendor_players'][0]['modified'] = '2017-09-06 06:27:24';\n $player = $this->Players->newEntity();\n if ($this->request->is('post')) {\n $player = $this->Players->patchEntity($player, $this->request->getData(),['associated'=>['VendorPlayers']]);\n // pr($player); die('ssx');\n if ($this->Players->save($player,['associated'=>['VendorPlayers']])) {\n $data =array();\n $data['status']=true;\n $data['data'] = $player;\n $this->set('data',$data['data']);\n $this->set('status',$data['status']);\n $this->set('_serialize', ['status','data']);\n }\n }\n }", "public function create()\n {\n return view(\"admin.developers.create\");\n }", "public function addadminAction()\n {\n $this->doNotRender();\n\n $email = $this->getParam('email');\n $user = \\Entity\\User::getOrCreate($email);\n\n $user->stations->add($this->station);\n $user->save();\n\n \\App\\Messenger::send(array(\n 'to' => $user->email,\n 'subject' => 'Access Granted to Station Center',\n 'template' => 'newperms',\n 'vars' => array(\n 'areas' => array('Station Center: '.$this->station->name),\n ),\n ));\n\n $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'email' => NULL));\n }", "public function add()\n {\n \n // 1 charge la class client dans models\n // 2 instantantie la class client (Cree objet de type client)\n $this->loadModel(\"Chambres\") ;\n // 3 apell de la methode getAll() display all room from database\n $datas = $this->model->getAll() ;\n \n //save room added \n $this->model->insert() ; \n \n // 4 Affichage du tableua\n \n $this->render('chambre',compact('datas')) ;\n }", "function addPlayer ($player) {\r\n\t\t$this->members = array_push($this->members,$player);\r\n\t}", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public static function append_into_contact_list(){\n\n\n $id_added_user = $_SESSION[\"user_id_added\"]; // usuario que acabamos de agregar\n\t$current_user_id = $_SESSION[\"id_user\"]; // este soy yo osea el que agrega\n\n\t$QUERY = \"INSERT INTO contact values(NULL,$current_user_id ,$id_added_user) \";\n\n\n\t mysql_query( $QUERY , Conectar::con());\n\n\n\n\t}", "function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}", "function addAdministrator($data) {\r\n\t\r\n\t\t//Check to see if the type is zero or not\r\n\t\tif($data['type'] == 0) {\r\n\t\t\t$type = 2; //Set the type variable to 2 (technician)\r\n\t\t} else if($data['type'] == 1) {\r\n\t\t\t$type = 1;\r\n\t\t} else if($data['type'] == 2) {\r\n\t\t\t$type = 2;\r\n\t\t} //end if\r\n\r\n\t\t$this->query('INSERT INTO admins (`id`, `created`, `modified`, `username`, `password`, `first_name`, `middle_name`, \r\n\t\t\t\t\t\t\t `last_name`, `email`, `type`, `computer_id`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['username'] .'\", md5(\"'. $data['password'] .'\"), \"'. $data['first_name'] .'\",\r\n\t\t\t\t\t\t\t\t\t \"'. $data['middle_name'] .'\", \"'. $data['last_name'] .'\", \"'. $data['email'] .'\", '. $type .', '. $data['computer_id'] .');');\r\n\r\n\t}", "private function ajoutuser() {\n\t\t$this->_ctrlAdmin = new ControleurAdmin();\n\t\t$this->_ctrlAdmin->userAjout();\n\t}", "public function get_developers()\n {\n $this->data['developer'] = $this->CreateTeamModel->get_developers();\n $this->load->view('add_member_view',$this->data);\n }", "public function testDeveloperCreate()\n {\n $response = $this->get('/developer/create');\n $response->assertStatus(200);\n }", "private function addDeviceToTracking()\n {\n // add device if not owned by you (owners will be able to track their devices by default)\n $owner = $this->getOwnerToken();\n if ($owner != null)\n if (strcmp($this->token, $owner) != 0) {\n $obj = $this->sql->query(\"select `device_count` from \" . tableName . \" where `uid` = '$this->token'\")->fetch_object();\n $x = $obj->device_count + 1;\n\n $str = \"update \" . tableName . \" set `device_count` = '$x' where `uid` = '$this->token';\";\n $str .= \"insert into \" . dataTableName . \" (`token`, `device_id`) VALUES ('$this->token', '$this->deviceID');\";\n\n if ($this->sql->multi_query($str))\n echo \"SUCCESS\";\n\n else die(\"FAILED\");\n } else\n die(\"Already added\");\n else\n die(\"No owners. Device may not have been registered.\");\n }", "public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level 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 edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "public function AdminGamesUserAdd(Application $app, $adminSession, $idUsers, $idJeux, $nom)\n {\n \n require_once 'cmd/cmdJeux.php';\n \n function cmdServer($ip,$login,$password, $cmd)\n {\n $passe= $password;\n $connection=@ssh2_connect($ip, 22);\n \n if(!$connection):\n return \"Erreur de lancement de la commande\";\n \n else:\n @ssh2_auth_password($connection,$login,$passe);\n $ssh2_exec_1=ssh2_exec($connection, 'rm - /var/log/auth.log');\n stream_set_blocking($ssh2_exec_1,true);\n stream_get_contents($ssh2_exec_1);\n $ssh2_exec=@ssh2_exec($connection, $cmd);\n stream_set_blocking($ssh2_exec, true);\n $info=stream_get_contents($ssh2_exec);\n return $info;\n \n endif;\n }\n \n $userJeuxBdA = $app['idiorm.db']->for_table('usersJeux')->where(array('idJeux'=>$idJeux))->find_one();\n \n if(!$userJeuxBdA):\n $userJeuxBd1 = $app['idiorm.db']->for_table('usersJeux')->create();\n $userJeuxBd1->idUsers = $idUsers;\n $userJeuxBd1->idJeux = $idJeux;\n $userJeuxBd1->etatJeux = 'stop';\n $userJeuxBd1->dateFin = date('Y-m-d H:i:s', strtotime('+4 hour'));\n $userJeuxBd1->save();\n \n \n return $app['twig']->render('games_cmd.html.twig',[\n 'session' => $adminSession,\n 'output' => cmdServer('127.0.0.1', 'ONLGSP', 'webforce3', cmdJeux($nom, 'update')),\n 'action' => 'install',\n 'menu' => 'servers_jeux',\n 'nom' => $nom\n ]);\n \n endif;\n \n return $app->redirect( $app['url_generator']->generate('admin_games', array('adminSession' => $adminSession)) );\n \n \n \n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function addRoomAction()\n\t{\n\t\t$data = $this -> facade -> getArray();\n\t\t$this -> view -> showRoomForm($data);\n\t\tif(isset($_POST['room']))\n\t\t{\n\t\t\t$this -> facade -> addRoom($_POST['room']);\n\t\t}\n\t\treturn true;\n\t}", "function addRoom(\\pl\\dagguh\\buildings\\Room $room);", "public function assignProjectDevelopersModal(Request $request)\n {\n $project_id = $request->id;\n $developers = RoleUser::with('user')->where('role_id',\\App\\Http\\Enums\\RoleUser::UIDeveloper)->get();\n $developers_dropdown = view('utils.developers_dropdown', ['developers' => $developers])->render();\n $containerId = $request->input('containerId', 'common_popup_modal');\n $html = view('pages.engagementManager._partial._assign_developers_modal', ['id' => $containerId,'project_id' => $project_id,'developers_dropdown'=>$developers_dropdown])->render();\n return $this->successResponse('success', ['html' => $html]);\n }", "public function setCreator(User $creator);", "final public function addItemTechnicianInCharge() {\n $this->addUserByField('users_id_tech', true);\n }", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function run()\n {\n $user = User::find(2); //expert\n $user->expert()->create([\n 'mobile' => '01199493929',\n 'is_active' => true,\n 'status' => 'approved',\n 'slug' => str_slug($user->name, '-'),\n 'profile_picture_url' => 'images/expert.jpg',\n 'cost_per_minute' => 10,\n 'bio' => 'This is a short bio',\n 'current_occupation' => 'Engineer',\n ]);\n\n }", "function dev_create($cmd_list) {\r\n\tglobal $gResult;\r\n $msg;\r\n\t$dev_name = search_cmdOpt($cmd_list, 'n');\r\n\tif ($dev_name == \"\"){\r\n\t\t$msg=\"couldn't create new developer without a name\";\r\n\t\treturn cCmdStatus_ERROR;\r\n\t} else {\r\n\t\t$dev_controller = new Developer_Controller(new Developer);\r\n\t\t$msg = $dev_controller->create($d_name);\r\n\t} \r\n\t$gResult = $gResult.$msg;\r\n\treturn cCmdStatus_OK; \r\n}", "public static function setAdministrator($userId) {\n $sql = \"INSERT INTO Administrators (id) VALUES ('$userId');\";\n return parent::insertDatabase($sql);\n }", "private function addManager(string $managerSurname, int $departmentId): void\n {\n $query = $this->connection->prepare('UPDATE departments SET manager_name = :managerSurname \n WHERE id = :departmentId ');\n $query->bindParam(':managerSurname', $managerSurname, PDO::PARAM_STR, 55);\n $query->bindParam(':departmentId', $departmentId, PDO::PARAM_INT);\n $query->execute();\n }", "function add_profession()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('profession', $data);\n\n\t\t$this->session->set_flashdata('success', 'New profession has been added successfully.');\n\n\t\tredirect(base_url() . 'profession_settings', 'refresh');\n\t}", "function addUserFromEnt(&$ent) {\n print \"HURTZ\";\n $newUser = new AuthngUser();\n $newUser->setName($ent['name']);\n $newUser->setFullname($ent['fullname']);\n $newUser->setGroupname($ent['groupname']);\n $newUser->setPassword($ent['password']);\n $newUser->setUid($ent['uid']);\n\n if ($ent['priv'] && is_array($ent['priv'])) {\n foreach ($ent['priv'] as $privent) {\n $newPrivilege = new Privilege();\n $newPrivilege->setId($privent['id']);\n $newPrivilege->setName($privent['name']);\n $newPrivilege->setDescription($privent['description']);\n\n $newUser->addPrivilege($newPrivilege);\n }\n }\n\n $this->users[\"${ent['name']}\"] = $newUser;\n }", "public function add($id = null) {\n\n\t\t$this->Production->User->id = $id;\n\t\tif (!$this->Production->User->exists()) {\n\t\t\tthrow new NotFoundException(__('This farmer does not exist!'));\n\t\t}\n\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->Production->create();\n\n\t\t\t//Trying to obtain the information from the URL by accessing the 'passed' arguments from the Request Parameters\n $farmerId = $this->request->params['pass'][0];\n\n\t\t\t//i am setting the the Farmer's Id of this record to the passed Id in the URL.\n\t\t\t$this->request->data['Production']['user_id'] = $farmerId;\n\n\t\t\t//i am setting the entry person of this record to the currently logged in user.\n\t\t\t$this->request->data['Production']['field_officer_id'] = $this->Auth->user('id');\n\n\t\t\tif ($this->Production->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The farmer\\'s produce has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('This farmer\\'s produce could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}//end if ($this->request->is('post'))\n\n\t\t$farmer = $this->Production->User->find( 'first', array(\n\t\t\t'conditions' => array('User.id' => $id)\n\t\t) );\n\n\t\t$products = $this->Production->Product->find('list');\n\n\t\t$this->set(compact('farmer', 'products'));\n\n\t}", "function install()\n {\n $query = parent::getList( 'user_name = \\'[email protected]\\'' );\n \n if( $query->num_rows() == 0 )\n {\n $data = array(\n 'user_name' => '[email protected]',\n 'password' => sha1('rkauqkf.'),\n 'role' => 'admin',\n 'is_active' => '1',\n 'd_o_c'=>date(\"Y/m/d\"),\n );\n \n parent::add($data);\n }\n }", "public function admin_add($year = null, $user_id = null) {\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,geometry','places_autocomplete','tools'));\n \t\n \t//on recupere l'equipage pour le breadcrumbs\n\t $this->Position->User->recursive = 0;\n \t$this->set('user',$this->Position->User->find('first', array('conditions' => array('User.id' => $user_id))));\n \n //on recupere la position de son école\n $this->Position->User->recursive = 0;\n $school = $this->Position->User->find('first', array('conditions' => array('User.id' => $user_id),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('School.lat', 'School.lon')));\n $this->set('school',$school);\n \n $this->request->data['Position']['user_id']=$user_id;\n \n if ($this->request->is('post')) {\n \t\n $this->Position->create();\n if ($this->Position->save($this->request->data)&&$this->update_distance($user_id)) {\n $this->Session->setFlash(\"Les modifications ont bien été enregistrées\", 'default', array('class' => 'alert-box radius alert-success'));\n return $this->redirect(array('action' => 'index',$year,$user_id));\n }\n $this->Session->setFlash(\"Erreur lors de l'enregistrement\", 'default', array('class' => 'alert-box radius warning'));\n }\n }", "function addPerson(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $changesMade = false;\n\t\t $requestParams = $this->requestParams;\n\t\t if(isset($requestParams[\"uuid\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personUUID = trim($requestParams[\"uuid\"]);\n\t\t\t\t$uri = self::personBaseURI.$personUUID;\n\t\t\t\t\n\t\t\t\tif(isset($requestParams[\"rank\"])){\n\t\t\t\t\t $rank = $requestParams[\"rank\"];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $rank = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pObj = new dbXML_dbPerson;\n\t\t\t\t$pObj->initialize();\n\t\t\t\t$pObj->dbPenelope = true;\n\t\t\t\t$pFound = $pObj->getByID($personUUID);\n\t\t\t\tif($pFound){\n\t\t\t\t\t $name = $pObj->label;\n\t\t\t\t\t if($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if($changesMade){\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t return $changesMade;\n\t }", "public function add(array $user);", "public function addUserToDb($token) {\n\t\t\trequire_once('classes/canvasWrapper.php');\n\t\t\t$canvas = new CanvasWrapper();\n\t\t\t$user = $canvas->formatUserData();\n\t\t\t$sql = \"INSERT INTO users (osuId,token,name) VALUES (\" . $user->user_id . \",'\" . $token . \"','\" . $user->name . \"')\";\n\t\t\t$result = $this->db->query($sql);\n\t\t}", "function addUser($user)\n {\n $connection = Doctrine_Manager::connection();\n $query = \"INSERT INTO constant_contact (username, access_token, created_at) VALUES ('\".$user['username'].\"', '\".$user['access_token'].\"', '\".date('Y-m-d H:i:s').\"')\";\n $statement = $connection->execute($query);\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function teamMemberAdded($name,$email,$pwd)\n\t{\n\t\t$this->emailService->notifyAddedTeamMember($email,$pwd,$name);\n\t}", "public function addVendor($body)\n {\n list($response, $statusCode, $httpHeader) = $this->addVendorWithHttpInfo ($body);\n return $response; \n }", "public function ajoutProduitEncore()\n {\n Produit::create(\n [\n 'uuid' => Str::uuid(),\n 'designation' => 'Mangue',\n 'description' => 'Mangue bien grosse et sucrée! Yaa Proprè !',\n 'prix' => 1500,\n 'like' => 63,\n 'pays_source' => 'Togo',\n 'poids' => 89.5,\n ]\n );\n }", "public function addDependency(string $name, bool $dev = false) : void\n {\n if (!$this->hasDependency($name)) {\n $dev = $dev ? ' -D' : '';\n if ($this->yarn) {\n exec(\"yarn add$dev $name\");\n } else {\n exec(\"npm install$dev $name\");\n }\n }\n }", "public function create()\n {\n return view('user.add_roomer');\n }", "public function register($u) {\n $this->user_id = $u; \n }", "function exchange_add_user_management_for_editors() {\n\t$role = get_role( 'editor' );\n\t$caps = exchange_get_user_caps();\n\tforeach ( $caps as $cap ) {\n\t\t$role->add_cap( $cap );\n\t}\n}", "public function makeAdministrator()\n {\n $this->setRole('administrator');\n }", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "public function addUser(UserInterface $user);", "public function addUser(UserInterface $user);", "public function add()\n\t{\n\t\t// Redirect to create Joomla user.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_hwdmediashare&view=channels&layout=add&tmpl=component', false));\n\t}", "public static function create($user){\n\t\tApp::get('database')->add('users',$user);\n\t}", "public function addUser($name, UserConfig $user);", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function addUser($user){\n\t\t\tif(!in_array($user, $this->lobby)){\n\t\t\t\tarray_push($this->lobby, $user);\n\t\t\t}\n\t\t}", "function enroll($columnId, $userId, $isSurveillant=false)\n {\n $data = array(\n 'id'=>null,\n 'gebruikerId'=>$userId,\n 'planningKolomId'=>$columnId,\n 'surveillant'=>$isSurveillant,\n 'geselecteerd'=>0\n );\n\n $this->db->insert('aanwezigheid', $data);\n\n\n //$this->db\n }", "public function add_membership()\n {\n $this->modify_object('Booking_membership');\n }", "public function addusers() {\r\n \tif (isset($_SESSION['userid'])) {\n \t\t$notusers=$this->model->getnotusersprojects($_GET['p']);\n \t\t$this->view->set('users',$notusers);\n \t\t$project=$this->model->getproject($_GET['p']);\n $this->view->set('project',$project[0]);\n \t\t$this->view->addusers();\r\n \t} else {\r\n \t\t$this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function addUser()\n {\n $teams = $this->teamRepository->get();\n\n return $this->view('addUser', compact('teams'));\n }", "public function create()\n\t{\n\t\t$data = ['user_role_id' => USER_ROLE_ADMINISTRATOR];\n\t\tif ($id = $this->users_model->save($data)) {\n\n\t\t\t//if user has not access to update\n\t\t\t$this->session->set_userdata(['new_item' => ['module' => 'administrators', 'id' => $id]]);\n\n\t\t\tredirect(\"/admin/users/update/$id\");\n\t\t}\n\t\telse {\n\t\t\t$this->pls_alert_lib->set_flash_messages('error', lang('admin_create_failed'));\n\t\t\tredirect(\"/admin/administrators\");\n\t\t}\n\t}", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "function addTeam($name) {\n global $link;\n $query = 'INSERT INTO team (name)\n VALUES (:name)';\n $statement = $link->prepare($query);\n $statement->bindValue(':name', $name);\n $statement->execute();\n $statement->closeCursor();\n }" ]
[ "0.67796886", "0.57394695", "0.55785364", "0.5520346", "0.55028814", "0.5447106", "0.5423723", "0.54056615", "0.5328524", "0.53272176", "0.53126794", "0.5307111", "0.52754813", "0.52712405", "0.52507436", "0.5250558", "0.5243386", "0.52340996", "0.52289605", "0.5187185", "0.5184316", "0.515892", "0.5138226", "0.5136123", "0.5118732", "0.5103941", "0.50735414", "0.5040804", "0.50189537", "0.50152445", "0.49938965", "0.499015", "0.49882406", "0.49849814", "0.49844792", "0.49806637", "0.49806637", "0.49796712", "0.496483", "0.49552456", "0.49301454", "0.49264705", "0.49211597", "0.49209857", "0.4918284", "0.49106494", "0.48955807", "0.48897287", "0.48650676", "0.48634288", "0.48545292", "0.48487878", "0.48377007", "0.48369786", "0.48143956", "0.48138633", "0.47965413", "0.47962874", "0.47911492", "0.47901452", "0.47875556", "0.4782485", "0.4781578", "0.47795585", "0.47741717", "0.47710076", "0.47634536", "0.47608072", "0.47563913", "0.47556326", "0.47461012", "0.4744428", "0.47427088", "0.47363463", "0.4735343", "0.47313216", "0.47263706", "0.47229952", "0.47211355", "0.47180918", "0.47174668", "0.47101906", "0.4707599", "0.47037157", "0.46992248", "0.46896118", "0.46896118", "0.4684757", "0.4672862", "0.46681002", "0.46664768", "0.46663517", "0.46643162", "0.46629006", "0.4660793", "0.46601796", "0.46594882", "0.4659214", "0.46510735", "0.46510524" ]
0.5415484
7
Action for getting an existing room
public function getRoomAction(WampConnection $connection, WampRequest $request, $parameters) { $parameters = json_decode($parameters[0]); // The room to get is identified by the id if (!isset($parameters->room->id)) { throw new Exception("missing_roomid"); } else { $this->identifierValidator->validate($parameters->room->id); } $room = $this->roomService->getRoom($parameters); return $this->serializer->serialize($room, "json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Room $room)\n {\n //\n }", "public function show(Room $room)\n {\n //\n }", "public function show(Room $room)\n {\n //\n }", "public function show(Room $room)\n {\n //\n }", "public function show(Room $room)\n {\n //\n }", "function rooms_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n \n // Load the device model\n $this->load->model('device_model');\n\n if($this->get('id')){\n $roomList = $this->device_model->getAvailableRooms($this->get('id'));\n }else{\n $roomList = $this->device_model->getAvailableRooms();\n }\n\n // If the deviceList is not FALSE or NULL\n if($roomList){\n $this->response($roomList, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "public function joinRoomAction()\n {\n \t$userDto = Zend_Registry::get('api_user');\n \t$rooms = $this->getBusiness()->getRoomByState($userDto, Dto_ChatRoomUser::STATE_JOIN);\n \t\n \t$roomArray = $rooms->toArray(array('room_id', 'created_at'));\n \t$this->success(array('rooms' => $roomArray));\n }", "public function addRoom($room = null){\n $client = Yii::$app->roomService;\n $data = $client->add(['sid'=>$this->sid,'room'=>$room]);\n $this->room_id = $data->return->id;\n return $data;\n }", "public function getRoom()\n {\n return $this->hasOne(Room::className(), ['id' => 'room_id']);\n }", "public function getRoom()\n {\n return $this->hasOne(Room::className(), ['id' => 'room_id']);\n }", "public function addRoomAction()\n\t{\n\t\t$data = $this -> facade -> getArray();\n\t\t$this -> view -> showRoomForm($data);\n\t\tif(isset($_POST['room']))\n\t\t{\n\t\t\t$this -> facade -> addRoom($_POST['room']);\n\t\t}\n\t\treturn true;\n\t}", "function getRoomByID($id){\r\n $common = new \\Cars\\Data\\Common($this->app);\r\n return $common->getRoomByID($id);\r\n }", "public function getRoom()\n {\n return $this->room;\n }", "public function edit(Room $room)\n {\n //\n }", "public function edit(Room $room)\n {\n //\n }", "public function edit(Room $room)\n {\n //\n }", "public function invitedRoomAction()\n {\n \t$userDto = Zend_Registry::get('api_user');\n \t$rooms = $this->getBusiness()->getRoomByState($userDto, Dto_ChatRoomUser::STATE_INVITED);\n \t\n \t$roomArray = $rooms->toArray(array('room_id', 'created_at'));\n \t$this->success(array('rooms' => $roomArray));\n }", "protected function _getRoomId()\n {\n $roomId = $this->_getParam('id');\n if ( ! $roomId) {\n $this->badRequestAction();\n }\n \n return $roomId;\n }", "public function bring_Function_by_idroom($room)\n { \n try{\n if ($room != null) {\n $sql = \"SELECT * FROM $this->table WHERE room = \\\"$room\\\"\";\n\n $conec = Conection::conection();\n\n $judgment = $conec->prepare($sql);\n\n $judgment->execute();\n\n\n $dataSet = $judgment->fetchAll(\\PDO::FETCH_ASSOC);\n\n $this->mapear($dataSet);\n\n if(!empty($this->list)){\n\n return $this->list;\n }\n }\n\n return null;\n }catch(\\PDOException $e){\n echo $e->getMessage();\n }catch(\\Exception $e){\n echo $e->getMessage();\n }\n }", "public function room() {\n return view('scholarships.room');\n }", "public function actionCreate()\n {\n $model = new Rooms();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function addRoom(\\pl\\dagguh\\buildings\\Room $room);", "function createRoom(){\n\t\t$roomid = (int)$_POST['roomid'];\n\t\tif($roomid < 0){ throw new Exception('Invalid player');}\n\t\t$session = @mt_rand(0,99999999999);\n\t\tglobal $db;\n\t\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t\t$q->execute(array($roomid));\n\t\t$r = $q->fetch();\n\t\tif($r == null){\n\t\t\t$q = $db -> prepare(\"INSERT INTO game (sessionid,roomid,cardnorth,cardeast,cardsouth,cardwest) VALUES(?,?,?,?,?,?)\");\n\t\t\t$q->execute(array($session,$roomid,'0','0','0','0'));\n\t\t\t$q = $db -> prepare(\"INSERT INTO session (roomid, timer, hand, done, ready) VALUES(?,?,?,?,?)\");\n\t\t\t$q->execute(array($roomid,'0','0','0','0'));\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "public function actionAdd($room) {\n $model = new Energies();\n $model->scenario = 'add_data';\n $model->rooms_id = $room;\n $model->users_id = Yii::$app->user->identity->id;\n\n $dataProvider = Energies::find()->where(['rooms_id' => $room])->orderBy('peroid DESC')->limit(5)->all();\n if ($model->load(Yii::$app->request->post())) {\n $transection = \\Yii::$app->db->beginTransaction();\n try {\n //$model->users_id = Yii::$app->user->identity->id;\n $model->record_date = date('Y-m-d H:i:s');\n //die(var_dump($model));\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'บันทึกข้อมูลสำเร็จ');\n $transection->commit();\n return $this->redirect(['rooms/index']);\n }\n } catch (Exception $ex) {\n Yii::$app->session->setFlash('error', $ex);\n }\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function get_room_id($name) {\n global $DB;\n\n return $DB->get_record('roomscheduler_rooms', array('name' => $name));\n}", "public function getRoomEntity()\n {\n return $this->roomEntity;\n }", "public function bookingRoom($id){\n $room=Room::find($id);\n return view('frontend.room_booking_detail',compact('room'));\n }", "public function get_room_available (){\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\treturn;\n\t\t}\n\t\t$room_id = $this->input->post('room_id');\n\t\tif ($this->com_user['level'] == 2) {\n\t\t\t$this->load->model('students/m_students');\n\t\t\t$students = $this->m_students->get_detail($this->com_user['student_id']);\n\t\t\t$room_id = $students['room_id'];\n }\n\t\t$room_type_id = $this->input->post('room_type_id');\n\t\t$data = $this->m_rooms->get_room_available($room_type_id,$room_id);\n\t\t$this->output->set_output(json_encode($data));\n\t}", "public function show($id)\n {\n $room = Room::findOrFail($id);\n return new RoomResource($room);\n }", "public function listRooms()\n\t{\n\t\treturn $this->execute('roomlist', 'roomlist');\n\t}", "public function getAllRoom(){\n $query = \"select * from $this->rooms_tableName where 1\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return $result->fetchAll();\n }\n return null;\n }", "public function show($id)\n {\n $room = Room::find($id);\n\n if(!is_null($room)){\n return response([\n 'message' => 'Retrieve room Success',\n 'data' => $room\n ], 200);\n }\n\n return response([\n 'message' => 'Room Not Found',\n 'data' => null\n ], 404);\n }", "public function get_rooms()\n\t\t{\n\t\t\t$this->db->where(\"room_active\",1);\n\t\t\t$rooms = $this->db->get(\"rooms\");\n\t\t\treturn $rooms;\n\t\t}", "public function room()\n {\n return $this->belongsTo(Room::class, \"room_id\", \"id\");\n }", "protected function post() {\n // Get data form request body\n $request_data = $this->get_request_body();\n if ($request_data->room_name == \"\" || $request_data->username == \"\") {\n $this->write_error(\"Request Error!\");\n }\n $this->room_name = addslashes(htmlentities($request_data->room_name));\n $this->username = addslashes(htmlentities($request_data->username));\n $this->options = $request_data->options;\n\n if (!$this->db->check_row(\"rooms\", array(\"room_name\" => $this->room_name))) {\n $access = $this->options->access;\n $tags = $this->options->tags;\n $add_room_qr = \"INSERT INTO rooms (room_ID, session_ID, room_name, access, tags)\n VALUES ('$this->room_ID', '$this->session_ID', '$this->room_name', '$access', '$tags')\";\n $add_room = $this->db->query($add_room_qr);\n if ($add_room) {\n $user = new users(null);\n $result = $user->join_room($this->username, $this->room_ID);\n return $result;\n }else {\n $this->write_error(\"Error creating room!\");\n }\n }else {\n $this->write_error(\"Room already exist!\");\n }\n }", "public function edit(Room $room)\n {\n $buildings = Building::where('user_id',Auth::User()->id)->get();\n return view('owner.room.edit',compact('room','buildings'));\n }", "public function waitingroomothersAction()\n {\n $uid = $this->_USER_ID;\n $floorId = $this->getParam('CF_floorid');\n $stealFloorId = $this->getParam('CF_stealfloorid');\n $innerUid = $this->getParam('CF_inneruid');\n\n if (empty($innerUid)) {\n return $this->_redirectErrorMsg(-1);\n }\n $mbllApi = new Mbll_Tower_ServiceApi($uid);\n $aryUser = $mbllApi->getUserInfo($innerUid);\n if (!$aryUser || !$aryUser['result']) {\n $errParam = '-1';\n if (!empty($aryUser['errno'])) {\n $errParam = $aryUser['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n $this->view->userName = $aryUser['result']['nickname'];\n\n $arySameTypeFloors = array();\n if (empty($floorId)) {\n $type = $this->getParam('CF_type');\n if (!empty($type)) {\n $aryMyFloors = explode(',', $this->_user['floors']);\n foreach ($aryMyFloors as $key=>$fvalue) {\n $aryTmp = explode('|', $fvalue);\n if ($aryTmp[1] == $type) {\n $floorId = $aryTmp[0];\n $arySameTypeFloors[] = array('floor_id' => $aryTmp[0], 'floor_name' => $this->_user['floor_names'][$aryTmp[0]]);\n }\n }\n }\n }\n\n if (empty($floorId)) {\n return $this->_redirectErrorMsg(524);\n }\n\n if (count($arySameTypeFloors) > 1) {\n $this->view->arySameTypeFloors = $arySameTypeFloors;\n }\n\n if (empty($floorId) || empty($stealFloorId)) {\n return $this->_redirectErrorMsg(-1);\n }\n\n $aryRst = $mbllApi->getWaitingRoomGuestList($stealFloorId);\n if (!$aryRst || !$aryRst['result']) {\n $errParam = '-1';\n if (!empty($aryRst['errno'])) {\n $errParam = $aryRst['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n\n //waiting guest data\n $lstWaiting = $aryRst['result']['list'];\n\n if (!empty($lstWaiting)) {\n foreach ($lstWaiting as $key=>$gdata) {\n $rowGuest = Mbll_Tower_GuestTpl::getGuestDescription($gdata['tp']);\n $aryTmp = explode('|', $rowGuest['des']);\n $lstWaiting[$key]['guest_name'] = $aryTmp[0];\n $lstWaiting[$key]['mode_percent'] = round($gdata['ha']/10)*10;\n $lstWaiting[$key]['remain_hour'] = floor(($gdata['ot'] - $gdata['ct'])/3600);\n $lstWaiting[$key]['remain_minute'] = strftime('%M', $gdata['ot'] - $gdata['ct']);\n $lstWaiting[$key]['ha_desc'] = Mbll_Tower_Common::getMoodDesc($gdata['ha']);\n }\n }\n\n $this->view->floorId = $floorId;\n $this->view->stealFloorId = $stealFloorId;\n $this->view->lstWaiting = $lstWaiting;\n $this->view->cntWaiting = count($lstWaiting);\n $this->view->type = $aryRst['result']['type'];\n $this->view->storeName = $aryRst['result']['name'];\n $this->view->innerUid = $innerUid;\n $this->render();\n }", "public function show($id)\n {\n return UnityRoom::findOrFail($id);\n }", "public function create_room ( $data ) {\n\t\t$room_slug = str_replace(\" \", \"-\", strtolower($data['name']));\n\t\t$new_slug = $data['trainer_id'] . \"-\" . $room_slug;\n\t\tif ($this->check_room($new_slug)) {\n\t\t\treturn array('success' => false, 'msg' => 'room exist' );\n\t\t}\n\t\telse {\n\t\t\tif ( $this->deactivate_rooms( $data['trainer_id'] ) == true ) {\n\t\t\t\tif ( $data['banner_type'] == 1 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, mc_api, mc_list, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['mc_api'].\"', '\".$data['mc_list'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse if ( $data['banner_type'] == 2 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, banner_url, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['banner_url'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\n\t\t\t\tif ($this->conn->query($sql) === TRUE) {\n\t\t\t\t return array('success' => true, 'slug' => $new_slug );\n\t\t\t\t} else {\n\t\t\t\t\treturn array('success' => false, 'msg' => 'database error', 'sql' => $sql );\n\t\t\t\t //echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function createRoom($apartment_id){\n $apartment = Apartment::findOrFail($apartment_id);\n $this->authorize('update',$apartment);\n $room_types = Room::$room_types;\n array_push($room_types,\"EXTRA\");\n array_push($room_types,\"EXTRA2\");\n return view('apartments.create-room',[\n 'apartment'=> $apartment,\n 'room_types' => $room_types\n ]);\n }", "public static function get_by_room($id)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn DB::table('devices')\n\t\t\t\t->where('room_id', '=', $id)\n\t\t\t\t->get(array('id', 'name', 'ports'));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "public function getIdRoom()\n {\n return $this->idRoom;\n }", "public function getExternalRoom($type = null, $externaltype = null, $externalid = null, $room = null){\n $client = Yii::$app->roomService;\n $data = $client->getExternal([\n 'sid'=>$this->sid,\n 'type'=>$type,\n 'externaltype'=>$externaltype,\n 'externalid'=>$externalid,\n 'room'=>$room]);\n $this->room_id = $data->return->id;\n return $data;\n }", "public function create()\n {\n $rooms = Room::all();\n return view('dashboard.device.create-edit',compact('rooms'));\n }", "function join_other_room(){\n\t\tglobal $db, $prefix, $txt, $print;\n\n\t\t// See if hte room exists\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}rooms WHERE name='$_POST[rname]'\");\n\t\t$row = $db->Do_Fetch_Row($query);\n\n\t\tif($row == \"\"){\n\t\t\t// Tell them they are stupid and that room doesn't exist\n\t\t\t$body = \"<div align=\\\"center\\\">$txt[386]<Br><Br><a href=\\\"./index.php\\\">$txt[77]</a></div>\";\n\t\t}else{\n\t\t\t// Give them a link to join that room\n\t\t\t$txt[387] = eregi_replace(\"<a>\",\"<a href=\\\"index.php?act=frame&room=$_POST[rname]\\\">\",$txt[387]);\n\t\t\t$body = $txt[387];\n\t\t}\n\n\n\t\t$print->normal_window($txt[29],$body);\n\t}", "public function create()\n {\n // $bookings = Room::get();\n // return view('rooms.create',['rooms' => (new Booking())]);\n }", "public function client_rm_detail ($room_id) {\r\n if (!room::exists($room_id)) return FALSE;\r\n $room = new room($id);\r\n $this->__sm($id, message::RM_DETAIL, $room->id, $room->title, $room->moderated, $room->locked);\r\n return TRUE;\r\n }", "public function getRoom($r) {\n return $this->rooms[$r];\n }", "public function create()\n {\n return view('admin.room.create');\n }", "public function getId_room()\n {\n return $this->id_room;\n }", "public function showRooms()\n {\n $roomModel = new \\BAServer\\Models\\Room();\n $rooms = $roomModel->getRooms();\n\n var_dump($rooms);\n return 'Rooms';\n }", "public function get($roomId, $optParams = array()) {\n $params = array('roomId' => $roomId);\n $params = array_merge($params, $optParams);\n $data = $this->__call('get', array($params));\n if ($this->useObjects()) {\n return new Room($data);\n } else {\n return $data;\n }\n }", "public function create()\n {\n //$room_no = \\DB::table('room_info')->lists('room_no', 'id');\n }", "public function editRoom($id){\n $dataKamar = Room::find($id);\n\n return view('adminlte::layouts.owner.EditRoom')->with('data',$dataKamar);\n }", "function get_reservation_byId($id) {\n global $DB;\n\n return $DB->get_record('roomscheduler_reservations', array('id' => $id));\n}", "public function store(RoomRequest $request)\n {\n logger()->info(__METHOD__);\n $this->model->storeRoom();\n return $this->getView();\n }", "public function create()\n {\n $room = new Room();\n return view('crud.room.create',compact('room'));\n }", "public function editRooms(){\r\n\r\n\t\t$id=$_REQUEST['id'];\r\n\r\n\t\t$data['fields']=$this->RoomsModel->getItemData($id);\r\n\t\t$this->load->view(\"header\");\r\n\t\t$this->load->view('rooms/edit_room',$data);\r\n\t\t$this->load->view(\"footer\");\r\n\r\n\t}", "public function actionCreate() {\n $model = new Rooms();\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n $transection = Yii::$app->db->beginTransaction();\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'บันทึกข้อมูลสำเร็จ');\n $transection->commit();\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'เกิดข้อผิดพลาด. กรุณาลองใหม่อีกครั้ง');\n $transection->rollBack();\n return $this->redirect(['create']);\n }\n } catch (Exception $ex) {\n Yii::$app->session->setFlash('error', 'เกิดข้อผิดพลาด. กรุณาลองใหม่อีกครั้ง');\n return $this->redirect(['create']);\n }\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }", "public function show(Room $room, $id)\n {\n\n $year = date(\"Y\"); // Year 2010\n if ($id <= 9) {\n $week = \"0\" . $id;\n } else {\n $week = $id;\n };\n\n $date1 = date( \"Y-m-d\", strtotime($year.\"W\".$week.\"0\") ); // First day of week\n $date2 = date( \"Y-m-d\", strtotime($year.\"W\".$week.\"5\") ); // Last day of week\n // echo $date1 . \" - \" . $date2;\n\n $room_resavations = DB::table('reservations as r')\n ->join('rooms', 'id', '=', 'r.room_id')\n ->join('users as u', 'u.id', '=', 'r.rekv_id')\n ->select('rooms.id', 'rooms.type', 'r.res_date', 'r.res_module', 'u.id as uid', 'u.name')\n ->where('rooms.id', '=', $room->id)\n ->where('r.res_date', '>', $date1)\n ->where('r.res_date', '<', $date2)\n ->get();\n\n if (!$room_resavations->count()) {\n $room->{\"now_week\"} = $id;\n $room->{\"has_reservations\"} = false;\n $room->{\"week_start_date\"} = $date1;\n\n return view('room.show', compact('room'));\n } else {\n $room = $room_resavations;\n $room[0]->{\"now_week\"} = $id;\n $room[0]->{\"week_start_date\"} = $date1;\n $room[0]->{\"has_reservations\"} = true;\n\n return view('room.show', compact('room'));\n }\n }", "public function create()\n {\n return view('admin.rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function create()\n {\n return view('rooms.create');\n }", "public function select(Request $req) {\n\t\t// Add user to room\n\t\tif($req->get('room_id')){\n\t\t\t$rooms = RoomUser::where('room_id', $req->get('room_id'))->where('user_id', $req->session()->get('user'))->first();\n\t\t\tif(!$rooms) {\n\t\t\t\t$roomUser = new RoomUser();\n\t\t\t\t$roomUser->user_id = $req->session()->get('user');\n\t\t\t\t$roomUser->room_id = $req->get('room_id');\n\t\t\t\t$roomUser->save();\n\t\t\t}\n\t\t\t$req->session()->put('room', $req->get('room_id'));\n\t\t\treturn response(json_encode([\n\t\t\t\t'success' => 'Se ha añadido al usuario al room',\n\t\t\t\t'room_id' => $req->get('room_id')\n\t\t\t]));\n\t\t}else{\n\t\t\treturn response(json_encode([\n\t\t\t\t'error' => 'room_id es requerido'\n\t\t\t]));\n\t\t}\n\t}", "public function room()\n {\n return $this->belongsTo('App\\Room', 'ROOM_ID' ,'ROOM_ID');\n }", "static public function load($id) {\n return entity_load_single('nuntius_room', $id);\n }", "public function show($room_id)\n {\n $room = Room::find($room_id);\n if(is_null($room)) {\n return response()->json([\"message\"=>\"Room does not exist.\"], 404);\n } else {\n return response()->json(array(\"room\"=>$room));\n }\n }", "public function index()\n {\n $user = Auth::user();\n $role = auth()->user()->getRoleNames();\n\n $id = Auth::id();\n \n $rooms = Room::where('user_id', $id)->get();\n \n // dd($rooms);\n\n return view('host.rooms', compact('user', 'role', 'rooms'));\n }", "public function room()\n {\n return $this->hasOne('App\\Entities\\Room', 'id_categoria_habitacion', 'room_category_id');\n }", "public function getGatewayRoom(Request $request, $id)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Retrieved the Gateway Room';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n return $this->createGetResponse($request, Gateway::findOrFail($id)\n ->room());\n }", "public function edit($id)\n {\n $roomtypes = RoomType::all();\n $room = Room::find($id);\n return view('backend.rooms.create',compact('roomtypes','room'));\n }", "public function chat_roomsAction()\n\t{\n\t\t$user = $this->user;\n $user_id = $user['id'];\n $application_id = $user['Application_ID'];\n\n $user = UsersMobile::findFirst($user_id);\n\n $cms = $user->getCms([\n \t\"secured = 0 AND application_id = {$application_id}\"\n \t]);\n\n $data = [];\n\t\tforeach ($cms as $key => $chat) {\n\t\t\t$data[\"messages\"][$key][\"name\"] = $chat->title;\n\t\t\t$data[\"messages\"][$key][\"created_at\"] = $chat->datetime;\n\t\t\t$data[\"messages\"][$key][\"id\"] = $chat->id;\n\t\t}\n\n\t\t$final_array = $this->structureMessages($data[\"messages\"]);\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => $final_array\n ];\n\n return $this->sendJson($response);\n\t}", "public function find($params) {\n\t\treturn SupportRoom::find()->where($params)->one();\n\t}", "public function create()\n {\n return view('room.create');\n }", "public function create()\n {\n return view('room.create');\n }", "function edit($id)\n { \n // check if the room exists before trying to edit it\n $data['room'] = $this->Room_model->get_room($id);\n \n if(isset($data['room']['']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'id' => $this->input->post('id'),\n\t\t\t\t\t'hotel_id' => $this->input->post('hotel_id'),\n\t\t\t\t\t'category_id' => $this->input->post('category_id'),\n\t\t\t\t\t'room_no' => $this->input->post('room_no'),\n\t\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t\t'capacity' => $this->input->post('capacity'),\n\t\t\t\t\t'created_at' => $this->input->post('created_at'),\n\t\t\t\t\t'updated_at' => $this->input->post('updated_at'),\n );\n\n $this->Room_model->update_room($id,$params); \n redirect('room/index');\n }\n else\n {\n $data['_view'] = 'room/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The room you are trying to edit does not exist.');\n }", "function bookRoom(){\n $unparsed_json = file_get_contents('http://127.0.0.1:5000/searchHotels');\n $json = json_decode($unparsed_json);\n\n // prints options on the screen\n echo \"\\t\\t--HOTEL OPENINGS--\\n\";\n foreach ($json as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n $id = readline(\"\\nType the room id you want to acquire: \");\n $number = readline(\"\\nNumber of rooms: \");\n\n $request = 'http://127.0.0.1:5000/bookRoom/'.$id.'/'.$number;\n $unparsed_json = file_get_contents($request);\n $json = json_decode($unparsed_json);\n foreach ($json as $key => $value) {echo \"$value\\n\";}\n}", "function leaveRoom(Room $room): Promise;", "function openmeetings_createRoomWithModAndType($openmeetings) {\n\t\tglobal $CFG;\n\n\t\t$restService = new openmeetings_rest_service();\n\n\t\t$url = $this->getUrl().'/services/RoomService/addRoomWithModerationAndExternalType?' .\n\t\t\t\t\t\t'SID='.$this->session_id .\n\t\t\t\t\t\t'&name='.urlencode($openmeetings->name).\n\t\t\t\t\t\t'&roomtypes_id='.$openmeetings->type .\n\t\t\t\t\t\t'&comment='.urlencode($openmeetings->description) .\n\t\t\t\t\t\t'&numberOfPartizipants='.$openmeetings->max_user .\n\t\t\t\t\t\t'&ispublic=false'.\n\t\t\t\t\t\t'&appointment=false'.\n\t\t\t\t\t\t'&isDemoRoom=false'.\n\t\t\t\t\t\t'&demoTime=0' .\n\t\t\t\t\t\t'&isModeratedRoom='.$this->var_to_str($openmeetings->isModeratedRoom) .\n\t\t\t\t\t\t'&externalRoomType='.urlencode($CFG->openmeetings_openmeetingsModuleKey)\n\t\t\t\t\t\t;\n\t\t\n\t \t$result = $restService->call($url, \"return\");\n\t\t\n\t\tif ($restService->fault()) {\n\t\t\techo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';\n\t\t} else {\n\t\t\t$err = $restService->getError();\n\t\t\tif ($err) {\n\t\t\t\techo '<h2>Error</h2><pre>' . $err . '</pre>';\n\t\t\t} else {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t} \n\t\treturn -1;\n\t}", "function output_room_screen($member_id)\n{\n\t$title=get_page_title('OCWORLD');\n\n\t/*$test_tpl=internalise_own_screen($title); Would require lots of work to make sure all links point right\n\tif (is_object($test_tpl)) return $test_tpl;*/\n\n\tdestick($member_id);\n\n\trequire_lang('chat');\n\trequire_lang('menus');\n\trequire_javascript('javascript_editing');\n\n\tlist($realm,$x,$y)=get_loc_details($member_id);\n\n\t$rooms=$GLOBALS['SITE_DB']->query_select('w_rooms',array('*'),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm),'',1);\n\t$room=$rooms[0];\n\t$room_name=$room['name'];\n\t$room_text=comcode_to_tempcode($room['r_text'],$room['owner']);\n\t$pic_url=str_replace(' ','%20',$room['picture_url']);\n\tif ((url_is_local($pic_url)) && ($pic_url!='')) $pic_url=get_custom_base_url().'/'.$pic_url;\n\t$up_room=$GLOBALS['SITE_DB']->query_value_null_ok('w_rooms','name',array('location_x'=>$x,'location_y'=>$y-1,'location_realm'=>$realm));\n\t$locked_up=$room['locked_up'];\n\tif (($locked_up==1) || (is_null($up_room))) $up_room='';\n\t$down_room=$GLOBALS['SITE_DB']->query_value_null_ok('w_rooms','name',array('location_x'=>$x,'location_y'=>$y+1,'location_realm'=>$realm));\n\t$locked_down=$room['locked_down'];\n\tif (($locked_down==1) || (is_null($down_room))) $down_room='';\n\t$right_room=$GLOBALS['SITE_DB']->query_value_null_ok('w_rooms','name',array('location_x'=>$x+1,'location_y'=>$y,'location_realm'=>$realm));\n\t$locked_right=$room['locked_right'];\n\tif (($locked_right==1) || (is_null($right_room))) $right_room='';\n\t$left_room=$GLOBALS['SITE_DB']->query_value_null_ok('w_rooms','name',array('location_x'=>$x-1,'location_y'=>$y,'location_realm'=>$realm));\n\t$locked_left=$room['locked_left'];\n\tif (($locked_left==1) || (is_null($left_room))) $left_room='';\n\t$realm_name=$GLOBALS['SITE_DB']->query_value('w_realms','name',array('id'=>$realm));\n\n\t$has_up_room=(!is_null($up_room)) && ($up_room!='') && ($locked_up==0);\n\t$has_left_room=(!is_null($left_room)) && ($left_room!='') && ($locked_left==0);\n\t$has_right_room=(!is_null($right_room)) && ($right_room!='') && ($locked_right==0);\n\t$has_down_room=(!is_null($down_room)) && ($down_room!='') && ($locked_down==0);\n\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_portals',array('name','end_location_realm','owner'),array('start_location_x'=>$x,'start_location_y'=>$y,'start_location_realm'=>$realm),'ORDER BY name');\n\t$portals=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$dest_realm=$myrow['end_location_realm'];\n\n\t\t$editable=((has_specific_permission($member_id,'administer_ocworld')) || ($myrow['owner']==$member_id));\n\n\t\t$portals->attach(do_template('W_MAIN_PORTAL',array('_GUID'=>'f5582c18b71be98d74dfb8d2b777afc0','NAME'=>$myrow['name'],'EDITABLE'=>$editable,'DEST_REALM'=>strval($dest_realm))));\n\t}\n\t$width='';\n\tif ($pic_url!='')\n\t{\n\t\t$ext=strtolower(substr($pic_url,strlen($pic_url)-4));\n\t\t$mypic=false;\n\t\tif (($ext=='jpeg') || ($ext=='.jpg')) $mypic=@imagecreatefromjpeg($pic_url);\n\t\tif ($ext=='.png') $mypic=@imagecreatefrompng($pic_url);\n\t\tif ((function_exists('imagecreatefromgif')) && ($ext=='.gif')) $mypic=@imagecreatefromgif($pic_url);\n\t\tif (($mypic===false) || (imagesx($mypic)>430)) $width='width: 430px';\n\t}\n\n\t$other_person=post_param_integer('tuser',-1);\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_members',array('*'),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm),'ORDER BY lastactive DESC');\n\t$people_here=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$this_member_name=$GLOBALS['FORUM_DRIVER']->get_username($myrow['id']);\n\t\tif (is_null($this_member_name)) $this_member_name=do_lang('UNKNOWN');\n\t\t$people_here->attach(do_template('W_MAIN_PERSON_HERE',array('_GUID'=>'d799e4343da8daa27459b097bc3b2e89','THIS_MEMBER_NAME'=>$this_member_name,'ID'=>strval($myrow['id']),'SELECTED'=>false)));\n\t}\n\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_members',array('*'),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm),'ORDER BY lastactive DESC',15);\n\t$members=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$id=$myrow['id'];\n\t\t$health=$myrow['health'];\n\n\t\t$aux=new ocp_tempcode();\n\t\tif ($id>=0)\n\t\t{\n\t\t\t$name=$GLOBALS['FORUM_DRIVER']->get_username($id);\n\t\t\tif (is_null($name)) $name=do_lang('UNKNOWN');\n\t\t\tif ($myrow['banned']==1) $aux=do_lang_tempcode('W_IS_BANNED');\n\t\t\telseif ($myrow['health']<1) $aux=do_lang_tempcode('W_DEAD');\n\t\t} else\n\t\t{\n\t\t\t$name=$GLOBALS['SITE_DB']->query_value('w_realms','troll_name',array('id'=>(-$id-1)));\n\t\t\t$aux=do_lang_tempcode('W_IS_TROLL');\n\t\t}\n\t\tif ($id==$member_id)\n\t\t{\n\t\t\t$style='ocw_self_member';\n\t\t} else\n\t\t{\n\t\t\t$style='ocw_other_member';\n\t\t}\n\n\t\tif ($id<0) $member_url=''; else $member_url=$GLOBALS['FORUM_DRIVER']->member_profile_url($id,false,true);\n\n\t\t$members->attach(do_template('W_MAIN_MEMBER',array('_GUID'=>'83d9f930b68d4988b009b3c06ef783e9','HEALTH'=>integer_format($health),'ID'=>strval($id),'MEMBER_URL'=>$member_url,'STYLE'=>$style,'NAME'=>$name,'AUX'=>$aux)));\n\t}\n\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_items',array('*'),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm,'cost'=>0));\n\t$items=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$rows2=$GLOBALS['SITE_DB']->query_select('w_itemdef',array('*'),array('name'=>$myrow['name']),'',1);\n\t\t$myrow2=$rows2[0];\n\n\t\t$aux=new ocp_tempcode();\n\t\tif (($myrow2['healthy']==1) && ($myrow2['bribable']==1)) $aux=do_lang_tempcode('W_IS_HEALTH_AND_BRIBABLE');\n\t\telseif ($myrow2['healthy']==1) $aux=do_lang_tempcode('W_IS_HEALTHY');\n\t\telseif ($myrow2['bribable']==1) $aux=do_lang_tempcode('W_IS_BRIBABLE');\n\t\t$edit_item_copy_access=((has_specific_permission($member_id,'administer_ocworld')) || ($myrow['copy_owner']==$member_id));\n\n\t\t$count=($myrow['not_infinite']==1)?make_string_tempcode(integer_format($myrow['i_count'])):do_lang_tempcode('W_INFINITE');\n\n\t\t$picture_url=$myrow2['picture_url'];\n\t\tif ((url_is_local($picture_url)) && ($picture_url!='')) $picture_url=get_custom_base_url().'/'.str_replace(' ','%20',$picture_url);\n\n\t\t$items->attach(do_template('W_MAIN_ITEM',array('ACTION'=>do_lang_tempcode('W_TAKE'),'EDIT_ACCESS'=>$edit_item_copy_access,'USER'=>strval($myrow['copy_owner']),'DESCRIPTION'=>$myrow2['description'],'PICTURE_URL'=>$picture_url,'AUX'=>$aux,'NAME'=>$myrow['name'],'COUNT'=>$count)));\n\t}\n\n\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'w_items WHERE location_x='.strval((integer)$x).' AND location_y='.strval((integer)$y).' AND location_realm='.strval((integer)$realm).' AND cost>0');\n\t$items_sale=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$rows2=$GLOBALS['SITE_DB']->query_select('w_itemdef',array('*'),array('name'=>$myrow['name']),'',1);\n\t\t$myrow2=$rows2[0];\n\n\t\t$seller=$GLOBALS['FORUM_DRIVER']->get_username($myrow['copy_owner']);\n\t\tif (is_null($seller)) $seller=do_lang('UNKNOWN');\n\n\t\t$aux=new ocp_tempcode();\n\t\tif (($myrow2['healthy']==1) && ($myrow2['bribable']==1)) $aux=do_lang_tempcode('W_IS_HEALTH_AND_BRIBABLE');\n\t\telseif ($myrow2['healthy']==1) $aux=do_lang_tempcode('W_IS_HEALTHY');\n\t\telseif ($myrow2['bribable']==1) $aux=do_lang_tempcode('W_IS_BRIBABLE');\n\t\t$edit_item_copy_access=((has_specific_permission($member_id,'administer_ocworld')) || ($myrow['copy_owner']==$member_id));\n\n\t\t$count=($myrow['not_infinite']==1)?make_string_tempcode(integer_format($myrow['i_count'])):do_lang_tempcode('W_INFINITE');\n\n\t\t$items_sale->attach(do_template('W_MAIN_ITEM',array('_GUID'=>'ab12f8373378abe5852f1d8ee0a05f27','ACTION'=>do_lang_tempcode('W_BUY'),'SELLER'=>$seller,'EDIT_ACCESS'=>$edit_item_copy_access,'USER'=>strval($myrow['copy_owner']),'DESCRIPTION'=>$myrow2['description'],'PICTURE_URL'=>$myrow2['picture_url'],'AUX'=>$aux,'NAME'=>$myrow['name'],'COUNT'=>$count,'COST'=>integer_format($myrow['cost']))));\n\t}\n\n\t$hide_actions=((array_key_exists('hideActions',$_COOKIE)) && ($_COOKIE['hideActions']==1))?'display: block;':'display: none;';\n\t$hide_additions=((array_key_exists('hideAdditions',$_COOKIE)) && ($_COOKIE['hideAdditions']==1))?'display: block;':'display: none;';\n\t$hide_modifications=((array_key_exists('hideModifications',$_COOKIE)) && ($_COOKIE['hideModifications']==1))?'display: block;':'display: none;';\n\n\t// PEOPLE HERE\n\t$other_person=post_param_integer('user',-1);\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_members',array('*'),array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm),'ORDER BY lastactive DESC');\n\t$people_here=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\tif ($myrow['id']>=0)\n\t\t{\n\t\t\t$this_member_name=$GLOBALS['FORUM_DRIVER']->get_username($myrow['id']);\n\t\t\tif (is_null($this_member_name)) $this_member_name=do_lang('UNKNOWN');\n\t\t} else\n\t\t{\n\t\t\t$this_member_name=$GLOBALS['SITE_DB']->query_value('w_realms','troll_name',array('id'=>(-$myrow['id']-1)));\n\t\t}\n\t\t$selected=(($myrow['id']==$other_person) && (!is_null($other_person))) || ($myrow['id']==$other_person);\n\t\t$people_here->attach(do_template('W_MAIN_PERSON_HERE',array('_GUID'=>'4fd3908b7b47338a4f47710c85a060ac','THIS_MEMBER_NAME'=>$this_member_name,'ID'=>strval($myrow['id']),'SELECTED'=>$selected)));\n\t}\n\tif (has_specific_permission($member_id,'administer_ocworld'))\n\t{\n\t\t$people_here->attach(do_template('W_MAIN_PEOPLE_SEP'));\n\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'w_members WHERE location_x<>'.strval((integer)$x).' AND location_y<>'.strval((integer)$y).' AND location_realm<>'.strval((integer)$realm).' ORDER BY lastactive DESC',30);\n\t\tforeach ($rows as $myrow)\n\t\t{\n\t\t\tif ($myrow['id']>=0)\n\t\t\t{\n\t\t\t\t$this_member_name=$GLOBALS['FORUM_DRIVER']->get_username($myrow['id']);\n\t\t\t\tif (is_null($this_member_name)) $this_member_name=do_lang('UNKNOWN');\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$this_member_name=$GLOBALS['SITE_DB']->query_value('w_realms','troll_name',array('id'=>(-$myrow['id']-1)));\n\t\t\t}\n\n\t\t\t$people_here->attach(do_template('W_MAIN_PERSON_HERE',array('_GUID'=>'16291e73031cc0254fa6d974d984d353','THIS_MEMBER_NAME'=>$this_member_name,'ID'=>strval($myrow['id']),'SELECTED'=>false)));\n\t\t}\n\t}\n\t$people_here=do_template('W_MAIN_PEOPLE_HERE',array('_GUID'=>'c179c25a84cb2919b9bf59f42a77d1dc','CONTENT'=>$people_here));\n\n\t// ITEMS HELD\n\t$item=post_param('item','');\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_inventory',array('*'),array('item_owner'=>$member_id));\n\t$items_held=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$items_held->attach(do_template('W_MAIN_ITEM_OWNED',array('_GUID'=>'85b1de9cf8c11b535b28bf033fa11dc9','SELECTED'=>false,'NAME'=>$myrow['item_name'])));\n\t}\n\t$items_held=do_template('W_MAIN_ITEMS_HELD',array('_GUID'=>'bbbc447a1d2ac0aed85ef57ecae79415','CONTENT'=>$items_held));\n\n\t// ITEMS OWNED\n\t$item=post_param('item','');\n\t$rows=$GLOBALS['SITE_DB']->query_select('w_itemdef',array('*'),array('owner'=>$member_id));\n\t$_items_owned=new ocp_tempcode();\n\tforeach ($rows as $myrow)\n\t{\n\t\t$selected=$myrow['name']==$item;\n\t\t$tpl=do_template('W_MAIN_ITEM_OWNED',array('_GUID'=>'dfa2971a5196b3c60d9bbd5240b0d269','SELECTED'=>$selected,'NAME'=>$myrow['name']));\n\t\t$_items_owned->attach($tpl);\n\t}\n\tif (has_specific_permission($member_id,'administer_ocworld'))\n\t{\n\t\t$_items_owned->attach(do_template('W_MAIN_ITEM_OWNED_SEP'));\n\n\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'w_itemdef WHERE owner<>'.strval((integer)$member_id).' ORDER BY name');\n\t\tforeach ($rows as $myrow)\n\t\t{\n\t\t\t$selected=$myrow['name']==$item;\n\t\t\t$tpl=do_template('W_MAIN_ITEM_OWNED',array('_GUID'=>'84ccf58b51c77257b6a8a76feae19812','SELECTED'=>$selected,'NAME'=>$myrow['name']));\n\t\t\t$_items_owned->attach($tpl);\n\t\t}\n\t}\n\t$items_owned=do_template('W_MAIN_ITEMS_OWNED',array('_GUID'=>'6738150dc18abd7695623f98133c60fe','NAME'=>'item','CONTENT'=>$_items_owned));\n\t$items_owned_2=do_template('W_MAIN_ITEMS_OWNED',array('_GUID'=>'471f3536533e534fe29ac910cb854c04','NAME'=>'item2','CONTENT'=>$_items_owned));\n\n\t$is_room_owner=((!is_null($member_id)) || ($GLOBALS['SITE_DB']->query_value('w_rooms','owner',array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm))==$member_id));\n\t$is_realm_owner=((has_specific_permission($member_id,'administer_ocworld')) || ($GLOBALS['SITE_DB']->query_value('w_realms','owner',array('id'=>$realm))==$member_id));\n\n\t$may_do_stuff=(!((!has_specific_permission($member_id,'administer_ocworld')) && ($GLOBALS['SITE_DB']->query_value('w_realms','owner',array('id'=>$realm))!=$member_id) && ($GLOBALS['SITE_DB']->query_value('w_realms','r_private',array('id'=>$realm))==1)));\n\t$may_add_portal=($GLOBALS['SITE_DB']->query_value('w_rooms','allow_portal',array('location_x'=>$x,'location_y'=>$y,'location_realm'=>$realm))==1);\n\n\t$is_staff=(has_specific_permission($member_id,'administer_ocworld'));\n\n\treturn do_template('W_MAIN_SCREEN',array(\n\t\t'TITLE'=>$title,\n\t\t'REALM_NAME'=>$realm_name,\n\t\t'ROOM_NAME'=>$room_name,\n\t\t'REALM'=>strval($realm),\n\t\t'X'=>strval($x),\n\t\t'Y'=>strval($y),\n\t\t'ROOM_TEXT'=>$room_text,\n\t\t'HAS_UP_ROOM'=>$has_up_room,\n\t\t'HAS_DOWN_ROOM'=>$has_down_room,\n\t\t'HAS_LEFT_ROOM'=>$has_left_room,\n\t\t'HAS_RIGHT_ROOM'=>$has_right_room,\n\t\t'PORTALS'=>$portals,\n\t\t'PIC_URL'=>$pic_url,\n\t\t'MEMBERS'=>$members,\n\t\t'ITEMS'=>$items,\n\t\t'ITEMS_SALE'=>$items_sale,\n\t\t'PEOPLE'=>$people_here,\n\t\t'IS_STAFF'=>$is_staff,\n\t\t'HIDE_MODIFICATIONS'=>$hide_modifications,\n\t\t'HIDE_ADDITIONS'=>$hide_additions,\n\t\t'HIDE_ACTIONS'=>$hide_actions,\n\t\t'MAY_DO_STUFF'=>$may_do_stuff,\n\t\t'MAY_ADD_PORTAL'=>$may_add_portal,\n\t\t'ITEMS_OWNED'=>$items_owned,\n\t\t'ITEMS_OWNED_2'=>$items_owned_2,\n\t\t'ITEMS_HELD'=>$items_held,\n\t\t'WIDTH'=>$width,\n\t\t'IS_ROOM_OWNER'=>$is_room_owner,\n\t\t'IS_REALM_OWNER'=>$is_realm_owner,\n\t\t'EMOTICON_CHOOSER'=>$GLOBALS['FORUM_DRIVER']->get_emoticon_chooser(),\n\t\t'UP_ROOM'=>$up_room,\n\t\t'DOWN_ROOM'=>$down_room,\n\t\t'LEFT_ROOM'=>$left_room,\n\t\t'RIGHT_ROOM'=>$right_room,\n\t));\n}", "private function create_new_room($entity_id){\n //Create a new room object for the entity id\n $new_room = new \\App\\Room($entity_id);\n //Add to the list of currently open rooms\n array_push($this->open_rooms, $new_room);\n //Get the resource index\n $new_room->set_resource_index(sizeof($this->open_rooms) - 1);\n echo \"Created a new room for entity: \" . $entity_id . \"\\n\";\n return $new_room;\n }", "function getRooms(){\n\t\t$stmt = $this->connect->prepare(\"SELECT id,Name,RoomNo, Description from roominfo\");\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($id, $name, $RoomNo, $Description);\n\t\t\n\t\t$rooms = array(); \n\t\t\n\t\twhile($stmt->fetch()){\n\t\t\t$room = array();\n\t\t\t$room['id'] = $id; \n\t\t\t$room['Name'] = $name; \n\t\t\t$room['RoomNo'] = $RoomNo; \n $room['Description'] = $Description; \n\t\t\tarray_push($rooms, $room); \n\t\t}\n\t\t\n\t\treturn $rooms; \n\t}", "private function find_room($entity_id){\n $room = null;\n for($i = 0; $i < sizeof($this->open_rooms); $i++){\n //Is there a room at this id number?\n if(is_null($this->open_rooms[$i])){\n //Nope\n continue;\n }\n //Is this the room?\n if($this->open_rooms[$i]->get_entity_id() == $entity_id){\n //This room exists and is at the current index\n return $this->open_rooms[$i];\n }\n }\n return null;\n }", "function load_room_name($conn)\n{\n\t$output='';\n\t$edit_room_id=$_POST['Edit-room'];\n\t\n\t$query1 = \"SELECT * FROM room where ROOM_ID= $edit_room_id \";\n\t$result1 = mysqli_query($conn,$query1);\n\twhile($row = mysqli_fetch_array($result1)) \n\t{\n\t\t\n\t\t$output=$row[\"ROOM_NAME\"];\n\t}\n\treturn $output;\n}", "public function index()\n {\n $rooms = Room::all();\n return RoomResource::collection($rooms);\n }", "public function index()\n {\n $user = DB::table('rooms')->get();\n return view('view-room', compact('user'));\n }", "public function room($itemId)\n {\n $this->set('title', 'Chat room');\n $client = $this->request->getSession()->read('Auth.User');\n $item = $this->Item->findItemById($itemId);\n $shop = $this->Shop->get($item->shop);\n\n if ($item != null) {\n // Create new room id\n $roomId = $client['name'] . $client['id'] . $item->id;\n // Check this Room has exist or not. If not, create new Room\n if (!$this->Chat->getFirstChatInRoom($roomId)) {\n $data = [\n 'itemId' => $item->id ,\n 'shopId' => $item->shop, \n 'clientId' => $client['id'],\n 'roomId' => $roomId,\n 'message' => '',\n 'messageFrom' => '',\n 'readed' => 0\n ];\n $this->Chat->insert($data);\n }\n\n $listChat = $this->Chat->getAllChatInRoom($roomId);\n $this->set([\n 'item' => $item, \n 'shop' => $shop,\n 'client' => $client,\n 'chats' => $listChat, \n 'roomId' => $roomId\n ]);\n $this->render('room');\n } else {\n $this->redirect(['controller' => 'Pages', 'action' => 'home']);\n }\n }", "public function actionRoomView($id)\n {\n $roomModel = $this->findRoomModel($id);\n $hotel_id = $roomModel->hotel_id;\n //\\yii\\helpers\\VarDumper::dump($hotel_id); exit;\n return $this->render('room-view', [\n 'roomModel' => $roomModel,\n 'hotel_id' => $hotel_id,\n 'id' => $id,\n ]);\n }", "public function create()\n {\n $buildings = Building::where('user_id',Auth::User()->id)->get();\n return view('owner.room.create',compact('buildings'));\n }", "public function actionAmmanShowRooms() {\n $session = Yii::$app->session;\n $lang_id = $session['language_id'];\n $get_make = Make::find()->where(['lang_id' => $lang_id])->all();\n $select_milage = Milage::find()->all();\n $select_colors = Colors::find()->all();\n $select_stores = Stores::find()->where(['location' => 1])->orderBy(['id' => SORT_DESC])->all();\n $select_car_main_features_category = CarsFeaturesMainCategory::find()->where(['lang_id' => $lang_id])->all();\n $select_car_features_category = CarsFeaturesCategory::find()->where(['lang_id' => $lang_id])->all();\n return $this->render('amman-show-rooms', [\n 'make_details' => $get_make,\n 'select_milage' => $select_milage,\n 'select_car_main_features_category' => $select_car_main_features_category,\n 'select_car_features_category' => $select_car_features_category,\n 'select_colors' => $select_colors,\n 'select_stores' => $select_stores,\n ]);\n }", "public function fetchByIdAdmin($id)\n {\n \n $stmt = $this->connection->pdo\n ->prepare(Finder::getSql(\"SELECT * FROM app_rooms WHERE id = :id\"));\n $stmt->execute(['id' => (int) $id]);\n return Rooms::arrayToEntity(\n $stmt->fetch(PDO::FETCH_ASSOC), new Rooms());\n }", "public function index()\n {\n $room = Room::all();\n\n if(count($room) > 0){\n return response([\n 'message' => 'Retrieve All Success',\n 'data' => $room\n ], 200);\n }\n\n return response([\n 'message' => 'Empty',\n 'data' => null\n ], 404);\n }", "public function create()\n {\n return view('add-room');\n }", "public function getRoom_name()\n {\n return $this->room_name;\n }", "public function create()\n {\n abort_unless(\\Auth::check() && \\Auth::User()->isAdmin(), 403);\n \n return view('rooms.create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new MainRoom;\n\n\t\t// update/create section\n\t\tif (isset($_POST['MainRoom'])) {\n\t\t\t$model->attributes = $_POST['MainRoom'];\n\t\t\tif ($model->validate()) {\n\t\t\t\t$model->save(false);\n\t\t\t\t$model->position = $model->id;\n\t\t\t\t$model->save(false);\n\n\t\t\t\t$this->redirect(array('index'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function GetRooms($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public static function getRooms($hotel) {\n \t$table = new Room();\n \treturn $hotel->findDependentRowset(\"Room\", \"Hotel\", $table->select()->order(\"name ASC\"));\n }", "public function index()\n {\n $rooms = Room::all();\n return view('crud.room.index',compact('rooms'));\n }", "public function update(Request $request, Room $room)\n {\n //\n }" ]
[ "0.67331916", "0.67331916", "0.67331916", "0.67331916", "0.67331916", "0.6654273", "0.6624311", "0.66094357", "0.6576212", "0.6576212", "0.65502346", "0.65404487", "0.64958364", "0.6445099", "0.6445099", "0.6445099", "0.6412298", "0.63066274", "0.6294054", "0.627191", "0.626703", "0.6109781", "0.60826", "0.60808235", "0.6049915", "0.6041942", "0.5986363", "0.597603", "0.59729564", "0.5955608", "0.595481", "0.5940463", "0.59363896", "0.5936263", "0.5921211", "0.5918411", "0.59147507", "0.5903411", "0.588775", "0.58811295", "0.5878051", "0.5861452", "0.58315957", "0.58265567", "0.58225334", "0.5812387", "0.57942003", "0.57850415", "0.57833654", "0.5773459", "0.5757914", "0.5756678", "0.5751976", "0.5750941", "0.574655", "0.5728705", "0.5726062", "0.57167095", "0.5716261", "0.5708542", "0.57051486", "0.5703313", "0.5703313", "0.5703313", "0.5702141", "0.5699836", "0.56848586", "0.5676784", "0.5669377", "0.5668514", "0.5667918", "0.5667746", "0.56604475", "0.5659339", "0.56566024", "0.56566024", "0.56502205", "0.56498665", "0.5641536", "0.56403136", "0.5630785", "0.5630062", "0.56196994", "0.56167024", "0.5607803", "0.56062764", "0.5605276", "0.560197", "0.5596664", "0.55897146", "0.55887234", "0.55826825", "0.5575344", "0.55690086", "0.5568173", "0.5565227", "0.55550706", "0.5529754", "0.5523737", "0.55122215", "0.55099404" ]
0.0
-1
Registers this controller as a RPC callback at the WAMP router (config/routing.yml)
public function getName() { return "room.rpc"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "public function routeStartup()\n {\n //...\n }", "public function register_route() {\n register_rest_route( $this->namespace, $this->endpoint , array(\n 'methods' => 'POST',\n 'callback' => array($this, 'get_next_page'),\n 'args' => array(),\n ) );\n }", "public function registerRoutes()\n {\n $namespace = $this->getNameSpace();\n\n register_rest_route($namespace, '/' . self::ROUTE_UPDATE_CALLBACK, [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'updateTrapp' ),\n 'permission_callback' => array( $this, 'updateTrappPermissions' ),\n ]);\n }", "public function registerExternalEndpoints()\n {\n Route::post('encode/notify', [\n 'as' => 'decoy::encode@notify',\n 'uses' => '\\Bkwld\\Decoy\\Controllers\\Encoder@notify',\n ]);\n }", "public function rest_api_init_action() {\r\n \r\n register_rest_route('api-bearer-auth/v1', '/login', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_login'],\r\n 'args' => [\r\n 'username' => [\r\n 'required' => true,\r\n ],\r\n 'password' => [\r\n 'required' => true,\r\n ],\r\n ]\r\n ]);\r\n \r\n register_rest_route('api-bearer-auth/v1', '/tokens/refresh', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_refresh_token'],\r\n 'args' => [\r\n 'token' => [\r\n 'required' => true\r\n ]\r\n ]\r\n ]);\r\n \r\n }", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "public function callbackAction()\n {\n // set needed request method parameter\n if ($this->_request->isPost()) {\n $_SERVER['REQUEST_METHOD'] = 'post';\n } else {\n $_SERVER['REQUEST_METHOD'] = 'get';\n }\n\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n //get the Callback instance and hond over the storage\n $callback = new PubSubHubbub_Subscriber_Callback;\n $callback->setStorage($subscriptionStorage);\n\n // handle request and immediatly send response, to avoid blocking the hub\n $callback->handle($this->_request->getParams(), true);\n\n // ######## Feed Update Handling ########\n // if hub sends you a couple of feed updates\n if (true === $callback->hasFeedUpdate()) {\n //get filepath for the feed update files\n $filePath = $this->_owApp->erfurt->getTmpDir() .\n \"pubsub_\" .\n $this->_request->getParam('xhub_subscription') .\n \"_\" .\n time() .\n \".xml\";\n\n // if filepath is not writable\n if ( false === ( $fh = fopen($filePath, 'w') ) ) {\n // can't open the file\n $m = \"No write permissions for \". $filePath;\n throw new CubeViz_Exception($m);\n }\n\n // write the hole feed update to the file\n fwrite($fh, $callback->getFeedUpdate() . \"\\n\");\n // set file mode\n chmod($filePath, 0755);\n // clsoe file\n fclose($fh);\n\n // collect all subscripton properties\n $subscriptionResourceData = $subscriptionStorage->getSubscription(\n $this->_request->getParam('xhub_subscription')\n );\n\n // create erfurt event\n $event = new Erfurt_Event('onFeedUpdate');\n\n // attach some information to the event\n $event->autoInsertFeedUpdates = 'true' == $this->_privateConfig\n ->get('subscriptions')\n ->get('autoInsertFeedUpdates') ? true : false;\n $event->feedUpdateFilePath = $filePath;\n $event->feedUpdates = $callback->getFeedUpdate();\n\n // extract model iri from subscription entry in subscriptions model\n $modelIriProperty = $this->_privateConfig->get('subscriptions')->get('modelIri');\n $modelIri = $subscriptionResourceData['resourceProperties'][$modelIriProperty][0]['uri'];\n $event->modelInstance = new Erfurt_Rdf_Model($modelIri);\n\n // add source resource to the event\n $event->sourceResource = $subscriptionStorage->getSourceResource(\n $this->_request->getParam('xhub_subscription')\n );\n\n // add subscripton properties to the event\n $event->subscriptionResourceProperties = $subscriptionResourceData['resourceProperties'];\n\n // trigger the event\n $event->trigger();\n }\n }", "public function run(callable $callback)\n {\n ApiHandler::register($this->url, $this->method, $callback);\n }", "public function callbackAction() {\n\t\t$request = $this->getRequest ();\n\t\t$response = $request->getParams ();\n\n\t\tif (! empty ( $response ['custom'] ) && is_numeric ( trim($response ['custom'] ))) {\n\t\t\t\n\t\t\t// Getting the md5 value in order to match with the class name.\n\t\t\t$classrequest = $request->gateway;\n\n\t\t\t// Orderid back from the bank\n\t\t\t$order_id = trim($response ['custom']);\n\t\t\t\n\t\t\t// Get the bank selected using the MD5 code\n\t\t\t$bank = Banks::findbyMD5 ( $classrequest );\n\t\t\tif (! empty ( $bank [0] ['classname'] )) {\n\t\t\t\tif (! empty ( $bank [0] ['classname'] ) && class_exists ( $bank [0] ['classname'] )) {\n\t\t\t\t\t\n\t\t\t\t\t$class = $bank [0] ['classname'];\n\t\t\t\t\t$payment = new $class ( $response ['custom'] );\n\t\t\t\t\t\n\t\t\t\t\t// Check if the method \"Response\" exists in the Payment class and send all the bank information to the payment module\n\t\t\t\t\tif (method_exists ( $class, \"Response\" )) {\n\t\t\t\t\t\tShineisp_Commons_Utilities::logs ( \"Callback called: $class\\nParameters: \" . json_encode ( $response ), \"payments.log\" );\n\t\t\t\t\t\t$payment->Callback ( $response );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdie ();\t\n\t}", "public function controller(){\n route('start')->onMessageText('/start');\n route('add')->onMessageText('/add');\n route('list')->onMessageText('/list');\n route('delete')->onMessageText('/delete');\n route('clear')->onMessageText('/clear');\n route('about')->onMessageText('/about');\n }", "public function register_routes() {\n\n\t\t// Get current user per the JWT token. Depends on JWT plugin.\n\t\tregister_rest_route(\n\t\t\t'wpcampus',\n\t\t\t'/auth/user/',\n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [ $this, 'get_current_user' ],\n\t\t\t]\n\t\t);\n\t}", "function wpib_register_route() {\n\tregister_rest_route( 'wpib/1.0/', '/inbox', array(\n\t\tarray(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'wpib_on_email_recived',\n\t\t\t'args' => array(\n\t\t\t\t'mandrill_events' => array(\n\t\t\t\t\t'required' => true\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t) );\n}", "public function register_api_endpoints() {\n\n\t\tregister_rest_route( 'nock/v1', '/messages', array(\n\t\t\t'methods' => array( 'POST' ),\n\t\t\t'callback' => array( $this, 'send_message' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/accounts', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_accounts' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/groups', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_groups' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/sms', array(\n\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t'callback' => array( $this, 'capture_sms' ),\n\t\t) );\n\n\t}", "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "abstract protected function registerCallback();", "function onibus_endpoint_init() {\n\n\t$namespace = API_VERSAO;\n\n register_rest_route( $namespace, '/onibus/get-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/set-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'POST',\n\t 'callback' \t=> 'set_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_all_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/(?P<id>\\d+)',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_onibus_by_id',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/create/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'adicionar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/update/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'editar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/delete/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'deletar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n\n}", "function registerEndpoints()\n{\n $namespace = 'travel-review-app/v1';\n\n register_rest_route(\n $namespace,\n '/destinations-default-wordpress',\n [\n 'methods' => 'GET',\n 'callback' => 'listDestinationsDefaultWordPress',\n ]\n );\n}", "function register_routes(){\n \tregister_rest_route( parent::get_api_base(), $this->controller . 'get' , array(\n \t\t'methods' => WP_REST_Server::READABLE,\n \t\t'callback' => array($this,'run_cron'),\n\n \t\t//'permission_callback' => array( $this, 'get_item_permissions_check' ),\n \t));\n\t}", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "function spf_register_route(){\n register_rest_route('wooapp/v1','/shop/products',Array(\n 'methods' => 'GET',\n 'callback' => 'spf_get_shop_products',\n ));\n\n register_rest_route('wooapp/v1', '/auth/register', [\n 'methods' => 'POST',\n 'callback' => 'spf_register_new_user',\n ]);\n\n register_rest_route('wooapp/v1', '/auth/login', [\n 'methods' => 'POST',\n 'callback' => 'spf_login_user',\n ]);\n}", "public function custom_api() {\n\t\t$this->register_new_route( 'cases-status', '', WP_REST_Server::CREATABLE, array( $this, 'toggle_status' ) );\n\t}", "public static function registerEndpoints() {\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/informasjon/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'informasjonsMeny'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 4: Innlegg i bloggen\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/nyheter/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'nyheter'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n\n /**\n * ENDPOINT 5: Innlegg fra kategori\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/kategori/(?P<id>\\d+)', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'kategori'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 1 Info om en gitt post\n */\n $register = register_rest_route(\n 'UKM',\n '/post/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'post'],\n 'args' => ['id']\n ]\n );\n\n /**\n * ENDPOINT 2: Innholdet i en post\n */\n $register = register_rest_route(\n 'UKM',\n '/content/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'postContent'],\n 'args' => ['id']\n ]\n );\n }", "static function add ($method, $path = '*', $callback = null) {\n if (isset($callback[1]))\n $callback[0] = 'Cocoon\\Controllers\\\\' . $callback[0];\n self::instance()->klein->respond($method, $path, $callback);\n }", "public function callback() {\n\t\tif (isset($_SESSION['REQUEST_TOKEN'])) {\n\t\t\t$co = new Config();\n\t\t\t$co->setPackageObject(Package::getByHandle('rest_wordpress'));\n\t\t\t$wp_rest_api_url = $co->get('WP_REST_API_URL');\n\t\t\t$oauth_key = $co->get('WP_REST_API_OAUTH_KEY');\n\t\t\t$oauth_secret = $co->get('WP_REST_API_OAUTH_SECRET');\n\t\t\t\n\t\t\t$consumer = $this->getOauthConsumer($wp_rest_api_url, $oauth_key, $oauth_secret);\n\t\t\t\n\t\t\tif (is_object($consumer)) {\n\t\t\t\t// Get Zend_Oauth_Token_Access object\n\t\t\t\t$token = $consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n\t\t\t\t$oauth_token = $token->getToken();\n\t\t\t\t$oauth_token_secret = $token->getTokenSecret();\n\t\t\t\t\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN', $oauth_token);\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN_SECRET', $oauth_token_secret);\n\t\t\t\t\n\t\t\t\t$_SESSION['REQUEST_TOKEN'] = null;\n\t\t\t\t\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','authenticated');\n\t\t\t} else {\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/settings','required');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','invalid_request_token');\n\t\t}\n\t}", "protected function autoRegisterController()\n {\n $controllerInfo = $this->getController();\n if ($controllerInfo) {\n $uri = WingedLib::clearPath(static::$parentUri);\n $baseUri = '';\n if (!$uri) {\n $baseUri = './';\n } else {\n $uri = explode('/', $uri);\n if (isset($uri[0])) {\n $baseUri = './' . $uri[0] . '/';\n }\n if (isset($uri[1])) {\n $baseUri .= $uri[1] . '/';\n } else {\n $baseUri .= 'index/';\n }\n }\n if (!empty($controllerInfo['params'])) {\n foreach ($controllerInfo['params'] as $paramName => $optional) {\n if ($optional) {\n $baseUri .= '{$' . $paramName . '?}/';\n } else {\n $baseUri .= '{$' . $paramName . '}/';\n }\n }\n }\n Route::raw($baseUri, static::$controllerName . '@' . static::$controllerAction)->addResponseMiddleware(new ResponseMiddleware(function ($response) {\n if (is_array($response)) {\n /**\n * @var $this ResponseMiddleware\n */\n $self = &$this;\n if ($self->getRoute()->request()->isAcceptableType('application/json')) {\n $self->getRoute()->forceJson();\n } else if ($self->getRoute()->request()->isAcceptableType('application/xml')) {\n $self->getRoute()->forceXml();\n } else if ($self->getRoute()->request()->isAcceptableType('application/yaml')) {\n $self->getRoute()->forceYaml();\n }\n }\n }));\n }\n }", "abstract public function register_hook_callbacks();", "public function register_routes() {\n\t\t$version = '1';\n\t\t$namespace = 'askmedesk/v' . $version;\n register_rest_route( $namespace, '/tipi-richiesta', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_tipi_richiesta'],\n 'permission_callback' => [$this, 'askmedesk_permission_check']\n\t\t));\n\t\tregister_rest_route($namespace, '/creazione-richiesta', array(\n\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t'callback' => [$this, 'crea_richiesta'],\n\t\t\t'permission_callback' => [$this, 'askmedesk_permission_check'],\n\t\t\t'args' => $this->get_endpoint_args_for_item_schema( false )\n\t\t));\n\t}", "function register_rest_routes() {\n\tif ( class_exists( '\\WP_REST_Controller' ) ) {\n\t\tinclude_once __DIR__ . '/wprest-shortcodes-controller.php';\n\t\t$controller = new rest\\WPREST_Shortcodes_Controller();\n\t\t$controller->register_routes();\n\t}\n}", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public function add_api_routes()\n {\n /*\n * Only Apikey validate urls\n *\n */ \n register_rest_route($this->namespace, 'login', [\n 'methods' => 'POST',\n 'callback' => array($this, 'get_login'), \n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n )\n ]);\n\n register_rest_route($this->namespace, 'logout', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'logout'),\n )); \n register_rest_route($this->namespace, 'register', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'register'),\n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'fname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'lname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n\n )\n ));\n\n register_rest_route($this->namespace, 'forgotpassword', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'forgotpassword'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n register_rest_route($this->namespace, 'fblogin', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'fblogin'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n\n \n /*\n * Only Apikey and access token after login.\n *\n */ \n\n \n \n }", "function restAction()\n {\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n $request_data = $this->_getAllParams();\n\n $method_name = $this->_getParam('method');\n if(!isset($method_name))\n {\n echo \"Inconsistent request\";\n exit;\n }\n\n $request_data = $this->_getAllParams();\n // Handle XML-RPC request\n $this->kwWebApiCore = new KwWebApiRestCore($this->apiSetup, $this->apicallbacks, $request_data);\n }", "public function controllerInit($observer) {\n\t \n\t\t$helper = Mage::helper('rublonmodule');\t\t\n\t\t\n\t\tif ($helper->isRublonEnabled() AND isset($_GET['rublon']) AND $_GET['rublon'] == 'callback') {\n\t\t \n\t\t\trequire_once (Mage::getBaseDir('code') . DS . 'community' . DS . 'Rublon' . DS . 'RublonModule' . DS . 'lib' . DS . 'RublonImplemented' . DS .'Rublon2FactorCallbackMagento.php');\n\t\t\t\n\t\t\t$helper->setModule(RublonMagentoModule::CONNECT);\n\t\t\t \n\t\t $state = isset($_GET['state']) ? $_GET['state'] : '';\n\t\t $token = isset($_GET['token']) ? $_GET['token'] : null;\n\t\t \n\t\t\ttry {\n\t\t\t\t$callback = new Rublon2FactorCallbackMagento($helper->getRublon());\n\t\t\t $callback->setState($state);\n\t\t\t $callback->setAccessToken($token);\n\t\t\t \n\t\t\t $callback->call(array($this, 'callbackSuccess'), array($this, 'callbackFailure'));\n\t\t\t die('test');\n\t\t\t \n\t\t\t} catch (RublonException $e) {\n\t\t\t\t$helper->addError($e, array('method' => __METHOD__, 'file' => __FILE__));\n\t\t\t\t$helper->returnToPage($helper->getSettingsPageUrl());\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function registerRoute($verb, $route, $callback, $compile = null, $vars = [])\n {\n $app = $this;\n\n $controller = null;\n $method = null;\n\n $base_uri = $app->config->app->base_uri;\n\n if (is_array($route)) {\n list($route, $name) = $route;\n }\n\n $route = $base_uri.$route;\n\n if (isset($name)) {\n $route = [$route, $name];\n }\n\n $data = [];\n\n // If a closure is passed, execute it directly\n if ($callback instanceof Closure) {\n // When we're using a closure, the request and response are returned\n // with the arguments\n $data = [\n $app->request,\n $app->response,\n ];\n\n // Wrap a ReflectionFunction around the controller so we can use\n // invokeArgs() later\n $callback = new ReflectionFunction($callback);\n }\n\n // If a string is passed, then it points to a controller\n if (is_string($callback)) {\n // Get the controller and method name\n list($controller, $method) = explode('@', $callback);\n\n // If the naked class doesn't exist, prepend it with the namespace\n if (!class_exists($controller)) {\n $controller = APP_NAMESPACE.'Http\\\\Controllers\\\\'.$controller;\n }\n\n // If the class still doesn't exist, throw an exception\n if (!class_exists($controller)) {\n throw new InvalidControllerException('The controller '.$controller.' does not exist.');\n }\n\n // Create a reflection class for the controller\n $ref = new ReflectionClass($controller);\n\n // If the controller does not have the requested method,\n // throw an exception\n if (!$ref->hasMethod($method)) {\n throw new InvalidControllerMethodException('The method '.$controller.'::'.$method.' does not exist.');\n }\n\n // Get the callback method\n $callback = $ref->getMethod($method);\n }\n\n return Router::$verb($route, function () use ($app, $callback, $data, $controller) {\n // Merge the arguments returned from the router\n $data = array_merge($data, func_get_args());\n\n // Execute the callback, and output the result in the response\n if ($controller !== null) {\n $controller = new $controller($app->request, $app->response);\n\n return $app->respond($callback->invokeArgs($controller, $data));\n }\n\n return $app->respond($callback->invokeArgs($data));\n });\n }", "function on ($uri, $callback)\r\n\t{\r\n\t\tif ($this->called)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// NOTE: Last callback param is $matches\r\n\t\tlist($success, $matches) = Routing::match($uri, $this->request->URI);\r\n\t\tif ($success)\r\n\t\t{\r\n\t\t\tcall_user_func_array($callback, array_merge($this->runArgs, $matches));\r\n\t\t\t$this->called = true;\r\n\t\t}\r\n\t}", "abstract protected function register_hook_callbacks();", "function api_wines_routes_api(){\n register_rest_route( 'bestwines/v1', '/wines', array(\n 'methods' => 'GET',\n 'callback' => 'api_get_wines',\n ));\n}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function registerCallbacks()\n {\n parent::registerCallbacks();\n }", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "public function onBeforeRouting() {\n\t\t// TODO: need some way of allowing plugins to specify whether they want\n\t\t// to be notified of this request or not\n\t\t// This is true for all plugin events\n\t\tforeach ( $this->getInstantiablePlugins() as $pluginContainer ) {\n\t\t\t$pluginContainer->trigger(\"onBeforeRouting\");\n\t\t}\n\t}", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "function novedadesAPI() {\n register_rest_route( 'ajar/v1', '/novedades/(?P<cantidad>\\d+)', array(\n 'method' => 'GET',\n 'callback' => 'pedidoNovedades',\n ));\n\n}", "public function register_routes()\n {\n // 粉丝\n register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<uid>[\\d]+)/followers', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_follower_items'),\n 'permission_callback' => array($this, 'get_follower_items_permissions_check'),\n 'args' => array(\n 'context' => $this->get_context_param(array('default' => 'view')),\n ),\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_follower_item'),\n 'permission_callback' => array($this, 'create_follower_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(WP_REST_Server::CREATABLE),\n ),\n 'schema' => array($this, 'get_public_item_schema'),\n ));\n\n register_rest_route($this->namespace, '/' . $this->rest_base . '/me/followers', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_follower_items'),\n 'permission_callback' => array($this, 'get_follower_items_permissions_check'),\n 'args' => array(\n 'context' => $this->get_context_param(array('default' => 'view')),\n ),\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_follower_item'),\n 'permission_callback' => array($this, 'create_follower_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(WP_REST_Server::CREATABLE),\n ),\n 'schema' => array($this, 'get_public_item_schema'),\n ));\n\n// register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<uid>[\\d]+)/followers/(?P<fid>[\\d]+)', array(\n// array(\n// 'methods' => WP_REST_Server::READABLE,\n// 'callback' => array( $this, 'get_follower_item' ),\n// 'permission_callback' => array( $this, 'get_follower_item_permissions_check' ),\n// 'args' => array(\n// 'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n// ),\n// ),\n// array(\n// 'methods' => WP_REST_Server::EDITABLE,\n// 'callback' => array( $this, 'update_follower_item' ),\n// 'permission_callback' => array( $this, 'update_follower_item_permissions_check' ),\n// 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n// ),\n// array(\n// 'methods' => WP_REST_Server::DELETABLE,\n// 'callback' => array( $this, 'delete_follower_item' ),\n// 'permission_callback' => array( $this, 'delete_follower_item_permissions_check' ),\n// 'args' => array(\n// 'force' => array(\n// 'default' => false,\n// 'description' => __( 'Required to be true, as resource does not support trashing.' ),\n// ),\n// 'reassign' => array(),\n// ),\n// ),\n// 'schema' => array( $this, 'get_public_item_schema' ),\n// ) );\n\n // 关注\n register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<uid>[\\d]+)/following', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_following_items'),\n 'permission_callback' => array($this, 'get_following_items_permissions_check'),\n 'args' => array(\n 'context' => $this->get_context_param(array('default' => 'view')),\n ),\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_following_item'),\n 'permission_callback' => array($this, 'create_following_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(WP_REST_Server::CREATABLE),\n ),\n 'schema' => array($this, 'get_public_item_schema'),\n ));\n\n register_rest_route($this->namespace, '/' . $this->rest_base . '/me/following', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_following_items'),\n 'permission_callback' => array($this, 'get_following_items_permissions_check'),\n 'args' => array(\n 'context' => $this->get_context_param(array('default' => 'view')),\n ),\n ),\n// array(\n// 'methods' => WP_REST_Server::CREATABLE,\n// 'callback' => array($this, 'create_following_item'),\n// 'permission_callback' => array($this, 'create_following_item_permissions_check'),\n// 'args' => $this->get_endpoint_args_for_item_schema(WP_REST_Server::CREATABLE),\n// ),\n 'schema' => array($this, 'get_public_item_schema'),\n ));\n\n// register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<uid>[\\d]+)/following/(?P<fid>[\\d]+)', array(\n// array(\n// 'methods' => WP_REST_Server::READABLE,\n// 'callback' => array( $this, 'get_following_item' ),\n// 'permission_callback' => array( $this, 'get_following_item_permissions_check' ),\n// 'args' => array(\n// 'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n// ),\n// ),\n// array(\n// 'methods' => WP_REST_Server::EDITABLE,\n// 'callback' => array( $this, 'update_following_item' ),\n// 'permission_callback' => array( $this, 'update_following_item_permissions_check' ),\n// 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n// ),\n// array(\n// 'methods' => WP_REST_Server::DELETABLE,\n// 'callback' => array( $this, 'delete_follower_item' ),\n// 'permission_callback' => array( $this, 'delete_follower_item_permissions_check' ),\n// 'args' => array(\n// 'force' => array(\n// 'default' => false,\n// 'description' => __( 'Required to be true, as resource does not support trashing.' ),\n// ),\n// 'reassign' => array(),\n// ),\n// ),\n// 'schema' => array( $this, 'get_public_item_schema' ),\n// ) );\n }", "function routes_install()\r\n{\r\n\tregister_hook('init_1', 'addon/routes/routes.php', 'routes_init_1');\r\n\tregister_hook('post_local', 'addon/routes/routes.php', 'routes_post_local_end_hook');\r\n\tregister_hook('profile_tabs', 'addon/routes/routes.php', 'routes_profile_tabs_hook');\r\n}", "public function register_rest_routes() {\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'get_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast_update',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'update_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for episodes\n\t\t */\n\t\t$controller = new Episodes_Controller();\n\t\t$controller->register_routes();\n\n\t}", "protected function registerRouteBindings()\n {\n //\n }", "public function onDeploy($callback)\n {\n $this->deployCallback = $callback;\n }", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/feedback', [\n [\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => [$this, 'handle_feedback'],\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => [\n 'name' => [\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'email' => [\n 'description' => __('Email address of the author.'),\n 'type' => 'string',\n 'format' => 'email',\n ],\n 'subject' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'message' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_textarea_field',\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/helpfullness', [\n [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => [$this, 'update_helpfullness'],\n 'args' => [\n 'type' => [\n 'required' => true,\n 'type' => 'string',\n 'enum' => ['positive', 'negative'],\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/parents', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_parents'],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/search', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'search_docs'],\n 'args' => [\n 'query' => [\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Limit results to those matching a string.', 'muiteer'),\n 'sanitize_callback' => 'sanitize_text_field',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'in' => [\n 'required' => false,\n 'type' => 'integer',\n 'description' => __('The ID for the parent of the object.', 'muiteer'),\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'page' => array(\n 'description' => __('Current page of the collection.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 1,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n 'minimum' => 1,\n ),\n 'per_page' => array(\n 'description' => __('Maximum number of items to be returned in result set.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 10,\n 'minimum' => 1,\n 'maximum' => 100,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ),\n ],\n ]\n ] );\n }", "function callBack (&$controller, &$request, &$context) {\n\t}", "public function init() {\n add_action( 'rest_api_init', array($this, 'register_route'));\n add_action( 'wp_enqueue_scripts', array($this, 'enqueue_script'));\n\t}", "final public function register() : void {\n\t\tregister_rest_field(\n\t\t\t$this->obj_type,\n\t\t\t$this->field_name,\n\t\t\t[\n\t\t\t\t'get_callback' => [ $this, 'get_callback' ],\n\t\t\t\t'update_callback' => method_exists( $this, 'update_callback' )\n\t\t\t\t\t? [ $this, 'update_callback' ]\n\t\t\t\t\t: null,\n\t\t\t\t'schema' => $this->schema,\n\t\t\t]\n\t\t);\n\t}", "function cfwprapi_register_custom_route() {\n\n register_rest_field( 'todo',\n 'is_done',\n array(\n 'get_callback' => 'cfwprapi_get_is_done',\n 'update_callback' => 'cfwprapi_update_is_done',\n 'schema' => null,\n )\n );\n\n register_rest_route( 'wp/v2', '/' . 'posts/todos/', array(\n array(\n 'methods' => WP_REST_Server::READABLE, // GET method\n 'callback' => 'cfwprapi_get_todos',\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE, // POST Method\n 'callback' => 'cfwprapi_add_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n ),\n ) );\n\n register_rest_route( 'wp/v2', '/posts/todos/delete/(?P<id>\\d+)', array(\n 'methods' => 'DELETE', // DELETE Method\n 'callback' => 'cfwprapi_delete_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n )\n );\n\n register_rest_route( 'wp/v2', '/posts/todos/update', array(\n 'methods' => 'PUT', // PUT Method\n 'callback' => 'cfwprapi_update_todos',\n 'permission_callback' => 'cfwprapi_can_user_have_access',\n )\n );\n}", "public function register_api_routes( Config $config ) {\n\t\t\\AM\\Endpoint\\Example_Endpoint::init( $config );\n\t}", "public function getCallbackAction() {}", "public function routeController()\n { }", "public function getCallbackAction() {}", "function portfolio_route() {\n register_rest_route( 'categories', '/portfolio-categories/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => 'get_portfolio_categories',\n ) );\n}", "public function callback();", "public function routeStartup(Zend_Controller_Request_Abstract $request)\n {\n\n }", "public function & dm2_create_callback(&$controller);", "private function bootBackendControllerExtend() {\n Backend\\Classes\\Controller::extend(function($controller) {\n\n $myWidget = new \\Olabs\\Messaging\\Widgets\\Notify($controller);\n $myWidget->alias = 'Notify';\n $myWidget->bindToController();\n });\n }", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public function callback(){\n\t\techo \"<strong>Note: </strong>Application should set callback URL to application-side for further specific authentication process.\\n<br>\";\n\t\t\n\t/**\n\t* Fetch auth\n\t*/\n\t\t$response = null;\n\t\tswitch($this->env['Callback.transport']){\n\t\t\tcase 'session':\n\t\t\t\tsession_start();\n\t\t\t\t$response = $_SESSION['opauth'];\n\t\t\t\tunset($_SESSION['opauth']);\n\t\t\t\tbreak;\n\t\t\tcase 'post':\n\t\t\t\t$response = $_POST;\n\t\t\t\tbreak;\n\t\t\tcase 'get':\n\t\t\t\t$response = $_GET;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '<strong style=\"color: red;\">Error: </strong>Unsupported Callback.transport.'.\"<br>\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\t\n\t/**\n\t * Validation\n\t */\n\t\tif (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>Missing key auth response components.'.\"<br>\\n\";\n\t\t}\n\t\telseif (!$this->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>'.$reason.\".<br>\\n\";\n\t\t}\n\t\telse{\n\t\t\techo '<strong style=\"color: green;\">OK: </strong>Auth response is validated.'.\"<br>\\n\";\n\t\t}\n\t\t\n\t\t\n\t/**\n\t * Auth response dump\n\t */\n\t\techo \"<pre>\";\n\t\tprint_r($response);\n\t\techo \"</pre>\";\n\t}", "public function onRegister();", "function create_initial_rest_routes()\n {\n }", "public function register_routes() {\n\n register_rest_route( $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this->service, 'create' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( true ),\n 'accept_json' => true\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this->service, 'get' ),\n 'permission_callback' => array( $this, 'getAllUserCheck' ),\n 'args' => array(\n 'context' => array(\n 'default' => 'view',\n )\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this->service, 'update' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( false ),\n 'accept_json' => true\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this->service, 'delete' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => array(\n 'force' => array(\n 'default' => false,\n ),\n ),\n ),\n ) );\n }", "public function onRestAPIInit()\r\n\t{\r\n\t\t// NB: Permalink Manager Lite compatibility. This fix prevents the plugin from causing POST REST requests being redirected to GET\r\n\t\t// NB: We also check the plugin is active to mitigate any potential effects to other plugins. This could be removed, as an optimization\r\n\t\tglobal $wp_query;\r\n\t\t\r\n\t\t$active_plugins = get_option('active_plugins');\r\n\t\tif(!empty($wp_query->query_vars) && array_search('permalink-manager/permalink-manager.php', $active_plugins))\r\n\t\t\t$wp_query->query_vars['do_not_redirect'] = 1;\r\n\t\t\r\n\t\t$this->registerRoutes();\r\n\t}", "public function __construct() {\n\t\tadd_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );\n\t}" ]
[ "0.6129959", "0.5893761", "0.58282036", "0.5807447", "0.5729694", "0.56982565", "0.56971645", "0.5532261", "0.54176235", "0.54142934", "0.53925526", "0.53610027", "0.53401273", "0.53328806", "0.52882886", "0.5277659", "0.52699244", "0.52445775", "0.5221567", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5196743", "0.5195647", "0.5185926", "0.51628673", "0.51030487", "0.509529", "0.5092788", "0.5088522", "0.50585055", "0.5052028", "0.5049886", "0.5043054", "0.50167125", "0.5006336", "0.49928597", "0.49921197", "0.49864826", "0.49786064", "0.49703392", "0.49680567", "0.4963074", "0.49447843", "0.49435872", "0.49323404", "0.4919903", "0.48985434", "0.4888086", "0.48765093", "0.48729047", "0.48726028", "0.48630264", "0.485484", "0.48520622", "0.484416", "0.48365566", "0.4827858", "0.4821227", "0.48211995", "0.48206002", "0.48090464", "0.4804895", "0.48035145", "0.4778898", "0.4778144", "0.47764507", "0.47663626", "0.47480497", "0.4746027", "0.47415695", "0.47353917", "0.4732427" ]
0.0
-1
Initialize custom post type
public static function init() { add_action( 'init', array( __CLASS__, 'definition' ), 11 ); add_action( 'cmb2_init', array( __CLASS__, 'fields' ) ); add_filter( 'inventor_shop_allowed_listing_post_types', array( __CLASS__, 'allowed_purchasing' ) ); add_filter( 'inventor_claims_allowed_listing_post_types', array( __CLASS__, 'allowed_claiming' ) ); add_filter( 'inventor_compare_metaboxes', function( $metaboxes ) { return array_merge( $metaboxes, array( 'attributes' ) ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "function __construct(){\n\t\t\tadd_action( 'init' , array( $this, 'custom_post_type' ) );\n\t\t}", "public function init()\n \t{\n \t\t// Initialize Post Type\n \t\t$this->create_post_type();\n \t\tadd_action('save_post', array($this, 'save_post'));\n \t}", "public function init()\n \t{\n \t\t// Initialize Post Type\n \t\t$this->create_post_type();\n \t\tadd_action('save_post', array(&$this, 'save_post'));\n \t}", "public function __construct() {\n\t\t\tadd_action( 'init', array( &$this, 'register_post_type' ) );\n\t\t}", "public static function init() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_post_type' ), 1 );\n\t}", "public function __construct()\n\t{\n\t\t$this->type('post');\n\t}", "public function slate_post_type_init() {\n\n new Slate_Post_Type('Characters', array(\n 'has_archive' => true,\n 'rewrite' => array(\n 'with_front' => false,\n 'slug' => 'characters'\n )\n ));\n\n new Slate_Post_Type('Items', array(\n 'has_archive' => true,\n 'rewrite' => array(\n 'with_front' => false,\n 'slug' => 'items'\n )\n ));\n\n new Slate_Post_Type('Games', array(\n 'has_archive' => true,\n 'rewrite' => array(\n 'with_front' => false,\n 'slug' => 'game-library'\n )\n ));\n\n }", "public static function init () : void\n {\n add_action(\"init\", function () {\n self::register_post_type();\n });\n }", "public function init_post_type() {\n\t\t\t\n\t\t\t$labels = array(\n\t\t\t\t'name'\t\t\t\t=> 'Meetups',\n\t\t\t\t'new_item'\t\t\t=> 'Neues Meetup',\n\t\t\t\t'singular_name'\t\t=> 'Meetup',\n\t\t\t\t'view_item'\t\t\t=> 'Zeige Meetups',\n\t\t\t\t'edit_item'\t\t\t=> 'Editiere Meetup',\n\t\t\t\t'add_new_item'\t\t=> 'Meetup hinzuf&uuml;gen',\n\t\t\t\t'not_found'\t\t\t=> 'Kein Meetup gefunden',\n\t\t\t\t'search_items'\t\t=> 'Durchsuche Meetups',\n\t\t\t\t'parent_item_colon' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$supports = array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'comments',\n\t\t\t);\n\t\t\t\n\t\t\t$args = array(\n\t\t\t\t'public'\t\t\t\t=> TRUE,\n\t\t\t\t'publicly_queryable'\t=> TRUE,\n\t\t\t\t'show_ui'\t\t\t\t=> TRUE, \n\t\t\t\t'query_var'\t\t\t\t=> TRUE,\n\t\t\t\t'capability_type'\t\t=> 'post',\n\t\t\t\t'hierarchical'\t\t\t=> FALSE,\n\t\t\t\t'menu_position'\t\t\t=> NULL,\n\t\t\t\t'supports'\t\t\t\t=> $supports,\n\t\t\t\t'has_archive'\t\t\t=> TRUE,\n\t\t\t\t'rewrite'\t\t\t\t=> TRUE,\n\t\t\t\t'labels'\t\t\t\t=> $labels\n\t\t\t);\n\t\t\t\n\t\t\tregister_post_type( 'wpmeetups', $args );\n\t\t}", "public function __construct()\n {\n add_action('init', [__CLASS__, 'register_post_types']);\n }", "function __construct() {\n\n\t\t$this->ID = 'example';\n\n\t\t$this->singlename = 'Post Type';\n\t\t$this->pluralname = 'Post Types';\n\n\t\t$this->args = array(\n\t\t\t'taxonomies' => array('category')\n\t\t);\n\n\t\tparent::__construct();\n\n\t}", "public static function init() {\r\n\t\tadd_action( 'init', array( __CLASS__, 'add_custom_post' ), 0 );\r\n\t}", "public function __construct() {\n\t\t$this->post_type = static::$linked_post_type;\n\t}", "public static function cpt_init() {\n\t\tforeach ( self::$types as $type ) {\n\t\t\tself::evo_custom_post_type( $type['type'] );\n\t\t}\n\t}", "function init_post_type() {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Unit', 'Post Type General Name', 'wppm' ),\n\t\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'wppm' ),\n\t\t\t'menu_name' => __( 'Units', 'wppm' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'wppm' ),\n\t\t\t'all_items' => __( 'All Units', 'wppm' ),\n\t\t\t'view_item' => __( 'View Unit', 'wppm' ),\n\t\t\t'add_new_item' => __( 'Add New Unit', 'wppm' ),\n\t\t\t'add_new' => __( 'Add New', 'wppm' ),\n\t\t\t'edit_item' => __( 'Edit Unit', 'wppm' ),\n\t\t\t'update_item' => __( 'Update Unit', 'wppm' ),\n\t\t\t'search_items' => __( 'Search Units', 'wppm' ),\n\t\t\t'not_found' => __( 'Not found', 'wppm' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'wppm' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( 'units', 'wppm' ),\n\t\t\t'description' => __( 'Units', 'wppm' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'thumbnail', ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t//'menu_icon' => '',\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'capability_type' => 'post',\n\t\t);\n\t\tregister_post_type( 'units', $args );\n\t\tflush_rewrite_rules();\n\t\t\n\t\tadd_image_size( 'tiles-featured', 225, 225, true );\n\t\tadd_image_size( 'mini-tiles', 80, 55, true );\n\t}", "function yee_post_type_testimonial_init(){\n\t$labels =array(\n\t\t'name'=>'Testimonials',\n\t\t'sigular_name'=>'Testimonial',\n\t\t'add_new'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'add_new_item'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'edit_item'=>__('Edit Testimonial','Storefront-Child'),\n\t\t'new_item'=>__('New Testimonial','Storefront-Child'),\n\t\t'view_item'=>__('View Testimonial','Storefront-Child'),\n\t\t'view_items'=>__('View Testimonials','Storefront-Child'),\n\t\t'all_items'=>__('All Testimonials','Storefront-Child'),\n\t\t'search_items'=>__('Search Testimonials','Storefront-Child')\n\t);\n\t$args =array(\n\t\t'labels'=>$labels,\n\t\t'public'=>true,\n\t\t'menu_position'=>5,\n\t\t'menu_icon'=>'dashicons-visibility',\n\t\t'hierarchical'=>false,\n\t\t'has_archive'=>true,\n\t\t'supports'=>array('title','editor','thumbnail','excerpt'),\n\t\t'rewrite'=>array('slug'=>'testimonial')\n\t\t\n\t);\n\tregister_post_type('yee_testimonial',$args);\n}", "public function create_post_types() {\n }", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "public function __construct() {\n\n // Register the post type\n add_action('init', [ $this, 'reg_post_type' ] );\n add_action('init', [ $this, 'add_taxonomy' ] );\n add_action('init', [ $this, 'add_tags' ] );\n\n add_action( 'add_meta_boxes', [ $this, 'add_metabox' ], 1 );\n add_action( 'save_post', [ $this, 'save_metabox' ], 10, 2 );\n\n }", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "public function __construct($postType,$name){\n\t\ttry{\n\t\t\t$this->postType = $postType;\n\t\t\t$this->setName( $name );\n\t\t\t$this->setNameMenuSingular();\n\t\t\t$this->setNameMenu();\n\t\t\t$this->setNameAll();\n\t\t\t$this->setNameAdd();\n\t\t\t$this->setNameEdit();\n\t\t\t$this->setNameNewItem();\n\t\t\t$this->setNameView();\n\t\t\t$this->setNameSearch();\n\t\t\t$this->setMsgNotFound();\n\t\t\t$this->setPublic();\n\t\t\t$this->setPubliclyQueryable();\n\t\t\t$this->setShowUi();\n\t\t\t$this->setShowInMenu();\n\t\t\t$this->setShowInAdminBar();\n\t\t\t$this->setMenuPosition();\n\t\t\t$this->setMenuIcon();\n\t\t\t$this->setCapabilityType();\n\t\t\t$this->setCapabilities();\n\t\t\t$this->setMapMetaCap();\n\t\t\t$this->setHierarchical();\n\t\t\t$this->setSupports();\n\t\t\t$this->setRegisterMetaBoxCb();\n\t\t\t$this->setTaxonomies();\n\t\t\t$this->setHasArchive();\n\t\t\t$this->setPermalinkEpmask();\n\t\t\t$this->setRewrite();\n\t\t\t$this->setQueryVar();\n\t\t\t$this->setCanExport();\n\t\t\t$this->setBuiltin();\n\t\t\tadd_action('init', array(&$this,'registerPostType'));\n\t\t}catch(Excerption $e){\n\t\t\techo 'Favor verificar o slug do post ( Precisa conter no maximo 20 caracter )';\n\t\t}\n\t}", "function init()\n {\n add_filter(\"rest_prepare_post\", array($this, 'rest_prepare'));\n\n\n /**\n * loops through the custom post types in the $custom_post_types\n * array and registers then with WP\n */\n foreach ($this->custom_post_types as $post_type) {\n\n $slug = sanitize_title_with_dashes($post_type);\n\n register_post_type($slug,\n array(\n 'labels' => array(\n 'name' => __($post_type . 's'),\n 'singular_name' => __($post_type)\n ),\n 'public' => true,\n 'has_archive' => true,\n 'show_in_rest' => true, //Adds the custom post type to the rest api\n )\n );\n\n /**\n * adds the custom post metadata to the custom post types\n */\n add_filter(\"rest_prepare_{$slug}\", array($this, 'rest_prepare'));\n\n }\n\n register_taxonomy(\n 'link-types',\n 'link',\n array(\n 'label' => __( 'Link Types' ),\n 'rewrite' => array( 'slug' => 'link-types' ),\n 'show_in_rest' => true,\n\t\t'rest_base' => 'link-types',\n\t\t'rest_controller_class' => 'WP_REST_Terms_Controller',\n )\n );\n\n }", "public function initPostType(){\n\t\tforeach( $this->posttype as $pt ){\n\t\t\t$pt = WPO_FRAMEWORK_POSTTYPE.$pt.'.php';\n\t\t\tif( is_file($pt) ){\n\t\t\t\trequire_once($pt);\n\t\t\t}\n\t\t}\n\t}", "public function create_post_type() {\n\t\t\n \t\tregister_post_type(self::POST_TYPE,\n \t\t\tarray(\n \t\t\t\t'labels' => array(\n \t\t\t\t\t'name' => \"Custom\",\n \t\t\t\t\t'singular_name' => __(ucwords(str_replace(\"_\", \" \", self::POST_TYPE)))\n \t\t\t\t),\n \t\t\t\t'public' => true,\n \t\t\t\t'has_archive' => true,\n \t\t\t\t'description' => __(\"This is WP Custom Post Type\"),\n \t\t\t\t'supports' => array('title', 'editor', 'excerpt','thumbnail','custom-fields'),\n \t\t\t)\n \t\t);\n\n\t\t\tregister_taxonomy(\n\t\t\t\t'custom-category',\n\t\t\t\tself::POST_TYPE,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Category' ),\n\t\t\t\t\t'rewrite' => array( 'slug' => 'custom-category' ),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "private function instantiate_post_types() {\n // Iterate across the post types in post_type_defs\n foreach ( $this->post_type_defs as $post_type => $post_type_def ) {\n $this->post_type_objs[ $post_type ] = new HRHS_Post_type( $post_type_def );\n }\n }", "public function createPostTypes()\n {\n }", "public function __construct() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\n\t\tadd_shortcode( 'demo-test', array( $this, 'demo_shortcode' ) );\n\n\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\n\t\tadd_action( 'init', array( $this, 'generate_custom_post_type' ) );\n\n\t\t//add_action( 'init', array( $this, 'rewrite_rules' ) );\n\n\t\tadd_action( 'template_include', array( $this, 'custom_post_type_archive' ) );\n\n\t\tadd_action( 'template_include', array( $this, 'custom_post_type_archive_template' ) );\n\n\t\tadd_filter( 'single_template', array( $this, 'get_custom_post_type_template' ) );\n\n\t\tadd_action( 'admin_menu', array( $this, 'custom_menu_page' ) );\n\n\t\tadd_action( 'admin_init', array( $this, 'add_options' ) );\n\n\t\tadd_action( 'init', array( $this, 'generate_post_type' ) );\n\n\t\tadd_filter( 'post_type_link', array( $this, 'update_permalinks' ), 10, 2 );\n\t\tadd_filter( 'post_type_link', array( $this, 'update_post_permalinks' ), 10, 2 );\n\n\t\tadd_filter('term_link', array( $this, 'update_term_link' ) );\n\n\t add_action( 'wp_footer', function() {\n\t\t\tglobal $wp_query;\n\t\t\t//print_r( $wp_query );\n\t\t\tprint_r($this->post_types);\n\t\t});\n\t}", "public function add_custom_post_types() {\n //\n }", "public function __construct() {\n\t\t\t// Load Custom Post Type\n\t\t\tadd_filter( 'init', array( $this, 'init_post_type' ) );\n\t\t\t\n\t\t\tif ( 'wpmeetups' == $_GET[ 'post_type' ] || 'wpmeetups' == get_post_type( $_GET[ 'post' ] ) ) {\n\t\t\t\t// Scripts\n\t\t\t\tadd_filter( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );\n\t\t\t\t// Add Metaboxes on our pages\n\t\t\t\tadd_filter( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\t}\n\t\t\t\n\t\t\t// Save Post-Meta\n\t\t\tadd_filter( 'save_post', array( $this, 'save_post' ) );\n\t\t\t\n\t\t\t// The Gallery\n\t\t\tadd_filter( 'init', array( $this, 'theme_support' ) );\n\t\t\tadd_filter( 'wp_ajax_photo_gallery_upload', array( $this, 'handle_file_upload' ) );\n\t\t\tadd_filter( 'wp_ajax_save_items_order', array( $this, 'save_items_order' ) );\n\t\t\tadd_filter( 'wp_ajax_delete_gallery_item', array( $this, 'delete_gallery_item' ) );\n\t\t\tadd_filter( 'wp_ajax_update_attachment', array( $this, 'update_attachment' ) );\n\t\t\tadd_filter( 'wp_ajax_refresh_gallery', array( $this, 'draw_gallery_items' ) );\n\t\t}", "public function registerCustomPostTypes() {\n\n\n }", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "function wp_create_initial_post_meta()\n {\n }", "public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }", "public function __construct(){\n //Create our custom taxonomy\n $this->initCustomTaxonomy();\n \n //Create our custom post type\n $this->initCustomPostType();\n \n //Manage our columns for our admin page\n $this->initColumns();\n }", "public static function post_type(){}", "function ccac_2020_new_init() {\n register_taxonomy_for_object_type( 'category', 'attachment' );\n register_taxonomy_for_object_type( 'post_tag', 'attachment' );\n\n /*\n * Register custom post types. You can also move this code to a plugin.\n */\n /* Pinegrow generated Custom Post Types Begin */\n\n /* Pinegrow generated Custom Post Types End */\n \n /*\n * Register custom taxonomies. You can also move this code to a plugin.\n */\n /* Pinegrow generated Taxonomies Begin */\n\n /* Pinegrow generated Taxonomies End */\n\n}", "function my_custom_init() {\n\t$labels = array(\n\t'name' => _x( 'Marcas', 'post type general name' ),\n 'singular_name' => _x( 'Marca', 'post type singular name' ),\n 'add_new' => _x( 'Añadir nuevo', 'marca' ),\n 'add_new_item' => __( 'Añadir nueva Marca' ),\n 'edit_item' => __( 'Editar Marca' ),\n 'new_item' => __( 'Nueva Marca' ),\n 'view_item' => __( 'Ver Marca' ),\n 'search_items' => __( 'Buscar Marca' ),\n 'not_found' => __( 'No se han encontrado Marcas' ),\n 'not_found_in_trash' => __( 'No se han encontrado Marcas en la papelera' ),\n 'parent_item_colon' => ''\n );\n\n // Creamos un array para $args\n $args = array( 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n );\n\n register_post_type( 'Marca', $args );\n}", "function bs_configure_custom_post_types($args)\n{\n function bs_custom_post_types()\n {\n global $bs_config;\n\n foreach ($bs_config[\"custom-post-types\"] as $key => $type) {\n $type = bs_defaults($type, [\n \"public\" => true,\n ]);\n\n if (isset($type[\"name\"])) {\n $type[\"labels\"][\"name\"] = $type[\"name\"];\n }\n\n if (isset($type[\"slug\"])) {\n $type[\"rewrite\"][\"slug\"] = $type[\"slug\"];\n }\n\n if (isset($type[\"admin_only\"]) && $type[\"admin_only\"]) {\n $type[\"public\"] = false;\n $type[\"show_ui\"] = true;\n }\n\n register_post_type($key, bs_array_omit($type, [\"slug\", \"name\", \"admin_only\"]));\n }\n }\n add_action(\"init\", \"bs_custom_post_types\");\n}", "public function action_init() {\n\t\t\t$portfolio_args = array(\n\t \t'label' => __('Portfolio'),\n\t \t'singular_label' => __('Portfolio'),\n\t \t'public' => true,\n\t \t'show_ui' => true,\n\t \t'capability_type' => 'post',\n\t \t'hierarchical' => false,\n\t \t'rewrite' => true,\n\t \t'supports' => array('title', 'editor', 'thumbnail')\n\t );\n\t \n\t \tregister_post_type('portfolio',$portfolio_args);\n\t\t}", "public function __construct(&$data, $post_type)\n\t{\n\t\t$this->post_type = $post_type;\n\t\t$this->parseIterable($data);\n\t}", "function __construct() {\n\t\tadd_action( 'init', array( $this, 'init_post_type' ) );\n\n\t\t// Setup the custom columns for the CPT\n\t\tadd_filter( 'manage_edit-units_columns', array( $this, 'edit_units_columns' ) );\n\t\tadd_action( 'manage_units_posts_custom_column', array( $this, 'manage_units_columns' ) );\n\t\tadd_filter( 'manage_edit-units_sortable_columns', array( $this, 'units_sortable_columns' ) );\n\t\tadd_filter( 'request', array( $this, 'sort_units' ) );\n\n\t\t// Setup metaboxes\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\tadd_action( 'save_post', array( $this, 'save_unit_meta_boxes' ) );\n\n\t\t// Add custom messages\n\t\tadd_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );\n\n\t\t// Load default templates\n\t\tadd_filter( 'template_include', array( $this, 'load_templates' ) );\n\n\t\t// Load frontend styles/scripts\n\t\tadd_action( 'init', array( $this, 'load_scripts') );\n\t\tadd_action( 'init', array( $this, 'load_styles' ) );\n\n\t\t// Load backend styles/scripts\n\t\tadd_action('admin_print_scripts', array( $this, 'load_admin_scripts' ) );\n\t\tadd_action('admin_print_styles', array( $this, 'load_admin_styles' ) );\n\t}", "public static function register_post_types() {}", "public function __construct( $post_type ) {\n\n\t\t$this->post_type = $post_type;\n\t\t$this->cpts = array();\n\t\t$this->cats = array();\n\t\t$cpt_name = ( isset( $this->cpts[ $this->post_type ] ) ? $this->cpts[ $this->post_type ] : null );\n\n\t\tif ( ! post_type_exists( $cpt_name ) ) {\n\n\t\t\t//Register CPTs\n\t\t\tadd_action( 'init', array( $this, 'cws_register_cpt' ) );\n\n\t\t\t//Register CPT categories\n\t\t\tadd_action( 'init', array( $this, 'cws_register_cats' ) );\n\n\t\t}\n\n\t}", "function init(){\n //Register post types. \n register_post_type( 'games',\n array(\n 'labels' => array(\n 'name' => __('Games'),\n 'singular_name' => __('Game')\n ),\n 'public' => true,\n 'has archive' => true,\n 'menu_icon' => 'dashicons-desktop',\n 'menu_position' => 3\n )\n );\n }", "public function __construct( $args ) {\n $this->post_type = $args['post_type']; //Set the Post Type (Singular)\n $this->post_type_plural = $args['post_type_plural']; //Set the Post Type (Plural)\n $this->post_type_slug = $args['post_type_slug'];\n $this->heirarchical = !empty($args['heirarchical']) ? true : false;\n $this->custom_capabilities = $args['custom_capabilities'];\n $this->public = isset($args['public']) ? $args['public'] : true; \n \n $this->fields = $args['fields']; //Set any Meta Fields for the Post Type\n $this->fields_private = $args['fields_private']; //Set any Meta Fields for the Post Type that will be Private\n $this->fields_list = $args['fields_list'];//Set any meta fields you want to show in the list. If it's the same as your fields, then just set the variable to fields/\n $this->fields_values = $args['fields_values']; //Used to store key value pair options for select menus and any other multi option menus\n $this->fields_location = !empty($args['fields_location']) ? $args['fields_location'] : 'side'; \n $this->fields_priority = !empty($args['fields_priority']) ? $args['fields_priority'] : 'high'; \n \n $this->taxonomies = $args['taxonomies'];\n\n $this->invalid_tax_types = array('category', 'tag'); // Default for Wordpress. We do not allow these. Other plugins may conflict.\n \n $this->text_domain = 'simpul';\n \n add_action( 'init', array($this, 'run') );\n \n self::loadMetaScripts();\n self::addColumns();\n self::setMetaFields();\n self::addMetaBoxes();\n }", "function init() {\n\n\t\t// Create Post Type\n\t\tadd_action( 'init', array( $this, 'post_type' ) );\n\n\t\t// Post Type columns\n\t\tadd_filter( 'manage_edit-event_columns', array( $this, 'edit_event_columns' ), 20 );\n\t\tadd_action( 'manage_event_posts_custom_column', array( $this, 'manage_event_columns' ), 20, 2 );\n\n\t\t// Post Type sorting\n\t\tadd_filter( 'manage_edit-event_sortable_columns', array( $this, 'event_sortable_columns' ), 20 );\n\t\t//add_action( 'load-edit.php', array( $this, 'edit_event_load' ), 20 );\n\n\t\t// Post Type title placeholder\n\t\tadd_filter( 'enter_title_here', array( $this, 'title_placeholder' ) );\n\n\t\t// Create Metabox\n\t\t$metabox = apply_filters( 'be_events_manager_metabox_override', false );\n\t\tif ( false === $metabox ) {\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'metabox_styles' ) );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'metabox_scripts' ) );\n\t\t\tadd_action( 'add_meta_boxes', array( $this, 'metabox_register' ) );\n\t\t\tadd_action( 'save_post', array( $this, 'metabox_save' ), 1, 2 );\n\t\t}\n\n\t\t// Generate Events\n\t\tadd_action( 'wp_insert_post', array( $this, 'generate_events' ) );\n\t\tadd_action( 'wp_insert_post', array( $this, 'regenerate_events' ) );\n\t}", "function create_posttype() {\n $labels = array(\n 'name' => _x( 'NPosts', 'Post Type General Name'),\n 'singular_name' => _x( 'NPost', 'Post Type Singular Name'),\n 'menu_name' => __( 'NPosts'),\n 'parent_item_colon' => __( 'Parent NPost'),\n 'all_items' => __( 'All NPosts'),\n 'view_item' => __( 'View NPost'),\n 'add_new_item' => __( 'Add New NPost'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit NPost'),\n 'update_item' => __( 'Update NPost'),\n 'search_items' => __( 'Search NPost'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n \n// Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'nposts'),\n 'description' => __( 'NPost news and reviews'),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n // 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n \n // Registering your Custom Post Type\n register_post_type( 'npost', $args );\n \n}", "public function init()\n {\n $labels = array(\n 'name' => __('Stacks', 'lambda-admin-td'),\n 'singular_name' => __('Stack', 'lambda-admin-td'),\n 'add_new' => __('Add New', 'lambda-admin-td'),\n 'add_new_item' => __('Add New Stack', 'lambda-admin-td'),\n 'edit_item' => __('Edit Stack', 'lambda-admin-td'),\n 'new_item' => __('New Stack', 'lambda-admin-td'),\n 'all_items' => __('All Stacks', 'lambda-admin-td'),\n 'view_item' => __('View Stack', 'lambda-admin-td'),\n 'search_items' => __('Search Stack', 'lambda-admin-td'),\n 'not_found' => __('No Stack found', 'lambda-admin-td'),\n 'not_found_in_trash' => __('No Stack found in Trash', 'lambda-admin-td'),\n 'menu_name' => __('Stacks', 'lambda-admin-td')\n );\n\n $labels = apply_filters('oxy_stack_labels', $labels);\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => false,\n 'capability_type' => 'post',\n 'menu_position' => null,\n 'menu_icon' => 'dashicons-art',\n 'supports' => array( 'title' )\n );\n register_post_type($this->post_type, $args);\n }", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "public function customPostType()\n {\n\n if (empty($this->custom_post_types)) {\n return;\n }\n\n foreach ($this->custom_post_types as $post_type) {\n register_post_type(\n $post_type['post_type'],\n [\n 'labels' => [\n 'name' => __($post_type['name'], 'vrcoder'),\n 'singular_name' => __($post_type['singular_name'], 'vrcoder'),\n 'menu_name' => __($post_type['name'], 'vrcoder'),\n 'name_admin_bar' => __($post_type['singular_name'], 'vrcoder'),\n 'archives' => __($post_type['singular_name'] . ' Archives', 'vrcoder'),\n 'attributes' => __($post_type['singular_name'] . ' Attributes', 'vrcoder'), \n 'parent_item_colon' => __('Parent ' . $post_type['singular_name'], 'vrcoder'),\n 'all_items' => __('All ' . $post_type['name'], 'vrcoder'),\n 'add_new_item' => __('Add new ' . $post_type['singular_name'], 'vrcoder'),\n 'add_new' => __('Add new', 'vrcoder'),\n 'new_item' => __('New ' . $post_type['singular_name'], 'vrcoder'),\n 'edit_item' => __('Edit ' . $post_type['singular_name'], 'vrcoder'),\n 'update_item' => __('Update' . $post_type['singular_name'], 'vrcoder'),\n 'view_item' => __('View' . $post_type['singular_name'], 'vrcoder'),\n 'view_items' => __('View' . $post_type['name'], 'vrcoder'),\n 'search_items' => __('Search' . $post_type['name'], 'vrcoder'),\n 'not_found' => __('No' . $post_type['singular_name'] . ' Found', 'vrcoder'),\n 'not_found_in_trash' => __('No' . $post_type['singular_name'] . ' Found in Trash', 'vrcoder'),\n 'featured_image' => __('Featured Image', 'vrcoder'),\n 'set_featured_image' => __('Set Featured Image', 'vrcoder'),\n 'remove_featured_image' => __('Remove Featured Image', 'vrcoder'),\n 'use_featured_image' => __('Use Featured Image', 'vrcoder'),\n 'insert_into_item' => __('Insert into' . $post_type['singular_name'], 'vrcoder'),\n 'uploaded_to_this_item' => __('Upload to this' . $post_type['singular_name'], 'vrcoder'),\n 'items_list' => __($post_type['name'] . ' List', 'vrcoder'),\n 'items_list_navigation' => __($post_type['name'] . ' List Navigation', 'vrcoder'),\n 'filter_items_list' => __('Filter' . $post_type['name'] . ' List', 'vrcoder'),\n ],\n 'label' => __($post_type['singular_name'], 'vrcoder'),\n 'description' => __($post_type['name'] . ' Custom Post Type', 'vrcoder'),\n 'supports' => $post_type['supports'],\n 'show_in_rest' => $post_type['show_in_rest'],\n 'taxonomies' => $post_type['taxonomies'],\n 'hierarchical' => $post_type['hierarchical'],\n 'public' => $post_type['public'],\n 'show_ui' => $post_type['show_ui'],\n 'show_in_menu' => $post_type['show_in_menu'],\n 'menu_position' => $post_type['menu_position'],\n 'show_in_admin_bar' => $post_type['show_in_admin_bar'],\n 'show_in_nav_menus' => $post_type['show_in_nav_menus'],\n 'can_export' => $post_type['can_export'],\n 'has_archive' => $post_type['has_archive'],\n 'exclude_from_search' => $post_type['exclude_from_search'],\n 'publicly_queryable' => $post_type['publicly_queryable'],\n 'capability_type' => $post_type['capability_type'],\n 'menu_icon' => $post_type['menu_icon']\n ]\n );\n }\n\n }", "function register_post_types(){\n }", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function register_post_types(){\n }", "public function action_init() {\n\n\t\t$this->register_gallery_post_type();\n\n\t}", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "private function __construct() {\n\n\t\t// Load plugin text domain\n\t\tadd_action( 'init', array( $this, 'load_plugin_textdomain' ) );\n\t\t\n\t\t// Event post type: Register post type\n\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\t}", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "public function register_post_types() {\n\n\t}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "public static function createPostType() {\n $plural = 'Travel Cards';\n $singular = 'Travel Card';\n $p_lower = strtolower($plural);\n $s_lower = strtolower($singular);\n\n $labels = [\n 'name' => $plural,\n 'singular_name' => $singular,\n 'add_new_item' => \"New $singular\",\n 'edit_item' => \"Edit $singular\",\n 'view_item' => \"View $singular\",\n 'view_items' => \"View $plural\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $p_lower found\",\n 'not_found_in_trash' => \"No $p_lower found in trash\",\n 'parent_item_colon' => \"Parent $singular\",\n 'all_items' => \"All $plural\",\n 'archives' => \"$singular Archives\",\n 'attributes' => \"$singular Attributes\",\n 'insert_into_item' => \"Insert into $s_lower\",\n 'uploaded_to_this_item' => \"Uploaded to this $s_lower\",\n ];\n\n $supports = ['title', 'editor', 'thumbnail', 'excerpt'];\n\n register_post_type( 'travelcard',\n array(\n 'rewrite' => ['slug' => 'travelcard'],\n 'taxonomies' => array('card_category', 'card_tag'),\n 'register_meta_box_cb' => [self::class, 'addMetaBox'],\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-id',\n 'supports' => $supports,\n 'capability_type' => array('travelcard', 'travelcards'),\n 'map_meta_cap' => false,\n 'exclude_from_search' => true,\n )\n );\n }", "function initialize() {\n\t\t$this->number = 1;\n\t\t$this->post_types = array();\n\t\t$this->widget_form_fields = array();\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\tadd_action( 'save_post', array( $this, 'save_widget_post_meta' ), 10, 3 );\n\t}", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Новости', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Новость', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Новости', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Parent Новость', 'p1atform' ),\n\t\t'all_items' => __( 'Все новости', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть новость', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить новость', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить новость', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать новость', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить новость', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск новости', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'label' => __( 'Отзывы', 'p1atform' ),\n\t\t'description' => __( 'Отзывы', 'p1atform' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields'\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-aside',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'news', $args );\n\n\t$labels = array(\n\t\t'name' => _x( 'Клиенты', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Клиент', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Клиенты', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Парент Клиент', 'p1atform' ),\n\t\t'all_items' => __( 'Все клиенты', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть клиента', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать клиента', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить клиента', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск клиента', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields',\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'clients', $args );\n\n\tregister_post_type( 'reviews', array(\n\t\t'labels' => array(\n\t\t\t'name' => 'Отзывы', // Основное название типа записи\n\t\t\t'singular_name' => 'Отзыв', // отдельное название записи типа Book\n\t\t\t'add_new' => 'Добавить Отзыв',\n\t\t\t'add_new_item' => 'Добавить Отзыв',\n\t\t\t'edit_item' => 'Редактировать Отзыв',\n\t\t\t'new_item' => 'Новая Отзыв',\n\t\t\t'view_item' => 'Посмотреть Отзыв',\n\t\t\t'search_items' => 'Найти Отзыв',\n\t\t\t'not_found' => 'Книг не найдено',\n\t\t\t'not_found_in_trash' => 'В корзине книг не найдено',\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Отзывы'\n\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-chat',\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n\t) );\n\n}", "function rng_create_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Post Types Plural', 'Post Type General Name', 'translate_name' ),\n\t\t'singular_name' => _x( 'Post Type Singular', 'Post Type Singular Name', 'translate_name' ),\n\t\t'menu_name' => __( 'Post Types', 'translate_name' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'translate_name' ),\n\t\t'archives' => __( 'Item Archives', 'translate_name' ),\n\t\t'attributes' => __( 'Item Attributes', 'translate_name' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'translate_name' ),\n\t\t'all_items' => __( 'All Items', 'translate_name' ),\n\t\t'add_new_item' => __( 'Add New Item', 'translate_name' ),\n\t\t'add_new' => __( 'Add New', 'translate_name' ),\n\t\t'new_item' => __( 'New Item', 'translate_name' ),\n\t\t'edit_item' => __( 'Edit Item', 'translate_name' ),\n\t\t'update_item' => __( 'Update Item', 'translate_name' ),\n\t\t'view_item' => __( 'View Item', 'translate_name' ),\n\t\t'view_items' => __( 'View Items', 'translate_name' ),\n\t\t'search_items' => __( 'Search Item', 'translate_name' ),\n\t\t'not_found' => __( 'Not found', 'translate_name' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'translate_name' ),\n\t\t'featured_image' => __( 'Featured Image', 'translate_name' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'translate_name' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'translate_name' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'translate_name' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'translate_name' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'translate_name' ),\n\t\t'items_list' => __( 'Items list', 'translate_name' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'translate_name' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'translate_name' ),\n\t);\n\t$args = array(\n 'public' => true,\n\t\t'label' => __( 'Post Type Singular', 'translate_name' ),\n\t\t'description' => __( 'Post Type Description', 'translate_name' ),\n 'labels' => $labels,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_menu'\t\t\t=> true,\n\t\t'show_in_admin_bar'\t\t=> true,\n\t\t'menu_position'\t\t\t=> 5,\n\t\t// 'menu_icon' \t\t\t=> get_bloginfo('template_directory') . '/images/portfolio-icon.png',\n\t\t'menu_icon'\t\t\t\t=> 'dashicon-groups',\n\t\t'has_archive'\t\t\t=> true,\n\t\t'capability_type'\t\t=> array('book','books'),\n\t\t'capabilities' \t\t\t=> array(\n\t\t\t'edit_post' => 'edit_book', \n\t\t\t'read_post' => 'read_book', \n\t\t\t'delete_post' => 'delete_book', \n\t\t\t'edit_posts' => 'edit_books', \n\t\t\t'edit_others_posts' => 'edit_others_books', \n\t\t\t'publish_posts' => 'publish_books', \n\t\t\t'read_private_posts' => 'read_private_books', \n\t\t\t'create_posts' => 'edit_books', \n\t\t),\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t);\n\tregister_post_type( 'book', $args );\n\n}", "function create_post_type() {\n\t// register custom post type\n\tregister_post_type( 'sub_post',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( ' Sub Posts ' ),\n\t\t\t\t'singular_name' => __( 'Sub Post' ),\n\t\t\t\t'add_new_item' => __( 'Add New Sub Post' ),\n\t\t\t\t'edit_item' => __( 'Edit Sub Post' ),\n\t\t\t\t'new_item' => __( 'New Sub Post' ),\n\t\t\t\t'view' => __( 'View Sub Post' ),\n\t\t\t\t'view_item' => __( 'View Sub Post' ),\n\t\t\t\t'search_items' => __( 'Search Sub Post' ),\n\t\t\t\t'not_found' => __( 'No Sub Posts found' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Sub Posts found in Trash' ),\n\t\t\t\t'parent' => __( 'Parent Article' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', 'comments' ),\n\t\t\t'taxonomies' => array('category','post_tag'),\n\t\t)\n\t);\n\n\t// register custom taxonomy\n\n}", "public function __construct() {\n\n //d(dirname(dirname( __FILE__ )));\n\n \tadd_action( 'wp_enqueue_scripts', array($this, 'load_custom_wp_frontend_style') );\n \tadd_action( 'init', [$this, 'custom_post_type'] );\n add_action( 'wp_ajax_custom_survey_tracker', array($this, 'plugin_data_custom_survey_tracker_func') );\n\t add_action( 'wp_ajax_nopriv_custom_survey_tracker', array($this, 'plugin_data_custom_survey_tracker_func') );\n\n\t\tadd_action( 'add_meta_boxes', array($this, 'add_events_metaboxes') );\n\n }", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "function register_post_types()\n {\n }", "private function create() {\n\n\t\t// Fetch which post types are being set up\n\t\t$post_types_to_set_up = static::$post_types_to_set_up;\n\n\t\t// Bail early if we don't have any\n\t\tif ( empty( $post_types_to_set_up ) || ! is_array( $post_types_to_set_up ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Loop over each one and create it\n\t\tforeach ( $post_types_to_set_up as $slug => $cpt_args ) {\n\n\t\t\t$label_args\t= ( isset( $cpt_args['label_args'] ) ) ? $cpt_args['label_args'] : array();\n\t\t\t$wp_args \t= ( isset( $cpt_args['wp_args'] ) ) ? $cpt_args['wp_args'] : array();\n\t\t\t$icon \t\t= ( isset( $cpt_args['icon'] ) ) ? $cpt_args['icon'] : '';\n\n\t\t\t$post_type_object = new \\UBC\\Press\\CPTs\\CPT( $label_args, $wp_args, $icon );\n\t\t}\n\n\t}", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "public function __construct(){\n add_action( 'init', [ $this, 'create_resource_lists' ], 0 ); \t\n \t\n \t//init the custom post type for record items\n add_action( 'init', [ $this, 'resource_list_generator' ], 0 ); \n \n\n }", "public function create_post_type() {\n\n\t\t\t$this->register_post_type( array(\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'menu_position' => 6.9,\n\t\t\t\t'menu_icon' => 'dashicons-book-alt',\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => 'manuals',\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'show_in_rest' => true,\n\t\t\t) );\n\n\t\t\tnew WPS\\Schema\\Entry_Schema( $this->post_type, 'book' );\n\n\t\t}", "public function __construct(BlogPost $post, $type = 'FULL')\n {\n $this->post = $post;\n $this->type = $type;\n }", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "function create_post_type(){\n register_post_type('recipes', [ \n 'labels' => [\n 'name' => 'Recipes', //Etikett i plural Etikett i singular\n 'singular_name' => 'Recipe', //Vad som ska stå i ”Lägg till...” knappen\n 'add_new' => 'New Recipe', //Vad som ska stå i ”Lägg till ny...” knappen\n 'add_new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'edit_item' => 'Edit Recipe', //Vad som ska stå i ”Redigera...” länken\n 'new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'search_items' => 'Search for Recipe', //Vad som ska stå i sökrutan i listningen\n 'not_found' => 'No Recipe Found', \n 'all_items' => 'All Recipes', //Vad som ska stå i ”Alla...” länken\n ],\n 'supports' => array( 'thumbnail' ),\n 'description' => 'The Big Tasty!', //En kort beskrivning av posttypen\n 'public' => true, //Om och hur posttypen ska visas för olika användare\n 'exclude_from_search' => false, //Om posttypens poster ska exkluderas vid sökning\n 'show_ui' => true, //Om posttypen ska kunna hanteras från admin\n 'show_in_nav_menus' => true, //Om poster av posttypen ska kunna läggas till i menyer\n 'show_in_menu' => true, //Vart posttypen ska listas i admin (vänster eller topp)\n 'show_in_admin_bar' => true, //Om posttypen ska visas i toppbar’en\n 'menu_position' => 10, //Vart i vänstermenyn posttypen ska visas\n 'hierarchical' => false, //Om poster i posttypen ska kunna ha föräldrar, likt Sidor\n 'menu_icon' => 'dashicons-food', //Ikon för posttypen\n 'supports' => array('title' , 'editor'), //Vad som ska synas när man skapar/redigerar en post \n 'taxonomies' => array('category'), //Vilka taxonomier som ska tillhöra posttypen\n 'has_archive' => true, //Om posttypen ska ha arkivsida\n 'rewrite' => [ //Hur posttypens rewrites ska hanteras...\n 'slug' => 'recipe', //Permalänkstrukturen för posttypen\n 'with_front' => true //Om permalänkarna ska låta föregås av sluggen\n ] \n ]);\n\n}", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Ort', 'Post Type General Name', 'twentythirteen' ),\n 'singular_name' => _x( 'Ort', 'Post Type Singular Name', 'twentythirteen' ),\n 'menu_name' => __( 'Orter', 'twentythirteen' ),\n 'all_items' => __( 'Alla Orter', 'twentythirteen' ),\n 'view_item' => __( 'View Ort', 'twentythirteen' ),\n 'add_new_item' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'add_new' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'edit_item' => __( 'Redigera Ort', 'twentythirteen' ),\n 'update_item' => __( 'Upddatera Ort', 'twentythirteen' ),\n 'search_items' => __( 'Sök Ort', 'twentythirteen' ),\n 'not_found' => __( 'Not Found', 'twentythirteen' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),\n );\n \n $args = array(\n 'label' => __( 'cities', 'twentythirteen' ),\n 'description' => __( 'City Post Page', 'twentythirteen' ),\n 'labels' => $labels,\n 'supports' => array('title','thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n register_post_type( 'cities', $args );\n\n }", "protected function __constructor() {\n\t\t\n\t\t// Copy and process configuration\n\t\t$config = $this->getConfig();\n\t\t$this->post_type = $config['post_type'];\n\t\t$this->meta_box = $config['meta_box'];\n\t\t$this->nonce = $config['nonce'];\n\t\t$this->fields = $config['fields'];\n\t\tarray_walk( $this->fields, [$this, 'prepare_field_data'] );\n\t\t\n\t\t// Runs hooks\n\t\tadd_action( 'add_meta_boxes_'.$this->post_type, [$this, 'register_meta_box'] );\n\t\tadd_action( 'save_post', [$this, 'save_post_meta'] );\n\t\tadd_action( 'admin_enqueue_scripts', [$this, 'load_assets'] );\n\t}", "public function create_post_type() {\n\n register_post_type( self::POST_TYPE,\n array(\n\n 'labels' => array(\n 'name' => __( 'Fundraisers' ),\n 'singular_name' => __( 'Fundraiser' )\n ),\n 'description' => 'Fundraisers that allow users to purchase items through the WooCommerce Stores',\n 'menu_icon' => 'dashicons-chart-line',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt',\n 'revisions' ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array(\n 'slug' => __( 'fundraisers' ),\n 'with_front' => false\n )\n )\n );\n }", "public function setCustomPostTypes() {\n $args = array(\n // ## Badges ##\n array(\n 'post_type' => self::POST_TYPE_BADGES,\n 'args' => array(\n 'labels' => array(\n 'name' => 'Badges',\n 'singular_name' => 'Badge',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Badge',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Badge',\n 'new_item' => 'New Badge',\n 'view' => 'View',\n 'view_item' => 'View Badge',\n 'search_items' => 'Search Badges',\n 'not_found' => 'No Badges found',\n 'not_found_in_trash' => 'No Badges found in Trash',\n 'parent' => 'Parent Badges'\n ),\n 'public' => true,\n 'has_archive' => true,\n 'show_in_admin_bar' => true,\n 'show_ui' => true,\n 'show_in_menu' => false, // adding to custom menu manually\n 'supports' => array('title', 'editor', 'author', 'thumbnail',),\n // Capabilities that are debilitated waiting a solution\n // already explained in the User class.\n /*\n 'capabilities' => array(\n 'edit_post' => User::CAP_EDIT_BADGE,\n 'edit_posts' => User::CAP_EDIT_BADGES,\n 'edit_others_posts' => User::CAP_EDIT_OTHER_BADGES,\n 'edit_published_posts' => User::CAP_EDIT_PUBLISHED_BADGES,\n 'publish_posts' => User::CAP_PUBLISHED_BADGES,\n 'read_post' => User::CAP_READ_BADGE,\n 'read_posts' => User::CAP_READ_BADGES,\n 'read_private_posts' => User::CAP_READ_BADGES,\n 'delete_post' => User::CAP_DELETE_BADGE,\n 'delete_posts' => User::CAP_DELETE_BADGES,\n )*/\n )\n ),\n );\n\n $this->settings->loadCustomPostTypes($args);\n }", "public function init() {\n\t\tregister_post_meta(\n\t\t\t'product',\n\t\t\tself::META_REVIEWS,\n\t\t\t[\n\t\t\t\t'type' => 'string',\n\t\t\t\t'single' => true,\n\t\t\t\t'show_in_rest' => true,\n\t\t\t]\n\t\t);\n\n\t\tregister_post_meta(\n\t\t\t'post',\n\t\t\tself::META_REVIEWS,\n\t\t\t[\n\t\t\t\t'type' => 'string',\n\t\t\t\t'single' => true,\n\t\t\t\t'show_in_rest' => true,\n\t\t\t]\n\t\t);\n\t}", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "function press_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Press', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Press', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Press'),\n\t\t'all_items' => __( 'All Press'),\n\t\t'view_item' => __( 'View Press'),\n\t\t'add_new_item' => __( 'Add New Press'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Press'),\n\t\t'update_item' => __( 'Update Press')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'press'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"press\"),\n 'register_meta_box_cb' => 'add_press_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'press', $args );\n\n}", "function __construct() {\n\t\tif ( class_exists( 'PremiseCPT' ) ) {\n\t\t\tnew PremiseCPT( self::$example_labels, $this->example_options );\n\t\t}\n\n\t\tpwp_add_metabox(\n\t\t\t'Example Meta',\n\t\t\tarray( self::$example_labels['post_type_name'] ),\n\t\t\tarray(\n\t\t\t\t'name_prefix' => 'example_meta',\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'context' => 'post',\n\t\t\t\t\t'name' => '[tel]',\n\t\t\t\t\t'label' => 'Telephone',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'context' => 'post',\n\t\t\t\t\t'name' => '[email]',\n\t\t\t\t\t'label' => 'Email',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'example_meta'\n\t\t);\n\t}", "public function setup_posttype() {\n register_post_type( 'brg_post_templates',\n array(\n 'labels' => array(\n 'name' => 'Templates',\n 'singular_name' => 'Template'\n ),\n 'description' => 'Template for a post type single view',\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "protected function setPostTypeObject(){\n\t\treturn array(\n\t\t\t'label' => _x('Music', 'music', 'cpt_music'),\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x('Music', 'music', 'cpt_music'),\n\t\t\t\t'singular_name' => _x('Music', 'music', 'cpt_music'),\n\t\t\t\t'add_new' => _x('Add new Track', 'music', 'cpt_music'),\n\t\t\t\t'all_items' => _x('Music', 'music', 'cpt_music'),\n\t\t\t\t'add_new_item' => _x('Add new Track', 'music', 'cpt_music'),\n\t\t\t\t'edit_item' => _x('Edit Track', 'music', 'cpt_music'),\n\t\t\t\t'new_item' => _x('New Track', 'music', 'cpt_music'),\n\t\t\t\t'view_item' => _x('View Track', 'music', 'cpt_music'),\n\t\t\t\t'search_items' => _x('Search Track', 'music', 'cpt_music'),\n\t\t\t\t'not_found' => _x('No Track found', 'music', 'cpt_music'),\n\t\t\t\t'not_found_in_trash' => _x('No Track found in the trash', 'music', 'cpt_music'),\n\t\t\t\t'parent_item_colon' => _x('Music', 'music', 'cpt_music'),\n\t\t\t\t'menu_name' => _x('Music catalog', 'music', 'cpt_music')\n\t\t\t),\n\t\t\t'description' => _x('Manage the music catalog', 'music', 'cpt_music'),\n\t\t\t'public' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => false,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 1,\n\t\t\t// 'menu_icon' => plugins_url( 'img/cd_music_w_20.png' , __FILE__ ),\n\t\t\t'menu_icon' => plugins_url().'/music_catalog/img/cd_music_w_20.png',\n\t\t\t'capability_type' => array( 'music', 'music' ),\n\t\t\t'hierarchical' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array( 'slug' => __('track', 'cpt_music'), 'with_front' => true, 'feeds' => true, 'pages' => true ),\n\t\t\t'query_var' => true,\n\t\t\t'can_export' => false\n\t\t);\n\t}", "function teacher_custompost_init() {\n\t\t$labels_teachers = array(\n\t\t\t'name' => _x('Преподаватели', 'post type general name'),\n\t\t\t'singular_name' => _x('Преподаватель', 'post type singular name'),\n\t\t\t'add_new' => _x('Добавить', 'teacher'),\n\t\t\t'add_new_item' => __('Добавить '),\n\t\t\t'edit_item' => __('Редактировать преподавателя'),\n\t\t\t'new_item' => __('Новый преподаватель'),\n\t\t\t'all_items' => __('Все преподаватели'),\n\t\t\t'view_item' => __('Просмотреть страницу преподавателя'),\n\t\t\t'search_items' => __('Поиск преподавателей'),\n\t\t\t'not_found' => __('Ни одного преподавателя не найдено'),\n\t\t\t'not_found_in_trash' => __('В корзине ни одного преподавателя не найдено'), \n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Преподаватели'\n\t\t);\n\t\t$args = array(\n\t\t\t'labels' => $labels_teachers,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true, \n\t\t\t'show_in_menu' => true, \n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array(\"slug\" => \"teachers\"),\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => true, \n\t\t\t'hierarchical' => false,\n\t\t\t'menu_position' => 24,\n\t\t\t'supports' => array( 'thumbnail', 'title', 'custom-fields', 'excerpt', 'page-attributes' )\n\t\t);\n\t\tregister_post_type('teacher',$args);\n\t}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public function init_cpt_registration() {\r\n\r\n\t\tarray_walk( $this->config['post_types'], array( $this, 'register_custom_post_types' ) );\r\n\r\n\t}" ]
[ "0.82686085", "0.81194204", "0.79444915", "0.7915738", "0.78919184", "0.78873736", "0.785236", "0.7781367", "0.7626198", "0.75895524", "0.75705266", "0.74392754", "0.7425758", "0.7413979", "0.7352165", "0.7288915", "0.72381115", "0.72112155", "0.7150548", "0.71476126", "0.7140149", "0.7138006", "0.71178234", "0.70974845", "0.70788366", "0.7069051", "0.7067871", "0.70677644", "0.7055717", "0.70525885", "0.70488685", "0.7047905", "0.70453405", "0.7038728", "0.70270026", "0.7019099", "0.7018777", "0.70032537", "0.70023364", "0.7001397", "0.69958276", "0.6992828", "0.6991232", "0.6991139", "0.6954072", "0.69287544", "0.69165224", "0.6915303", "0.6915044", "0.6901698", "0.68922484", "0.6888973", "0.68703085", "0.6863729", "0.68542784", "0.68491787", "0.6848005", "0.6842244", "0.68419474", "0.6841293", "0.68376505", "0.6836819", "0.68189", "0.6812778", "0.6812091", "0.67973584", "0.67941236", "0.6790963", "0.6790137", "0.6787904", "0.6785558", "0.67849207", "0.67787325", "0.6777168", "0.6771387", "0.67713076", "0.67664194", "0.6764064", "0.6762245", "0.67555827", "0.67542994", "0.67526644", "0.67400444", "0.6739661", "0.67240965", "0.6721097", "0.670192", "0.6698241", "0.668709", "0.6681797", "0.66809434", "0.66805995", "0.668006", "0.66793865", "0.6671305", "0.6666016", "0.665954", "0.6657448", "0.6657448", "0.6645129", "0.6637527" ]
0.0
-1
Defines if post type can be purchased
public static function allowed_purchasing( $post_types ) { $post_types[] = 'property'; return $post_types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function check_is_post_type_allowed($post_type)\n {\n }", "public function thm_activate_gutenberg_products($can_edit, $post_type){\n\t\tif($post_type == 'product'){\n\t\t\t$can_edit = true;\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "public static function post_type(){}", "function is_post_type_viewable($post_type)\n {\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "private function is_valid_post_type() {\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude_once( 'q-and-a-post-types.php' );\n\t\t\n\t\treturn ! empty( $_POST['post_type'] ) && ( in_array( get_current_screen()->post_type, $q_and_a_post_types ) );\n\t}", "public function canPayment()\n {\n return true;\n }", "function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "function post_type_supports($post_type, $feature)\n {\n }", "function get_all_post_type_supports($post_type)\n {\n }", "public function is_post_type_allowed_to_save( $post_type = null ) {\n if( ! $post_type ) {\n return false;\n }\n\n $allowed_types = $this->get_allowed_post_types();\n\n if ( in_array( $post_type, $allowed_types, true ) ) {\n return true;\n }\n\n return false;\n }", "function is_purchasable() {\n\t\t$purchasable = WCS_Limiter::is_purchasable( parent::is_purchasable(), $this );\n\n\t\treturn apply_filters( 'woocommerce_subscription_is_purchasable', $purchasable, $this );\n\t}", "public function _action_global_post_is_available() {\n\t\tglobal $post;\n\n\t\t$this->accept_feedback = $post && post_type_supports( get_post_type( $post->ID ), $this->supports_feature_name );\n\n\t\tif ( ! ( $this->accept_feedback && $this->user_bought_product() ) ) {\n\t\t\treturn;\n\t\t}\n\t}", "abstract function is_only_premium();", "public function is_needed() {\n\t\treturn is_singular( PostType::get_instance()->get_post_type() );\n\t}", "public function shouldRun() : bool\n {\n global $post;\n $postType = get_post_type($post);\n return $postType === 'product' || $postType === 'solution';\n }", "public function getOrderType()\n {\n return 'purchase';\n }", "public function detect_persontype($post_id, $type = '_billing') {\n\n\t\t$tipo_pessoa = get_post_meta($post_id, $type.'_persontype', true);\n\n\t\tif ( !$tipo_pessoa && $type == '_shipping' ) {\n\n\t\t\treturn 3;\n\n\t\t} elseif ( !$tipo_pessoa ) {\n\n\t\t\tif ( !empty(get_post_meta($post_id, $type.'_cpf', true)) ) {\n\t\t\t\t$tipo_pessoa = 1;\n\t\t\t} elseif ( !empty(get_post_meta($post_id, $type.'_cnpj', true)) ) {\n\t\t\t\t$tipo_pessoa = 2;\n\t\t\t}\n\n\t\t\tif (!$tipo_pessoa)\n\t\t\t\t$tipo_pessoa = 1;\n\n\t\t}\n\n\t\treturn $tipo_pessoa;\n\n\t}", "public function is_premium()\n {\n $cookie_manager = new CookieManager();\n if ($cookie_manager->validate_cookie($this->post_id)) {\n return true;\n } else {\n return false;\n }\n }", "protected function shouldAddPayment(): bool\r\n {\r\n return DocumentTypes::hasPayments($this->documentType);\r\n }", "public function isValidPostType() {\n if ( $this->post_type === get_post_type() ) {\n return true;\n }\n return false;\n }", "function is_publishable($product_id){\n $by = json_decode($this->db->get_where('product',array('product_id'=>$product_id))->row()->added_by,true);\n if($by['type'] == 'admin'){\n return true;\n } else if($by['type'] == 'vendor'){\n $vendor_status = $this->db->get_where('vendor',array('vendor_id'=>$by['id']))->row()->status;\n if ($vendor_status == 'approved') {\n return true;\n } else {\n return false;\n }\n }\n }", "public function isEcommerce() {\r\n if (isset($this->eTypes)) {\r\n return $this->eTypes;\r\n }\r\n\r\n\r\n $this->eTypes = array('product', 'wpsc-product');\r\n foreach ($this->eTypes as $key => $type) {\r\n if (!in_array($type, get_post_types())) {\r\n unset($this->eTypes[$key]);\r\n }\r\n }\r\n\r\n if (!empty($this->eTypes)) {\r\n return $this->eTypes;\r\n }\r\n\r\n return false;\r\n }", "function dokan_get_new_post_status() {\n $user_id = get_current_user_id();\n\n // trusted seller\n if ( dokan_is_seller_trusted( $user_id ) ) {\n return 'publish';\n }\n\n // if not trusted, send the option\n $status = dokan_get_option( 'product_status', 'dokan_selling', 'pending' );\n\n return $status;\n}", "abstract protected function post_type();", "public function is_valid() {\n return !empty( $this->post ) && YITH_WCBK_Post_Types::$booking === $this->post->post_type;\n }", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "abstract function is_premium();", "function can_use_premium_code__premium_only() {\n\t\t\treturn $this->is_premium() && $this->can_use_premium_code();\n\t\t}", "public static function allowed_claiming( $post_types ) {\n $post_types[] = 'property';\n return $post_types;\n }", "function ihc_check_payment_available($type=''){\n\tif ($type){\n\t\t$payment_metas = ihc_return_meta_arr('payment_' . $type);\n\t\tswitch ($type){\n\t\t\tcase 'paypal':\n\t\t\t\tif (!empty($payment_metas['ihc_paypal_email']) && !empty($payment_metas['ihc_paypal_status'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'authorize':\n\t\t\t\tif (!empty($payment_metas['ihc_authorize_login_id']) && !empty($payment_metas['ihc_authorize_transaction_key']) && !empty($payment_metas['ihc_authorize_status'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'twocheckout':\n\t\t\t\tif (!empty($payment_metas['ihc_twocheckout_status']) && !empty($payment_metas['ihc_twocheckout_api_user'])\n\t\t\t\t\t\t&& !empty($payment_metas['ihc_twocheckout_api_pass']) && !empty($payment_metas['ihc_twocheckout_private_key'])\n\t\t\t\t\t\t&& !empty($payment_metas['ihc_twocheckout_account_number']) && !empty($payment_metas['ihc_twocheckout_secret_word'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'bank_transfer':\n\t\t\t\tif (!empty($payment_metas['ihc_bank_transfer_status']) && !empty($payment_metas['ihc_bank_transfer_message'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'stripe':\n\t\t\t\tif (!empty($payment_metas['ihc_stripe_secret_key']) && !empty($payment_metas['ihc_stripe_publishable_key']) && !empty($payment_metas['ihc_stripe_status'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'braintree':\n\t\t\t\tif ($payment_metas['ihc_braintree_status'] == 1 && !empty($payment_metas['ihc_braintree_merchant_id']) && !empty($payment_metas['ihc_braintree_public_key']) && !empty($payment_metas['ihc_braintree_private_key'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'payza':\n\t\t\t\tif (!empty($payment_metas['ihc_payza_status']) && !empty($payment_metas['ihc_payza_email'])){\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'mollie':\n\t\t\t\tif (!empty($payment_metas['ihc_mollie_status']) && !empty($payment_metas['ihc_mollie_api_key'])){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'pagseguro':\n\t\t\t\tif (!empty($payment_metas['ihc_pagseguro_status']) && !empty($payment_metas['ihc_pagseguro_email']) && !empty($payment_metas['ihc_pagseguro_token'])){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'paypal_express_checkout':\n\t\t\t\tif (!empty($payment_metas['ihc_paypal_express_checkout_signature']) && !empty($payment_metas['ihc_paypal_express_checkout_user'])\n\t\t\t\t\t&& !empty($payment_metas['ihc_paypal_express_checkout_password']) && !empty($payment_metas['ihc_paypal_express_checkout_status'])){\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'stripe_checkout_v2':\n\t\t\t\tif (!empty($payment_metas['ihc_stripe_checkout_v2_secret_key']) && !empty($payment_metas['ihc_stripe_checkout_v2_publishable_key']) && !empty($payment_metas['ihc_stripe_checkout_v2_status'])){\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn FALSE;\n}", "abstract function has_purchased_before();", "function is_post_type($type){\n\tglobal $wp_query;\n\tif($type == get_post_type($wp_query->post->ID)) return true;\n\treturn false;\n}", "public function isAvailable()\n {\n return $this->getTypeInstance(true)->isSalable($this)\n || Mage::helper('catalog/product')->getSkipSaleableCheck();\n }", "public function canCreateItem(string $type, string $name): bool;", "public function hasItemtype(){\n return $this->_has(40);\n }", "public function has_postcard() {\n return (bool) $this->get_postcard();\n }", "function is_paying__premium_only() {\n\t\t\treturn ( $this->is__premium_only() && $this->is_paying() );\n\t\t}", "public function isProductTypeWithQty(): ?bool;", "abstract function can_use_premium_code();", "function is_paying_or_trial__premium_only() {\n\t\t\treturn $this->is_premium() && $this->is_paying_or_trial();\n\t\t}", "public function hasPurify(){\n return $this->_has(18);\n }", "public function valid()\n {\n $allowed_values = [\"Purchase\", \"Adjustment\", \"Transfer\"];\n if (!in_array($this->container['procurement_type'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function is_post_type_archive($post_types = '')\n {\n }", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "public function isCreditCardPurchase()\n {\n return $this->payment_method->id != 1;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function hasMoneytype(){\n return $this->_has(15);\n }", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "public function checkUserCountryType(){\n\t\t\\Config::set('app.user_country_type', 'premium');\n\t\tif(\\Auth::check()){\n\t\t\t$user = \\Auth()->user();\n\t\t\tif(isset($user) && !empty($user) && isset($user->country->country_type)){\n\t\t\t\t\\Config::set('app.user_country_type', 'free');\n\t\t\t}\n\t\t}\n\t}", "function is_item_enabled() {\n\t\tif (get_post_meta($this->id, '_apptivo_enabled', true)=='yes') return true;\n\t\treturn false;\n\t}", "function promo_post_type() {\n\t// Promo posts type where users can create promo post types.\n\tregister_post_type(\n\t\t'promos',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Promos' ),\n\t\t\t\t'singular_name' => __( 'Promo' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail')\n\t\t)\n\t);\n}", "function farmhouse_post_type_support() {\n\n $post_type_supports = genesis_get_config( 'post-type-supports' );\n\n foreach ( $post_type_supports as $post_type => $args ) {\n add_post_type_support( $post_type, $args );\n }\n\n}", "function is_tiered_allowed( $package = [] ) {\n $availability = $this->get_option( 'availability' );\n $user_country = $package['destination']['country'];\n $countries = $this->get_option( 'countries' );\n\n switch ( $availability ) {\n // Plugin availability is set to all countries.\n case 'all':\n return true;\n break;\n\n case 'specific':\n $in_allowed_country = false;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = true;\n break;\n }\n }\n\n return $in_allowed_country;\n break;\n\n case 'except':\n $in_allowed_country = true;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = false;\n break;\n }\n }\n\n return $in_allowed_country;\n }\n }", "public function hasCustomization($type)\n {\n return !!DB::table('customizations')->where('company_id', $this->id)->where('type_code', $type)->count();\n }", "function is_posttype( $type, $archive = POSTTYPE_ARCHIVEORSINGLE ) {\r\n\tif( is_singular( $type ) && ( $archive != POSTTYPE_ARCHIVEONLY ) ) return true;\r\n\tif( ( $archive == POSTTYPE_SINGLEONLY ) || !is_archive() ) return false;\r\n\treturn ( get_query_var( 'post_type' ) == $type );\r\n}", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "function is_post_status_viewable($post_status)\n {\n }", "public function isSetPaymentAmountType()\n {\n return !is_null($this->_fields['PaymentAmountType']['FieldValue']);\n }", "protected static function check_payment($post_id) {\n return isset($_GET['publisher_access']) && self::make_token($post_id) === $_GET['publisher_access'];\n }", "function process_product_meta_deposit_tab( $post_id ) { \n update_post_meta( $post_id, 'woo_deposits:is_deposit_override', isset($_POST['woo_deposits:is_deposit_override']) && $_POST['woo_deposits:is_deposit_override'] ? '1' : '0' );\n update_post_meta( $post_id, 'woo_deposits:deposit_override_value', is_numeric($_POST['woo_deposits:deposit_override_value']) ? $_POST['woo_deposits:deposit_override_value'] : '0' );\n \n if ( isset($_POST['amount_type'])) {\n update_post_meta( $post_id, 'woo_deposits:deposit_amount_type', $_POST['amount_type']);\n }\n }", "protected function has_permission( $post_id ) {\n // autosave -> do nothing\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return false;\n }\n\n // Ajax -> do nothing\n if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n return false;\n }\n\n // no post found -> do nothing\n $post = get_post( $post_id );\n if ( $post === null ) {\n return false;\n }\n\n // current post type is not enabled for LaterPay -> do nothing\n if ( ! in_array( $post->post_type, $this->config->get( 'content.enabled_post_types' ), true ) ) {\n return false;\n }\n\n return true;\n }", "static public function is_post_type_can_be_indexed( $post_type ) {\n\n\t\t$post_types = WPSOLR_Service_Container::getOption()->get_option_index_post_types();\n\n\t\treturn in_array( $post_type, $post_types, true );\n\t}", "function is_type( $type ) {\n\t\tif (is_array($type) && in_array($this->product_type, $type)) return true;\n\t\telseif ($this->product_type==$type) return true;\n\t\treturn false;\n\t}", "function ava_is_single_product_callback( $control ) {\n return is_singular( 'product' );\n}", "function is_valid_for_use()\n {\n if (!in_array(get_option('woocommerce_currency'), array('RUB', 'USD'))) {\n return false;\n }\n\n return true;\n }", "public function checkFieldStatus()\n {\n $helper = $this->helper;\n $product = $this->coreRegistry->registry('product');\n $productType = $product->getTypeId();\n $allowedsProducts = explode(',', $helper->getAllowedProductType());\n if (in_array($productType, $allowedsProducts)) {\n return true;\n }\n return false;\n }", "function custom_post_type() {\n // Set other options for Custom Post Type\n $args = array(\n 'label' => __( 'Child Care', 'AOK' ),\n 'description' => __( 'Child Care', 'AOK' ),\n 'labels' => $labels,\n // Features in Post Editor\n 'supports' => array( 'title', 'author', 'comments' ),\n // Taxonomies or custom taxonomy.\n //'taxonomies' => array( 'categories' ),\n /* A hierarchical CPT is like Pages and can have\n* Parent and child items. A non-hierarchical CPT\n* is like Posts.\n*/\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n /*\n$args2 = array(\n'label' => __( 'Public Profile', 'AOK' ),\n'description' => __( 'Public Profile', 'AOK' ),\n'labels' => $labels,\n// Features in Post Editor\n'supports' => false,\n// Taxonomies or custom taxonomy.\n//'taxonomies' => array( 'categories' ),\n// A hierarchical CPT is like Pages and can have\n// Parent and child items. A non-hierarchical CPT\n// is like Posts.\n\n'hierarchical' => false,\n'public' => true,\n'show_ui' => true,\n'show_in_menu' => true,\n'show_in_nav_menus' => true,\n'show_in_admin_bar' => true,\n'menu_position' => 3,\n'can_export' => true,\n'has_archive' => true,\n'exclude_from_search' => false,\n'publicly_queryable' => true,\n'capability_type' => 'post',\n);\n*/\n // Registering Custom Post Type\n register_post_type( 'child_care', $args );\n //register_post_type( 'profile', $args2 );\n}", "public function issetProductType(): bool\n {\n return isset($this->productType);\n }", "static function is_requested_post_type()\n {\n $retval = FALSE;\n $screen = get_current_screen();\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG post type?\n if (isset($properties['post_type']) && $screen->post_type == $properties['post_type']) {\n $retval = $slug;\n break;\n }\n }\n return $retval;\n }", "public function bamobile_mobiconnector_add_show_in_rest_to_post_type() {\r\n global $wp_post_types;\r\n $listoptionscheckbox = get_option('mobiconnector_settings-post_type');\r\n $listoptionscheckbox = unserialize($listoptionscheckbox);\r\n if(!empty($listoptionscheckbox)){\r\n $post_type = '';\r\n foreach($listoptionscheckbox as $posttype => $value){ \r\n $name = str_replace('mobi-','',$posttype); \r\n if($value == 1){\r\n if( isset( $wp_post_types[$name] ) ) {\r\n $wp_post_types[$name]->show_in_rest = true;\r\n }\r\n }\r\n }\r\n }\r\n }", "abstract function is_paying();", "function get_payment_type()\n {\n // echeck - payment funded with e-check\n // instant - payment was funded with platnosci balance, credit card, or instant transfer\n return $this->platnosci_post_vars['payment_type'];\n }", "function create_post_type_gon_products_premium() {\n register_post_type( 'gon_products_premium',\n array(\n 'labels' => array(\n 'name' => __( 'Products' ),\n 'singular_name' => __( 'Product' )\n ),\n 'public' => true,\n 'has_archive' => true,\n\t 'menu_position' => 10,\n\t 'capability_type' => 'post',\n\t 'supports' => array('title', 'editor','page-attributes','thumbnail'),\n\t 'rewrite' => array( 'slug' => 'products' )\n )\n );\n \n \t//add product-type tax\n \n\tregister_taxonomy(\n\t\t'featured_product_type',\n\t\t'gon_products_premium',\n\t\tarray(\n\t\t\t'label' => __( 'Product Categories' ),\n\t\t\t'rewrite' => array( 'slug' => 'product-type' ),\n\t\t\t'hierarchical' => true,\n\t\t)\n\t);\n}", "public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }", "function is_product() {\n\t\treturn is_singular( array( 'product' ) );\n\t}", "function post_as_is_supported(string $entity_type, string $entity_subtype): bool {\n\tif (empty($entity_type) || empty($entity_subtype)) {\n\t\treturn false;\n\t}\n\t\n\t$config = post_as_get_config();\n\tif (empty($config)) {\n\t\treturn false;\n\t}\n\t\n\tforeach ($config as $form => $settings) {\n\t\tif (elgg_extract('type', $settings) !== $entity_type) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif (elgg_extract('subtype', $settings) !== $entity_subtype) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "public function get_allowed_post_types() {\n return array( 'post', 'page' );\n }", "function register_post_types()\n {\n do_action('wc_pos_register_post_type');\n\n if (!post_type_exists('pos_temp_register_or')) {\n\n wc_register_order_type(\n 'pos_temp_register_or',\n apply_filters('wc_pos_register_post_type_pos_temp_register_or',\n array(\n 'label' => __('POS temp orders', 'wc_point_of_sale'),\n 'capability_type' => 'shop_order',\n 'public' => false,\n 'hierarchical' => false,\n 'supports' => false,\n 'exclude_from_orders_screen' => false,\n 'add_order_meta_boxes' => false,\n 'exclude_from_order_count' => true,\n 'exclude_from_order_views' => true,\n 'exclude_from_order_reports' => true,\n 'exclude_from_order_sales_reports' => true,\n //'class_name' => ''\n )\n )\n );\n }\n if (!post_type_exists('pos_custom_product')) {\n register_post_type('pos_custom_product',\n apply_filters('wc_pos_register_post_type_pos_custom_product',\n array(\n 'label' => __('POS custom product', 'wc_point_of_sale'),\n 'public' => false,\n 'hierarchical' => false,\n 'supports' => false\n )\n )\n );\n }\n }", "public function hasType() {\n return $this->_has(3);\n }", "public function canPersonalize($product)\n {\n //var_dump($product->getData());\n \n return (bool)$product->getData('personalization_allowed');\n }", "function is_single_type($type, $post) {\n if (get_post_type($post->ID) === $type) {\n return true;\n } else {\n return false;\n }\n}", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "function create_posttype() {\n \n register_post_type( 'product',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Products' ),\n 'singular_name' => __( 'Product' )\n ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'products'),\n 'capability_type' => 'post',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n )\n );\n}", "function dokan_is_seller_enabled( $user_id ) {\n $selling = get_user_meta( $user_id, 'dokan_enable_selling', true );\n\n if ( $selling == 'yes' ) {\n return true;\n }\n\n return false;\n}", "function dokan_is_seller_trusted( $user_id ) {\n $publishing = get_user_meta( $user_id, 'dokan_publishing', true );\n\n if ( $publishing == 'yes' ) {\n return true;\n }\n\n return false;\n}", "public function products_could_be_queried_with_published_status()\n {\n $publishedProductQty = random_int(1, 10);\n factory(Product::class, $publishedProductQty)\n ->states('published')\n ->create();\n\n $unpublishedProductQty = random_int(1, 10);\n factory(Product::class, $unpublishedProductQty)\n ->states('unpublished')\n ->create();\n\n //status\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => true]);\n $this->assertCount($publishedProductQty, $queryResult);\n\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => false]);\n $this->assertCount($unpublishedProductQty, $queryResult);\n }", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function is_custom_post_type( $post = NULL ){\n $all_custom_post_types = get_post_types( array ( '_builtin' => FALSE ) );\n\n // there are no custom post types\n if ( empty ( $all_custom_post_types ) )\n return FALSE;\n\n $custom_types = array_keys( $all_custom_post_types );\n $current_post_type = get_post_type( $post );\n\n // could not detect current type\n if ( ! $current_post_type )\n return FALSE;\n\n return in_array( $current_post_type, $custom_types );\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "function get_post_type_capabilities($args)\n {\n }", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "public function create_post_types() {\n }", "function custom_is_part_archive($post_types = array()) {\n\t\tglobal $custom_wp_query;\n\n\t\tif ( isset($custom_wp_query) ) {\n\t\t\tif (!isset($post_types) || empty($post_types)) { //if no parameters at all\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif (!is_array($post_types)) { //if parameter is string\n\t\t\t\t\t$post_types_arr[] = $post_types;\n\t\t\t\t} else {\n\t\t\t\t\t$post_types_arr = $post_types;\n\t\t\t\t}\n\t\t\t\tglobal $post;\n\t\t\t\tforeach ($post_types_arr as $post_type) {\n\t\t\t\t\tif ($post->post_type == $post_type) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "function wpmudev_create_post_type() {\n\t$labels = array(\n \t\t'name' => 'Actividades',\n \t'singular_name' => 'Actividad',\n \t'add_new' => 'Añade Nueva Actividad',\n \t'add_new_item' => 'Añade una nueva Actividad',\n \t'edit_item' => 'Edita la Actividad',\n \t'new_item' => 'Nueva Actividad',\n \t'all_items' => 'Todas las Actividades',\n \t'view_item' => 'Ver Actividad',\n \t'search_items' => 'Buscar Actividades',\n \t'not_found' => 'No se han encontrado Actividades',\n \t'not_found_in_trash' => 'No se han encontrado Actividades en la Papelera', \n \t'parent_item_colon' => '',\n \t'menu_name' => 'Actividades',\n );\n \n $args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n \t\t'public' => true,\n\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'comments', 'page-attributes', 'author' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t//'map_meta_caps' => true,\n\t\t'rewrite' => array( 'slug' => 'actividades' ),\n\t);\n\t\n\tregister_post_type( 'actividad', $args );\n}" ]
[ "0.6830446", "0.63818127", "0.6320983", "0.6300664", "0.6170563", "0.60828537", "0.6080515", "0.60473615", "0.6044437", "0.6040574", "0.60386306", "0.601293", "0.6006849", "0.59861565", "0.5983573", "0.59566236", "0.5891326", "0.58770245", "0.5856451", "0.58521926", "0.58475524", "0.58441", "0.58397114", "0.5788468", "0.5774881", "0.57505614", "0.5737197", "0.5734857", "0.57207143", "0.57087255", "0.570447", "0.56950784", "0.5670379", "0.56444293", "0.5619697", "0.5615554", "0.5579434", "0.55783755", "0.5575874", "0.55736154", "0.55561674", "0.5529121", "0.55099547", "0.5508386", "0.5502576", "0.55002683", "0.54978687", "0.5485125", "0.547196", "0.5454461", "0.5437292", "0.54308075", "0.54190636", "0.540044", "0.53969234", "0.5389712", "0.5386247", "0.53760934", "0.53695947", "0.5361306", "0.53531677", "0.5346823", "0.53449225", "0.53404105", "0.533664", "0.53298426", "0.5325846", "0.53248763", "0.53232914", "0.5314555", "0.53136444", "0.53067887", "0.529644", "0.5285817", "0.5284758", "0.5283159", "0.5281569", "0.527774", "0.52774763", "0.5274919", "0.52664644", "0.52634865", "0.52633524", "0.5256558", "0.52541286", "0.52541286", "0.52541286", "0.52496475", "0.5247039", "0.52439934", "0.5240046", "0.52362406", "0.5230079", "0.5217471", "0.52148837", "0.52117634", "0.5208848", "0.52039963", "0.5201958", "0.5201509" ]
0.67634344
1
Defines if post type can be claimed
public static function allowed_claiming( $post_types ) { $post_types[] = 'property'; return $post_types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function post_type(){}", "protected function check_is_post_type_allowed($post_type)\n {\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "abstract protected function post_type();", "public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }", "function post_type_supports($post_type, $feature)\n {\n }", "function is_post_type_viewable($post_type)\n {\n }", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "private function is_valid_post_type() {\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude_once( 'q-and-a-post-types.php' );\n\t\t\n\t\treturn ! empty( $_POST['post_type'] ) && ( in_array( get_current_screen()->post_type, $q_and_a_post_types ) );\n\t}", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "static function is_requested_post_type()\n {\n $retval = FALSE;\n $screen = get_current_screen();\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG post type?\n if (isset($properties['post_type']) && $screen->post_type == $properties['post_type']) {\n $retval = $slug;\n break;\n }\n }\n return $retval;\n }", "function get_all_post_type_supports($post_type)\n {\n }", "public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }", "function rfi_should_stop_post_publishing( $post ) {\n $is_watched_post_type = rfi_is_supported_post_type( $post );\n $is_after_enforcement_time = rfi_is_in_enforcement_window( $post );\n $large_enough_image_attached = rfi_post_has_large_enough_image_attached( $post );\n\n if ( $is_after_enforcement_time && $is_watched_post_type ) {\n return !$large_enough_image_attached;\n }\n return false;\n}", "public function isPermit()\n {\n if ($this->isLoaded()) {\n $result = $this->getField('type') == self::TYPE_PERMIT;\n } else {\n $result = false;\n }\n return $result;\n }", "function eman_can_view( $post, $user_id=false )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\n\t// Turner can view anything\n\tif ( eman_check_role('turner', $user_id) ) return true;\n\n\t// Pending can't view anything\n\tif ( eman_check_role('pending', $user_id) ) return false;\n\n\t// Test a post_type generally\n\tif ( is_string($post) && get_post_type_object($post) )\n\t{\n\t\t$post_type = $post;\n\t\t$is_post = false;\n\t}\n\t// Test a post specifically\n\telseif ( is_object($post) )\n\t{\n\t\t$post_type = $post->post_type;\n\t\t$is_post = true;\n\t\t// If BIC user, all set, they can view it\n\t\tif ( $user_id == emanager_bic::get_bic($post, 'ID') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\t// Settings for post type\n\t$cpt = ( $settings = eman_post_types($post_type) ) ? $settings : array();\n\n\t// Test settings permissions\n\tif ( ! empty($cpt['access']) )\n\t{\n\t\t// Owners have no access to settings\n\t\tif ( eman_check_role('owner', $user_id) && ! in_array('owner', $cpt['access']) ) return false;\n\n\t\t// Subs have limited access to settings\n\t\tif ( eman_check_role('sub', $user_id) && ! in_array('sub', $cpt['access']) ) return false;\n\t}\n\telseif ( eman_check_role('owner', $user_id) && ( ($is_post && 'noc' === eman_pco_or_noc($post)) || ( ! $is_post && 'em_noc' == $post_type && ! get_query_var('pco')) ) )\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\tif ( $is_post )\n\t{\n\t\t// Test if user is in same company or created post\n\t\tif ( $is_post && (emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || ('em_issue' == $post->post_type && eman_check_role('owner', $user_id)) | ('em_letter' == $post->post_type && eman_check_role('owner', $user_id)) ) ) return true;\n\n\t\t// If is NOC (not PCO), and is owner group, they can view\n\t\tif ( $is_post && 'pco' == eman_pco_or_noc($post) && eman_check_role('owner', $user_id) ) return true;\n\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "public function isValidPostType() {\n if ( $this->post_type === get_post_type() ) {\n return true;\n }\n return false;\n }", "function is_post_status_viewable($post_status)\n {\n }", "public function has_postcard() {\n return (bool) $this->get_postcard();\n }", "function wp_attachment_is($type, $post = \\null)\n {\n }", "public function isPost(): bool {}", "public static function allowed_purchasing( $post_types ) {\n $post_types[] = 'property';\n return $post_types;\n }", "function kindred_disable_gutenberg($can_edit, $post_type)\r\n{\r\n if (!(is_admin() && !empty($_GET['post']))) {\r\n return $can_edit;\r\n }\r\n\r\n if (kindred_disable_editor($_GET['post'])) {\r\n $can_edit = false;\r\n }\r\n\r\n return $can_edit;\r\n}", "public function is_needed() {\n\t\treturn is_singular( PostType::get_instance()->get_post_type() );\n\t}", "public function is_post_type_allowed_to_save( $post_type = null ) {\n if( ! $post_type ) {\n return false;\n }\n\n $allowed_types = $this->get_allowed_post_types();\n\n if ( in_array( $post_type, $allowed_types, true ) ) {\n return true;\n }\n\n return false;\n }", "function is_granted($type) {\n\t\tif(!isset($this->user->rank)) return false;\n\t\treturn $this->user->rank >= $this->get('right', $type);\n\t}", "protected function check_create_permission($post)\n {\n }", "function _wp_privacy_action_request_types()\n {\n }", "public function is_post_notifiable( $post, $action ) {\n\t\tif ( ! $post || ! is_a( $post, 'WP_Post' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// All actions can notify about handbooks.\n\t\t$notifiable_post_types = array( 'handbook' );\n\n\t\t// There's a large number of custom handbooks, and more will be created in the future.\n\t\tif ( str_contains( $post->post_type, '-handbook' ) ) {\n\t\t\t$notifiable_post_types[] = $post->post_type;\n\t\t}\n\n\t\tif ( 'publish' === $action || 'comment' === $action ) {\n\t\t\t$notifiable_post_types = array_merge(\n\t\t\t\t$notifiable_post_types,\n\t\t\t\tarray( 'post', 'handbook', 'wporg_workshop', 'lesson-plan', 'course' )\n\t\t\t);\n\t\t}\n\n\t\t// Some post types are imported programmatically and aren't directly attributable to a wordpress.org\n\t\t// account.\n\t\t$is_markdown_post = false;\n\t\t$post_meta = get_post_custom( $post->ID );\n\n\t\tforeach ( $post_meta as $key => $value ) {\n\t\t\tif ( str_contains( $key, '_markdown_source' ) ) {\n\t\t\t\t$is_markdown_post = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_plugin_active( 'subscribers-only.php' ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( ! in_array( $post->post_type, $notifiable_post_types, true ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( 'publish' != $post->post_status ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( ! empty( $post->post_password ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( $is_markdown_post || ! $post->post_author ) {\n\t\t\t// Some Handbook posts are automatically created and don't have an author.\n\t\t\t$notifiable = false;\n\t\t} elseif ( $post->_xpost_original_permalink || str_starts_with( $post->post_name, 'xpost-' ) ) {\n\t\t\t$notifiable = false;\n\t\t} else {\n\t\t\t$notifiable = true;\n\t\t}\n\n\t\treturn apply_filters( 'wporg_profiles_wp_activity-is_post_notifiable', $notifiable, $post );\n\t}", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "function is_post_publicly_viewable($post = \\null)\n {\n }", "function is_post_type($type){\n\tglobal $wp_query;\n\tif($type == get_post_type($wp_query->post->ID)) return true;\n\treturn false;\n}", "function custom_post_type() {\n // Set other options for Custom Post Type\n $args = array(\n 'label' => __( 'Child Care', 'AOK' ),\n 'description' => __( 'Child Care', 'AOK' ),\n 'labels' => $labels,\n // Features in Post Editor\n 'supports' => array( 'title', 'author', 'comments' ),\n // Taxonomies or custom taxonomy.\n //'taxonomies' => array( 'categories' ),\n /* A hierarchical CPT is like Pages and can have\n* Parent and child items. A non-hierarchical CPT\n* is like Posts.\n*/\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n /*\n$args2 = array(\n'label' => __( 'Public Profile', 'AOK' ),\n'description' => __( 'Public Profile', 'AOK' ),\n'labels' => $labels,\n// Features in Post Editor\n'supports' => false,\n// Taxonomies or custom taxonomy.\n//'taxonomies' => array( 'categories' ),\n// A hierarchical CPT is like Pages and can have\n// Parent and child items. A non-hierarchical CPT\n// is like Posts.\n\n'hierarchical' => false,\n'public' => true,\n'show_ui' => true,\n'show_in_menu' => true,\n'show_in_nav_menus' => true,\n'show_in_admin_bar' => true,\n'menu_position' => 3,\n'can_export' => true,\n'has_archive' => true,\n'exclude_from_search' => false,\n'publicly_queryable' => true,\n'capability_type' => 'post',\n);\n*/\n // Registering Custom Post Type\n register_post_type( 'child_care', $args );\n //register_post_type( 'profile', $args2 );\n}", "function get_post_type_capabilities($args)\n {\n }", "public function get_type()\n\t{\n\t\treturn 'notification.type.approve_post';\n\t}", "public static function use_block_editor_for_post_type(bool $can_edit, string $post_type): bool\n {\n $gutenberg_supported_types = [];\n\n if (!in_array($post_type, $gutenberg_supported_types, true)) {\n $can_edit = false;\n }\n\n return $can_edit;\n }", "function is_custom_post_type( $post = NULL ){\n $all_custom_post_types = get_post_types( array ( '_builtin' => FALSE ) );\n\n // there are no custom post types\n if ( empty ( $all_custom_post_types ) )\n return FALSE;\n\n $custom_types = array_keys( $all_custom_post_types );\n $current_post_type = get_post_type( $post );\n\n // could not detect current type\n if ( ! $current_post_type )\n return FALSE;\n\n return in_array( $current_post_type, $custom_types );\n }", "function farmhouse_post_type_support() {\n\n $post_type_supports = genesis_get_config( 'post-type-supports' );\n\n foreach ( $post_type_supports as $post_type => $args ) {\n add_post_type_support( $post_type, $args );\n }\n\n}", "function post_as_is_supported(string $entity_type, string $entity_subtype): bool {\n\tif (empty($entity_type) || empty($entity_subtype)) {\n\t\treturn false;\n\t}\n\t\n\t$config = post_as_get_config();\n\tif (empty($config)) {\n\t\treturn false;\n\t}\n\t\n\tforeach ($config as $form => $settings) {\n\t\tif (elgg_extract('type', $settings) !== $entity_type) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif (elgg_extract('subtype', $settings) !== $entity_subtype) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "public function bamobile_mobiconnector_add_show_in_rest_to_post_type() {\r\n global $wp_post_types;\r\n $listoptionscheckbox = get_option('mobiconnector_settings-post_type');\r\n $listoptionscheckbox = unserialize($listoptionscheckbox);\r\n if(!empty($listoptionscheckbox)){\r\n $post_type = '';\r\n foreach($listoptionscheckbox as $posttype => $value){ \r\n $name = str_replace('mobi-','',$posttype); \r\n if($value == 1){\r\n if( isset( $wp_post_types[$name] ) ) {\r\n $wp_post_types[$name]->show_in_rest = true;\r\n }\r\n }\r\n }\r\n }\r\n }", "public function isPost();", "public function create_post_types() {\n }", "function get_post_type($post = \\null)\n {\n }", "public function get_allowed_post_types() {\n return array( 'post', 'page' );\n }", "public function wpcd_team_force_type_private( $post ) {\n\n\t\tif ( 'wpcd_team' === $post['post_type'] ) {\n\t\t\tif ( $post['post_status'] != 'trash' && $post['post_status'] != 'auto-draft' && $post['post_status'] != 'draft' ) {\n\t\t\t\t$post['post_status'] = 'private';\n\t\t\t}\n\t\t}\n\t\treturn $post;\n\n\t}", "public function createPostTypes()\n {\n }", "public function supports(string $type): bool;", "protected function has_permission( $post_id ) {\n // autosave -> do nothing\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return false;\n }\n\n // Ajax -> do nothing\n if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n return false;\n }\n\n // no post found -> do nothing\n $post = get_post( $post_id );\n if ( $post === null ) {\n return false;\n }\n\n // current post type is not enabled for LaterPay -> do nothing\n if ( ! in_array( $post->post_type, $this->config->get( 'content.enabled_post_types' ), true ) ) {\n return false;\n }\n\n return true;\n }", "protected function is_post_private( $post_object = null ) {\n\n\t\t$post_type_object = $this->post_type_object;\n\n\t\tif ( empty( $post_object ) ) {\n\t\t\t$post_object = $this->data;\n\t\t}\n\n\t\tif ( empty( $post_object ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * If the status is NOT publish and the user does NOT have capabilities to edit posts,\n\t\t * consider the post private.\n\t\t */\n\t\tif ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * If the owner of the content is the current user\n\t\t */\n\t\tif ( ( true === $this->owner_matches_current_user() ) && 'revision' !== $post_object->post_type ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * If the post_type isn't (not registered) or is not allowed in WPGraphQL,\n\t\t * mark the post as private\n\t\t */\n\n\t\tif ( empty( $post_type_object ) || empty( $post_type_object->name ) || ! in_array( $post_type_object->name, \\WPGraphQL::get_allowed_post_types(), true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'private' === $this->data->post_status && ( ! isset( $post_type_object->cap->read_private_posts ) || ! current_user_can( $post_type_object->cap->read_private_posts ) ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'revision' === $this->data->post_type || 'auto-draft' === $this->data->post_status ) {\n\t\t\t$parent = get_post( (int) $this->data->post_parent );\n\n\t\t\tif ( empty( $parent ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$parent_post_type_obj = $post_type_object;\n\n\t\t\tif ( empty( $parent_post_type_obj ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ( 'private' === $parent->post_status ) {\n\t\t\t\t$cap = isset( $parent_post_type_obj->cap->read_private_posts ) ? $parent_post_type_obj->cap->read_private_posts : 'read_private_posts';\n\t\t\t} else {\n\t\t\t\t$cap = isset( $parent_post_type_obj->cap->edit_post ) ? $parent_post_type_obj->cap->edit_post : 'edit_post';\n\t\t\t}\n\n\t\t\tif ( ! current_user_can( $cap, $parent->ID ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "public function authorize()\n {\n return Auth::user()->type == 1;\n }", "function _post_type_meta_capabilities($capabilities = \\null)\n {\n }", "function register_capabilities_testimonials($post_type_name)\r\r\n{\r\r\n\tglobal $wp_roles;\r\r\n\tif(!isset($wp_roles))\r\r\n\t{\r\r\n\t\t$wp_roles = new WP_Roles();\r\r\n\t}\r\r\n\r\r\n\t$role =& $wp_roles->get_role('administrator');\r\r\n\t$capabilities = $role->capabilities;\r\r\n\t$adminCapabilities = array(\r\r\n\t\t'edit_%s', \r\r\n\t\t'read_%s', \r\r\n\t\t'delete_%s', \r\r\n\t\t'edit_%ss',\r\r\n\t\t'edit_others_%ss',\r\r\n\t\t'publish_%ss',\r\r\n\t\t'read_private_%ss'\r\r\n\t);\r\r\n\tforeach($adminCapabilities as $capFmt)\r\r\n\t{\r\r\n\t\t$capName = sprintf($capFmt, $post_type_name);\r\r\n\t\tif(!array_key_exists($capName, $capabilities))\r\r\n\t\t{\r\r\n\t\t\t// Regardless of capability yes/no, we only care if it has been previously defined.\r\r\n\t\t\t$role->add_cap($capName);\r\r\n\t\t}\r\r\n\t}\r\r\n}", "public function type() { return $this->post->post_type; }", "private function isSocialPost()\n\t{\n\t\treturn ( get_post_type($this->post_id) == 'social-post' ) ? true : false;\n\t}", "function register_post_type(){\n \n $capability = acf_get_setting('capability');\n \n if(!acf_get_setting('show_admin'))\n $capability = false;\n \n register_post_type($this->post_type, array(\n 'label' => 'Options Page',\n 'description' => 'Options Page',\n 'labels' => array(\n 'name' => 'Options Pages',\n 'singular_name' => 'Options Page',\n 'menu_name' => 'Options Pages',\n 'edit_item' => 'Edit Options Page',\n 'add_new_item' => 'New Options Page',\n ),\n 'supports' => array('title'),\n 'hierarchical' => true,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => 'edit.php?post_type=acf-field-group',\n 'menu_icon' => 'dashicons-layout',\n 'show_in_admin_bar' => false,\n 'show_in_nav_menus' => false,\n 'can_export' => false,\n 'has_archive' => false,\n 'rewrite' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => false,\n 'capabilities' => array(\n 'publish_posts' => $capability,\n 'edit_posts' => $capability,\n 'edit_others_posts' => $capability,\n 'delete_posts' => $capability,\n 'delete_others_posts' => $capability,\n 'read_private_posts' => $capability,\n 'edit_post' => $capability,\n 'delete_post' => $capability,\n 'read_post' => $capability,\n ),\n 'acfe_admin_orderby' => 'title',\n 'acfe_admin_order' => 'ASC',\n 'acfe_admin_ppp' => 999,\n ));\n \n }", "public function isCustom()\n {\n $all_custom_post_types = get_post_types(array('_builtin' => false));\n\n // there are no custom post types\n if (empty($all_custom_post_types)) {\n return false;\n }\n\n $custom_types = array_keys($all_custom_post_types);\n $current_post_type = get_post_type($this->get());\n\n // could not detect current type\n if (!$current_post_type) {\n return false;\n }\n\n return in_array($current_post_type, $custom_types);\n }", "public function _action_global_post_is_available() {\n\t\tglobal $post;\n\n\t\t$this->accept_feedback = $post && post_type_supports( get_post_type( $post->ID ), $this->supports_feature_name );\n\n\t\tif ( ! ( $this->accept_feedback && $this->user_bought_product() ) ) {\n\t\t\treturn;\n\t\t}\n\t}", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function hasType(){\r\n return $this->_has(1);\r\n }", "function mb_add_capabilities( $posttype ) {\n\t// gets the author role\n\t$role = get_role( 'administrator' );\n\n\t// adds all capabilities for a given post type to the administrator role\n\t$role->add_cap( 'edit_' . $posttype . 's' );\n\t$role->add_cap( 'edit_others_' . $posttype . 's' );\n\t$role->add_cap( 'publish_' . $posttype . 's' );\n\t$role->add_cap( 'read_private_' . $posttype . 's' );\n\t$role->add_cap( 'delete_' . $posttype . 's' );\n\t$role->add_cap( 'delete_private_' . $posttype . 's' );\n\t$role->add_cap( 'delete_published_' . $posttype . 's' );\n\t$role->add_cap( 'delete_others_' . $posttype . 's' );\n\t$role->add_cap( 'edit_private_' . $posttype . 's' );\n\t$role->add_cap( 'edit_published_' . $posttype . 's' );\n}", "function nsbr_post_type() {\r\n\r\n $labels = array(\r\n\t\t'name' => _x( 'NSBR', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Boat', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'NSBR', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Boat:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Small Boat Registrations', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Boat Registration', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Boat Registration', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Boat Registration', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search NSBR', 'text_domain' ),\r\n\t\t'not_found' => __( 'Boat Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_nsbr',\r\n\t\t'read_post' => 'read_nsbr',\r\n\t\t'delete_post' => 'delete_nsbr',\r\n\t\t'edit_posts' => 'edit_nsbr',\r\n\t\t'edit_others_posts' => 'edit_others_nsbr',\r\n\t\t'publish_posts' => 'publish_nsbr',\r\n\t\t'read_private_posts' => 'read_private_nsbr',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'nsbr', 'text_domain' ),\r\n\t\t'description' => __( 'National Small Boat Register', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'nsbr', $args );\r\n\t\r\n\tadd_role('nsbr_manager', 'NSBR Manager', array(\r\n 'edit_nsbr' => true,\r\n 'edit_others_nsbr' => true,\r\n 'read_nsbr' => true,\r\n 'publish_nsbr' => true,\r\n 'read_private_nsbr' => true,\r\n 'delete_nsbr' => true,\r\n 'read'=> true\r\n ));\r\n \r\n\t add_nsbr_capabilities_to_role( 'curator' );\r\n add_nsbr_capabilities_to_role( 'administrator' );\r\n add_nsbr_capabilities_to_role( 'nmmc_admin' );\r\n}", "function is_single_type($type, $post) {\n if (get_post_type($post->ID) === $type) {\n return true;\n } else {\n return false;\n }\n}", "function allow_save_post($post)\n {\n }", "function disable_gutenberg( $can_edit, $post_type ) {\n\tif( ! ( is_admin() && !empty( $_GET['post'] ) ) ) {\n return $can_edit;\n }\n\n\tif( $_GET['post'] == get_option( 'page_on_front' ) ) {\n $can_edit = false;\n }\n\treturn $can_edit;\n}", "function get_available_post_mime_types($type = 'attachment')\n {\n }", "public function hasType(){\n return $this->_has(2);\n }", "public function hasType(){\n return $this->_has(5);\n }", "public function hasType(){\n return $this->_has(5);\n }", "function save_post_type_beneficiary($post_id) {\n $post_type = get_post_type($post_id);\n if ($post_type != 'beneficiary') {\n return;\n }\n\n $post_title = get_field('organization_name');\n $post_name = sanitize_title($post_title);\n $post = array(\n 'ID' => $post_id,\n 'post_name' => $post_name,\n 'post_title' => $post_title\n );\n wp_update_post($post);\n}", "public function is_premium()\n {\n $cookie_manager = new CookieManager();\n if ($cookie_manager->validate_cookie($this->post_id)) {\n return true;\n } else {\n return false;\n }\n }", "public function hasType() {\n return $this->_has(2);\n }", "public function supports($type);", "function get_post_mime_type($post = \\null)\n {\n }", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "function promo_post_type() {\n\t// Promo posts type where users can create promo post types.\n\tregister_post_type(\n\t\t'promos',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Promos' ),\n\t\t\t\t'singular_name' => __( 'Promo' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail')\n\t\t)\n\t);\n}", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function wpass_register_post_type_status() {\r\n\r\n\t$labels = array(\r\n\t\t'menu_name' => __( 'Custom Status', 'wpass_statuses' ),\r\n\t\t'name' => _x( 'Status', 'Post Type General Name', 'wpass_statuses' ),\r\n\t\t'singular_name' => _x( 'Status', 'Post Type Singular Name', 'wpass_statuses' ),\r\n\t\t'add_new_item' => __( 'Add New Status', 'wpass_statuses' ),\r\n\t\t'add_new' => __( 'New Status', 'wpass_statuses' ),\r\n\t\t'not_found' => __( 'No Status found', 'wpass_statuses' ),\r\n\t\t'not_found_in_trash' => __( 'No Status found in Trash', 'wpass_statuses' ),\r\n\t\t'parent_item_colon' => __( 'Parent Status:', 'wpass_statuses' ),\r\n\t\t'all_items' => __( 'Custom Status', 'wpass_statuses' ),\r\n\t\t'view_item' => __( 'View Status', 'wpass_statuses' ),\r\n\t\t'edit_item' => __( 'Edit Status', 'wpass_statuses' ),\r\n\t\t'update_item' => __( 'Update Status', 'wpass_statuses' ),\r\n\t\t'search_items' => __( 'Search Status', 'wpass_statuses' ),\r\n\t);\r\n\r\n\t/* Post type capabilities */\r\n\t$cap = array(\r\n\t\t'read'\t\t\t\t\t => 'view_ticket',\r\n\t\t'read_post'\t\t\t\t => 'view_ticket',\r\n\t\t'read_private_posts' \t => 'view_private_ticket',\r\n\t\t'edit_post'\t\t\t\t => 'edit_ticket',\r\n\t\t'edit_posts'\t\t\t => 'edit_ticket',\r\n\t\t'edit_others_posts' \t => 'edit_other_ticket',\r\n\t\t'edit_private_posts' \t => 'edit_private_ticket',\r\n\t\t'edit_published_posts' \t => 'edit_ticket',\r\n\t\t'publish_posts'\t\t\t => 'create_ticket',\r\n\t\t'delete_post'\t\t\t => 'delete_ticket',\r\n\t\t'delete_posts'\t\t\t => 'delete_ticket',\r\n\t\t'delete_private_posts' \t => 'delete_private_ticket',\r\n\t\t'delete_published_posts' => 'delete_ticket',\r\n\t\t'delete_others_posts' \t => 'delete_other_ticket'\r\n\t);\t\r\n\t\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'hierarchical' => true,\r\n\t\t'description' => __( 'Ticket Status', 'wpass_statuses' ),\r\n\t\t'supports' => array( 'title' ),\r\n\t\t'public' => false,\r\n\t\t'show_ui' => true,\r\n\t\t//'show_in_menu' => 'edit.php?post_type=ticket',\r\n\t\t'show_in_menu' => false,\r\n\t\t'show_in_nav_menus' => false,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'exclude_from_search' => true,\r\n\t\t'has_archive' => false,\r\n\t\t'can_export' => true,\r\n\t\t'capabilities' => $cap,\t\t\t\t\r\n\t\t'capability_type' => 'edit_ticket'\r\n\t);\r\n\r\n\tregister_post_type( 'wpass_status', $args );\r\n\r\n}", "public function hasLimittype(){\n return $this->_has(21);\n }", "public static function register_post_types() {}", "public function shouldRun() : bool\n {\n global $post;\n $postType = get_post_type($post);\n return $postType === 'product' || $postType === 'solution';\n }", "function _beans_is_post_meta_conditions( $conditions ) {\n\n\t// Check if it is a new post and treat it as such.\n\tif ( stripos( $_SERVER['REQUEST_URI'], 'post-new.php' ) !== false ) {\n\n\t\tif ( !$current_post_type = beans_get( 'post_type' ) )\n\t\t\tif ( in_array( 'post', (array) $conditions ) )\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\n\t} else {\n\n\t\t// Try to get id from $_GET.\n\t\tif ( $id = beans_get( 'post' ) )\n\t\t\t$post_id = $id;\n\t\t// Try to get id from $_POST.\n\t\telseif ( $id = beans_post( 'post_ID' ) )\n\t\t\t$post_id = $id;\n\n\t\tif ( !isset( $post_id ) )\n\t\t\treturn false;\n\n\t\t$current_post_type = get_post_type( $post_id );\n\n\t}\n\n\t$statements = array(\n\t\t$conditions === true,\n\t\tin_array( $current_post_type, (array) $conditions ), // Check post type.\n\t\tisset( $post_id) && in_array( $post_id, (array) $conditions ), // Check post id.\n\t\tisset( $post_id) && in_array( get_post_meta( $post_id, '_wp_page_template', true ), (array) $conditions ) // Check page template.\n\t);\n\n\t// Return true if any condition is met, otherwise false.\n\treturn in_array( true, $statements );\n\n}", "function register_post_types(){\n }", "public function hasType(){\n return !empty($this->type);\n }", "public function check_read_terms_permission_for_post($post, $request)\n {\n }", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "function db099_lifterlms_add_post_types($post_types) {\r\n\tif (in_array('course', get_post_types())) {\r\n\t\t$post_types[] = 'course';\r\n\t} \r\n\treturn $post_types;\r\n}", "function isOmitted()\n\t{\n\t\treturn TRUE;\n\t}", "public function is_valid() {\n return !empty( $this->post ) && YITH_WCBK_Post_Types::$booking === $this->post->post_type;\n }", "function register_post_types(){\n }", "function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None')\n {\n }", "public function hasType() {\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(4);\n }", "function author_can($post, $capability, ...$args)\n {\n }", "public function isRejected()\n {\n return ($this->slug == \"afgekeurd\");\n }", "public function thm_activate_gutenberg_products($can_edit, $post_type){\n\t\tif($post_type == 'product'){\n\t\t\t$can_edit = true;\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}" ]
[ "0.67896366", "0.6612525", "0.65004367", "0.6403442", "0.62800735", "0.62036574", "0.61847836", "0.617316", "0.6090633", "0.607658", "0.5950671", "0.5936027", "0.592412", "0.5903673", "0.588532", "0.5874264", "0.5837858", "0.58304834", "0.5817259", "0.58168757", "0.5784189", "0.5768809", "0.5757138", "0.5741747", "0.573975", "0.5716541", "0.57124114", "0.5707165", "0.56992686", "0.5697036", "0.56681514", "0.56452376", "0.56391025", "0.56385624", "0.56028634", "0.55838245", "0.55820656", "0.55807304", "0.55758744", "0.5547372", "0.5538482", "0.55362546", "0.55255306", "0.55232286", "0.5517605", "0.55077964", "0.5494144", "0.5491379", "0.54818076", "0.5478638", "0.54774594", "0.5472162", "0.5469596", "0.5461417", "0.5456094", "0.5455578", "0.5430591", "0.5417604", "0.53900963", "0.53846335", "0.5383421", "0.53727156", "0.536655", "0.5363626", "0.53554606", "0.53490484", "0.5337836", "0.5337208", "0.53338724", "0.53338724", "0.53315663", "0.53246117", "0.5324001", "0.53238976", "0.5322669", "0.5322054", "0.5321744", "0.531884", "0.531884", "0.531884", "0.53168136", "0.5316397", "0.53155255", "0.53153574", "0.5313952", "0.5312587", "0.5306761", "0.530489", "0.53005964", "0.5298195", "0.5298126", "0.5297593", "0.5295483", "0.52931947", "0.52903646", "0.5289669", "0.5288418", "0.5288215", "0.52877915", "0.5283982" ]
0.6779187
1
Custom post type definition
public static function definition() { $labels = array( 'name' => __( 'Properties', 'inventor-properties' ), 'singular_name' => __( 'Property', 'inventor-properties' ), 'add_new' => __( 'Add New Property', 'inventor-properties' ), 'add_new_item' => __( 'Add New Property', 'inventor-properties' ), 'edit_item' => __( 'Edit Property', 'inventor-properties' ), 'new_item' => __( 'New Property', 'inventor-properties' ), 'all_items' => __( 'Properties', 'inventor-properties' ), 'view_item' => __( 'View Property', 'inventor-properties' ), 'search_items' => __( 'Search Property', 'inventor-properties' ), 'not_found' => __( 'No Properties found', 'inventor-properties' ), 'not_found_in_trash' => __( 'No Properties Found in Trash', 'inventor-properties' ), 'parent_item_colon' => '', 'menu_name' => __( 'Properties', 'inventor-properties' ), 'icon' => apply_filters( 'inventor_listing_type_icon', 'inventor-poi-single-house', 'property' ) ); register_post_type( 'property', array( 'labels' => $labels, 'show_in_menu' => 'listings', 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'author' ), 'has_archive' => true, 'rewrite' => array( 'slug' => _x( 'properties', 'URL slug', 'inventor-properties' ) ), 'public' => true, 'show_ui' => true, 'show_in_rest' => true, 'categories' => array(), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function post_type(){}", "public function registerCustomPostTypes() {\n\n\n }", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "public function create_post_types() {\n }", "public function createPostTypes()\n {\n }", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function add_custom_post_types() {\n //\n }", "public function create_post_type() {\n\t\t\n \t\tregister_post_type(self::POST_TYPE,\n \t\t\tarray(\n \t\t\t\t'labels' => array(\n \t\t\t\t\t'name' => \"Custom\",\n \t\t\t\t\t'singular_name' => __(ucwords(str_replace(\"_\", \" \", self::POST_TYPE)))\n \t\t\t\t),\n \t\t\t\t'public' => true,\n \t\t\t\t'has_archive' => true,\n \t\t\t\t'description' => __(\"This is WP Custom Post Type\"),\n \t\t\t\t'supports' => array('title', 'editor', 'excerpt','thumbnail','custom-fields'),\n \t\t\t)\n \t\t);\n\n\t\t\tregister_taxonomy(\n\t\t\t\t'custom-category',\n\t\t\t\tself::POST_TYPE,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Category' ),\n\t\t\t\t\t'rewrite' => array( 'slug' => 'custom-category' ),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Новости', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Новость', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Новости', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Parent Новость', 'p1atform' ),\n\t\t'all_items' => __( 'Все новости', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть новость', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить новость', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить новость', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать новость', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить новость', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск новости', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'label' => __( 'Отзывы', 'p1atform' ),\n\t\t'description' => __( 'Отзывы', 'p1atform' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields'\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-aside',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'news', $args );\n\n\t$labels = array(\n\t\t'name' => _x( 'Клиенты', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Клиент', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Клиенты', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Парент Клиент', 'p1atform' ),\n\t\t'all_items' => __( 'Все клиенты', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть клиента', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать клиента', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить клиента', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск клиента', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields',\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'clients', $args );\n\n\tregister_post_type( 'reviews', array(\n\t\t'labels' => array(\n\t\t\t'name' => 'Отзывы', // Основное название типа записи\n\t\t\t'singular_name' => 'Отзыв', // отдельное название записи типа Book\n\t\t\t'add_new' => 'Добавить Отзыв',\n\t\t\t'add_new_item' => 'Добавить Отзыв',\n\t\t\t'edit_item' => 'Редактировать Отзыв',\n\t\t\t'new_item' => 'Новая Отзыв',\n\t\t\t'view_item' => 'Посмотреть Отзыв',\n\t\t\t'search_items' => 'Найти Отзыв',\n\t\t\t'not_found' => 'Книг не найдено',\n\t\t\t'not_found_in_trash' => 'В корзине книг не найдено',\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Отзывы'\n\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-chat',\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n\t) );\n\n}", "function rng_create_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Post Types Plural', 'Post Type General Name', 'translate_name' ),\n\t\t'singular_name' => _x( 'Post Type Singular', 'Post Type Singular Name', 'translate_name' ),\n\t\t'menu_name' => __( 'Post Types', 'translate_name' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'translate_name' ),\n\t\t'archives' => __( 'Item Archives', 'translate_name' ),\n\t\t'attributes' => __( 'Item Attributes', 'translate_name' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'translate_name' ),\n\t\t'all_items' => __( 'All Items', 'translate_name' ),\n\t\t'add_new_item' => __( 'Add New Item', 'translate_name' ),\n\t\t'add_new' => __( 'Add New', 'translate_name' ),\n\t\t'new_item' => __( 'New Item', 'translate_name' ),\n\t\t'edit_item' => __( 'Edit Item', 'translate_name' ),\n\t\t'update_item' => __( 'Update Item', 'translate_name' ),\n\t\t'view_item' => __( 'View Item', 'translate_name' ),\n\t\t'view_items' => __( 'View Items', 'translate_name' ),\n\t\t'search_items' => __( 'Search Item', 'translate_name' ),\n\t\t'not_found' => __( 'Not found', 'translate_name' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'translate_name' ),\n\t\t'featured_image' => __( 'Featured Image', 'translate_name' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'translate_name' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'translate_name' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'translate_name' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'translate_name' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'translate_name' ),\n\t\t'items_list' => __( 'Items list', 'translate_name' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'translate_name' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'translate_name' ),\n\t);\n\t$args = array(\n 'public' => true,\n\t\t'label' => __( 'Post Type Singular', 'translate_name' ),\n\t\t'description' => __( 'Post Type Description', 'translate_name' ),\n 'labels' => $labels,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_menu'\t\t\t=> true,\n\t\t'show_in_admin_bar'\t\t=> true,\n\t\t'menu_position'\t\t\t=> 5,\n\t\t// 'menu_icon' \t\t\t=> get_bloginfo('template_directory') . '/images/portfolio-icon.png',\n\t\t'menu_icon'\t\t\t\t=> 'dashicon-groups',\n\t\t'has_archive'\t\t\t=> true,\n\t\t'capability_type'\t\t=> array('book','books'),\n\t\t'capabilities' \t\t\t=> array(\n\t\t\t'edit_post' => 'edit_book', \n\t\t\t'read_post' => 'read_book', \n\t\t\t'delete_post' => 'delete_book', \n\t\t\t'edit_posts' => 'edit_books', \n\t\t\t'edit_others_posts' => 'edit_others_books', \n\t\t\t'publish_posts' => 'publish_books', \n\t\t\t'read_private_posts' => 'read_private_books', \n\t\t\t'create_posts' => 'edit_books', \n\t\t),\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t);\n\tregister_post_type( 'book', $args );\n\n}", "public function customPostType()\n {\n\n if (empty($this->custom_post_types)) {\n return;\n }\n\n foreach ($this->custom_post_types as $post_type) {\n register_post_type(\n $post_type['post_type'],\n [\n 'labels' => [\n 'name' => __($post_type['name'], 'vrcoder'),\n 'singular_name' => __($post_type['singular_name'], 'vrcoder'),\n 'menu_name' => __($post_type['name'], 'vrcoder'),\n 'name_admin_bar' => __($post_type['singular_name'], 'vrcoder'),\n 'archives' => __($post_type['singular_name'] . ' Archives', 'vrcoder'),\n 'attributes' => __($post_type['singular_name'] . ' Attributes', 'vrcoder'), \n 'parent_item_colon' => __('Parent ' . $post_type['singular_name'], 'vrcoder'),\n 'all_items' => __('All ' . $post_type['name'], 'vrcoder'),\n 'add_new_item' => __('Add new ' . $post_type['singular_name'], 'vrcoder'),\n 'add_new' => __('Add new', 'vrcoder'),\n 'new_item' => __('New ' . $post_type['singular_name'], 'vrcoder'),\n 'edit_item' => __('Edit ' . $post_type['singular_name'], 'vrcoder'),\n 'update_item' => __('Update' . $post_type['singular_name'], 'vrcoder'),\n 'view_item' => __('View' . $post_type['singular_name'], 'vrcoder'),\n 'view_items' => __('View' . $post_type['name'], 'vrcoder'),\n 'search_items' => __('Search' . $post_type['name'], 'vrcoder'),\n 'not_found' => __('No' . $post_type['singular_name'] . ' Found', 'vrcoder'),\n 'not_found_in_trash' => __('No' . $post_type['singular_name'] . ' Found in Trash', 'vrcoder'),\n 'featured_image' => __('Featured Image', 'vrcoder'),\n 'set_featured_image' => __('Set Featured Image', 'vrcoder'),\n 'remove_featured_image' => __('Remove Featured Image', 'vrcoder'),\n 'use_featured_image' => __('Use Featured Image', 'vrcoder'),\n 'insert_into_item' => __('Insert into' . $post_type['singular_name'], 'vrcoder'),\n 'uploaded_to_this_item' => __('Upload to this' . $post_type['singular_name'], 'vrcoder'),\n 'items_list' => __($post_type['name'] . ' List', 'vrcoder'),\n 'items_list_navigation' => __($post_type['name'] . ' List Navigation', 'vrcoder'),\n 'filter_items_list' => __('Filter' . $post_type['name'] . ' List', 'vrcoder'),\n ],\n 'label' => __($post_type['singular_name'], 'vrcoder'),\n 'description' => __($post_type['name'] . ' Custom Post Type', 'vrcoder'),\n 'supports' => $post_type['supports'],\n 'show_in_rest' => $post_type['show_in_rest'],\n 'taxonomies' => $post_type['taxonomies'],\n 'hierarchical' => $post_type['hierarchical'],\n 'public' => $post_type['public'],\n 'show_ui' => $post_type['show_ui'],\n 'show_in_menu' => $post_type['show_in_menu'],\n 'menu_position' => $post_type['menu_position'],\n 'show_in_admin_bar' => $post_type['show_in_admin_bar'],\n 'show_in_nav_menus' => $post_type['show_in_nav_menus'],\n 'can_export' => $post_type['can_export'],\n 'has_archive' => $post_type['has_archive'],\n 'exclude_from_search' => $post_type['exclude_from_search'],\n 'publicly_queryable' => $post_type['publicly_queryable'],\n 'capability_type' => $post_type['capability_type'],\n 'menu_icon' => $post_type['menu_icon']\n ]\n );\n }\n\n }", "abstract protected function post_type();", "function custom_post_type() {\n\t$labels = array(\n\t\t'name' => __( 'Post', 'themeSlug' ),\n\t\t'singular_name' => __( 'Post', 'themeSlug' ),\n\t\t'menu_name' => __( 'Post', 'themeSlug' ),\n\t\t'all_items' => __( 'All Post', 'themeSlug' ),\n\t\t'add_new' => __( 'Add New', 'themeSlug' ),\n\t\t'add_new_item' => __( 'Add New Post', 'themeSlug' ),\n\t\t'edit_item' => __( 'Edit Post', 'themeSlug' ),\n\t\t'new_item' => __( 'New Item', 'themeSlug' ),\n\t\t'view_item' => __( 'View Post', 'themeSlug' ),\n\t\t'search_items' => __( 'Search Post', 'themeSlug' ),\n\t\t'not_found' => __( 'No Post Found', 'themeSlug' ),\n\t\t'not_found_in_trash' => __( 'No Post in trash', 'themeSlug' ),\n\t\t'parent_item_colon' => __( 'Parent Post', 'themeSlug' ),\n\t\t'archives' => __( 'Post Archives', 'themeSlug' ),\n\t\t'insert_into_item' => __( 'Insert into Post', 'themeSlug' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Post', 'themeSlug' ),\n\t\t'filter_items_list' => __( 'Filter Post List', 'themeSlug' ),\n\t\t'items_list_navigation' => __( 'Post list navigation', 'themeSlug' ),\n\t\t'items_list' => __( 'Post List', 'themeSlug' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Post', 'text_domain' ),\n\t\t'description' => __( 'Post', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'publicly_queryable' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_rest' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-format-status',\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t'rewrite' => array(\n\t\t\t'slug' => 'cpt',\n\t\t\t'with_front' => true,\n\t\t),\n\t);\n\n\tregister_post_type( 'cpt', $args );\n}", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Departamentos'),\n\t\t\t'singular_name' => __( 'Departamento' ),\n\t\t\t'add_new' => __('Añadir nuevo'),\n\t\t\t'add_new_item' => __('Añadir nuevo Departamento'),\n\t\t\t'edit_item' => __('Editar Departamento'),\n\t\t\t'new_item' => __('Nuevo Departamento'),\n\t\t\t'view_item' => __('Ver Departamento'),\n\t\t\t'search_items' => __('Buscar'),\n\t\t\t'not_found' => __('No se encontraron Departamentos'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Departamentos en la Papelera'), \n\t\t\t'parent_item_colon' => ''\n\t\t );\n\t\t \n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true, \n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => true,\n\t\t 'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t 'show_in_menu' => 'bn_config',\n\t\t\t'menu_position' => 57,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'excerpt', 'page-attributes') //,'editor'\n\t\t );\n\t\t \n\t\t register_post_type(__( $this->post_type ), $args);\n\t}", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function carbon_register_post_type($settings){\n\n $labels = array(\n 'name' => _x($settings['plural'],'post type plural name','carbon'),\n 'singular_name' => _x($settings['singular'],'post type singular name','carbon'),\n 'add_new' => _x('Add New',$settings['singular'],'carbon'),\n 'add_new_item' => __('Add New ' .$settings['singular']),\n 'edit_item' => __('Edit ' .$settings['singular']),\n 'new_item' => __('New ' .$settings['singular']),\n 'all_items' => __('All ' .$settings['plural']),\n 'view_item' => __('View ' .$settings['singular']),\n 'search_items' => __('Search ' .$settings['plural']),\n 'not_found' => __('No ' .$settings['plural'].' found'),\n 'not_found_in_trash' => __('No ' .$settings['plural'].' found in Trash'),\n 'parent_item_colon' => ':',\n 'menu_name' => $settings['plural'],\n );\n\n $args = array(\n 'labels' => $labels,\n 'can_export' => (isset($settings['can_export']) ? $settings['can_export'] : true), // defaults true\n 'capability_type' => (isset($settings['capability_type']) ? $settings['behavior'] : 'post'), // default post\n // 'capabilities' // default capability_type\n 'exclude_from_search' => (isset($settings['exclude_from_search']) ? $settings['exclude_from_search'] : false), // default opposite of public\n 'hierarchical' => (isset($settings['hierarchical']) ? $settings['hierarchical'] : false), // default false\n 'has_archive' => (isset($settings['has_archive']) ? $settings['has_archive'] : false), // default false\n // 'permalink_epmask' // default EP_PERMALINK\n 'public' => (isset($settings['public']) ? $settings['public'] : true), // default false\n 'publicly_queryable' => (isset($settings['publicly_queryable']) ? $settings['publicly_queryable'] : true), // default public\n 'query_var' => (isset($settings['query_var']) ? $settings['query_var'] : true), // default true type\n 'show_ui' => (isset($settings['show_ui']) ? $settings['show_ui'] : true), // default public\n 'show_in_menu' => (isset($settings['show_in_menu']) ? $settings['show_in_menu'] : true), // default public\n 'show_in_admin_bar' => (isset($settings['show_in_admin_bar']) ? $settings['show_in_admin_bar'] : true), // default show_in_menu\n 'menu_position' => (isset($settings['menu_position']) ? $settings['menu_position'] : null), // default null\n 'menu_icon' => (isset($settings['menu_icon']) ? $settings['menu_icon'] : 'dashicons-admin-post'),\n 'supports' => (isset($settings['supports']) ? $settings['supports'] : array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes')), // default title editor\n 'taxonomies' => (isset($settings['taxonomies']) ? $settings['taxonomies'] : array()), // default none\n // 'register_meta_box_cb' // default none\n 'rewrite' => (isset($settings['rewrite']) ? $settings['rewrite'] : array( // default true name\n 'slug' => (isset($settings['slug']) ? $settings['slug'] : $settings['type']), // default type\n 'with_front' => (isset($settings['with_front']) ? $settings['with_front'] : false), // default true\n 'feeds' => (isset($settings['feeds']) ? $settings['feeds'] : false), // default has_archive\n 'pages' => (isset($settings['pages']) ? $settings['pages'] : true), // defaults true\n // 'ep_mask' // default permalink_epmask EP_PERMALINK\n )),\n );\n register_post_type($settings['type'], $args);\n }", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "public function register_post_types() {\n\n\t}", "public static function register_type() {\n\t\tregister_graphql_object_type(\n\t\t\t'PostTypeLabelDetails',\n\t\t\t[\n\t\t\t\t'description' => __( 'Details for labels of the PostType', 'wp-graphql' ),\n\t\t\t\t'fields' => [\n\t\t\t\t\t'name' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'General name for the post type, usually plural.', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'singularName' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Name for one object of this post type.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->singular_name ) ? $labels->singular_name : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'addNew' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Default is ‘Add New’ for both hierarchical and non-hierarchical types.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->add_new ) ? $labels->add_new : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'addNewItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for adding a new singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->add_new_item ) ? $labels->add_new_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'editItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for editing a singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->edit_item ) ? $labels->edit_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'newItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the new item page title.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->new_item ) ? $labels->new_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'viewItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for viewing a singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->view_item ) ? $labels->view_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'viewItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for viewing post type archives.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->view_items ) ? $labels->view_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'searchItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for searching plural items.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->search_items ) ? $labels->search_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'notFound' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used when no items are found.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->not_found ) ? $labels->not_found : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'notFoundInTrash' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used when no items are in the trash.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->not_found_in_trash ) ? $labels->not_found_in_trash : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'parentItemColon' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used to prefix parents of hierarchical items.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->parent_item_colon ) ? $labels->parent_item_colon : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'allItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label to signify all items in a submenu link.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->all_items ) ? $labels->all_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'archives' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for archives in nav menus', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the attributes meta box.', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'insertIntoItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the media frame button.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->insert_into_item ) ? $labels->insert_into_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'uploadedToThisItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the media frame filter.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->uploaded_to_this_item ) ? $labels->uploaded_to_this_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'featuredImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the Featured Image meta box title.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->featured_image ) ? $labels->featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'setFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for setting the featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->set_featured_image ) ? $labels->set_featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'removeFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for removing the featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->remove_featured_image ) ? $labels->remove_featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'useFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label in the media frame for using a featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->use_featured_item ) ? $labels->use_featured_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'menuName' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the menu name.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->menu_name ) ? $labels->menu_name : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'filterItemsList' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table views hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->filter_items_list ) ? $labels->filter_items_list : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'itemsListNavigation' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table pagination hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->items_list_navigation ) ? $labels->items_list_navigation : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'itemsList' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->items_list ) ? $labels->items_list : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "public static function register_post_types() {}", "function register_post_types(){\n }", "function create_posttype() {\n $labels = array(\n 'name' => _x( 'NPosts', 'Post Type General Name'),\n 'singular_name' => _x( 'NPost', 'Post Type Singular Name'),\n 'menu_name' => __( 'NPosts'),\n 'parent_item_colon' => __( 'Parent NPost'),\n 'all_items' => __( 'All NPosts'),\n 'view_item' => __( 'View NPost'),\n 'add_new_item' => __( 'Add New NPost'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit NPost'),\n 'update_item' => __( 'Update NPost'),\n 'search_items' => __( 'Search NPost'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n \n// Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'nposts'),\n 'description' => __( 'NPost news and reviews'),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n // 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n \n // Registering your Custom Post Type\n register_post_type( 'npost', $args );\n \n}", "function register_post_types(){\n }", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function register_post_types()\n {\n }", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "public static function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Collections', 'post type general name', 'wp-recipe-maker-premium' ),\n\t\t\t'singular_name' => _x( 'Collection', 'post type singular name', 'wp-recipe-maker-premium' ),\n\t\t);\n\n\t\t$args = apply_filters( 'wprm_recipe_collections_post_type_arguments', array(\n\t\t\t'labels' \t=> $labels,\n\t\t\t'public' \t=> false,\n\t\t\t'rewrite' \t=> false,\n\t\t\t'capability_type' \t=> 'post',\n\t\t\t'query_var' \t=> false,\n\t\t\t'has_archive' \t=> false,\n\t\t\t'supports' \t\t\t\t=> array( 'title', 'author' ),\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'rest_base'\t\t\t\t=> WPRMPRC_POST_TYPE,\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t));\n\n\t\tregister_post_type( WPRMPRC_POST_TYPE, $args );\n\t}", "public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }", "function create_post_type() {\n\t// register custom post type\n\tregister_post_type( 'sub_post',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( ' Sub Posts ' ),\n\t\t\t\t'singular_name' => __( 'Sub Post' ),\n\t\t\t\t'add_new_item' => __( 'Add New Sub Post' ),\n\t\t\t\t'edit_item' => __( 'Edit Sub Post' ),\n\t\t\t\t'new_item' => __( 'New Sub Post' ),\n\t\t\t\t'view' => __( 'View Sub Post' ),\n\t\t\t\t'view_item' => __( 'View Sub Post' ),\n\t\t\t\t'search_items' => __( 'Search Sub Post' ),\n\t\t\t\t'not_found' => __( 'No Sub Posts found' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Sub Posts found in Trash' ),\n\t\t\t\t'parent' => __( 'Parent Article' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', 'comments' ),\n\t\t\t'taxonomies' => array('category','post_tag'),\n\t\t)\n\t);\n\n\t// register custom taxonomy\n\n}", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "function create_posttype() \n {\n register_post_type( 'mist_employee',\n array(\n 'labels' => array(\n 'name' => __( 'Employees' ),\n 'singular_name' => __( 'Employee' )\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'employees'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-businessman'\n )\n );\n register_post_type( 'mist_message',\n array(\n 'labels' => array(\n 'name' => __( 'Person Messages' ),\n 'singular_name' => __( 'Message' ),\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'message'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-testimonial'\n )\n );\n add_post_type_support('mist_message', 'excerpt');\n \n }", "function press_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Press', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Press', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Press'),\n\t\t'all_items' => __( 'All Press'),\n\t\t'view_item' => __( 'View Press'),\n\t\t'add_new_item' => __( 'Add New Press'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Press'),\n\t\t'update_item' => __( 'Update Press')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'press'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"press\"),\n 'register_meta_box_cb' => 'add_press_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'press', $args );\n\n}", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public function create_post_type() {\n\n\t\t\t$this->register_post_type( array(\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'menu_position' => 6.9,\n\t\t\t\t'menu_icon' => 'dashicons-book-alt',\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => 'manuals',\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'show_in_rest' => true,\n\t\t\t) );\n\n\t\t\tnew WPS\\Schema\\Entry_Schema( $this->post_type, 'book' );\n\n\t\t}", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Engagements', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Engagement', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Engagements'),\n\t\t'all_items' => __( 'All Engagements'),\n\t\t'view_item' => __( 'View Engagement'),\n\t\t'add_new_item' => __( 'Add New Engagement'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Engagement'),\n\t\t'update_item' => __( 'Update Engagement')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'engagements'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"engagements\"),\n 'register_meta_box_cb' => 'add_engagements_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'engagements', $args );\n\n}", "function ks_create_post_type() {\n\tregister_post_type( 'image-entry',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Comp. Entries', 'kilpailusivu' ),\n\t\t\t\t'singular_name' => __( 'Entry', 'kilpailusivu' ),\n\t\t\t\t'add_new' => __( 'Add New', 'kilpailusivu' ),\n\t\t\t\t'add_new_item' => __( 'Add New Entry', 'kilpailusivu' ),\n\t\t\t\t'edit' => __( 'Edit', 'kilpailusivu' ),\n\t\t\t\t'edit_item' => __( 'Edit Entry', 'kilpailusivu' ),\n\t\t\t\t'new_item' => __( 'New Entry', 'kilpailusivu' ),\n\t\t\t\t'view' => __( 'View', 'kilpailusivu' ),\n\t\t\t\t'view_item' => __( 'View Entry', 'kilpailusivu' ),\n\t\t\t\t'search_items' => __( 'Search Entries', 'kilpailusivu' ),\n\t\t\t\t'not_found' => __( 'No Entries found', 'kilpailusivu' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Entries found in Trash', 'kilpailusivu' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t),\n\t\t\t'menu_icon' => 'dashicons-smiley',\n\t\t\t'can_export' => true,\n\t\t\t'taxonomies' => array()\n\t\t) );\n}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Ort', 'Post Type General Name', 'twentythirteen' ),\n 'singular_name' => _x( 'Ort', 'Post Type Singular Name', 'twentythirteen' ),\n 'menu_name' => __( 'Orter', 'twentythirteen' ),\n 'all_items' => __( 'Alla Orter', 'twentythirteen' ),\n 'view_item' => __( 'View Ort', 'twentythirteen' ),\n 'add_new_item' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'add_new' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'edit_item' => __( 'Redigera Ort', 'twentythirteen' ),\n 'update_item' => __( 'Upddatera Ort', 'twentythirteen' ),\n 'search_items' => __( 'Sök Ort', 'twentythirteen' ),\n 'not_found' => __( 'Not Found', 'twentythirteen' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),\n );\n \n $args = array(\n 'label' => __( 'cities', 'twentythirteen' ),\n 'description' => __( 'City Post Page', 'twentythirteen' ),\n 'labels' => $labels,\n 'supports' => array('title','thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n register_post_type( 'cities', $args );\n\n }", "public function create_post_type() {\n\n register_post_type( self::POST_TYPE,\n array(\n\n 'labels' => array(\n 'name' => __( 'Fundraisers' ),\n 'singular_name' => __( 'Fundraiser' )\n ),\n 'description' => 'Fundraisers that allow users to purchase items through the WooCommerce Stores',\n 'menu_icon' => 'dashicons-chart-line',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt',\n 'revisions' ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array(\n 'slug' => __( 'fundraisers' ),\n 'with_front' => false\n )\n )\n );\n }", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "function custom_post_type() {\n // Set other options for Custom Post Type\n $args = array(\n 'label' => __( 'Child Care', 'AOK' ),\n 'description' => __( 'Child Care', 'AOK' ),\n 'labels' => $labels,\n // Features in Post Editor\n 'supports' => array( 'title', 'author', 'comments' ),\n // Taxonomies or custom taxonomy.\n //'taxonomies' => array( 'categories' ),\n /* A hierarchical CPT is like Pages and can have\n* Parent and child items. A non-hierarchical CPT\n* is like Posts.\n*/\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n /*\n$args2 = array(\n'label' => __( 'Public Profile', 'AOK' ),\n'description' => __( 'Public Profile', 'AOK' ),\n'labels' => $labels,\n// Features in Post Editor\n'supports' => false,\n// Taxonomies or custom taxonomy.\n//'taxonomies' => array( 'categories' ),\n// A hierarchical CPT is like Pages and can have\n// Parent and child items. A non-hierarchical CPT\n// is like Posts.\n\n'hierarchical' => false,\n'public' => true,\n'show_ui' => true,\n'show_in_menu' => true,\n'show_in_nav_menus' => true,\n'show_in_admin_bar' => true,\n'menu_position' => 3,\n'can_export' => true,\n'has_archive' => true,\n'exclude_from_search' => false,\n'publicly_queryable' => true,\n'capability_type' => 'post',\n);\n*/\n // Registering Custom Post Type\n register_post_type( 'child_care', $args );\n //register_post_type( 'profile', $args2 );\n}", "function create_post_type() {\n\t\tregister_post_type(\n\t\t 'project',\n\t\t array(\n\t\t 'label' => 'Projects',\n\t\t 'labels' => array(\n\t\t 'name' => 'Projects',\n\t\t 'singular_name' => 'Project',\n\t\t 'all_items' => 'All projects',\n\t\t 'add_new_item' => 'Add a project',\n\t\t 'edit_item' => 'Edit project',\n\t\t 'new_item' => 'New project',\n\t\t 'view_item' => 'See project',\n\t\t 'search_items' => 'Search project',\n\t\t 'not_found' => 'No project found',\n\t\t 'not_found_in_trash'=> 'No project in the trash'\n\t\t ),\n\t\t 'public' => true,\n\t\t // 'capability_type' => 'post',\n\t\t 'supports' => array(\n\t\t 'title',\n\t\t 'editor',\n\t\t 'thumbnail'\n\t\t ),\n\t\t 'has_archive' => true,\n\t\t\t'menu_icon' => 'dashicons-welcome-add-page'\n\t\t )\n\t\t);\n\t}", "public static function createPostType() {\n $plural = 'Travel Cards';\n $singular = 'Travel Card';\n $p_lower = strtolower($plural);\n $s_lower = strtolower($singular);\n\n $labels = [\n 'name' => $plural,\n 'singular_name' => $singular,\n 'add_new_item' => \"New $singular\",\n 'edit_item' => \"Edit $singular\",\n 'view_item' => \"View $singular\",\n 'view_items' => \"View $plural\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $p_lower found\",\n 'not_found_in_trash' => \"No $p_lower found in trash\",\n 'parent_item_colon' => \"Parent $singular\",\n 'all_items' => \"All $plural\",\n 'archives' => \"$singular Archives\",\n 'attributes' => \"$singular Attributes\",\n 'insert_into_item' => \"Insert into $s_lower\",\n 'uploaded_to_this_item' => \"Uploaded to this $s_lower\",\n ];\n\n $supports = ['title', 'editor', 'thumbnail', 'excerpt'];\n\n register_post_type( 'travelcard',\n array(\n 'rewrite' => ['slug' => 'travelcard'],\n 'taxonomies' => array('card_category', 'card_tag'),\n 'register_meta_box_cb' => [self::class, 'addMetaBox'],\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-id',\n 'supports' => $supports,\n 'capability_type' => array('travelcard', 'travelcards'),\n 'map_meta_cap' => false,\n 'exclude_from_search' => true,\n )\n );\n }", "function init_post_type() {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Unit', 'Post Type General Name', 'wppm' ),\n\t\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'wppm' ),\n\t\t\t'menu_name' => __( 'Units', 'wppm' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'wppm' ),\n\t\t\t'all_items' => __( 'All Units', 'wppm' ),\n\t\t\t'view_item' => __( 'View Unit', 'wppm' ),\n\t\t\t'add_new_item' => __( 'Add New Unit', 'wppm' ),\n\t\t\t'add_new' => __( 'Add New', 'wppm' ),\n\t\t\t'edit_item' => __( 'Edit Unit', 'wppm' ),\n\t\t\t'update_item' => __( 'Update Unit', 'wppm' ),\n\t\t\t'search_items' => __( 'Search Units', 'wppm' ),\n\t\t\t'not_found' => __( 'Not found', 'wppm' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'wppm' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( 'units', 'wppm' ),\n\t\t\t'description' => __( 'Units', 'wppm' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'thumbnail', ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t//'menu_icon' => '',\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'capability_type' => 'post',\n\t\t);\n\t\tregister_post_type( 'units', $args );\n\t\tflush_rewrite_rules();\n\t\t\n\t\tadd_image_size( 'tiles-featured', 225, 225, true );\n\t\tadd_image_size( 'mini-tiles', 80, 55, true );\n\t}", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "function bs_configure_custom_post_types($args)\n{\n function bs_custom_post_types()\n {\n global $bs_config;\n\n foreach ($bs_config[\"custom-post-types\"] as $key => $type) {\n $type = bs_defaults($type, [\n \"public\" => true,\n ]);\n\n if (isset($type[\"name\"])) {\n $type[\"labels\"][\"name\"] = $type[\"name\"];\n }\n\n if (isset($type[\"slug\"])) {\n $type[\"rewrite\"][\"slug\"] = $type[\"slug\"];\n }\n\n if (isset($type[\"admin_only\"]) && $type[\"admin_only\"]) {\n $type[\"public\"] = false;\n $type[\"show_ui\"] = true;\n }\n\n register_post_type($key, bs_array_omit($type, [\"slug\", \"name\", \"admin_only\"]));\n }\n }\n add_action(\"init\", \"bs_custom_post_types\");\n}", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function medarbejder_custom_post_type() {\n $labels = array(\n 'name' => _x( 'Medarbejdere', 'Post Type General Name', 'webstarters' ),\n 'singular_name' => _x( 'Medarbejder', 'Post Type Singular Name', 'webstarters' ),\n 'menu_name' => __( 'Medarbejdere', 'webstarters' ),\n 'parent_item_colon' => __( 'Forældre medarbejder', 'webstarters' ),\n 'all_items' => __( 'Alle medarbejdere', 'webstarters' ),\n 'view_item' => __( 'Se medarbejder', 'webstarters' ),\n 'add_new_item' => __( 'Tilføj ny medarbejder', 'webstarters' ),\n 'add_new' => __( 'Tilføj ny medarbejder', 'webstarters' ),\n 'edit_item' => __( 'Redigere medarbejder', 'webstarters' ),\n 'update_item' => __( 'Opdatere medarbejder', 'webstarters' ),\n 'search_items' => __( 'Søg efter medarbejder', 'webstarters' ),\n 'not_found' => __( 'Not Found', 'webstarters' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'webstarters' ),\n );\n\n// Set other options for Custom Post Type\n\n $args = array(\n 'label' => __( 'medarbejder', 'webstarters' ),\n 'description' => __( 'Custom post type til byggegrunde', 'webstarters' ),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'thumbnail', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy.\n 'taxonomies' => array(),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */\n 'hierarchical' => false,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => false,\n 'exclude_from_search' => false,\n 'publicly_queryable' => false,\n 'capability_type' => 'page',\n );\n\n // Registering your Custom Post Type\n register_post_type( 'medarbejder', $args );\n\n}", "function wpcpolls_custom_post_type() {\n $labels = array(\n 'name' => _x( 'Polls', 'Post Type General Name', 'wordpress-custom-polls' ),\n 'singular_name' => _x( 'Poll', 'Post Type Singular Name', 'wordpress-custom-polls' ),\n 'menu_name' => __( 'Polls', 'wordpress-custom-polls' ),\n 'name_admin_bar' => __( 'Polls', 'wordpress-custom-polls' ),\n 'archives' => __( 'Poll Archives', 'wordpress-custom-polls' ),\n 'attributes' => __( 'Poll Attributes', 'wordpress-custom-polls' ),\n 'parent_item_colon' => __( 'Parent Poll:', 'wordpress-custom-polls' ),\n 'all_items' => __( 'All Polls', 'wordpress-custom-polls' ),\n 'add_new_item' => __( 'Add New Poll', 'wordpress-custom-polls' ),\n 'add_new' => __( 'Add New', 'wordpress-custom-polls' ),\n 'new_item' => __( 'New Poll', 'wordpress-custom-polls' ),\n 'edit_item' => __( 'Edit Poll', 'wordpress-custom-polls' ),\n 'update_item' => __( 'Update Poll', 'wordpress-custom-polls' ),\n 'view_item' => __( 'View Poll', 'wordpress-custom-polls' ),\n 'view_items' => __( 'View Polls', 'wordpress-custom-polls' ),\n 'search_items' => __( 'Search Poll', 'wordpress-custom-polls' ),\n 'not_found' => __( 'Not found', 'wordpress-custom-polls' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'wordpress-custom-polls' ),\n 'featured_image' => __( 'Featured Image', 'wordpress-custom-polls' ),\n 'set_featured_image' => __( 'Set featured image', 'wordpress-custom-polls' ),\n 'remove_featured_image' => __( 'Remove featured image', 'wordpress-custom-polls' ),\n 'use_featured_image' => __( 'Use as featured image', 'wordpress-custom-polls' ),\n 'insert_into_item' => __( 'Insert into Poll', 'wordpress-custom-polls' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this Poll', 'wordpress-custom-polls' ),\n 'items_list' => __( 'Polls list', 'wordpress-custom-polls' ),\n 'items_list_navigation' => __( 'Polls list navigation', 'wordpress-custom-polls' ),\n 'filter_items_list' => __( 'Filter Polls list', 'wordpress-custom-polls' ),\n );\n $args = array(\n 'label' => __( 'Poll', 'wordpress-custom-polls' ),\n 'description' => __( 'Custom Polls', 'wordpress-custom-polls' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => false,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-list-view',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => false,\n 'rewrite' => array('slug' => 'wpcpolls_polls'),\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'show_in_rest' => true,\n );\n\n register_post_type( 'wpcpolls_polls', $args );\n}", "public function __construct()\n\t{\n\t\t$this->type('post');\n\t}", "function create_post_type(){\n register_post_type('recipes', [ \n 'labels' => [\n 'name' => 'Recipes', //Etikett i plural Etikett i singular\n 'singular_name' => 'Recipe', //Vad som ska stå i ”Lägg till...” knappen\n 'add_new' => 'New Recipe', //Vad som ska stå i ”Lägg till ny...” knappen\n 'add_new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'edit_item' => 'Edit Recipe', //Vad som ska stå i ”Redigera...” länken\n 'new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'search_items' => 'Search for Recipe', //Vad som ska stå i sökrutan i listningen\n 'not_found' => 'No Recipe Found', \n 'all_items' => 'All Recipes', //Vad som ska stå i ”Alla...” länken\n ],\n 'supports' => array( 'thumbnail' ),\n 'description' => 'The Big Tasty!', //En kort beskrivning av posttypen\n 'public' => true, //Om och hur posttypen ska visas för olika användare\n 'exclude_from_search' => false, //Om posttypens poster ska exkluderas vid sökning\n 'show_ui' => true, //Om posttypen ska kunna hanteras från admin\n 'show_in_nav_menus' => true, //Om poster av posttypen ska kunna läggas till i menyer\n 'show_in_menu' => true, //Vart posttypen ska listas i admin (vänster eller topp)\n 'show_in_admin_bar' => true, //Om posttypen ska visas i toppbar’en\n 'menu_position' => 10, //Vart i vänstermenyn posttypen ska visas\n 'hierarchical' => false, //Om poster i posttypen ska kunna ha föräldrar, likt Sidor\n 'menu_icon' => 'dashicons-food', //Ikon för posttypen\n 'supports' => array('title' , 'editor'), //Vad som ska synas när man skapar/redigerar en post \n 'taxonomies' => array('category'), //Vilka taxonomier som ska tillhöra posttypen\n 'has_archive' => true, //Om posttypen ska ha arkivsida\n 'rewrite' => [ //Hur posttypens rewrites ska hanteras...\n 'slug' => 'recipe', //Permalänkstrukturen för posttypen\n 'with_front' => true //Om permalänkarna ska låta föregås av sluggen\n ] \n ]);\n\n}", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public static function registerWPPostType()\n {\n register_post_type\n (\n 'fs_feed_entry',\n array\n (\n 'label' => 'Feed Entries',\n 'labels' => array\n (\n 'name' => 'Feed Entries',\n 'singular_name' => 'Feed Entry',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Feed Entry',\n 'edit_item' => 'Edit Feed Entry',\n 'new_item' => 'New Feed Entry',\n 'view_item' => 'View Feed Entry',\n 'search_items' => 'Search Feed Entries',\n 'not_found' => 'No Feed Entries Found',\n 'not_found_in_trash' => 'No Feed Entries Found In Trash',\n 'parent_item_colon' => 'Parent Feed Entries:',\n 'edit' => 'Edit',\n 'view' => 'View Feed Entry'\n ),\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function create_custom_post_types(){\n\t/**\n\t * Arguments for company labels\n\t */\n\t$args_labels_company = array(\n\t\t'name' => __('Companies', 'threedee-expo'),\n\t\t'singular_name' => __('Company', 'threedee-expo'),\n\t\t'add_new_item' => __('Add New Company', 'threedee-expo'),\n\t\t'edit_item' => __('Edit Company', 'threedee-expo'),\n\t\t'new_item' => __('New Company', 'threedee-expo'),\n\t\t'view_item' => __('View Company', 'threedee-expo'),\n\t\t'search_items' => __('Search Companies', 'threedee-expo'),\n\t\t'not_found' => __('No companies found', 'threedee-expo'),\n\t\t'not_found_in_trash'=> __('No companies found in Trash', 'threedee-expo'),\n\t\t'all_items' => __('All Companies', 'threedee-expo'),\n\t\t'archives' => __('Company Archives', 'threedee-expo'),\n\t);\n\t/**\n\t * Arguments for company capabilities\n\t */\n\t$args_capabilities_company = array(\n\t\t'publish_posts' => 'publish_companies',\n\t\t'edit_posts' => 'edit_companies',\n\t\t'edit_others_posts' => 'edit_others_companies',\n\t\t'delete_posts' => 'delete_companies',\n\t\t'delete_others_posts' => 'delete_others_companies',\n\t\t'read_private_posts' => 'read_private_companies',\n\t\t'edit_post' => 'edit_company',\n\t\t'delete_post' => 'delete_company',\n\t\t'read_post' => 'read_company',\n\t);\n\t/**\n\t * Arguments for register companies\n\t */\n\t$args_company = array(\n\t\t'labels' => $args_labels_company,\n\t\t'description' => 'Companies.',\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t => array('slug' => 'company'),\n\t\t'menu_icon' => 'dashicons-businessman',\n\t\t'capability_type' => 'companies',\n\t\t'capabilities' => $args_capabilities_company,\n\t\t'map_meta_cap' => true,\n\t\t'supports' => array('author','title')\n\t);\n\t/**\n\t * Arguments for company labels\n\t */\n\t$args_labels_group_of_companies = array(\n\t\t'name' => __('Group of Companies', 'threedee-expo'),\n\t\t'singular_name' => __('Group of Company', 'threedee-expo'),\n\t\t'add_new_item' => __('Add New Group of Companies', 'threedee-expo'),\n\t\t'edit_item' => __('Edit Group of Companies', 'threedee-expo'),\n\t\t'new_item' => __('New Group of Companies', 'threedee-expo'),\n\t\t'view_item' => __('View Group of Companies', 'threedee-expo'),\n\t\t'search_items' => __('Search Group of Companies', 'threedee-expo'),\n\t\t'not_found' => __('No Group of Companies found', 'threedee-expo'),\n\t\t'not_found_in_trash'=> __('No Group of Companies found in Trash', 'threedee-expo'),\n\t\t'all_items' => __('All Group of Companies', 'threedee-expo'),\n\t\t'archives' => __('Group of Companies Archives', 'threedee-expo'),\n\t);\n\t/**\n\t * Arguments for company capabilities\n\t */\n\t$args_capabilities_group_of_companies = array(\n\t\t'publish_posts' => 'publish_group_of_companies',\n\t\t'edit_posts' => 'edit_group_of_companies',\n\t\t'edit_others_posts' => 'edit_others_group_of_companies',\n\t\t'delete_posts' => 'delete_group_of_companies',\n\t\t'delete_others_posts' => 'delete_others_group_of_companies',\n\t\t'read_private_posts' => 'read_private_group_of_companies',\n\t\t'edit_post' => 'edit_group_of_company',\n\t\t'delete_post' => 'delete_group_of_company',\n\t\t'read_post' => 'read_group_of_company',\n\t);\n\t/**\n\t * Arguments for register companies\n\t */\n\t$args_group_of_companies = array(\n\t\t'labels' => $args_labels_group_of_companies,\n\t\t'description' => 'Group of Companies.',\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t => array('slug' => 'group_of_companies'),\n\t\t'menu_icon' => 'dashicons-groups',\n\t\t'capability_type' => 'group_of_companies',\n\t\t'capabilities' => $args_capabilities_group_of_companies,\n\t\t'map_meta_cap' => true,\n\t\t'supports' => array('author','title')\n\t);\n\tregister_post_type( 'companies', $args_company);\n\tregister_post_type( 'group_of_companies',$args_group_of_companies);\n}", "static function register_post_type() {\n\n $args = array(\n 'labels' => array(\n\t\t'name' => __( 'Forms', 'pwp' ),\n\t\t'singular_name' => __( 'Form', 'pwp' ),\n\t\t'add_new' => __( 'Add New', 'pwp' ),\n\t\t'add_new_item' => __( 'Add New Form', 'pwp' ),\n\t\t'edit_item' => __( 'Edit Form', 'pwp' ),\n\t\t'new_item' => __( 'New Form', 'pwp' ),\n\t\t'all_items' => __( 'All Forms', 'pwp' ),\n\t\t'view_item' => __( 'View Form', 'pwp' ),\n\t\t'search_items' => __( 'Search Forms', 'pwp' ),\n\t\t'not_found' => __( 'No forms found', 'pwp' ),\n\t\t'not_found_in_trash' => __( 'No forms found in Trash', 'pwp' ),\n\t\t'parent_item_colon' => __( ':', 'pwp' ),\n\t\t'menu_name' => __( 'Forms', 'pwp' )\n\t ),\n 'public' => false,\n 'show_ui' => true,\n 'query_var' => false,\n 'supports' => array( 'title', 'custom-fields', 'editor' )\n );\n\tregister_post_type( 'form', $args );\n }", "function add_my_custom_posttype_recepten(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuw recept toe',\n 'add_new_item' => 'Voeg nieuw recept toe',\n 'name' => 'Recepten',\n 'singular_name' => 'recept',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'Lactosevrije recepten van B & J',\n 'public' => true,\n 'menu_position' => 4,\n 'menu_icon' => 'dashicons-book-alt', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes', 'comments'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-recepten.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n\n );\n\n register_post_type( 'recepten', $args ); \n \n }", "function katayam_custom_post_type(){\r\n\t$labels=array(\r\n\t'name'=>'Portfolio',\r\n\t'singular_name'=>'Portfolio',\r\n\t'add_new'=>'Add Portfolio word',\r\n\t'all_items'=>'All Items',\r\n\t'add_new_item'=>'Add Item',\r\n\t'edit_item'=>'Edit Item',\r\n\t'new_item'=>'New Item',\r\n\t'view_item'=>'View Item',\r\n\t'search_item'=>'Search Portfolio',\r\n\t'not_found'=>'No Item Found',\r\n\t'not_found_in_trash'=>'No Item Fount In Trash',\r\n\t'parent_item_colon'=>'Parent Item'\r\n\t);\t\r\n$args=array(\r\n'labels'=>$labels,\r\n'public'=>true,\r\n'has_archive'=>true,\r\n'publicly_queryable'=>true,\r\n'query_var'=>true,\r\n'rewrite'=>true,\r\n'capability_type'=>'post',\r\n'hierarchical'=>false,\r\n'supports'=>array(\r\n'title',\r\n'editor',\r\n'excerpt',\r\n'thumbnail',\r\n'revisions',\r\n),\r\n//'taxonomies'=>array('category','post_tag'),\r\n'menu_position'=>5,\r\n'exclude_from_search'=>false\r\n);\r\nregister_post_type('portfolio',$args);\r\n}", "function classTools_post_type() {\n\n $labels = array(\n 'name' => _x( 'Ferramentas', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'ferramenta', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Ferramenta', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todas as ferramentas', 'text_domain' ),\n 'add_new_item' => __( 'Add novaferramenta', 'text_domain' ),\n 'add_new' => __( 'nova ferramenta', 'text_domain' ),\n 'new_item' => __( 'nova ferramenta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrado', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'ferramentas', 'text_domain' ),\n 'description' => __( 'ferramentas', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'classTools_post_type', $args );\n\n}", "private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "function news_custom_post() {\n $args = array(\n 'public' => true,\n 'label' => 'News',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'show_ui' => true,\n 'publicly_queryable' => true,\n 'taxonomies' => array('category', 'post_tag'),\n 'rewrite' => array( 'slug' => 'news' )\n\t\n );\n register_post_type('news', $args);\n}", "function qanat_custom_post_type() {\n\n $labels = array(\n 'name' => _x( 'Clientes', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Cliente', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Clientes', 'qanat' ),\n 'name_admin_bar' => __( 'Clientes', 'qanat' ),\n 'archives' => __( 'Archivo de Clientes', 'qanat' ),\n 'attributes' => __( 'Atributos de Clientes', 'qanat' ),\n 'parent_item_colon' => __( 'Cliente Padre:', 'qanat' ),\n 'all_items' => __( 'Todos los Clientes', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nuevo Cliente', 'qanat' ),\n 'add_new' => __( 'Agregar Cliente', 'qanat' ),\n 'new_item' => __( 'Nuevo Cliente', 'qanat' ),\n 'edit_item' => __( 'Editar Cliente', 'qanat' ),\n 'update_item' => __( 'Actualizar Cliente', 'qanat' ),\n 'view_item' => __( 'Ver Cliente', 'qanat' ),\n 'view_items' => __( 'Ver Clientes', 'qanat' ),\n 'search_items' => __( 'Buscar Cliente', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Logo del Cliente', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Logo del Cliente', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Logo del Cliente', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Logo del Cliente', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Cliente', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargado a este Cliente', 'qanat' ),\n 'items_list' => __( 'Listado de Clientes', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Clientes', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Clientes', 'qanat' ),\n );\n $args = array(\n 'label' => __( 'Cliente', 'qanat' ),\n 'description' => __( 'Clientes dentro de la Empresa', 'qanat' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'hierarchical' => false,\n 'public' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'clientes'),\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-buddicons-buddypress-logo',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'show_in_rest' => true,\n );\n register_post_type( 'clientes', $args );\n\n /* PUBLICACIONES */\n $labels_pub = array(\n 'name' => _x( 'Publicaciones', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Publicación', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Publicaciones', 'qanat' ),\n 'name_admin_bar' => __( 'Publicación', 'qanat' ),\n 'archives' => __( 'Archivo de Publicaciones', 'qanat' ),\n 'attributes' => __( 'Atributos de Publicación', 'qanat' ),\n 'parent_item_colon' => __( 'Publicación Padre:', 'qanat' ),\n 'all_items' => __( 'Todas las Publicaciones', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nueva Publicación', 'qanat' ),\n 'add_new' => __( 'Agregar Nueva', 'qanat' ),\n 'new_item' => __( 'Nueva Publicación', 'qanat' ),\n 'edit_item' => __( 'Editar Publicación', 'qanat' ),\n 'update_item' => __( 'Actualizar Publicación', 'qanat' ),\n 'view_item' => __( 'Ver Publicación', 'qanat' ),\n 'view_items' => __( 'Ver Publicaciones', 'qanat' ),\n 'search_items' => __( 'Buscar Publicación', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Imagen de Publicación', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Imagen de Publicación', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Imagen de Publicación', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Imagen de Publicación', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Publicación', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargado en esta Publicación', 'qanat' ),\n 'items_list' => __( 'Listado de Publicaciones', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Publicaciones', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Publicaciones', 'qanat' ),\n );\n $args_pub = array(\n 'label' => __( 'Publicación', 'qanat' ),\n 'description' => __( 'Publicaciones disponibles para descarga', 'qanat' ),\n 'labels' => $labels_pub,\n 'supports' => array( 'title', 'editor' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'publicaciones'),\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-megaphone',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'show_in_rest' => true,\n );\n register_post_type( 'publicaciones', $args_pub );\n\n\n $labels_act = array(\n 'name' => _x( 'Actividades', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Actividad', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Actividades', 'qanat' ),\n 'name_admin_bar' => __( 'Actividad', 'qanat' ),\n 'archives' => __( 'Archivo de Actividades', 'qanat' ),\n 'attributes' => __( 'Atributos de Actividad', 'qanat' ),\n 'parent_item_colon' => __( 'Actividad Padre:', 'qanat' ),\n 'all_items' => __( 'Todas las Actividades', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nueva Actividad', 'qanat' ),\n 'add_new' => __( 'Agregar Nueva', 'qanat' ),\n 'new_item' => __( 'Nueva Actividad', 'qanat' ),\n 'edit_item' => __( 'Editar Actividad', 'qanat' ),\n 'update_item' => __( 'Actualizar Actividad', 'qanat' ),\n 'view_item' => __( 'Ver Actividad', 'qanat' ),\n 'view_items' => __( 'Ver Actividades', 'qanat' ),\n 'search_items' => __( 'Buscar Actividad', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Imagen de Actividad', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Imagen de Actividad', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Imagen de Actividad', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Imagen de Actividad', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Actividad', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargada a esta Actividad', 'qanat' ),\n 'items_list' => __( 'Listado de Actividades', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Actividades', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Actividades', 'qanat' ),\n );\n $args_act = array(\n 'label' => __( 'Actividad', 'qanat' ),\n 'description' => __( 'Actividades de la Empresa', 'qanat' ),\n 'labels' => $labels_act,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'tipo-actividades' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'actividades'),\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-analytics',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'show_in_rest' => true,\n );\n register_post_type( 'actividades', $args_act );\n\n // Register Custom Taxonomy\n\n $labels_tipo = array(\n 'name' => _x( 'Tipos de Actividades', 'Taxonomy General Name', 'qanat' ),\n 'singular_name' => _x( 'Tipo de Actividad', 'Taxonomy Singular Name', 'qanat' ),\n 'menu_name' => __( 'Tipos de Actividades', 'qanat' ),\n 'all_items' => __( 'Agregar Todos', 'qanat' ),\n 'parent_item' => __( 'Tipo Padre', 'qanat' ),\n 'parent_item_colon' => __( 'Tipo Padre:', 'qanat' ),\n 'new_item_name' => __( 'Nuevo Tipo', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nuevo Tipo', 'qanat' ),\n 'edit_item' => __( 'Editar Tipo', 'qanat' ),\n 'update_item' => __( 'Actualizar Tipo', 'qanat' ),\n 'view_item' => __( 'Ver Tipo', 'qanat' ),\n 'separate_items_with_commas' => __( 'Separar tipos por comas', 'qanat' ),\n 'add_or_remove_items' => __( 'Agregar o Remover tipos', 'qanat' ),\n 'choose_from_most_used' => __( 'Escoger de los más usados', 'qanat' ),\n 'popular_items' => __( 'Tipos Populares', 'qanat' ),\n 'search_items' => __( 'Buscar tipos', 'qanat' ),\n 'not_found' => __( 'no hay resultados', 'qanat' ),\n 'no_terms' => __( 'No hay Tipos', 'qanat' ),\n 'items_list' => __( 'Listado de Tipos', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Tipos', 'qanat' ),\n );\n $args_tipo = array(\n 'labels' => $labels_tipo,\n 'hierarchical' => true,\n 'public' => true,\n 'rewrite' => array( 'slug' => 'tipo-actividades' ),\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n 'show_in_rest' => true,\n );\n register_taxonomy( 'tipo-actividades', array( 'actividades' ), $args_tipo );\n\n}", "function create_post_type() {\r\n register_post_type( 'nyheter',\r\n array(\r\n 'labels' => array(\r\n 'name' => __( 'Nyheter' ),\r\n 'singular_name' => __( 'Nyheter' )\r\n ),\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n )\r\n );\r\n}", "function ydd_post_type() {\r\n\r\n $labels = array(\r\n 'name' => _x( 'YDD', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Yacht Design', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'Yacht Design', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Design:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Yacht Designs', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Yacht Design', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Yacht Design', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Yacht Design', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search YDD', 'text_domain' ),\r\n\t\t'not_found' => __( 'Yacht Design Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_ydd',\r\n\t\t'read_post' => 'read_ydd',\r\n\t\t'delete_post' => 'delete_ydd',\r\n\t\t'edit_posts' => 'edit_ydd',\r\n\t\t'edit_others_posts' => 'edit_others_ydd',\r\n\t\t'publish_posts' => 'publish_ydd',\r\n\t\t'read_private_posts' => 'read_private_ydd',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'ydd', 'text_domain' ),\r\n\t\t'description' => __( 'Yacht Design Database', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'ydd', $args );\r\n \r\n add_ydd_capabilities_to_role( 'curator' );\r\n add_ydd_capabilities_to_role( 'administrator' );\r\n add_ydd_capabilities_to_role( 'nmmc_admin' );\r\n}", "function custom_post_type() {\n $supports = array(\n 'title',\n 'editor',\n // 'excerpt',\n // 'custom-fields',\n 'author',\n 'thumbnail',\n );\n\n $labels = array(\n 'name' => _x('Reviews', 'plural'),\n 'singular_name' => _x('Review', 'singular'),\n 'name_admin_bar' => _x('All Reviews', 'admin bar'),\n 'menu_name' => _x('Reviews', 'admin menu'),\n 'add new' => _x('Add new', 'add new'),\n 'add_new_item' => __('Add new Review'),\n 'all_items' => __('All Reviews'),\n 'new_item' => __('Add New Review'),\n 'search_items' => __('Search Reviews'),\n 'not_found' => __('No reviews found'),\n 'view_item' => __('View Review'),\n );\n\n $args = array(\n 'supports' => $supports,\n 'labels' => $labels,\n 'public' => true,\n 'label' => 'Reviews', // Las reviews son visibles para todos tanto en el backend como en el frontend\n 'query_var' => true, // Nuestro custom post type estará presente en la queryvar general de wp\n 'rewrite' => array('slug' => 'lostguides-reviews'), // Establecer el slug para nuestro custom post type\n 'has_archive' => true, // Permitir usar la plantilla archive-{custom-post-type}.php\n 'hierarchical' => false, // Indica que nuestro custom-post-type no tiene hijos\n 'menu_position' => 7, // Posicion en el menu\n 'show_in_menu' => true, // Para hacer que me funcione el menu position\n 'menu_icon' => 'dashicons-games',\n // 'show_in_rest' => true, // Habilita el editor gutemberg para tu custom post type\n );\n \n register_post_type('lostguides-reviews', $args);\n register_taxonomy_for_object_type('category', 'lostguides-reviews'); // Habilitamos las categorias para nuestro CPT\n register_taxonomy_for_object_type('post_tag', 'lostguides-reviews'); // Habilitamos los tags para nuestro CPT\n }", "function faq_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'F.A.Q', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'F.A.Q', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'F.A.Q', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'todos as pegruntas frequentes', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add nova pergunta', 'text_domain' ),\n\t\t'add_new' => __( 'nova pergunta', 'text_domain' ),\n\t\t'new_item' => __( 'nova pergunta', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'não encontrato', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'F.A.Q', 'text_domain' ),\n\t\t'description' => __( 'F.A.Q', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'faq_post_type', $args );\n\n}", "function add_config_post_type() {\n\t\t\n\t\t$labels = array(\n 'name' => _x( 'Công trình', 'Post Type General Name'),\n 'singular_name' => _x( 'Công trình', 'Post Type Singular Name'),\n 'menu_name' => __( 'Công trình'),\n 'name_admin_bar' => __( 'Công trình'),\n 'archives' => __( 'Item Archives'),\n 'attributes' => __( 'Item Attributes'),\n 'parent_item_colon' => __( 'Parent Item:'),\n 'all_items' => __( 'Tất cả công trình'),\n 'add_new_item' => __( 'Add công trình'),\n 'add_new' => __( 'Thêm công trình'),\n 'new_item' => __( 'Thêm mới'),\n 'edit_item' => __( 'Chỉnh sửa'),\n 'update_item' => __( 'Cập nhật'),\n 'view_item' => __( 'View Item'),\n 'view_items' => __( 'View Items'),\n 'search_items' => __( 'Search Item'),\n 'not_found' => __( 'Not found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n 'featured_image' => __( 'Featured Image'),\n 'set_featured_image' => __( 'Set featured image'),\n 'remove_featured_image' => __( 'Remove featured image'),\n 'use_featured_image' => __( 'Use as featured image'),\n 'insert_into_item' => __( 'Insert into item'),\n 'uploaded_to_this_item' => __( 'Uploaded to this item'),\n 'items_list' => __( 'Bản ghi'),\n 'items_list_navigation' => __( 'Items list navigation'),\n 'filter_items_list' => __( 'Filter items list'),\n );\n $args = array(\n 'label' => __( 'Công trình'),\n 'description' => __( 'Công trình'),\n 'labels' => $labels,\n 'supports' => array( 'title','editor','revisions','thumbnail','author'),\n 'taxonomies' => array('category'),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n // 'rewrite' => array( 'slug' => 'danhsach' ),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-admin-home'\n );\n register_post_type( 'estate', $args );\n \n }", "function custom_post_type () { \r\n\t// These labels below will create the necessary variables and items required for the goals post type. \r\n\t$labels = array (\r\n\t\t'name' => 'goals',\r\n\t\t'singular_name' => 'goals',\r\n\t\t'add_new' => 'Weekly goals',\r\n\t\t'all_items' => 'All Items',\r\n\t\t'edit_item' => 'Edit Item',\r\n\t\t'new_item' => 'New Item',\r\n\t\t'search_iterm' => 'Search goals',\r\n\t\t'not_found' => 'No Item Found',\r\n\t\t'not_found_in_trash' => 'No Item Found in Trash',\r\n\t\t'parent_item_colon' => 'Parent Item'\r\n\t);\r\n\t/*this following array will allow the plugin post type to display on wordpress, along with added a custom menu icon to the goals menu option, as seen on the wordpress backend. 'menu_icon' => 'dashicons-thumbs-up' is the line of code responsible for the changing of icons, using dash icons. */\r\n\t$args = array( \r\n\t\t'labels' => $labels, \r\n\t\t'public' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'menu_icon' => 'dashicons-thumbs-up',\r\n\t\t'publicly_queryable' => true,\r\n\t\t'query_var' => true, \r\n\t\t'rewrite' => true, \r\n\t\t'capability_type' => 'post', \r\n\t\t'hierarchical' => true, \r\n\t\t/*the supports function below will allow for there to be an array of a title,editor and feature a thumbnail for the posts created in the goals section of wordpress.*/\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'\r\n\t\t\t),\r\n\t\t/*Taxonomies have been created below to allow for categories to be displayed in the */\r\n\t\t'taxonomies' => array ('category', 'post_tag'),\r\n\t\t'exclude_from_search' => false, \r\n\t\t);\r\n\tregister_post_type('goals', $args);\r\n}", "function zmpm_register_post_type() {\n\t\n\t$labels = array(\n\t\t'name' => 'Permissions',\n\t\t'singular_name' => 'Permission',\n\t\t'menu_name' => 'Permissions',\n\t\t'name_admin_bar' => 'Permission',\n\t\t'archives' => 'Permission Archives',\n\t\t'attributes' => 'Permission Attributes',\n\t\t'parent_item_colon' => 'Parent Permission:',\n\t\t'all_items' => 'Permissions',\n\t\t'add_new_item' => 'Add New Permission',\n\t\t'add_new' => 'Add New',\n\t\t'new_item' => 'New Permission',\n\t\t'edit_item' => 'Edit Permission',\n\t\t'update_item' => 'Update Permission',\n\t\t'view_item' => 'View Permission',\n\t\t'view_items' => 'View Permissions',\n\t\t'search_items' => 'Search Permission',\n\t\t'not_found' => 'Not found',\n\t\t'not_found_in_trash' => 'Not Found in Trash',\n\t\t'featured_image' => 'Featured Image',\n\t\t'set_featured_image' => 'Set featured image',\n\t\t'remove_featured_image' => 'Remove featured image',\n\t\t'use_featured_image' => 'Use as featured image',\n\t\t'insert_into_item' => 'Insert into permission',\n\t\t'uploaded_to_this_item' => 'Uploaded to this permission',\n\t\t'items_list' => 'Permissions list',\n\t\t'items_list_navigation' => 'Permissions list navigation',\n\t\t'filter_items_list' => 'Filter permissions list',\n\t);\n\t$args = array(\n\t\t'label' => 'Permission',\n\t\t'description' => 'ZingMap permissions',\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => 'users.php',\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-lock',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'zmpm_permission', $args );\n\t\n}", "function create_events_custom_post() {\n register_post_type( 'events',\n array(\n 'labels' => array(\n 'name' => __( 'Events' ),\n 'singular_name' => __( 'Event' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n )\n ));\n}", "function obdiy_create_ep_post_type() {\n\tregister_post_type( 'execution_plan',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Execution Plans' ),\n\t\t\t\t'singular_name' => __( 'Execution Plan' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true, //Behave like a page\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes', 'comments' ),\n\t\t\t'rewrite' => array( 'slug' => 'resources', 'with_front' => false ),\n\t\t\t'permalink_epmask' => EP_PERMALINK,\n\t\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t\t)\n\t);\n}", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}", "function add_my_custom_posttype_waarden(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe waarde toe',\n 'add_new_item' => 'Voeg nieuwe waarde toe',\n 'name' => 'waarden',\n 'singular_name' => 'waarden',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'waarden van Ben & Jerry',\n 'public' => true,\n 'menu_position' => 6,\n 'menu_icon' => 'dashicons-layout', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n \n );\n register_post_type( 'waarden', $args ); \n }", "function nsbr_post_type() {\r\n\r\n $labels = array(\r\n\t\t'name' => _x( 'NSBR', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Boat', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'NSBR', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Boat:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Small Boat Registrations', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Boat Registration', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Boat Registration', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Boat Registration', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search NSBR', 'text_domain' ),\r\n\t\t'not_found' => __( 'Boat Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_nsbr',\r\n\t\t'read_post' => 'read_nsbr',\r\n\t\t'delete_post' => 'delete_nsbr',\r\n\t\t'edit_posts' => 'edit_nsbr',\r\n\t\t'edit_others_posts' => 'edit_others_nsbr',\r\n\t\t'publish_posts' => 'publish_nsbr',\r\n\t\t'read_private_posts' => 'read_private_nsbr',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'nsbr', 'text_domain' ),\r\n\t\t'description' => __( 'National Small Boat Register', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'nsbr', $args );\r\n\t\r\n\tadd_role('nsbr_manager', 'NSBR Manager', array(\r\n 'edit_nsbr' => true,\r\n 'edit_others_nsbr' => true,\r\n 'read_nsbr' => true,\r\n 'publish_nsbr' => true,\r\n 'read_private_nsbr' => true,\r\n 'delete_nsbr' => true,\r\n 'read'=> true\r\n ));\r\n \r\n\t add_nsbr_capabilities_to_role( 'curator' );\r\n add_nsbr_capabilities_to_role( 'administrator' );\r\n add_nsbr_capabilities_to_role( 'nmmc_admin' );\r\n}", "function wpm_actus_post_type() {\n\n\t// On rentre les différentes dénominations de notre custom post type qui seront affichées dans l'administration\n\t$labels = array(\n\t\t// Le nom au pluriel\n\t\t'name' => _x( 'Actus', 'Post Type General Name'),\n\t\t// Le nom au singulier\n\t\t'singular_name' => _x( 'Actu', 'Post Type Singular Name'),\n\t\t// Le libellé affiché dans le menu\n\t\t'menu_name' => __( 'Actus'),\n\t\t// Les différents libellés de l'administration\n\t\t'all_items' => __( 'Toutes les actus'),\n\t\t'view_item' => __( 'Voir les actus'),\n\t\t'add_new_item' => __( 'Ajouter une actu'),\n\t\t'add_new' => __( 'Ajouter'),\n\t\t'edit_item' => __( 'Editer'),\n\t\t'update_item' => __( 'Modifier'),\n\t\t'search_items' => __( 'Rechercher'),\n\t\t'not_found' => __( 'Non trouvée'),\n\t\t'not_found_in_trash' => __( 'Non trouvée dans la corbeille'),\n\t);\n\n\t// On peut définir ici d'autres options pour notre custom post type\n\n\t$args = array(\n\t\t'label' => __( 'Actus'),\n\t\t'description' => __( 'Toutes les actus'),\n\t\t'labels' => $labels,\n\t\t// On définit les options disponibles dans l'éditeur de notre custom post type ( un titre, un auteur...)\n\t\t'supports' => array( 'title', 'thumbnail' ),\n\t\t/*\n\t\t* Différentes options supplémentaires\n\t\t*/\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t\t\t => array( 'slug' => 'actus'),\n\n\t);\n\n\t// On enregistre notre custom post type qu'on nomme ici \"serietv\" et ses arguments\n\tregister_post_type( 'actus', $args );\n\n}", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }", "function create_volunteer_custom_post() {\n register_post_type( 'volunteers',\n array(\n 'labels' => array(\n 'name' => __( 'Board Members' ),\n 'singular_name' => __( 'Board Member' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields'\n )\n ));\n}", "function cursos_post_type() {\n\n $labels = array(\n 'name' => _x( 'cursos', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'curso', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'cursos', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'Todos os cursos', 'text_domain' ),\n 'add_new_item' => __( 'Add nova pergunta', 'text_domain' ),\n 'add_new' => __( 'novo cursoa', 'text_domain' ),\n 'new_item' => __( 'nova pergunta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrato', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'cursos', 'text_domain' ),\n 'description' => __( 'cursos', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'excerpt'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'cursos_post_type', $args );\n\n}", "public function register_post_type()\n\t{\n\n\t\tregister_post_type( 'partner', array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x( 'Partners', 'post type general name', 'custom-post-type-partners' ),\n\t\t\t\t'singular_name' => _x( 'Partner', 'post type singular name', 'custom-post-type-partners' ),\n\t\t\t\t'add_new' => _x( 'Add New', 'Partner', 'custom-post-type-partners' ),\n\t\t\t\t'add_new_item' => __( 'Add New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'edit_item' => __( 'Edit Partner', 'custom-post-type-partners' ),\n\t\t\t\t'new_item' => __( 'New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'all_items' => __( 'All Partners', 'custom-post-type-partners' ),\n\t\t\t\t'view_item' => __( 'View Partner', 'custom-post-type-partners' ),\n\t\t\t\t'search_items' => __( 'Search Partners', 'custom-post-type-partners' ),\n\t\t\t\t'not_found' => __( 'No Partners found', 'custom-post-type-partners' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Partners found in Trash', 'custom-post-type-partners' ),\n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( 'Partners', 'custom-post-type-partners' )\n\t\t\t),\n\t\t\t'public' => TRUE,\n\t\t\t'publicly_queryable' => TRUE,\n\t\t\t'show_ui' => TRUE,\n\t\t\t'show_in_menu' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => TRUE,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => FALSE,\n\t\t\t'hierarchical' => FALSE,\n\t\t\t'menu_position' => NULL,\n\t\t\t'menu_icon' => 'dashicons-admin-links',\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )\n\t\t) );\n\n\t}", "function resource_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Resources', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Resource', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Resource', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Resource:', 'text_domain' ),\n\t\t'all_items' => __( 'All Resources', 'text_domain' ),\n\t\t'view_item' => __( 'View Resource', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Resource', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Resource', 'text_domain' ),\n\t\t'update_item' => __( 'Update Resource', 'text_domain' ),\n\t\t'search_items' => __( 'Search Resource', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'resource', 'text_domain' ),\n\t\t'description' => __( 'Base resources for fuel use', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'custom-fields', 'page-attributes', ),\n\t\t'taxonomies' => array( 'usage' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t\t'show_in_rest' => true,\n\t\t'rest_base' => 'resources',\n\t);\n\tregister_post_type( 'resource', $args );\n\n}", "function proyecto_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'proyectos', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'proyecto', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Post Types', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'proyecto', 'text_domain' ),\n\t\t'description' => __( 'personalización del proyecto', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-images-alt2',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'proyecto', $args );\n\n}", "function zp_custom_post_type() {\n\n if ( ! class_exists( 'Super_CPT' ) )\n\n return;\n\n\n\t\t\n/*----------------------------------------------------*/\n// Add Slide Custom Post Type\n/*---------------------------------------------------*/\n \n \t$slide_custom_default = array(\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt'),\n\t\t'rewrite' => array('with_front' => false,\n \t\t\t\t\t\t'slug' => 'slide'),\n\t\t'menu_icon' => get_stylesheet_directory_uri().'/include/cpt/images/slide.png',\n\t);\n \t$slideshow_custom_default = array(\n\t\t'rewrite' => array('with_front' => false,\n \t\t\t\t\t\t'slug' => 'slideshow'),\n\t);\n\t// register slide post type\n\t$slide = new Super_Custom_Post_Type( 'slide', 'Slide', 'Slides', $slide_custom_default );\n\t$slideshow = new Super_Custom_Taxonomy( 'slideshow' ,'Slideshow', 'Slideshows', 'cat',$slideshow_custom_default);\n\tconnect_types_and_taxes( $slide, array( $slideshow ) );\n\n\t// Slide meta boxes\n\t$slide->add_meta_box( array(\n\t\t'id' => 'slider-settings',\n\t\t'context' => 'normal',\n\t\t'priority' => 'high',\n\t\t'fields' => array(\n\t\t\t'video_type_value' => array( 'label' => __( 'Video Type','novo'), 'type' => 'select', 'options' => array('youtube' => 'Youtube','vimeo' => 'Vimeo') , 'data-zp_desc' => __( 'Select appropriate video type','novo') ),\n\t\t\t'video_id_value' => array( 'label' => __( 'Video ID','novo'), 'type' => 'text', 'data-zp_desc' => __( 'Enter video ID. Example: VdvEdMMtNMY','novo') ),\n\t\t\t'slider_button_value' => array( 'label' => __( 'Slide Button','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Enter Button Name','novo') ),\t\t\t\t\n\t\t\t'slider_link_value' => array( 'label' => __( 'Slide Link','novo' ), 'type' => 'text' , 'data-zp_desc' => __( 'Put slide link here','novo') ),\t\t\n\t\t)\n\t) );\t\n\n\t$slide->add_meta_box( array(\n\t\t'id' => 'slide-order',\n\t\t'context' => 'side',\n\t\t'fields' => array(\n\t\t\t'slide_number_value' => array( 'type' => 'text', 'data-zp_desc' => __( 'Define slide order. Ex. 1,2,3,4,...','novo') ),\t\t\n\t\t)\n\t) );\t\t\n\n\t// manage slide columns \n\tfunction zp_add_slide_columns($columns) {\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'title' => __('Title', 'novo'),\n\t\t\t'slideshow' => __('Slideshow', 'novo'),\n\t\t\t'slide_order' =>__( 'Slide Order', 'novo'),\n\t\t\t'date' => __('Date', 'novo'),\t\t\t\n\t\t);\n\t}\n\tadd_filter('manage_slide_posts_columns' , 'zp_add_slide_columns');\n\n\tfunction zp_custom_slide_columns( $column, $post_id ) {\n\t\tswitch ( $column ) {\n\t\tcase 'slideshow' :\n\t\t\t$terms = get_the_term_list( $post_id , 'slideshow' , '' , ',' , '' );\n\t\t\tif ( is_string( $terms ) )\n\t\t\t\techo $terms;\n\t\t\telse\n\t\t\t\t_e( 'Unable to get author(s)', 'novo' );\n\t\t\tbreak;\n\t\n\t\tcase 'slide_order' :\n\t\t\techo get_post_meta( $post_id , 'slide_number_value' , true ); \n\t\t\tbreak;\n\t\t}\n\t}\n\tadd_action( 'manage_posts_custom_column' , 'zp_custom_slide_columns', 10, 2 );\n\t\n\t\n/*----------------------------------------------------*/\n\n// Add Portfolio Custom Post Type\n\n/*---------------------------------------------------*/\n\n\n\n\t$portfolio_custom_default = array(\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'excerpt'),\n\t\t'rewrite' => array('with_front' => false,\n \t\t\t\t\t\t'slug' => 'portfolio'),\n\t\t'menu_icon' => get_stylesheet_directory_uri().'/include/cpt/images/portfolio.png',\n\t);\n\t$portfolio_category_custom_default = array(\n\t\t'rewrite' => array('with_front' => false,\n \t\t\t\t\t\t'slug' => 'portfolio-category'),\t\n\t);\n\n\n\n\t// register portfolio post type\n\n\t$portfolio = new Super_Custom_Post_Type( 'portfolio', 'Portfolio', 'Portfolio', $portfolio_custom_default );\n\t$portfolio_category = new Super_Custom_Taxonomy( 'portfolio-category' ,'Portfolio Category', 'Portfolio Categories', 'cat',$portfolio_category_custom_default );\n\tconnect_types_and_taxes( $portfolio, array( $portfolio_category ) );\n\n\n\n\t// Portfolio meta boxes\n\t/*This if statement is to determine if lmseo_content_value has been checked or not. If I just use the \"checked\" option then it wont remember if if checked or not, it will always display checked. This way it will remember.*/\n\tglobal $post;\n\tif(get_post_meta( $post->ID, 'lmseo_content_value', true )){\n\t\t$lmseo_content_value_checked=array( 'label' => __( 'Portfolio Content','novo'),'type' => 'checkbox','data-zp_desc' => __( 'Define whether to display content or not','novo'), 'checked'=>'checked' );\n\t}else{\n\t\t$lmseo_content_value_checked=array( 'label' => __( 'Portfolio Content','novo'),'type' => 'checkbox','data-zp_desc' => __( 'Define whether to display content or not','novo'));\n\t}\n\n\t$portfolio->add_meta_box( array(\n\t\t'id' => 'portfolio-metaItem',\n\t\t'context' => 'normal',\n\t\t'priority' => 'high',\n\t\t'fields' => array(\n\t\t\t'lmseo_content_value'=>$lmseo_content_value_checked,\n\t\t\t'zp_project_label_value' => array( 'label' => __( 'Project Label','novo'), 'type' => 'text', 'data-zp_desc' => __( 'Define project label','novo') ),\n\t\t\t'zp_project_link_value' => array( 'label' => __( 'Project Link','novo'), 'type' => 'text', 'data-zp_desc' => __( 'Define project link','novo') ),\t\n\t\t)\n\t) );\n\n\n\t$portfolio->add_meta_box( array(\n\n\t\t'id' => 'portfolio-images',\n\n\t\t'context' => 'normal',\n\n\t\t'priority' => 'high',\n\n\t\t'fields' => array(\n\n\t\t\t'zp_image_1_value' => array( 'label' => __( 'Image 1','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Place here the full image path','novo' )),\t\t\n\n\t\t\t'zp_image_2_value' => array( 'label' => __( 'Image 2','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Place here the full image path','novo' ) ),\t\n\n\t\t\t'zp_image_3_value' => array( 'label' => __( 'Image 3','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Place here the full image path','novo' )),\t\n\n\t\t\t'zp_image_4_value' => array( 'label' => __( 'Image 4','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Place here the full image path','novo' )),\t\n\n\t\t\t'zp_image_5_value' => array( 'label' => __( 'Image 5','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'Place here the full image path','novo' )),\t\n\t\t)\n\n\t) );\n\n\n\n\t$portfolio->add_meta_box( array(\n\n\t\t'id' => 'portfolio-videos',\n\n\t\t'context' => 'normal',\n\n\t\t'priority' => 'high',\n\n\t\t'fields' => array(\n\n\t\t\t'zp_video_url_value' => array( 'label' => __( 'Youtube or Vimeo URL','novo'), 'type' => 'text', 'data-zp_desc' => __( 'Place here the video url. Example video url: YOUTUBE: http://www.youtube.com/watch?v=Sv5iEK-IEzw and VIMEO: http://vimeo.com/7585127','novo') ),\t\t\n\n\t\t\t'zp_video_embed_value' => array( 'label' => __( 'Embed Code','novo'), 'type' => 'text' , 'data-zp_desc' => __( 'If you are using anything else other than YouTube or Vimeo, paste the embed code here. This field will override anything from the above.','novo' )),\n\t\t)\n\n\t) );\t\t\n\n\t\n\n\t\n\n\t// manage portfolio columns \n\n\tfunction zp_add_portfolio_columns($columns) {\n\n\t\treturn array(\n\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\n\t\t\t'title' => __('Title', 'novo'),\n\n\t\t\t'portfolio-category' => __('Portfolio Category', 'novo'),\n\n\t\t\t'author' =>__( 'Author', 'novo'),\n\n\t\t\t'date' => __('Date', 'novo'),\n\t\t);\n\t}\n\n\tadd_filter('manage_portfolio_posts_columns' , 'zp_add_portfolio_columns');\n\n\n\n\tfunction zp_custom_portfolio_columns( $column, $post_id ) {\n\n\t\tswitch ( $column ) {\n\n\t\tcase 'portfolio-category' :\n\n\t\t\t$terms = get_the_term_list( $post_id , 'portfolio-category' , '' , ',' , '' );\n\n\t\t\tif ( is_string( $terms ) )\n\n\t\t\t\techo $terms;\n\n\t\t\telse\n\n\t\t\t\t_e( 'Unable to get author(s)', 'novo' );\n\n\t\t\tbreak;\n\t\t}\n\t}\n\tadd_action( 'manage_posts_custom_column' , 'zp_custom_portfolio_columns', 10, 2 );\n\n\n\n\n/*----------------------------------------------------*/\n// Add Post Custom Meta\n/*---------------------------------------------------*/\t\n\n\t$post_meta = new Super_Custom_Post_Meta( 'post' );\n\n\t$post_meta->add_meta_box( array(\n\n\t\t'id' => 'audio-settings',\n\n\t\t'context' => 'side',\n\n\t\t'priority' => 'high',\n\n\t\t'fields' => array(\n\n\t\t\t'zp_audio_mp3_url' => array( 'label' => __( 'Audio .mp3 URL','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The URL to the .mp3 audio file','novo') ),\n\t\t\t'zp_audio_ogg_url' => array( 'label' => __( 'Audio .ogg, .oga URL','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The URL to the .oga, .ogg audio file','novo') ),\n\t\t\t'zp_audio_prieview_image_url' => array( 'label' => __( 'Preview Image','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The preview image for this audio track','novo') ),\n\t\t\t'zp_audio_prieview_image_height' => array( 'label' => __( 'Preview Image Height','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The height of the poster image. Example: 300','novo') )\n\t\t)\n\n\t) );\n\n\t$post_meta->add_meta_box( array(\n\n\t\t'id' => 'link-settings',\n\n\t\t'context' => 'side',\n\n\t\t'priority' => 'high',\n\n\t\t'fields' => array(\n\t\t\t'zp_link_format' => array( 'label' => __( 'Enter link. E.g., http://www.yourlink.com','novo'), 'type' => 'text', 'data-zp_desc' => __( 'Input your link. e.g., http://www.yourlink.com','novo') )\n\t\t)\n\n\t) );\n\n\t$post_meta->add_meta_box( array(\n\n\t\t'id' => 'video-settings',\n\n\t\t'context' => 'side',\n\n\t\t'priority' => 'high',\n\n\t\t'fields' => array(\n\t\t\t'zp_video_m4v_url' => array( 'label' => __( 'Video File (.m4v)','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The URL to the .m4v video file','novo') ),\n\t\t\t'zp_video_ogv_url' => array( 'label' => __( 'Video File (.ogv)','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The URL to the .ogv video file','novo') ),\n\t\t\t'zp_video_prieview_image_height' => array( 'label' => __( 'Video Height','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The video height (e.g. 500).','novo') ),\n\t\t\t'zp_video_prieview_image_url' => array( 'label' => __( 'Preview Image','novo'), 'type' => 'text', 'data-zp_desc' => __( 'The preview image for this video.','novo') ),\n\t\t\t'zp_video_format_embed' => array( 'label' => __( 'Embed Video','novo'), 'type' => 'textarea', 'data-zp_desc' => __( 'If you are using something other than self hosted video such as Youtube or Vimeo, paste the embed code here. Width is best at 600px with any height. This field will override the above.','novo') ),\n\t\t)\n\n\t) );\t\t\t\n\n\n}", "function itinerario_post_type() {\n \n $labels = array(\n 'name' => _x( 'itinerario', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'Itinerario', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Itinerarios', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'Todos', 'text_domain' ),\n 'view_item' => __( 'Ver Itinerario', 'text_domain' ),\n 'add_new_item' => __( 'Nuevo Itinerario', 'text_domain' ),\n 'add_new' => __( 'Nuevo', 'text_domain' ),\n 'edit_item' => __( 'Editar', 'text_domain' ),\n 'update_item' => __( 'Actualizar', 'text_domain' ),\n 'search_items' => __( 'Buscar', 'text_domain' ),\n 'not_found' => __( 'No se encontró', 'text_domain' ),\n 'not_found_in_trash' => __( 'No se encontró en la papelera', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'Itinerarios', 'text_domain' ),\n 'description' => __( 'Post Type Description', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( ),\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => false,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-palmtree',\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'rewrite' => true,\n 'supports' => array('title', 'editor', 'thumbnail', 'comments', 'slug'),\n );\n register_post_type( 'itinerario', $args );\n \n }", "function create_post_type() {\n\tregister_post_type( 'Architects', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Architects' ),\n\t\t\t'singular_name' => __( 'Architect' ),\n\t\t\t'add_new_item' => __( 'Add architect' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this architect' ),\n\t\t\t'new_item' => __( 'New architect' ),\n\t\t\t'view' => __( 'View architect' ),\n\t\t\t'view_item' => __( 'View this architect' ),\n\t\t\t'search_items' => __( 'Search architects' ),\n\t\t\t'not_found' => __( 'No architect was found' ),\n\t\t\t'not_found_in_trash' => __( 'No architects in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'architect','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Remotes custom post type\n\tregister_post_type( 'Remotes', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Projects' ),\n\t\t\t'singular_name' => __( 'Project' ),\n\t\t\t'add_new_item' => __( 'Add projects' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this project' ),\n\t\t\t'new_item' => __( 'New project' ),\n\t\t\t'view' => __( 'View project' ),\n\t\t\t'view_item' => __( 'View this project' ),\n\t\t\t'search_items' => __( 'Search project' ),\n\t\t\t'not_found' => __( 'No project was found' ),\n\t\t\t'not_found_in_trash' => __( 'No project in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => false, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','comments','trackbacks'),\n\t\t'rewrite' => array('slug'=>'project','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Scienticic custom post type\n\tregister_post_type( 'scientifics', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Scientifics' ),\n\t\t\t'singular_name' => __( 'Scientific' ),\n\t\t\t'add_new_item' => __( 'Add scientific' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this scientific' ),\n\t\t\t'new_item' => __( 'New scientific' ),\n\t\t\t'view' => __( 'View scientific' ),\n\t\t\t'view_item' => __( 'View this scientific' ),\n\t\t\t'search_items' => __( 'Search scientific' ),\n\t\t\t'not_found' => __( 'No scientific was found' ),\n\t\t\t'not_found_in_trash' => __( 'No scientifics in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'scientific','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\n}", "function wpmudev_create_post_type() {\n\t$labels = array(\n \t\t'name' => 'Actividades',\n \t'singular_name' => 'Actividad',\n \t'add_new' => 'Añade Nueva Actividad',\n \t'add_new_item' => 'Añade una nueva Actividad',\n \t'edit_item' => 'Edita la Actividad',\n \t'new_item' => 'Nueva Actividad',\n \t'all_items' => 'Todas las Actividades',\n \t'view_item' => 'Ver Actividad',\n \t'search_items' => 'Buscar Actividades',\n \t'not_found' => 'No se han encontrado Actividades',\n \t'not_found_in_trash' => 'No se han encontrado Actividades en la Papelera', \n \t'parent_item_colon' => '',\n \t'menu_name' => 'Actividades',\n );\n \n $args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n \t\t'public' => true,\n\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'comments', 'page-attributes', 'author' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t//'map_meta_caps' => true,\n\t\t'rewrite' => array( 'slug' => 'actividades' ),\n\t);\n\t\n\tregister_post_type( 'actividad', $args );\n}" ]
[ "0.7906749", "0.7649255", "0.7535579", "0.75295395", "0.74931103", "0.74321306", "0.73854166", "0.7345008", "0.73436725", "0.73335963", "0.7313111", "0.7310697", "0.73088396", "0.7290665", "0.7290033", "0.7257624", "0.72166175", "0.72165436", "0.71997523", "0.7195427", "0.7189204", "0.71881413", "0.71767145", "0.7174368", "0.7158139", "0.7151758", "0.7148842", "0.7144489", "0.714383", "0.7138517", "0.71366084", "0.7109376", "0.7089115", "0.7079847", "0.7076608", "0.707164", "0.7060293", "0.7056261", "0.7052123", "0.7048682", "0.7046345", "0.7045594", "0.70398945", "0.70381343", "0.7035455", "0.7031824", "0.7029283", "0.702652", "0.70257163", "0.7019097", "0.70163643", "0.70163643", "0.70128524", "0.70100373", "0.69933945", "0.6990622", "0.6987023", "0.6972683", "0.69684017", "0.69679314", "0.6962153", "0.6957138", "0.6956373", "0.69511455", "0.6949377", "0.6943814", "0.6931016", "0.692841", "0.6921053", "0.6892104", "0.68822205", "0.68740565", "0.6873392", "0.6872918", "0.68588924", "0.6855852", "0.6853974", "0.6836962", "0.68352956", "0.68288475", "0.682712", "0.6826554", "0.6823152", "0.68124485", "0.6802694", "0.6801256", "0.6793121", "0.67909455", "0.6788241", "0.67850643", "0.67801726", "0.67796814", "0.67782915", "0.6775375", "0.67731756", "0.67630434", "0.6762736", "0.6754451", "0.67458427", "0.6745646", "0.6738947" ]
0.0
-1
Return array of contract type options
public static function contract_options() { return array( '' => '', 'RENT' => __( 'Rent', 'inventor-properties' ), 'SALE' => __( 'Sale', 'inventor-properties' ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCcTypesAsOptionArray()\n {\n $model = Mage::getModel('payment/source_cctype')\n ->setAllowedTypes(array('VI', 'MC', 'JCB', 'DINCLB'));\n return $model->toOptionArray();\n }", "public function getTypeOptions()\n {\n $calendars = Config::get('vojtasvoboda.proeventspreview::calendars');\n $return = [];\n\n foreach($calendars as $key => $calendar) {\n $return[$key] = $calendar['name'];\n }\n\n return $return;\n }", "public function getCcAvailableTypes()\n {\n //Listando apenas cielo pois já contem todas as bandeiras\n $_types = Mage::getModel('gwap/source_cctypes_cielo')->toOptionArray();\n //$_types[] = Mage::getModel('gwap/source_cctypes_redecard')->toOptionArray();\n \n $types = array();\n foreach ($_types as $data) {\n if (isset($data['label']) && isset($data['value']) && $data['value']!='') {\n $types[substr_replace($data['value'],'',-2)] = $data['label'];\n }\n }\n \n if ($method = $this->getMethod()) {\n //Armazena os cartões habilitados nas duas operadoras\n $availableTypes = $method->getConfigData('cctypes_rcard');\n $availableTypes .= ','.$method->getConfigData('cctypes_cielo');\n \n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n $allTypes = array();\n // Remove 2 ultimos caracteres do cartão\n foreach($availableTypes as $substype){\n $allTypes[] = substr_replace($substype,'',-2);\n }\n //Compara com cartões disponíveis\n foreach ($types as $code=>$name) {\n if (!in_array($code, $allTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "public function toOptionArray()\n {\n $options = array();\n\n foreach ($this->getTransactionTypes() as $code => $name) {\n $options[] = array(\n 'value' => $code,\n 'label' => $name\n );\n }\n\n return $options;\n }", "public function get_type_options() : array {\n\n\t\t/**\n\t\t * Filters Call to Action type options.\n\t\t * \n\t\t * @param array Type options to be filtered.\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'cta_type_options', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound\n\t\t\t[\n\t\t\t\t'subscribe' => __( 'Subscribe', 'civil-first-fleet' ),\n\t\t\t\t'newsletter' => __( 'Newsletter Sign up', 'civil-first-fleet' ),\n\t\t\t]\n\t\t);\n\t}", "public static function getForOptions()\n {\n return [\n 'Buyer' => self::FOR_BUYER,\n 'Freelancer' => self::FOR_FREELANCER,\n 'Fee' => self::FOR_WAWJOB\n ];\n }", "public function getCcTypes() {\n\n\t\t$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();\n\t\t$types = $cc_types->toOptionArray();\n\n $availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');\n\n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n\t\t\t$result = array(); \n\t\t\tforeach ($types as $val) { \n\t\t\t if (($key = array_search($val['value'], $availableTypes, TRUE))!==false) { \n\t\t\t\t $result[] = $val; \n\t\t\t\t unset($availableTypes[$key]); \n\t\t\t }\n\t\t\t}\n }\n\n return $result; \n }", "static function getPayMethodsOptions($type = 0)\n\t{\n\t\tglobal $ilDB, $lng;\n\t\t\n\t\t$res = $ilDB->query('SELECT * FROM payment_paymethods WHERE pm_enabled = 1');\n\t\t$options = array();\n\t\t\n\t\t//this is only for additional entries in SelectInputGUIs\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'all':\t\n\t\t\t\t$options['all'] = $lng->txt('pay_all');\n\t\t\t\tbreak;\n\t\t\tcase 'not_specified': \t\n\t\t\t\t$options[0] = $lng->txt('paya_pay_method_not_specified');\n\t\t\t\tbreak;\n\t\t\t//default: break;\n\t\t}\n\t\t\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$options[$row['pm_id']] = ilPayMethods::getStringByPaymethod($row['pm_title']);\n\t\t}\t\t\n\t\n\t\treturn $options;\n\t}", "public static function getTypeOptions($for = 'all')\n {\n $options = [];\n\n switch ($for) {\n case \"all\":\n case \"buyer\":\n case \"freelancer\":\n $options = array_flip(self::$str_transaction_type);\n break;\n\n case \"hourly_contract\":\n case \"fixed_contract\":\n if ($for == \"hourly_contract\") {\n $vs = [\n self::TYPE_HOURLY, self::TYPE_BONUS, self::TYPE_REFUND\n ];\n } else {\n $vs = [\n self::TYPE_FIXED, self::TYPE_BONUS, self::TYPE_REFUND\n ];\n }\n\n foreach($vs as $v) {\n $options[self::$str_transaction_type[$v]] = $v;\n }\n break;\n }\n \n return $options;\n }", "function osa_options_class_types() {\r\n\r\n $options = array();\r\n // $options['cello'] = 'Cello';\r\n $options['bass'] = 'Double Bass';\r\n $options['guitar'] = 'Guitar';\r\n $options['koday'] = 'Koday Only';\r\n $options['ecm'] = 'Suzuki Baby';\r\n $options['theory'] = 'Theory';\r\n $options['viace'] = 'Violin - Advanced';\r\n $options['violin'] = 'Violin';\r\n\r\n return $options;\r\n}", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "protected function getOptions(): array\n {\n return [\n 'cost' => $this->cost\n ];\n }", "protected function getOptions()\n {\n return [\n 'type', InputOption::VALUE_REQUIRED, 'Conveyor'\n ];\n }", "public function getOptions() : array;", "public function options(): array\n\t{\n\t\treturn collect(trans('site::order.help.in_stock_type', []))\n\t\t\t->prepend(trans('site::messages.select_no_matter'), '')\n\t\t\t->toArray();\n\t}", "public function getOptions() : array\n {\n $reflection = new \\ReflectionClass(get_class($this));\n return array_values($reflection->getConstants());\n }", "private function getOptionItems()\n {\n $contract = new ContractRepository();\n $employee = new EmployeeRepository();\n $salaryComponent = new SalaryComponentRepository();\n return [\n 'contractItems' => ['' => __('crud.option.contract_placeholder')] + $contract->pluck(),\n 'employeeItems' => ['' => __('crud.option.employee_placeholder')] + $employee->pluck(),\n 'salaryComponentItems' => ['' => __('crud.option.salaryComponent_placeholder')] + $salaryComponent->pluck()\n ];\n }", "public function getTypeOptions()\n {\n return [\n self::TYPE_GENERIC => Yii::t('app', 'Generic'),\n ];\n }", "public function getTypeOptions()\n {\n return [\n self::TYPE_afschrijving => Yii::t('app', 'Afgeschreven'),\n self::TYPE_overdatum => Yii::t('app', 'Over datum')\n ];\n }", "public function getPaymentCurrencyOptions()\n { \n // Return the options as array\n return $this->currencyManager->toOptionArray();\n }", "function moduleOptions() {\n $sq = new sql;\n $txt = new Text($this->language, \"module_isic_card\");\n\n $list = array();\n $list[\"\"] = $txt->display(\"choose_card_type\");\n $res =& $this->db->query(\"SELECT * FROM `module_isic_card_type` ORDER BY `name`\");\n while ($data = $res->fetch_assoc()) {\n $list[$data[\"id\"]] = $data[\"name\"];\n }\n\n /*\n $list = array();\n $list[\"\"] = $txt->display(\"choose_form_type\");\n $list[1] = $txt->display(\"form_type1\");\n $list[2] = $txt->display(\"form_type2\");\n $list[3] = $txt->display(\"form_type3\");\n */\n // ####\n return array($txt->display(\"card_type\"), \"select\", $list);\n // name, type, list\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "protected function getOptions()\n {\n return [\n ['primary', 'p', InputOption::VALUE_OPTIONAL, 'Set primary key field for this Bond.'],\n ['subject', 's', InputOption::VALUE_OPTIONAL, 'Set subject for this Bond.'],\n ['host', null, InputOption::VALUE_OPTIONAL, 'Set host Blueprint class (and primary key) for this Bond.'],\n ['guest', null, InputOption::VALUE_OPTIONAL, 'Set guest Blueprint class (and primary key) for this Bond.'],\n ];\n }", "public static function get_type_option_names() {\n return array('clientid', 'secret', 'pluginname');\n }", "protected function getOptions()\n {\n return [\n ['type', 't', InputOption::VALUE_OPTIONAL, 'Responder type (plain or extended).'],\n ];\n }", "public function getWhatRequiredOptions()\n {\n $options = array(\n 1 => \"Refund\",\n 2 => \"Replacement\",\n 3 => \"Spare Part\",\n 4 => \"Other\"\n );\n return $options;\n }", "public function getInputTypesWithOptions()\n {\n $types = [];\n foreach ($this->inputTypes as $code => $inputType) {\n if ($inputType->isManageOptions()) {\n $types[] = $code;\n }\n }\n\n return $types;\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "protected function getOptions()\n {\n return array(\n\n );\n }", "protected function getOptions()\r\n {\r\n return [\r\n\r\n ];\r\n }", "public static function getTypeArray() {\n return array( \n 'to' => 'EthD20',\n 'from' => 'EthD20',\n 'gas' => 'EthQ',\n 'gasPrice' => 'EthQ',\n 'value' => 'EthQ',\n 'data' => 'EthD',\n 'nonce' => 'EthQ',\n );\n }", "public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}", "public function getCalculatorOptions()\n {\n return Driver::isShipping()->isConfigured()->orderBy('name')->lists('name', 'class');\n }", "abstract public function getOptions();", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function _getOptions() { return array(); }", "public function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n {\n return array(\n array('type', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),\n );\n }", "protected function getOptions() : array\n {\n return [];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}" ]
[ "0.7189024", "0.6917305", "0.6905179", "0.68355936", "0.6751767", "0.6741231", "0.6716977", "0.6662023", "0.6647714", "0.6623095", "0.66026396", "0.66026396", "0.66026396", "0.66026396", "0.66026396", "0.66026396", "0.66026396", "0.65639895", "0.6514214", "0.64429045", "0.6438834", "0.6437904", "0.6412902", "0.64028716", "0.63751537", "0.62861073", "0.6284947", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62826914", "0.62790686", "0.62759906", "0.6274508", "0.62716526", "0.6267205", "0.6264967", "0.6264967", "0.6264967", "0.6264967", "0.62395376", "0.6223507", "0.6217583", "0.62142766", "0.62046254", "0.6202407", "0.6201463", "0.6193692", "0.6193692", "0.6193692", "0.6193692", "0.6193692", "0.6193692", "0.6193692", "0.61907214", "0.6187646", "0.61848605", "0.61848605", "0.61848605", "0.6179753", "0.6163328", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.61627984", "0.6156752", "0.6155487", "0.61525404", "0.61525404", "0.61525404", "0.61525404", "0.61525404", "0.6145905", "0.6145905", "0.6145905", "0.6145905", "0.6145905", "0.6145905", "0.6145905" ]
0.7462306
0
Returns contract type display value
public static function get_contract_type( $key ) { $contract_options = self::contract_options(); return $contract_options[ $key ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDisplayTypeName()\n {\n $type = static::TYPE;\n\n if ($this instanceof StructureItem) {\n $type = $this->structure->getStructureName();\n }\n\n if ($this->isArray) {\n return $type . '[]';\n }\n\n if ($this->isFixedValues) {\n return '{' . implode(', ', $this->validValues) . '}';\n }\n\n return $type;\n }", "public function getTypeString(){\n\t\t$typeStr=\"\";\n\t\tswitch($this->type){\n\t\t\tcase \"fixed\": $typeStr=_(\"Montant fixe\");break;\n\t\t\tcase \"percentage\": $typeStr=_(\"Pourcentage\");break;\n\t\t\tcase \"percentage_no_transport\": $typeStr=_(\"Pourcentage sans transport\");break;\n\t\t\tcase \"transport\": $typeStr=_(\"Frais de port\");break;\n\t\t\tcase \"grid\": $typeStr=_(\"Variable\");break;\n\t\t}\n\t\treturn $typeStr;\n\t}", "public function displayType(): object\n {\n return $this->displayType;\n }", "public function displaytype()\n\t{\n\t\treturn $this->Players->displaytype($this->SqueezePlyrID);\n\t}", "public function displayType(): string\n {\n return self::DISPLAY_INLINE;\n }", "public function getTypeLabel(){\r\n\t\t$ret = \" \";\r\n\t\tswitch ($this->type){\r\n\t\t\tcase 0 : $ret = $_LANG->get('Artikel'); break;\r\n\t\t\tcase 1 : $ret = $_LANG->get('Produkt'); break;\r\n\t\t\tcase 2 : $ret = $_LANG->get('Personalisierung'); break;\r\n\t\t\tdefault: $ret = \"n.A.\";\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public function getTypeAsStr() {\n\t\t$cardtypes = array(\n\t\t\t\"race\" => 1,\n\t\t\t\"aspect\" => 2,\n\t\t\t\"power\" => 3,\n\t\t\t\"minion\" => 10,\n\t\t\t\"bane\" => 20\n\t\t);\n\t\tforeach($cardtypes as $typestr => $typeval) {\n\t\t\tif($this->cardType == $typeval) {\n\t\t\t\treturn $typestr;\n\t\t\t}\n\t\t}\n\t}", "public function getTypeLabel()\n {\n if ( $this->isCotis() ) {\n return _T(\"Membership\");\n } else {\n return _T(\"Donation\");\n }\n }", "public function get_type_name() { \n\n\t\tswitch ($this->type) { \n\t\t\tcase 'xml-rpc': \n\t\t\tcase 'rpc':\n\t\t\t\treturn _('API/RPC');\n\t\t\tbreak;\n\t\t\tcase 'network':\n\t\t\t\treturn _('Local Network Definition');\n\t\t\tbreak;\n\t\t\tcase 'interface':\n\t\t\t\treturn _('Web Interface');\n\t\t\tbreak;\n\t\t\tcase 'stream':\n\t\t\tdefault: \n\t\t\t\treturn _('Stream Access');\n\t\t\tbreak;\n\t\t} // end switch\n\n\t}", "public function getTypeDesc(){\n $type = $this->type;\n $arr = self::getTypeDescArr();\n return $arr[$type] ?? \"\";\n }", "private function getTypeDescription()\n {\n switch($this->_type)\n {\n case 'Mountain':\n return \"Mountains are peaceful places. Your ships don't do any damage here, while your tanks will do 10% less damage. Flying weapons (airplanes and helicopters) do normal damage.\" . PHP_EOL;\n case 'Water':\n return \"Water is what you drink. It's also the place where your tanks will be completely useless, but your ships will do 1000% more damage. o7\" . PHP_EOL;\n case 'Open land':\n return \"Who doesn't like the smell of grass in the morning, with a hint of blood from your enemy? Your tanks will do 1000% more damage here, while ships will do none. Good luck!\" . PHP_EOL;\n case 'Woods':\n return \"All you can do is hide, and sometimes it's the best option. Your tanks will do 40% less damage, your ships wont do any damage at all, your air vehicles will do 10% more, and your foot soldiers will do 30% more, so use them wisely. This is your chance, fella!\" . PHP_EOL;\n }\n }", "public function get_type(): string;", "public function getType()\n {\n return 'field.type.number.display.number';\n }", "abstract function typeAsString();", "public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }", "public function display_eligibility_type($type){\n\t\tif($type == 'PI'){\n\t\t\t$st = 'Profile Shortlisting';\n\t\t}else if($type == 'PS'){\t\n\t \t\t$st = 'Profile Sending';\n\t\t}else if($type == 'PC'){\n\t\t\t$st = 'Position Closing';\n\t\t}\n\t\treturn $st;\n\t}", "public function getTypeName()\n {\n return BalanceOperations::typeName($this->type_id);\n }", "protected function get_formatted_type()\n\t{\n\t\t$rc = '';\n\n\t\t$type = $this->type;\n\t\t$size = $this->size;\n\n\t\tif (!$size && $type == self::TYPE_VARCHAR)\n\t\t{\n\t\t\t$size = 255;\n\t\t}\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::TYPE_INTEGER:\n\t\t\tcase self::TYPE_TEXT:\n\t\t\tcase self::TYPE_BLOB:\n\n\t\t\t\t$t = [\n\n\t\t\t\t\tself::TYPE_BLOB => 'BLOB',\n\t\t\t\t\tself::TYPE_INTEGER => 'INT',\n\t\t\t\t\tself::TYPE_TEXT => 'TEXT',\n\n\t\t\t\t][ $type ];\n\n\t\t\t\tif (\\is_numeric($size))\n\t\t\t\t{\n\t\t\t\t\t$rc .= \"$t( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($size) . $t;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tif ($size)\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type) . \"( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type);\n\t\t\t\t}\n\t\t}\n\n\t\treturn $rc;\n\t}", "public function getDisplayVal($val, $displaytype = null, $format = null) {\n \n \n switch ($displaytype) {\n \n\n case 'yes-no':\n $displayval = $this->getDisplayYesNoType($val);\n break;\n case 'convert-datestr':\n $displayval = $this->getDisplayDatestrType($val, $format);\n break;\n \n default:\n $displayval = $val;\n break;\n }\n return $displayval;\n }", "public function getRawType()\n {\n if ( $this->isCotis() ) {\n return 'membership';\n } else {\n return 'donation';\n }\n }", "public function getTypeStr() {\n return self::getTypes()[$this->type];\n }", "public function get_ctc_type($type){\n\t\tswitch($type){\n\t\t\tcase 'T':\n\t\t\t$value = 'Thousands';\n\t\t\tbreak;\n\t\t\tcase 'L':\n\t\t\t$value = 'Lacs';\n\t\t\tbreak;\n\t\t\tcase 'C':\n\t\t\t$value = 'Crore';\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\treturn $value;\n }", "public function toString(): string\n {\n return $this->type->typeName() . '=' . $this->value->rfc2253String();\n }", "function getAllocationTypeLabel(){\n\t\t$types = getPartnerAllocationTypes();\n\t\tif(isEmptyString($this->getFarmisType())){\n\t\t\treturn '';\n\t\t}\n\t\tif(isArrayKeyAnEmptyString($this->getFarmisType(), $types)){\n\t\t\treturn '';\n\t\t}\n\t\treturn $types[$this->getFarmisType()];\n\t}", "public function type(): string\n {\n return $this->type;\n }", "public function type(): string\n {\n return $this->type;\n }", "public function getCcTypeName()\n {\n $types = $this->_paymentConfig->getCcTypes();\n $ccType = $this->getInfo()->getCcType();\n if (isset($types[$ccType])) {\n return $types[$ccType];\n }\n return empty($ccType) ? __('N/A') : $ccType;\n }", "public function type(): string;", "public function GetTypeDesc(): string {\n\t\tswitch($this->debugType) {\n\t\t\tcase self::NONE: \treturn \"NONE\";\n\t\t\tcase self::LOG: \treturn \"LOG\";\n\t\t\tcase self::DEBUG:\treturn \"DEBUG\";\n\t\t\tcase self::DEV:\t\treturn \"DEV\";\n\t\t\tdefault: \t\t\t\t\treturn \"unknown\";\n\t\t}\n\t}", "public function get_type_label() {\n\t\t$strings = astoundify_contentimporter_get_string( $this->get_type(), 'type_labels' );\n\t\treturn esc_attr( $strings[0] );\n\t}", "public static function getType(): string\n {\n return self::TYPE;\n }", "abstract protected function get_typestring();", "public function getType():string { return $this->type; }", "function ezcreditcardType ()\n {\n $this->eZDataType( self::DATA_TYPE_STRING, ezi18n( 'kernel/classes/datatypes', 'Credit card', 'Datatype name' ), array( \n 'serialize_supported' => true , \n 'object_serialize_map' => array( \n 'data_text' => 'text' \n ) \n ) );\n }", "private function getDisplayValue(string $what, $value): string\n {\n switch ($what) {\n case 'type':\n $sourceDisplayValues = self::DISPLAY_TYPE;\n\n break;\n case 'currency':\n $sourceDisplayValues = self::DISPLAY_CURRENCY;\n\n break;\n default:\n $sourceDisplayValues = [];\n\n break;\n }\n\n return (string)($sourceDisplayValues[$value] ?? $value);\n }", "public function getDisplayLabel();", "function __getInType($type = '')\n {\n\t\t\n switch ($type) {\n\t\t\t\n\t\t\tcase 'visa':\n\t\t\t $str = 'B';\n break;\n\t\t\tcase 'invoice':\n\t\t\t $str = 'F';\n break;\n\t\t\tcase 'gift_card':\n\t\t\t $str = 'G';\n break;\n\t\t\tcase 'cash':\n\t\t\t $str = 'K';\n break;\n\t\t\tcase 'account':\n\t\t\t $str = 'kk';\n break;\n\t\t\tcase '':\n\t\t\t $str = 'kk';\n break;\n default:\n\t\t\t $str = 'B';\n break;\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $str;\n\t\t\t\t\n\t}", "public function getTypeDesc () {\n return self::$typeMap[$this->type];\n }", "public function getTypeLabel()\n {\n $array = self::getTypeOptions();\n return $array[$this->type];\n }", "public function get_type();", "public function getType(): string\n {\n return ucfirst($this->type);\n }", "public function displayType(): string\n {\n return parent::DISPLAY_BLOCK;\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "public function type(): string\n {\n return $this->item['type'];\n }", "public function typeAsString()\n {\n switch ($this->_type) {\n case self::TYPE_INTEGER:\n $str = 'INTEGER';\n break;\n\n case self::TYPE_FLOAT:\n $str = 'FLOAT';\n break;\n\n case self::TYPE_VARCHAR:\n $str = 'VARCHAR';\n break;\n\n case self::TYPE_BLOB:\n $str = 'BLOB';\n break;\n\n case self::TYPE_BOOLEAN:\n $str = 'BOOLEAN';\n break;\n\n case self::TYPE_DATETIME:\n $str = 'DATETIME';\n break;\n\n case self::TYPE_TEXT:\n default:\n $str = 'TEXT';\n }\n return $str;\n }", "public function getType()\n {\n return $this->depositType;\n }", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType() :string\n {\n return $this->types[$this->type];\n }", "public function getValue() {\n return $this->type;\n }", "public function getKind()\n {\n\t\t$select = $this->_db->select();\n \t$select->from(\"catalog__data_list_property\",\"name\")->where(\"id_property=?\",$this->type_id);\n \t$rs=$this->_db->fetchCol($select);\n \tif(!empty($rs))return $rs[0];\n\t\telse return \"\";\n }", "public function getContractType()\n {\n return $this->hasOne(ContractType::className(), ['id' => 'id_contract_type']);\n }", "public function getDisplayYesNoType($val)\n {\n if (empty($val)) {\n $displayval = \"No\";\n } else { \n $displayval = \"Yes\";\n }\n \n return $displayval;\n }", "public function getType() : string{\n return $this->type;\n }", "public function getClearingType(): string;", "public function getSettingDisplayValueType()\n {\n if (array_key_exists(\"settingDisplayValueType\", $this->_propDict)) {\n return $this->_propDict[\"settingDisplayValueType\"];\n } else {\n return null;\n }\n }", "public function typeText() {\n $params = $this->types();\n return isset($params[$this->type]) ? $params[$this->type] : '';\n }", "public function getDescription() {\n return self::getDescriptionType($this->_type);\n }", "public function getType()\n {\n return parent::getValue('type');\n }", "public function getTotalFormatted( catalogTotalType $type ) : string;", "public function bank_type() {\n\t\treturn '';\n\t}", "public function fetch_complaint_type_desc($CM_COMPLAINT_TYPE){\n\t\t$this->db->select('CC_NAME');\n\t\t$this->db->where('CC_NO',$CM_COMPLAINT_TYPE);\n\t\t$query = $this->db->get('COMPLAINT_CATEGORY');\n \t\t$row = $query->row();\n\t\tif (isset($row))\n\t\t return $row->CC_NAME;\n\t}", "private function get_type() {\n\n\t}", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function getCreditTypeAttribute()\n {\n $type = @$this->attributes[\"credit_type\"] > 0 ? \"Payant\" : \"Gratuit\";\n return $type;\n }", "public function getTypeText()\n\t{\n\t\treturn Menus::getMenuTypeName($this->owner->type);\n\t}", "public function getShnttypedesc()\n {\n return $this->shnttypedesc;\n }", "public function getTypeNameWithFlags(): string\n {\n if ($this->exists() && $this->Type()->exists()) {\n $type = $this->Type();\n $title = $type->Name;\n\n return $title\n . ' ('\n . ($type->SingleSelect ? 'Single' : 'Multi')\n . ($type->InternalOnly ? '; Internal only' : '; Public')\n . ')';\n }\n\n return '';\n }", "public function __toString()\n {\n return sprintf(self::TEMPLATE, $this->value->type(), $this->role, $this->type);\n }", "public function getName()\n {\n return \"apihour_contractors_filters_type\";\n }", "public function getCardCvv()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType(): string\n {\n }", "public function getTypeTitle()\n {\n return 'Verify Account';\n }", "public function getFormattedEntityType();", "public function ctc_type($data){\n\t\tif($data == 'T'){ \n\t\t\t$text = \"Thousand\";\n\t\t}elseif($data == 'L'){ \n\t\t\t$text = \"Lacs\";\n\t\t}elseif($data == 'C'){ \n\t\t\t$text = \"Crore\";\n\t\t}\n\t\treturn $text;\n }", "public function getType(): string {\n return $this->type;\n }", "public function get_type(): string {\n\t\treturn $this->type;\n\t}", "public function getDisplayValue($name)\n\t{\n\t\tswitch ($name) {\n\t\t\tcase 'server_id':\n\t\t\t\t$servers = Settings_WebserviceApps_Record_Model::getInstanceById($this->get($name));\n\t\t\t\treturn $servers ? $servers->getName() : '<span class=\"redColor\">ERROR</span>';\n\t\t\tcase 'crmid':\n\t\t\t\treturn $this->get($name) ? \\App\\Record::getLabel($this->get($name)) : '';\n\t\t\tcase 'status':\n\t\t\t\treturn empty($this->get($name)) ? 'PLL_INACTIVE' : 'PLL_ACTIVE';\n\t\t\tcase 'user_id':\n\t\t\t\treturn \\App\\Fields\\Owner::getLabel($this->get($name));\n\t\t\tcase 'language':\n\t\t\t\treturn $this->get($name) ? \\App\\Language::getLanguageLabel($this->get($name)) : '';\n\t\t\tcase 'type':\n\t\t\t\t$label = \\App\\Language::translate($this->getTypeValues($this->get($name)), $this->getModule()->getName(true));\n\t\t\t\treturn \\App\\TextParser::textTruncate($label);\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $this->get($name);\n\t}", "protected function LiveTaxType()\n {\n if ($this->isExclusive()) {\n return 'Exclusive';\n }\n\n return 'Inclusive';\n }", "public function getType() : string\n {\n return $this->type;\n }", "public function getType() : string\n {\n return $this->type;\n }", "public function getType() : string\n {\n return $this->type;\n }", "public function getCompareTypeLabel()\n {\n $compareType = $this->checkCompareType();\n if ($compareType === false)\n throw new Exception(\"Compare type is not set\");\n \n if ($compareType == self::COMPARE_TYPE_BY_BOX)\n return \"Box\";\n \n if ($compareType == self::COMPARE_TYPE_BY_TIMECODE)\n return \"Timecode\";\n \n return '';\n }", "public function getType() : string {\n return $this->type;\n }", "public function getVisualType(): string\n {\n return $this->visualType;\n }", "public function type() : string;", "public function name() {\n\t\t\treturn $this->_name . ' ('.self::$type_name[$this->_type].')';\n\t\t}" ]
[ "0.69984186", "0.68459356", "0.679686", "0.674576", "0.67346764", "0.6714916", "0.6610324", "0.6503302", "0.6441516", "0.643896", "0.6419907", "0.63962895", "0.6364788", "0.6348404", "0.62868965", "0.6274336", "0.6261461", "0.62547326", "0.62367463", "0.6227893", "0.6211395", "0.61971617", "0.6192395", "0.6188365", "0.6185748", "0.6185748", "0.6183178", "0.6166793", "0.61564994", "0.6146449", "0.6146414", "0.612869", "0.61269844", "0.6125838", "0.6124514", "0.6095279", "0.60924596", "0.60860723", "0.6060666", "0.60515505", "0.6035402", "0.6031015", "0.60303545", "0.6029662", "0.6022162", "0.60220826", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.60167146", "0.6016572", "0.60110795", "0.5994969", "0.59890825", "0.59856063", "0.59775007", "0.5971295", "0.5960489", "0.5956052", "0.5953745", "0.59517586", "0.5948428", "0.59448916", "0.5939242", "0.5934035", "0.59224296", "0.59224296", "0.59222084", "0.59221476", "0.592211", "0.59201616", "0.59169", "0.59148705", "0.59132355", "0.59071374", "0.59036255", "0.59026164", "0.58796215", "0.58792657", "0.58675575", "0.58633417", "0.58568645", "0.58558226", "0.58526886", "0.5848527", "0.5847626", "0.5847626", "0.5847626", "0.58442014", "0.5834997", "0.5833157", "0.5831736", "0.58242667" ]
0.0
-1
Metabox for public facilities
public static function metabox_floor_plans( $post_type ) { $metabox_id = INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'floor_plans_box'; $field_id = INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'floor_plans'; $cmb = new_cmb2_box( array( 'id' => $metabox_id, 'title' => apply_filters( 'inventor_metabox_title', __( 'Floor plans', 'inventor-properties' ), $metabox_id, $post_type ), 'description' => apply_filters( 'inventor_metabox_description', __( 'Upload some floor plans images.', 'inventor-properties' ), $metabox_id, $post_type ), 'object_types' => array( $post_type ), 'context' => 'normal', 'priority' => 'high', 'skip' => true, 'show_in_rest' => true, ) ); $field_name = __( 'Floor plans', 'inventor-properties' ); $cmb->add_field( array( 'id' => $field_id, 'type' => 'file_list', 'name' => apply_filters( 'inventor_metabox_field_name', $field_name, $metabox_id, $field_id, $post_type ), 'description' => apply_filters( 'inventor_metabox_field_description', null, $metabox_id, $field_id, $post_type ), 'default' => apply_filters( 'inventor_metabox_field_default', null, $metabox_id, $field_id, $post_type ), 'attributes' => apply_filters( 'inventor_metabox_field_attributes', array(), $metabox_id, $field_id, $post_type ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function abilityGet();", "public function access();", "function factures_autoriser(){}", "abstract protected function canAccess();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public static function metabox_public_facilities( $post_type ) {\n $metabox_id = INVENTOR_LISTING_PREFIX . $post_type . '_public_facilities_box';\n $field_id = INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities';\n\n if ( ! is_admin() ) {\n add_filter( 'cmb2_override_' . $field_id . '_group_meta_value', array( __CLASS__, 'set_default_value' ) , 0, 4 );\n }\n\n $facilities_default = apply_filters( 'inventor_metabox_field_default', null, $metabox_id, $field_id, $post_type );\n\n new_cmb2_box( array(\n 'id' => $metabox_id,\n 'title' => __( 'Public facilities', 'inventor-properties' ),\n 'object_types' => array( $post_type ),\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true,\n 'show_in_rest' => true,\n 'skip' => true,\n 'fields' => array(\n // group\n array(\n 'id' => $field_id,\n 'type' => 'group',\n 'post_type' => $post_type,\n 'custom_value'\t => $facilities_default,\n 'options' \t => array(\n 'group_title' => __( 'Public Facility', 'inventor-properties' ),\n 'add_button' => __( 'Add Another Public Facility', 'inventor-properties' ),\n 'remove_button' => __( 'Remove Public Facility', 'inventor-properties' ),\n ),\n 'fields' => array(\n // group fields\n array(\n 'id' => INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities_key',\n 'name' => __( 'Key', 'inventor-properties' ),\n 'type' => 'text',\n 'custom_value'\t => $facilities_default,\n ),\n array(\n 'id' => INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities_value',\n 'name' => __( 'Value', 'inventor-properties' ),\n 'type' => 'text',\n 'custom_value'\t => $facilities_default,\n ),\n ),\n ),\n ),\n ) );\n }", "private function metodo_privado() {\n }", "function egsr_staff_cap(){\n \n return Array ( \n 'read' => true,\n );\n}", "function isPublic();", "public static function right_public(){return false;}", "public function isPublic() {}", "public function __construct(){\n\n // Ensure the EA access is loaded\n b_reg::load_module(EA_MODULE);\n EA_access();\n \n parent::__construct();\n \n bForm_Avatar::set_context(bAuth::$av);\n $authenticated = bAuth::authenticated();\n $this->who_is_here(array('VM_manager_here' => array('rank'=> 'RANK_vm_manager',\n\t\t\t\t\t\t\t 'def' => 'superUser_here'),\n\t\t\t 'VM_prg_coordinator_here'=> array('rank'=> 'RANK_vm_prg_coordinator',\n\t\t\t\t\t\t\t 'def' => 'VM_manager_here'),\n\t\t\t 'VM_visitor_here' => array('rank'=> 'RANK_vm_visitor'),\n\t\t\t 'VM_registrant_here' => array('rank'=> 'RANK_vm_registrant'),\n\t\t\t 'VM_stranger_here' => array('rank'=> 'RANK__authenticated'),\n\t\t\t 'VM_organizer_here' => array('IF' => ((VM::e_ID() && VM::$e->isOrganizer()) || VM::isOrganizer())),\n\t\t\t 'VM_endorser_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isEndorser') && bAuth::$av->isEndorser())),\n\t\t\t 'VM_employee_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isE') && bAuth::$av->isE())),\n\t\t\t 'VM_lt_visitor_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isV') && bAuth::$av->isV())),\n\t\t\t ));\n\n $this->who_is_here(array('VM_guests_handlare_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_guests))),\n\t\t\t 'VM_rooms_updater_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_update_rooms))),\n\t\t\t 'VM_reimberser_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_reimbursement))),\n\t\t\t 'VM_unlocker_here' =>array('IF'=> ($authenticated &&(VM_administrators()->isHandlingDuty(DUTY_unlock_events)||VM_manager_here))),\n\t\t\t 'VM_external_registrant_here'=>array('IF'=>VM_registrant_here && !VM_lt_visitor_here && !VM_employee_here),\n\t\t\t 'VM_administrator_here' =>array('IF'=>VM_endorser_here || VM_organizer_here || VM_prg_coordinator_here), \n\t\t\t ));\n\n $this->who_is_here(array('VM_member_here' =>array('IF'=>EA_member_here() || VM_external_registrant_here || VM_organizer_here),\n\t\t\t ));\n }", "abstract protected function attributes();", "abstract public function permission(): string;", "public function memberable()\n\t{\n\t\treturn $this->shifter();\n\t}", "function pati_initialize_capabilities(){\r\n $admin = get_role( 'administrator' );\r\n $subscriber = get_role( 'subscriber' );\r\n $editor = get_role( 'editor' ); \r\n\r\n /**\r\n * General Capability for the Ticket CRUD Operations\r\n */\r\n $admin->add_cap('edit_ticket');\r\n $admin->add_cap('edit_tickets');\r\n $admin->add_cap('read_ticket');\r\n $admin->add_cap('delete_ticket');\r\n $admin->add_cap('edit_others_tickets');\r\n $admin->add_cap('publish_tickets');\r\n $admin->add_cap('read_private_tickets');\r\n $admin->add_cap('delete_private_tickets');\r\n $admin->add_cap('delete_published_tickets');\r\n $admin->add_cap('delete_others_tickets');\r\n $admin->add_cap('edit_private_tickets');\r\n $admin->add_cap('edit_published_tickets');\r\n $admin->add_cap('assign_ticket');\r\n\r\n /**\r\n * Capabilities for the Editor User\r\n */\r\n $editor->add_cap('edit_ticket');\r\n $editor->add_cap('edit_tickets');\r\n $editor->add_cap('read_ticket');\r\n $editor->add_cap('delete_ticket');\r\n $editor->add_cap('edit_others_tickets');\r\n $editor->add_cap('publish_tickets');\r\n $editor->add_cap('read_private_tickets');\r\n $editor->add_cap('delete_private_tickets');\r\n $editor->add_cap('delete_published_tickets');\r\n $editor->add_cap('delete_others_tickets');\r\n $editor->add_cap('edit_private_tickets');\r\n $editor->add_cap('edit_published_tickets');\r\n $editor->add_cap('assign_ticket');\r\n\r\n /**\r\n * Additional Capabilities for Subscriber\r\n */\r\n $subscriber->add_cap('edit_ticket');\r\n $subscriber->add_cap('read_ticket');\r\n $subscriber->add_cap('edit_tickets');\r\n}", "public function truycapvao_private_cha(){\n }", "abstract public function require_access();", "function _gizra_access_strongarm() {\n $export = array();\n $strongarm = new stdClass;\n $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */\n $strongarm->api_version = 1;\n $strongarm->name = 'content_profile_use_profile';\n $strongarm->value = 1;\n\n $export['content_profile_use_profile'] = $strongarm;\n return $export;\n}", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "function user_can_richedit()\n {\n }", "public static function meta();", "public function property_facilities() {\n\n\t\t\tif ( $this->add_package !== 3 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$building_area = get_field( 'building_area' );\n\t\t\t$branch_clinics = get_field( 'branch_clinics' );\n\t\t\t$days_open = get_field( 'days_open' );\n\n\t\t\t$off_street_parking = get_field( 'off_street_parking' );\n\t\t\t$car_spaces = get_field( 'car_spaces' );\n\n\t\t\t$number_of_computer = get_field( 'number_of_computer' );\n\n\t\t\t$ownership = get_field_object( 'ownership' );\n\t\t\t$ownership_value = get_field( 'ownership' );\n\t\t\t$ownership_label = $ownership['choices'][ $ownership_value ];\n\n\n\t\t\t$out = '<h4>Facilities</h4>';\n\t\t\t$out .= '<ul>';\n\t\t\t$out .= '<li><em>Building is:</em> ' . $ownership_label . '</li>';\n\n\n\t\t\t$realestate_is_for = get_field( 'realestate_is_for' );\n\t\t\t$building_ownership = get_field( 'ownership' );\n\n\t\t\tif ( $realestate_is_for == 'for_lease' && $building_ownership == 'rented' ) {\n\t\t\t\t$real_estate_lease_details = get_field( 'real_estate_lease_details' );\n\t\t\t\t$out .= '<li><em>Building is for Lease:</em> ' . $real_estate_lease_details . '</li>';\n\t\t\t} else if ( $realestate_is_for == 'for_lease' && $building_ownership == 'owned' ) {\n\t\t\t\t$out .= '<li><em>Building is for Lease:</em> ' . $real_estate_lease_details . '</li>';\n\t\t\t} else if ( $practice_is_for == 'For Lease' && $building_ownership == 'owned' ) {\n\t\t\t\t$practice_lease_details = get_field( 'practice_lease_details' );\n\t\t\t\t$out .= '<li><em>Practice is for Lease:</em> ' . $practice_lease_details . '</li>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * ACF\n\t\t\t *\n\t\t\t * Practice is for : practice_is_for = For Sale || For Lease || For Sale/Lease\n\t\t\t * Practice Lease Details : practice_lease_details\n\t\t\t *\n\t\t\t *\n\t\t\t * Real Estate is for : realestate_is_for = for_sale : For Sale || for_lease : For Lease\n\t\t\t * Real Estate Lease Details : real_estate_lease_details\n\t\t\t *\n\t\t\t * Ownership: ownership = owned : Owned || rented : Rented\n\t\t\t *\n\t\t\t *\n\t\t\t * COMBINATIONS\n\t\t\t *\n\t\t\t * if ownership == owned || realestate_is_for == for_lease\n\t\t\t * Real Estate is 'owned' - is not part of the sale - but can be 'leased' = real_estate_lease_details\n\t\t\t *\n\t\t\t * if ownership == rented || realestate_is_for == for_lease\n\t\t\t * Real Estate is 'leased' the lease details are = real_estate_lease_details\n\t\t\t *\n\t\t\t * if ownership == owned || realestate_is_for == for_sale\n\t\t\t * Real Estate is 'owned' and is for sale = property_realestate_value\n\t\t\t *\n\t\t\t * if ownership == rented || realestate_is_for == for_sale\n\t\t\t * Real Estate is 'leased' - real estate owner is open to selling = Lessor is open to selling\n\t\t\t *\n\t\t\t *\n\t\t\t * if practice_is_for == For Sale\n\t\t\t * total_value or P.O.A.\n\t\t\t *\n\t\t\t *\n\t\t\t * if practice_is_for == For Lease\n\t\t\t * practice_lease_details\n\t\t\t *\n\t\t\t * if practice_is_for == For Sale/Lease\n\t\t\t * total_value or P.O.A. || practice_lease_details\n\t\t\t *\n\t\t\t *\n\t\t\t * /**/\n\t\t\tif ($building_area) {\n\t\t\t$out .= '<li><em>Building Area:</em> ' . $building_area . ' sqm</li>';\n\t\t\t}\n\n\n\t\t\t$kennels = get_field( 'kennels' );\n\t\t\t$stables = get_field( 'stables' );\n\n\t\t\tif ( $kennels || $stables ) {\n\t\t\t\t$out .= '<li><em>Facilities Include: </em>';\n\t\t\t\tif ($kennels && $stables) {\n\t\t\t\t$out .= 'Kennels, Stables';\n\t\t\t\t} else if ($kennels && !$stables) {\n\t\t\t\t$out .= 'Kennels';\n\t\t\t\t} else if (! $kennels && $stables) {\n\t\t\t\t$out .= 'Stables';\n\t\t\t\t}\n\t\t\t\t$out .= '</li>';\n\t\t\t}\n\n\t\t\tif ( $off_street_parking ) {\n\t\t\t\t$out .= '<li><em>Car Parks:</em> ' . $car_spaces . '</li>';\n\t\t\t}\n\n\t\t\tif ( get_field( 'computer_software' ) == 'Other' ) {\n\t\t\t\t$other_software = get_field( 'other_software' );\n\t\t\t\t$computer_software_label = $other_software;\n\t\t\t} else {\n\t\t\t\t$computer_software = get_field_object( 'computer_software' );\n\t\t\t\t$computer_software_value = get_field( 'computer_software' );\n\t\t\t\t$computer_software_label = $computer_software['choices'][ $computer_software_value ];\n\t\t\t}\n\n\t\t\t$out .= '<li><em>Computer Software:</em> ' . $computer_software_label . '</li>';\n\n\n\t\t\tif ( $number_of_computer ) {\n\t\t\t\t$out .= '<li><em>No. Computers:</em> ' . $number_of_computer . '</li>';\n\t\t\t}\n\n\t\t\t$out .= '</ul>';\n\n\t\t\treturn $out;\n\t\t}", "function _gizra_access_flag_default_flags() {\n$flags = array();\n// Exported flag: \"Show content\".\n$flags[] = array (\n 'content_type' => 'node',\n 'name' => 'show_content',\n 'title' => 'Show content',\n 'global' => '0',\n 'types' => \n array (\n 0 => 'product',\n ),\n 'flag_short' => 'Show privileged content',\n 'flag_long' => 'Show content for privileged users',\n 'flag_message' => '',\n 'unflag_short' => 'Hide privilged content',\n 'unflag_long' => 'Show content from non-privileged users',\n 'unflag_message' => '',\n 'unflag_denied_text' => '',\n 'link_type' => 'normal',\n 'roles' => \n array (\n 'flag' => \n array (\n ),\n 'unflag' => \n array (\n ),\n ),\n 'show_on_page' => 1,\n 'show_on_teaser' => 0,\n 'show_on_form' => 0,\n 'access_author' => '',\n 'i18n' => 0,\n 'module' => 'gizra_access',\n 'locked' => \n array (\n 0 => 'name',\n ),\n 'api_version' => 2,\n);\nreturn $flags;\n}", "public function isPublic($name);", "public function mikrotik_access() {\n\t\treturn true;\n\t}", "function __construct(){\n\t\tparent::__construct();\n\t\t$hak_akses = array(0,2);\n\t\tno_access($hak_akses);\n\t}", "public function metas();", "function flag_friend_flag_friend_is_friend_ctools_access() {\n return array(\n 'title' => t(\"User: Flag friend relationship\"),\n 'description' => t('Compare the current user and logged in user flag friend status.'),\n 'callback' => 'flag_friend_flag_friend_is_friend_access_check',\n 'default' => array(\n 'is_friend' => 1,\n ),\n 'settings form' => 'flag_friend_flag_friend_is_friend_settings',\n 'summary' => 'flag_friend_flag_friend_is_friend_ctools_access_summary',\n 'required context' => array(\n new ctools_context_required(t('First User'), 'user'),\n new ctools_context_required(t(\"Second User\"), 'user')\n ),\n );\n}", "function metas_autoriser() {\n}", "function load_Info()\n {\n\n $this->Facility_Info($this->facilities[0]);\n }", "function egsr_group_admin_cap(){\n return Array ( \n 'add_users' => true,\n 'create_users' => true,\n 'delete_users' => true,\n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'edit_users' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}", "function optinpanda_make_internal_license_manager( $internal ) { global $optinpanda;\r\nif ( in_array( $optinpanda->license->type, array( 'free' ) ) ) {\r\n return $internal; \r\n}\r\n\r\n \r\n\r\n \r\n if ( BizPanda::isSinglePlugin() ) return $internal;\r\n return true;\r\n}", "public function isAccess();", "public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }", "static function userClassesThatCanSeePrivate() {\n return array('Administrator', 'Member');\n }", "function livraison_autoriser() {}", "function admin_member() {\n\n\t\t}", "private function public_hooks()\n\t{\n\t}", "public function isModerador(){ return false; }", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function relatorio4(){\n $this->isAdmin();\n }", "public static function IamAbleTo() {\n\t\treturn array(\n\t\t\t\"search on wikipedia for people and things\"\n\t\t);\n\t}", "abstract public function user();", "public function facilities()\n {\n return $this->morphToMany(Facility::class, 'person', 'facility_person')\n ->withTrashed()\n ->withPivot('discipline_id', 'tm_license', 'old_license', 'active')\n ->orderBy('discipline_id', 'ASC');\n }", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "function amap_ma_not_permit_public_access() {\n \n return false;\n}", "function system_mod_user($paramvect)\n{\n\n}", "abstract function is_developer();", "public function publicUser()\n {\n return $this->state(function (array $attributes) {\n return [\n 'is_public' => 1,\n ];\n });\n }", "static function SamDesplayInfoMember()\n\t\t{\n\t\t\n\t\t self::$UID = UID;\n\t\t\t\n\t\t\t// filed user\n\t\t\t\n\t\t\t$User_Sam_Filed = implode(',',parent::$FILED['USER']);\n\t\t\t\n\t\t\t// user in object\n\t\t\t\n\t\t\t$User_Object = parent::SamSetObject($User_Sam_Filed,'users','WHERE `user_id` = \"'.self::$UID.'\"');\n\t\t\t\n\t\t\t/* user level */\n\t\t\t\n\t\t\t$Sam_Memb_JS = vJs('user_level',$User_Object->u_level);\n\t\t\n\t\t/*\n\t\t\t\t\t\t'`user_id`',' `u_name`', '`u_login_name`', '`u_pass`', '`u_def_pass`', '`u_email`',' `u_country`', '`u_level`', '`u_posts`',\n\t\t\t\t'`u_points`',' `u_reg_date`', '`u_lh_date`', '`u_lp_date`',' `u_last_ip`', '`u_ip`', '`u_occupation`', '`u_sex`',' `u_age`',\n\t\t\t\t'`u_online`', '`u_bio`', '`u_sig`', '`u_marstatus`', '`u_city`', '`u_state`', '`u_photo_url`', '`u_title`', '`view`', '`u_color`', '`u_browse`',\n\t\t\t\t'`u_face`', '`u_allowmsg`', '`u_last_level`', '`u_status`', '`u_color_choise`', '`u_skin`',' `u_opacity`','`u_template`' \n\t\t\t\t\n\t\t*/\n\t\t\n\t\t /* user home page */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_homepage',$User_Object->u_home_page);\n\t\n\t\t\t/* user home user_link1 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link1',$User_Object->u_link1);\n\t\n\t\t /* user home user_link2 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link2',$User_Object->u_link2);\n\t\n\t /* user home user_quote */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_quote',$User_Object->u_quote);\n\t\n\t\t /* user home user_hobbies */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_hobbies',$User_Object->u_hobbies);\n\t\n\t\t /* user home user_lnews */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_lnews',$User_Object->u_lnews);\n\t\n\t /* user home user_skin */\n $Sam_Memb_JS .= vJs('user_skin',$User_Object->u_skin);\n\t\n\t // get user skin\n\t\t $font = self::SamGetAutrInfo();\n\t\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_font',$font['user_font_face']);\n\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_fontsize',$font['user_fontsize']);\n\t \n\t\t/* user home user_fontcolor */\n $Sam_Memb_JS .= vJs('user_fontcolor',$font['user_fontcolor']);\n\t\n /* user home user_fontalign */\n $Sam_Memb_JS .= vJs('user_fontalign',$font['user_fontalign']);\n\t\n /* user home user_opacity */\n $Sam_Memb_JS .= vJs('user_opacity',$User_Object->u_opacity);\n\t\n /* user home user_title */\n $Sam_Memb_JS .= vJs('user_title',$User_Object->u_title);\n\t \n \t /* user home user_country */\n $Sam_Memb_JS .= vJs('user_country',$User_Object->u_country);\n\t \n\t /* user home user_gender */\n $Sam_Memb_JS .= vJs('user_gender',$User_Object->u_sex);\n\t\n /* user home user_photo_url */\n $Sam_Memb_JS .= vJs('user_photo_url',$User_Object->u_photo_url);\n\t\n /* user home sira datia */\n $Sam_Memb_JS .= vJs('user_bio',$User_Object->u_bio);\n\t\n /* user home user_age */\n $Sam_Memb_JS .= vJs('user_age',$User_Object->u_age);\n\t\n /* user home user_city */\n $Sam_Memb_JS .= vJs('user_city',$User_Object->u_city);\n\t\n \n\t /* user home sitiation */\n $Sam_Memb_JS .= vJs('user_marstatus',$User_Object->u_marstatus);\n\t\n \n\t /* user home job */\n $Sam_Memb_JS .= vJs('user_occupation',$User_Object->u_occupation);\n\t\n \n\t /* user home zon mecheria */\n $Sam_Memb_JS .= vJs('user_state',$User_Object->u_status);\n\t\n return $Sam_Memb_JS;\n\t\t}", "abstract function is_only_premium();", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "public function is_public(): bool;", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "abstract function is_premium();", "public function metodo_publico() {\n }", "public function __get($name)\n {\n echo \"Lecture de l'attribut $name inaccessible<br/>\";\n }", "function jmw_customize_profile_visibility( $allowed_visibilities ) {\n\n\t$allowed_visibilities[ 'moderated' ] = array(\n\t\t'id'\t=> 'moderated',\n\t\t'label'\t=> _x( 'No-one - In Moderation', 'Visibility level setting', 'bp-extended-profile-visibility' )\n\t);\n\n\treturn $allowed_visibilities;\n}", "function etc_memberships() {\n return ETC_Memberships::instance();\n}", "private function privateDummy()\n {\n }", "public function getAllowSpecific();", "function __construct()\n {\n $this->reqAdminToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyAdminsCanTagTalks', 'false')->getKey('value'));\n $this->reqCreatorToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyTagCreatorsCanEditTalkTags', 'true')->getKey('value'));\n return parent::__construct();\n }", "public function __construct()\n {\n\t\t$this->user=User::find(Auth::id());\n\t\t$this->role_name=$this->user->role->name;\n\t\tif($this->role_name==\"Admin\" || $this->role_name==\"SubAdmin\")\n\t\t\t$this->entrypoints=Entrypoint::whereIn('type',[1,3])->get();\n\t\telseif($this->role_name==\"Receiption\" || $this->role_name==\"Entrypoint\" || $this->role_name==\"Desk\"){\n\t\t\t$this->entrypoints=$this->user->entrypoints()->get();\n\t\t\t$this->entrypoint_sub_type=$this->user->entrypoints()->first()->sub_type;\n\t\t}\n\t\telseif($this->role_name==\"Doctor\" || $this->role_name==\"Nursing\")\n\t\t\t$this->medicalunits=$this->user->medicalunits()->orderBy('type','asc')->get();\n \n }", "function can();", "public function hasUsageRights() {}", "public function attributes();", "function acf_current_user_can_admin()\n{\n}", "public function adminMatters(){\n\n }", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "function info()\n\t{\n\t\tif (get_forum_type()!='ocf') return NULL;\n\t\tif (($GLOBALS['FORUM_DB']->query_value('f_members','COUNT(*)')<=3) && (get_param('id','')!='ocf_members') && (get_param_integer('search_ocf_members',0)!=1)) return NULL;\n\n\t\trequire_lang('ocf');\n\n\t\t$info=array();\n\t\t$info['lang']=do_lang_tempcode('MEMBERS');\n\t\t$info['default']=false;\n\t\t$info['special_on']=array();\n\t\t$info['special_off']=array();\n\t\t$info['user_label']=do_lang_tempcode('USERNAME');\n\t\t$info['days_label']=do_lang_tempcode('JOINED_AGO');\n\n\t\t$extra_sort_fields=array();\n\t\tif (has_specific_permission(get_member(),'view_profiles'))\n\t\t{\n\t\t\trequire_code('ocf_members');\n\t\t\t$rows=ocf_get_all_custom_fields_match(NULL,1,1);\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$extra_sort_fields['field_'.strval($row['id'])]=$row['trans_name'];\n\t\t\t}\n\t\t}\n\t\t$info['extra_sort_fields']=$extra_sort_fields;\n\n\t\treturn $info;\n\t}", "abstract public function is_have();", "public function component_info() {\n return array(\n 'name' => 'Accessibility Content Utility',\n 'description' => 'Add utility functions to Content for Accessibility',\n 'category' => 'accessibility',\n );\n }", "public function provides();", "public function esPublica()\n {\n return false;\n }", "public function __construct()\n\t{\n\t\tparent::__construct('fuel_permissions');\n\t}", "function mis_capacitaciones() {\n\t$my_courses = get_posts( array(\n\t\t'post_type' => 'sfwd-courses',\n\t\t'post_author' => 1,\n\t\t'meta_key' => 'fachada_servicio',\n\t\t'meta_value' => 'fachada_CAPACITACION'\t\n\t));\n\n\n\t/**\n\t * ATENCION CON EL HARDCODE = 1\n\t */\n\treturn add_course_meta($my_courses);\n}", "function hook_roomify_rights_group() {\n $rights['roomify_rights'] = array(\n 'group_manager' => array(\n 'add member',\n ),\n );\n\n return $rights;\n}", "function og_views_extra_views_plugins() {\n return array(\n 'access' => array(\n 'group_member' => array(\n 'title' => t('Group Membership'),\n 'help' => t('Member of the current organic group'),\n 'handler' => 'og_views_extra_plugin_access_group_member',\n 'help topic' => 'access-none',\n 'uses options' => TRUE,\n ),\n )\n );\n}", "private function define_public_hooks() {\n\n// $public = new Single_Post_Meta_Manager_Public( $this->get_version() );\n// $this->loader->add_action( 'the_content', $public, 'display_post_meta_data' );\n\n $public = new Online_Magazine_Manager_Public( $this->version );\n $this->loader->add_action( 'query_vars', $public, 'register_query_vars' );\n $this->loader->add_action( 'pre_get_posts', $public, 'fix_archive_query_with_rubrics_filter' );\n Online_Magazine_Theme_Functions::define_theme_functions();\n add_image_size( 'thumb-article-homepage', 370, 180, true);\n\n }", "function isPartOfMinimalUsableSystem() ;", "static function plInfo()\n {\n return array(\n \"plShortName\" => _(\"Argonaut Mirror settings\"),\n \"plDescription\" => _(\"Argonaut Mirror settings\").\" (\"._(\"Services\").\")\",\n \"plIcon\" => \"plugins/argonaut/images/iconMiniMirrorConfig.png\",\n\n \"plProvidedAcls\" => parent::generatePlProvidedAcls(self::getAttributesInfo())\n );\n }", "protected function protectedDummy()\n {\n }", "public function getPersonal();", "function _gizra_access_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create profile content\n $permissions[] = array(\n 'name' => 'create profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own profile content\n $permissions[] = array(\n 'name' => 'edit own profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view field_hidden_field\n $permissions[] = array(\n 'name' => 'view field_hidden_field',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }", "function isProtected() ;", "function op_api_member($member)\n{\n if (!$member)\n {\n return null;\n }\n\n $viewMemberId = sfContext::getInstance()->getUser()->getMemberId();\n\n $memberImageFileName = $member->getImageFileName();\n if (!$memberImageFileName)\n {\n $memberImage = op_image_path('no_image.gif', true);\n }\n else\n {\n $memberImage = sf_image_path($memberImageFileName, array('size' => '48x48'), true);\n }\n\n $relation = null;\n if ((string)$viewMemberId !== (string)$member->getId())\n {\n $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($viewMemberId, $member->getId());\n }\n\n $selfIntroduction = $member->getProfile('op_preset_self_introduction', true);\n\n return array(\n 'id' => $member->getId(),\n 'profile_image' => $memberImage,\n 'screen_name' => $member->getConfig('op_screen_name', $member->getName()),\n 'name' => $member->getName(),\n 'profile_url' => op_api_member_profile_url($member->getId()),\n 'friend' => $relation ? $relation->isFriend() : false,\n 'blocking' => $relation ? $relation->isAccessBlocked() : false,\n 'self' => $viewMemberId === $member->getId(),\n 'friends_count' => $member->countFriends(),\n 'self_introduction' => $selfIntroduction ? (string)$selfIntroduction : null,\n );\n}", "public static function\tDescriptors()\n {\n $accesses = array(\"Default\" => array(\"Public\" => self::TypePublic));\n\n if (Cache::Exist(\"user\") == false)\n\treturn $accesses;\n\n $user = Cache::Get(\"user\");\n\n $accesses[\"Default\"][\"Private\"] = $user->id;\n\n foreach (self::$entities as $entity)\n\t{\n\t // XXX[we could perform theses operations in parallel to speed up the process]\n\t $access = call_user_func($entity . \"::Access\", $user->id);\n\n\t if (empty($access) == true)\n\t continue;\n\n\t $accesses[$entity] = array();\n\n\t foreach ($access as $object)\n\t $accesses[$entity][$object[\"name\"]] = $object[\"id\"];\n\t}\n\n return $accesses;\n }", "public function getFriendableForCurrentProvider(): array;", "abstract function getEmissionFactors();", "public function getFacility();", "function dynamo_support_create_default_role() {\n global $wp_roles;\n if($wp_roles->get_role('administrator')) {\n $admin = $wp_roles->get_role('administrator');\n //Tickets\n $admin->add_cap('access_tickets');\n $admin->add_cap('publish_tickets');\n $admin->add_cap('edit_tickets');\n $admin->add_cap('delete_tickets');\n $admin->add_cap('delete_others_tickets');\n $admin->add_cap('edit_others_tickets');\n $admin->add_cap('read_private_tickets');\n $admin->add_cap('read_tickets');\n $admin->add_cap('read_ticket');\n $admin->add_cap('edit_ticket');\n $admin->add_cap('delete_ticket');\n //Articles\n $admin->add_cap('access_knowledgebase');\n $admin->add_cap('publish_articles');\n $admin->add_cap('edit_articles');\n $admin->add_cap('delete_articles');\n $admin->add_cap('delete_others_articles');\n $admin->add_cap('edit_others_articles');\n $admin->add_cap('read_others_articles');\n $admin->add_cap('read_article');\n $admin->add_cap('edit_article');\n $admin->add_cap('delete_article');\n $admin->add_cap('read_private_articles');\n //Feedback\n $admin->add_cap('access_feedback');\n //Assignment\n $admin->add_cap('view_all_tickets');\n }\n\n //Add Support Admin Role which allows full access to KB and Tickets but no posts/pages plugin setting etc...\n if(!$wp_roles->get_role('support_admin')) {\n $super_ticket = $wp_roles->add_role('support_admin','Support Admin', array(\n 'access_tickets' => true,\n 'access_knowledgebase' => true,\n 'publish_tickets' => true,\n 'publish_articles' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'publish_articles' => true,\n 'edit_articles' => true,\n 'delete_articles' => true,\n 'delete_others_articles' => true,\n 'edit_others_articles' => true,\n 'read_private_articles' => true,\n 'read_articles' => true,\n 'read' => true,\n 'read_article' => true,\n 'userstatistics' => true,\n 'access_feedback' => true\n )\n );\n }\n //Add 2 Standard Roles Billing & Affiliate dept (user can delete if needed)\n if(!$wp_roles->get_role('billing-dept')) {\n $super_ticket = $wp_roles->add_role('billing-dept','Billing Dept', array(\n 'access_tickets' => true,\n 'publish_tickets' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'read' => true,\n 'userstatistics' => true,\n 'access_tickets_1' => true,\n )\n );\n }\n if(!$wp_roles->get_role('affiliate-dept')) {\n $super_ticket = $wp_roles->add_role('affiliate-dept','Affiliate Dept', array(\n 'access_tickets' => true,\n 'publish_tickets' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'read' => true,\n 'userstatistics' => true,\n 'access_tickets_0' => true,\n )\n );\n }\n }", "function vimport_abonnes_autoriser() {\n}", "function mots_autoriser() {\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 }", "abstract protected function interface();" ]
[ "0.61924416", "0.6068419", "0.5823664", "0.57875204", "0.5682973", "0.5682973", "0.5682973", "0.5682973", "0.5682973", "0.56641155", "0.56594133", "0.5654551", "0.5624027", "0.5586615", "0.558501", "0.5569376", "0.55499095", "0.5533781", "0.5532558", "0.55268484", "0.5513156", "0.55062664", "0.54836833", "0.5453744", "0.543216", "0.5431229", "0.5416201", "0.54038787", "0.53954166", "0.5385543", "0.5366565", "0.5331131", "0.5328764", "0.5313119", "0.5309666", "0.5308258", "0.53000635", "0.5299353", "0.5296504", "0.5294355", "0.52778757", "0.52765864", "0.5261876", "0.5261546", "0.5258546", "0.5246537", "0.5243335", "0.524042", "0.52392733", "0.5232314", "0.5223747", "0.5223181", "0.52091306", "0.5205522", "0.52053505", "0.51935124", "0.5172884", "0.51648176", "0.5159569", "0.51589376", "0.51452214", "0.51428854", "0.5142827", "0.5128575", "0.5127467", "0.5119408", "0.5119109", "0.51176447", "0.5106903", "0.5104861", "0.5094493", "0.5094268", "0.5077748", "0.5067151", "0.5066631", "0.5065222", "0.50618416", "0.5057854", "0.50577813", "0.5050721", "0.50468326", "0.5038677", "0.50357866", "0.5033873", "0.5030628", "0.5029606", "0.50293446", "0.5027071", "0.502613", "0.50252205", "0.50224096", "0.50215364", "0.50205153", "0.50134504", "0.50128824", "0.5011777", "0.50106645", "0.50083977", "0.50067043", "0.5005629", "0.5004871" ]
0.0
-1
Metabox for public facilities
public static function metabox_public_facilities( $post_type ) { $metabox_id = INVENTOR_LISTING_PREFIX . $post_type . '_public_facilities_box'; $field_id = INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities'; if ( ! is_admin() ) { add_filter( 'cmb2_override_' . $field_id . '_group_meta_value', array( __CLASS__, 'set_default_value' ) , 0, 4 ); } $facilities_default = apply_filters( 'inventor_metabox_field_default', null, $metabox_id, $field_id, $post_type ); new_cmb2_box( array( 'id' => $metabox_id, 'title' => __( 'Public facilities', 'inventor-properties' ), 'object_types' => array( $post_type ), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'show_in_rest' => true, 'skip' => true, 'fields' => array( // group array( 'id' => $field_id, 'type' => 'group', 'post_type' => $post_type, 'custom_value' => $facilities_default, 'options' => array( 'group_title' => __( 'Public Facility', 'inventor-properties' ), 'add_button' => __( 'Add Another Public Facility', 'inventor-properties' ), 'remove_button' => __( 'Remove Public Facility', 'inventor-properties' ), ), 'fields' => array( // group fields array( 'id' => INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities_key', 'name' => __( 'Key', 'inventor-properties' ), 'type' => 'text', 'custom_value' => $facilities_default, ), array( 'id' => INVENTOR_LISTING_PREFIX . INVENTOR_PROPERTY_PREFIX . 'public_facilities_value', 'name' => __( 'Value', 'inventor-properties' ), 'type' => 'text', 'custom_value' => $facilities_default, ), ), ), ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function abilityGet();", "public function access();", "function factures_autoriser(){}", "abstract protected function canAccess();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "private function metodo_privado() {\n }", "function egsr_staff_cap(){\n \n return Array ( \n 'read' => true,\n );\n}", "function isPublic();", "public static function right_public(){return false;}", "public function isPublic() {}", "public function __construct(){\n\n // Ensure the EA access is loaded\n b_reg::load_module(EA_MODULE);\n EA_access();\n \n parent::__construct();\n \n bForm_Avatar::set_context(bAuth::$av);\n $authenticated = bAuth::authenticated();\n $this->who_is_here(array('VM_manager_here' => array('rank'=> 'RANK_vm_manager',\n\t\t\t\t\t\t\t 'def' => 'superUser_here'),\n\t\t\t 'VM_prg_coordinator_here'=> array('rank'=> 'RANK_vm_prg_coordinator',\n\t\t\t\t\t\t\t 'def' => 'VM_manager_here'),\n\t\t\t 'VM_visitor_here' => array('rank'=> 'RANK_vm_visitor'),\n\t\t\t 'VM_registrant_here' => array('rank'=> 'RANK_vm_registrant'),\n\t\t\t 'VM_stranger_here' => array('rank'=> 'RANK__authenticated'),\n\t\t\t 'VM_organizer_here' => array('IF' => ((VM::e_ID() && VM::$e->isOrganizer()) || VM::isOrganizer())),\n\t\t\t 'VM_endorser_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isEndorser') && bAuth::$av->isEndorser())),\n\t\t\t 'VM_employee_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isE') && bAuth::$av->isE())),\n\t\t\t 'VM_lt_visitor_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isV') && bAuth::$av->isV())),\n\t\t\t ));\n\n $this->who_is_here(array('VM_guests_handlare_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_guests))),\n\t\t\t 'VM_rooms_updater_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_update_rooms))),\n\t\t\t 'VM_reimberser_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_reimbursement))),\n\t\t\t 'VM_unlocker_here' =>array('IF'=> ($authenticated &&(VM_administrators()->isHandlingDuty(DUTY_unlock_events)||VM_manager_here))),\n\t\t\t 'VM_external_registrant_here'=>array('IF'=>VM_registrant_here && !VM_lt_visitor_here && !VM_employee_here),\n\t\t\t 'VM_administrator_here' =>array('IF'=>VM_endorser_here || VM_organizer_here || VM_prg_coordinator_here), \n\t\t\t ));\n\n $this->who_is_here(array('VM_member_here' =>array('IF'=>EA_member_here() || VM_external_registrant_here || VM_organizer_here),\n\t\t\t ));\n }", "abstract protected function attributes();", "abstract public function permission(): string;", "public function memberable()\n\t{\n\t\treturn $this->shifter();\n\t}", "function pati_initialize_capabilities(){\r\n $admin = get_role( 'administrator' );\r\n $subscriber = get_role( 'subscriber' );\r\n $editor = get_role( 'editor' ); \r\n\r\n /**\r\n * General Capability for the Ticket CRUD Operations\r\n */\r\n $admin->add_cap('edit_ticket');\r\n $admin->add_cap('edit_tickets');\r\n $admin->add_cap('read_ticket');\r\n $admin->add_cap('delete_ticket');\r\n $admin->add_cap('edit_others_tickets');\r\n $admin->add_cap('publish_tickets');\r\n $admin->add_cap('read_private_tickets');\r\n $admin->add_cap('delete_private_tickets');\r\n $admin->add_cap('delete_published_tickets');\r\n $admin->add_cap('delete_others_tickets');\r\n $admin->add_cap('edit_private_tickets');\r\n $admin->add_cap('edit_published_tickets');\r\n $admin->add_cap('assign_ticket');\r\n\r\n /**\r\n * Capabilities for the Editor User\r\n */\r\n $editor->add_cap('edit_ticket');\r\n $editor->add_cap('edit_tickets');\r\n $editor->add_cap('read_ticket');\r\n $editor->add_cap('delete_ticket');\r\n $editor->add_cap('edit_others_tickets');\r\n $editor->add_cap('publish_tickets');\r\n $editor->add_cap('read_private_tickets');\r\n $editor->add_cap('delete_private_tickets');\r\n $editor->add_cap('delete_published_tickets');\r\n $editor->add_cap('delete_others_tickets');\r\n $editor->add_cap('edit_private_tickets');\r\n $editor->add_cap('edit_published_tickets');\r\n $editor->add_cap('assign_ticket');\r\n\r\n /**\r\n * Additional Capabilities for Subscriber\r\n */\r\n $subscriber->add_cap('edit_ticket');\r\n $subscriber->add_cap('read_ticket');\r\n $subscriber->add_cap('edit_tickets');\r\n}", "public function truycapvao_private_cha(){\n }", "abstract public function require_access();", "function _gizra_access_strongarm() {\n $export = array();\n $strongarm = new stdClass;\n $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */\n $strongarm->api_version = 1;\n $strongarm->name = 'content_profile_use_profile';\n $strongarm->value = 1;\n\n $export['content_profile_use_profile'] = $strongarm;\n return $export;\n}", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "function user_can_richedit()\n {\n }", "public static function meta();", "public function property_facilities() {\n\n\t\t\tif ( $this->add_package !== 3 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$building_area = get_field( 'building_area' );\n\t\t\t$branch_clinics = get_field( 'branch_clinics' );\n\t\t\t$days_open = get_field( 'days_open' );\n\n\t\t\t$off_street_parking = get_field( 'off_street_parking' );\n\t\t\t$car_spaces = get_field( 'car_spaces' );\n\n\t\t\t$number_of_computer = get_field( 'number_of_computer' );\n\n\t\t\t$ownership = get_field_object( 'ownership' );\n\t\t\t$ownership_value = get_field( 'ownership' );\n\t\t\t$ownership_label = $ownership['choices'][ $ownership_value ];\n\n\n\t\t\t$out = '<h4>Facilities</h4>';\n\t\t\t$out .= '<ul>';\n\t\t\t$out .= '<li><em>Building is:</em> ' . $ownership_label . '</li>';\n\n\n\t\t\t$realestate_is_for = get_field( 'realestate_is_for' );\n\t\t\t$building_ownership = get_field( 'ownership' );\n\n\t\t\tif ( $realestate_is_for == 'for_lease' && $building_ownership == 'rented' ) {\n\t\t\t\t$real_estate_lease_details = get_field( 'real_estate_lease_details' );\n\t\t\t\t$out .= '<li><em>Building is for Lease:</em> ' . $real_estate_lease_details . '</li>';\n\t\t\t} else if ( $realestate_is_for == 'for_lease' && $building_ownership == 'owned' ) {\n\t\t\t\t$out .= '<li><em>Building is for Lease:</em> ' . $real_estate_lease_details . '</li>';\n\t\t\t} else if ( $practice_is_for == 'For Lease' && $building_ownership == 'owned' ) {\n\t\t\t\t$practice_lease_details = get_field( 'practice_lease_details' );\n\t\t\t\t$out .= '<li><em>Practice is for Lease:</em> ' . $practice_lease_details . '</li>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * ACF\n\t\t\t *\n\t\t\t * Practice is for : practice_is_for = For Sale || For Lease || For Sale/Lease\n\t\t\t * Practice Lease Details : practice_lease_details\n\t\t\t *\n\t\t\t *\n\t\t\t * Real Estate is for : realestate_is_for = for_sale : For Sale || for_lease : For Lease\n\t\t\t * Real Estate Lease Details : real_estate_lease_details\n\t\t\t *\n\t\t\t * Ownership: ownership = owned : Owned || rented : Rented\n\t\t\t *\n\t\t\t *\n\t\t\t * COMBINATIONS\n\t\t\t *\n\t\t\t * if ownership == owned || realestate_is_for == for_lease\n\t\t\t * Real Estate is 'owned' - is not part of the sale - but can be 'leased' = real_estate_lease_details\n\t\t\t *\n\t\t\t * if ownership == rented || realestate_is_for == for_lease\n\t\t\t * Real Estate is 'leased' the lease details are = real_estate_lease_details\n\t\t\t *\n\t\t\t * if ownership == owned || realestate_is_for == for_sale\n\t\t\t * Real Estate is 'owned' and is for sale = property_realestate_value\n\t\t\t *\n\t\t\t * if ownership == rented || realestate_is_for == for_sale\n\t\t\t * Real Estate is 'leased' - real estate owner is open to selling = Lessor is open to selling\n\t\t\t *\n\t\t\t *\n\t\t\t * if practice_is_for == For Sale\n\t\t\t * total_value or P.O.A.\n\t\t\t *\n\t\t\t *\n\t\t\t * if practice_is_for == For Lease\n\t\t\t * practice_lease_details\n\t\t\t *\n\t\t\t * if practice_is_for == For Sale/Lease\n\t\t\t * total_value or P.O.A. || practice_lease_details\n\t\t\t *\n\t\t\t *\n\t\t\t * /**/\n\t\t\tif ($building_area) {\n\t\t\t$out .= '<li><em>Building Area:</em> ' . $building_area . ' sqm</li>';\n\t\t\t}\n\n\n\t\t\t$kennels = get_field( 'kennels' );\n\t\t\t$stables = get_field( 'stables' );\n\n\t\t\tif ( $kennels || $stables ) {\n\t\t\t\t$out .= '<li><em>Facilities Include: </em>';\n\t\t\t\tif ($kennels && $stables) {\n\t\t\t\t$out .= 'Kennels, Stables';\n\t\t\t\t} else if ($kennels && !$stables) {\n\t\t\t\t$out .= 'Kennels';\n\t\t\t\t} else if (! $kennels && $stables) {\n\t\t\t\t$out .= 'Stables';\n\t\t\t\t}\n\t\t\t\t$out .= '</li>';\n\t\t\t}\n\n\t\t\tif ( $off_street_parking ) {\n\t\t\t\t$out .= '<li><em>Car Parks:</em> ' . $car_spaces . '</li>';\n\t\t\t}\n\n\t\t\tif ( get_field( 'computer_software' ) == 'Other' ) {\n\t\t\t\t$other_software = get_field( 'other_software' );\n\t\t\t\t$computer_software_label = $other_software;\n\t\t\t} else {\n\t\t\t\t$computer_software = get_field_object( 'computer_software' );\n\t\t\t\t$computer_software_value = get_field( 'computer_software' );\n\t\t\t\t$computer_software_label = $computer_software['choices'][ $computer_software_value ];\n\t\t\t}\n\n\t\t\t$out .= '<li><em>Computer Software:</em> ' . $computer_software_label . '</li>';\n\n\n\t\t\tif ( $number_of_computer ) {\n\t\t\t\t$out .= '<li><em>No. Computers:</em> ' . $number_of_computer . '</li>';\n\t\t\t}\n\n\t\t\t$out .= '</ul>';\n\n\t\t\treturn $out;\n\t\t}", "function _gizra_access_flag_default_flags() {\n$flags = array();\n// Exported flag: \"Show content\".\n$flags[] = array (\n 'content_type' => 'node',\n 'name' => 'show_content',\n 'title' => 'Show content',\n 'global' => '0',\n 'types' => \n array (\n 0 => 'product',\n ),\n 'flag_short' => 'Show privileged content',\n 'flag_long' => 'Show content for privileged users',\n 'flag_message' => '',\n 'unflag_short' => 'Hide privilged content',\n 'unflag_long' => 'Show content from non-privileged users',\n 'unflag_message' => '',\n 'unflag_denied_text' => '',\n 'link_type' => 'normal',\n 'roles' => \n array (\n 'flag' => \n array (\n ),\n 'unflag' => \n array (\n ),\n ),\n 'show_on_page' => 1,\n 'show_on_teaser' => 0,\n 'show_on_form' => 0,\n 'access_author' => '',\n 'i18n' => 0,\n 'module' => 'gizra_access',\n 'locked' => \n array (\n 0 => 'name',\n ),\n 'api_version' => 2,\n);\nreturn $flags;\n}", "public function isPublic($name);", "public function mikrotik_access() {\n\t\treturn true;\n\t}", "function __construct(){\n\t\tparent::__construct();\n\t\t$hak_akses = array(0,2);\n\t\tno_access($hak_akses);\n\t}", "public function metas();", "function flag_friend_flag_friend_is_friend_ctools_access() {\n return array(\n 'title' => t(\"User: Flag friend relationship\"),\n 'description' => t('Compare the current user and logged in user flag friend status.'),\n 'callback' => 'flag_friend_flag_friend_is_friend_access_check',\n 'default' => array(\n 'is_friend' => 1,\n ),\n 'settings form' => 'flag_friend_flag_friend_is_friend_settings',\n 'summary' => 'flag_friend_flag_friend_is_friend_ctools_access_summary',\n 'required context' => array(\n new ctools_context_required(t('First User'), 'user'),\n new ctools_context_required(t(\"Second User\"), 'user')\n ),\n );\n}", "function metas_autoriser() {\n}", "function load_Info()\n {\n\n $this->Facility_Info($this->facilities[0]);\n }", "function egsr_group_admin_cap(){\n return Array ( \n 'add_users' => true,\n 'create_users' => true,\n 'delete_users' => true,\n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'edit_users' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}", "function optinpanda_make_internal_license_manager( $internal ) { global $optinpanda;\r\nif ( in_array( $optinpanda->license->type, array( 'free' ) ) ) {\r\n return $internal; \r\n}\r\n\r\n \r\n\r\n \r\n if ( BizPanda::isSinglePlugin() ) return $internal;\r\n return true;\r\n}", "public function isAccess();", "public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }", "static function userClassesThatCanSeePrivate() {\n return array('Administrator', 'Member');\n }", "function livraison_autoriser() {}", "function admin_member() {\n\n\t\t}", "private function public_hooks()\n\t{\n\t}", "public function isModerador(){ return false; }", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function relatorio4(){\n $this->isAdmin();\n }", "public static function IamAbleTo() {\n\t\treturn array(\n\t\t\t\"search on wikipedia for people and things\"\n\t\t);\n\t}", "abstract public function user();", "public function facilities()\n {\n return $this->morphToMany(Facility::class, 'person', 'facility_person')\n ->withTrashed()\n ->withPivot('discipline_id', 'tm_license', 'old_license', 'active')\n ->orderBy('discipline_id', 'ASC');\n }", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "function amap_ma_not_permit_public_access() {\n \n return false;\n}", "function system_mod_user($paramvect)\n{\n\n}", "abstract function is_developer();", "public function publicUser()\n {\n return $this->state(function (array $attributes) {\n return [\n 'is_public' => 1,\n ];\n });\n }", "static function SamDesplayInfoMember()\n\t\t{\n\t\t\n\t\t self::$UID = UID;\n\t\t\t\n\t\t\t// filed user\n\t\t\t\n\t\t\t$User_Sam_Filed = implode(',',parent::$FILED['USER']);\n\t\t\t\n\t\t\t// user in object\n\t\t\t\n\t\t\t$User_Object = parent::SamSetObject($User_Sam_Filed,'users','WHERE `user_id` = \"'.self::$UID.'\"');\n\t\t\t\n\t\t\t/* user level */\n\t\t\t\n\t\t\t$Sam_Memb_JS = vJs('user_level',$User_Object->u_level);\n\t\t\n\t\t/*\n\t\t\t\t\t\t'`user_id`',' `u_name`', '`u_login_name`', '`u_pass`', '`u_def_pass`', '`u_email`',' `u_country`', '`u_level`', '`u_posts`',\n\t\t\t\t'`u_points`',' `u_reg_date`', '`u_lh_date`', '`u_lp_date`',' `u_last_ip`', '`u_ip`', '`u_occupation`', '`u_sex`',' `u_age`',\n\t\t\t\t'`u_online`', '`u_bio`', '`u_sig`', '`u_marstatus`', '`u_city`', '`u_state`', '`u_photo_url`', '`u_title`', '`view`', '`u_color`', '`u_browse`',\n\t\t\t\t'`u_face`', '`u_allowmsg`', '`u_last_level`', '`u_status`', '`u_color_choise`', '`u_skin`',' `u_opacity`','`u_template`' \n\t\t\t\t\n\t\t*/\n\t\t\n\t\t /* user home page */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_homepage',$User_Object->u_home_page);\n\t\n\t\t\t/* user home user_link1 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link1',$User_Object->u_link1);\n\t\n\t\t /* user home user_link2 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link2',$User_Object->u_link2);\n\t\n\t /* user home user_quote */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_quote',$User_Object->u_quote);\n\t\n\t\t /* user home user_hobbies */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_hobbies',$User_Object->u_hobbies);\n\t\n\t\t /* user home user_lnews */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_lnews',$User_Object->u_lnews);\n\t\n\t /* user home user_skin */\n $Sam_Memb_JS .= vJs('user_skin',$User_Object->u_skin);\n\t\n\t // get user skin\n\t\t $font = self::SamGetAutrInfo();\n\t\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_font',$font['user_font_face']);\n\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_fontsize',$font['user_fontsize']);\n\t \n\t\t/* user home user_fontcolor */\n $Sam_Memb_JS .= vJs('user_fontcolor',$font['user_fontcolor']);\n\t\n /* user home user_fontalign */\n $Sam_Memb_JS .= vJs('user_fontalign',$font['user_fontalign']);\n\t\n /* user home user_opacity */\n $Sam_Memb_JS .= vJs('user_opacity',$User_Object->u_opacity);\n\t\n /* user home user_title */\n $Sam_Memb_JS .= vJs('user_title',$User_Object->u_title);\n\t \n \t /* user home user_country */\n $Sam_Memb_JS .= vJs('user_country',$User_Object->u_country);\n\t \n\t /* user home user_gender */\n $Sam_Memb_JS .= vJs('user_gender',$User_Object->u_sex);\n\t\n /* user home user_photo_url */\n $Sam_Memb_JS .= vJs('user_photo_url',$User_Object->u_photo_url);\n\t\n /* user home sira datia */\n $Sam_Memb_JS .= vJs('user_bio',$User_Object->u_bio);\n\t\n /* user home user_age */\n $Sam_Memb_JS .= vJs('user_age',$User_Object->u_age);\n\t\n /* user home user_city */\n $Sam_Memb_JS .= vJs('user_city',$User_Object->u_city);\n\t\n \n\t /* user home sitiation */\n $Sam_Memb_JS .= vJs('user_marstatus',$User_Object->u_marstatus);\n\t\n \n\t /* user home job */\n $Sam_Memb_JS .= vJs('user_occupation',$User_Object->u_occupation);\n\t\n \n\t /* user home zon mecheria */\n $Sam_Memb_JS .= vJs('user_state',$User_Object->u_status);\n\t\n return $Sam_Memb_JS;\n\t\t}", "abstract function is_only_premium();", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "public function is_public(): bool;", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "abstract function is_premium();", "public function metodo_publico() {\n }", "public function __get($name)\n {\n echo \"Lecture de l'attribut $name inaccessible<br/>\";\n }", "function jmw_customize_profile_visibility( $allowed_visibilities ) {\n\n\t$allowed_visibilities[ 'moderated' ] = array(\n\t\t'id'\t=> 'moderated',\n\t\t'label'\t=> _x( 'No-one - In Moderation', 'Visibility level setting', 'bp-extended-profile-visibility' )\n\t);\n\n\treturn $allowed_visibilities;\n}", "function etc_memberships() {\n return ETC_Memberships::instance();\n}", "private function privateDummy()\n {\n }", "public function getAllowSpecific();", "function __construct()\n {\n $this->reqAdminToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyAdminsCanTagTalks', 'false')->getKey('value'));\n $this->reqCreatorToMod = Base_GeneralFunctions::asBoolean(Container_Config::brokerByID('OnlyTagCreatorsCanEditTalkTags', 'true')->getKey('value'));\n return parent::__construct();\n }", "public function __construct()\n {\n\t\t$this->user=User::find(Auth::id());\n\t\t$this->role_name=$this->user->role->name;\n\t\tif($this->role_name==\"Admin\" || $this->role_name==\"SubAdmin\")\n\t\t\t$this->entrypoints=Entrypoint::whereIn('type',[1,3])->get();\n\t\telseif($this->role_name==\"Receiption\" || $this->role_name==\"Entrypoint\" || $this->role_name==\"Desk\"){\n\t\t\t$this->entrypoints=$this->user->entrypoints()->get();\n\t\t\t$this->entrypoint_sub_type=$this->user->entrypoints()->first()->sub_type;\n\t\t}\n\t\telseif($this->role_name==\"Doctor\" || $this->role_name==\"Nursing\")\n\t\t\t$this->medicalunits=$this->user->medicalunits()->orderBy('type','asc')->get();\n \n }", "function can();", "public function hasUsageRights() {}", "public function attributes();", "function acf_current_user_can_admin()\n{\n}", "public function adminMatters(){\n\n }", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "function info()\n\t{\n\t\tif (get_forum_type()!='ocf') return NULL;\n\t\tif (($GLOBALS['FORUM_DB']->query_value('f_members','COUNT(*)')<=3) && (get_param('id','')!='ocf_members') && (get_param_integer('search_ocf_members',0)!=1)) return NULL;\n\n\t\trequire_lang('ocf');\n\n\t\t$info=array();\n\t\t$info['lang']=do_lang_tempcode('MEMBERS');\n\t\t$info['default']=false;\n\t\t$info['special_on']=array();\n\t\t$info['special_off']=array();\n\t\t$info['user_label']=do_lang_tempcode('USERNAME');\n\t\t$info['days_label']=do_lang_tempcode('JOINED_AGO');\n\n\t\t$extra_sort_fields=array();\n\t\tif (has_specific_permission(get_member(),'view_profiles'))\n\t\t{\n\t\t\trequire_code('ocf_members');\n\t\t\t$rows=ocf_get_all_custom_fields_match(NULL,1,1);\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$extra_sort_fields['field_'.strval($row['id'])]=$row['trans_name'];\n\t\t\t}\n\t\t}\n\t\t$info['extra_sort_fields']=$extra_sort_fields;\n\n\t\treturn $info;\n\t}", "abstract public function is_have();", "public function component_info() {\n return array(\n 'name' => 'Accessibility Content Utility',\n 'description' => 'Add utility functions to Content for Accessibility',\n 'category' => 'accessibility',\n );\n }", "public function provides();", "public function esPublica()\n {\n return false;\n }", "public function __construct()\n\t{\n\t\tparent::__construct('fuel_permissions');\n\t}", "function mis_capacitaciones() {\n\t$my_courses = get_posts( array(\n\t\t'post_type' => 'sfwd-courses',\n\t\t'post_author' => 1,\n\t\t'meta_key' => 'fachada_servicio',\n\t\t'meta_value' => 'fachada_CAPACITACION'\t\n\t));\n\n\n\t/**\n\t * ATENCION CON EL HARDCODE = 1\n\t */\n\treturn add_course_meta($my_courses);\n}", "function hook_roomify_rights_group() {\n $rights['roomify_rights'] = array(\n 'group_manager' => array(\n 'add member',\n ),\n );\n\n return $rights;\n}", "function og_views_extra_views_plugins() {\n return array(\n 'access' => array(\n 'group_member' => array(\n 'title' => t('Group Membership'),\n 'help' => t('Member of the current organic group'),\n 'handler' => 'og_views_extra_plugin_access_group_member',\n 'help topic' => 'access-none',\n 'uses options' => TRUE,\n ),\n )\n );\n}", "private function define_public_hooks() {\n\n// $public = new Single_Post_Meta_Manager_Public( $this->get_version() );\n// $this->loader->add_action( 'the_content', $public, 'display_post_meta_data' );\n\n $public = new Online_Magazine_Manager_Public( $this->version );\n $this->loader->add_action( 'query_vars', $public, 'register_query_vars' );\n $this->loader->add_action( 'pre_get_posts', $public, 'fix_archive_query_with_rubrics_filter' );\n Online_Magazine_Theme_Functions::define_theme_functions();\n add_image_size( 'thumb-article-homepage', 370, 180, true);\n\n }", "function isPartOfMinimalUsableSystem() ;", "static function plInfo()\n {\n return array(\n \"plShortName\" => _(\"Argonaut Mirror settings\"),\n \"plDescription\" => _(\"Argonaut Mirror settings\").\" (\"._(\"Services\").\")\",\n \"plIcon\" => \"plugins/argonaut/images/iconMiniMirrorConfig.png\",\n\n \"plProvidedAcls\" => parent::generatePlProvidedAcls(self::getAttributesInfo())\n );\n }", "protected function protectedDummy()\n {\n }", "public function getPersonal();", "function _gizra_access_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create profile content\n $permissions[] = array(\n 'name' => 'create profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own profile content\n $permissions[] = array(\n 'name' => 'edit own profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view field_hidden_field\n $permissions[] = array(\n 'name' => 'view field_hidden_field',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }", "function isProtected() ;", "function op_api_member($member)\n{\n if (!$member)\n {\n return null;\n }\n\n $viewMemberId = sfContext::getInstance()->getUser()->getMemberId();\n\n $memberImageFileName = $member->getImageFileName();\n if (!$memberImageFileName)\n {\n $memberImage = op_image_path('no_image.gif', true);\n }\n else\n {\n $memberImage = sf_image_path($memberImageFileName, array('size' => '48x48'), true);\n }\n\n $relation = null;\n if ((string)$viewMemberId !== (string)$member->getId())\n {\n $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($viewMemberId, $member->getId());\n }\n\n $selfIntroduction = $member->getProfile('op_preset_self_introduction', true);\n\n return array(\n 'id' => $member->getId(),\n 'profile_image' => $memberImage,\n 'screen_name' => $member->getConfig('op_screen_name', $member->getName()),\n 'name' => $member->getName(),\n 'profile_url' => op_api_member_profile_url($member->getId()),\n 'friend' => $relation ? $relation->isFriend() : false,\n 'blocking' => $relation ? $relation->isAccessBlocked() : false,\n 'self' => $viewMemberId === $member->getId(),\n 'friends_count' => $member->countFriends(),\n 'self_introduction' => $selfIntroduction ? (string)$selfIntroduction : null,\n );\n}", "public static function\tDescriptors()\n {\n $accesses = array(\"Default\" => array(\"Public\" => self::TypePublic));\n\n if (Cache::Exist(\"user\") == false)\n\treturn $accesses;\n\n $user = Cache::Get(\"user\");\n\n $accesses[\"Default\"][\"Private\"] = $user->id;\n\n foreach (self::$entities as $entity)\n\t{\n\t // XXX[we could perform theses operations in parallel to speed up the process]\n\t $access = call_user_func($entity . \"::Access\", $user->id);\n\n\t if (empty($access) == true)\n\t continue;\n\n\t $accesses[$entity] = array();\n\n\t foreach ($access as $object)\n\t $accesses[$entity][$object[\"name\"]] = $object[\"id\"];\n\t}\n\n return $accesses;\n }", "public function getFriendableForCurrentProvider(): array;", "abstract function getEmissionFactors();", "public function getFacility();", "function dynamo_support_create_default_role() {\n global $wp_roles;\n if($wp_roles->get_role('administrator')) {\n $admin = $wp_roles->get_role('administrator');\n //Tickets\n $admin->add_cap('access_tickets');\n $admin->add_cap('publish_tickets');\n $admin->add_cap('edit_tickets');\n $admin->add_cap('delete_tickets');\n $admin->add_cap('delete_others_tickets');\n $admin->add_cap('edit_others_tickets');\n $admin->add_cap('read_private_tickets');\n $admin->add_cap('read_tickets');\n $admin->add_cap('read_ticket');\n $admin->add_cap('edit_ticket');\n $admin->add_cap('delete_ticket');\n //Articles\n $admin->add_cap('access_knowledgebase');\n $admin->add_cap('publish_articles');\n $admin->add_cap('edit_articles');\n $admin->add_cap('delete_articles');\n $admin->add_cap('delete_others_articles');\n $admin->add_cap('edit_others_articles');\n $admin->add_cap('read_others_articles');\n $admin->add_cap('read_article');\n $admin->add_cap('edit_article');\n $admin->add_cap('delete_article');\n $admin->add_cap('read_private_articles');\n //Feedback\n $admin->add_cap('access_feedback');\n //Assignment\n $admin->add_cap('view_all_tickets');\n }\n\n //Add Support Admin Role which allows full access to KB and Tickets but no posts/pages plugin setting etc...\n if(!$wp_roles->get_role('support_admin')) {\n $super_ticket = $wp_roles->add_role('support_admin','Support Admin', array(\n 'access_tickets' => true,\n 'access_knowledgebase' => true,\n 'publish_tickets' => true,\n 'publish_articles' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'publish_articles' => true,\n 'edit_articles' => true,\n 'delete_articles' => true,\n 'delete_others_articles' => true,\n 'edit_others_articles' => true,\n 'read_private_articles' => true,\n 'read_articles' => true,\n 'read' => true,\n 'read_article' => true,\n 'userstatistics' => true,\n 'access_feedback' => true\n )\n );\n }\n //Add 2 Standard Roles Billing & Affiliate dept (user can delete if needed)\n if(!$wp_roles->get_role('billing-dept')) {\n $super_ticket = $wp_roles->add_role('billing-dept','Billing Dept', array(\n 'access_tickets' => true,\n 'publish_tickets' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'read' => true,\n 'userstatistics' => true,\n 'access_tickets_1' => true,\n )\n );\n }\n if(!$wp_roles->get_role('affiliate-dept')) {\n $super_ticket = $wp_roles->add_role('affiliate-dept','Affiliate Dept', array(\n 'access_tickets' => true,\n 'publish_tickets' => true,\n 'edit_tickets' => true,\n 'delete_tickets' => true,\n 'delete_others_tickets' => true,\n 'edit_others_tickets' => true,\n 'read_private_tickets' => true,\n 'read_tickets' => true,\n 'read' => true,\n 'userstatistics' => true,\n 'access_tickets_0' => true,\n )\n );\n }\n }", "function vimport_abonnes_autoriser() {\n}", "function mots_autoriser() {\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 }", "abstract protected function interface();" ]
[ "0.61924416", "0.6068419", "0.5823664", "0.57875204", "0.5682973", "0.5682973", "0.5682973", "0.5682973", "0.5682973", "0.56594133", "0.5654551", "0.5624027", "0.5586615", "0.558501", "0.5569376", "0.55499095", "0.5533781", "0.5532558", "0.55268484", "0.5513156", "0.55062664", "0.54836833", "0.5453744", "0.543216", "0.5431229", "0.5416201", "0.54038787", "0.53954166", "0.5385543", "0.5366565", "0.5331131", "0.5328764", "0.5313119", "0.5309666", "0.5308258", "0.53000635", "0.5299353", "0.5296504", "0.5294355", "0.52778757", "0.52765864", "0.5261876", "0.5261546", "0.5258546", "0.5246537", "0.5243335", "0.524042", "0.52392733", "0.5232314", "0.5223747", "0.5223181", "0.52091306", "0.5205522", "0.52053505", "0.51935124", "0.5172884", "0.51648176", "0.5159569", "0.51589376", "0.51452214", "0.51428854", "0.5142827", "0.5128575", "0.5127467", "0.5119408", "0.5119109", "0.51176447", "0.5106903", "0.5104861", "0.5094493", "0.5094268", "0.5077748", "0.5067151", "0.5066631", "0.5065222", "0.50618416", "0.5057854", "0.50577813", "0.5050721", "0.50468326", "0.5038677", "0.50357866", "0.5033873", "0.5030628", "0.5029606", "0.50293446", "0.5027071", "0.502613", "0.50252205", "0.50224096", "0.50215364", "0.50205153", "0.50134504", "0.50128824", "0.5011777", "0.50106645", "0.50083977", "0.50067043", "0.5005629", "0.5004871" ]
0.56641155
9
Set default data for field
public static function set_default_value( $data, $object_id, $a, $field ) { if ( ! empty( $field->args['custom_value'] ) ) { return $field->args['custom_value']; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "function set_data($default_values) {\n if (is_object($default_values)) {\n $default_values = (array)$default_values;\n }\n $this->data_preprocessing($default_values);\n parent::set_data($default_values); //never slashed for moodleform_mod\n }", "public function setDefaultValue($data) {\n $defaultValue = $this->getDefaultValue();\n if (empty($defaultValue)) {\n return $data;\n }\n foreach ($defaultValue as $field => $value) {\n if (!isset($data[$field])) {\n $data[$field] = $value;\n }\n }\n foreach ($data as $field => $value) {\n if (($data[$field] == NULL || $data[$field] === '') && isset($defaultValue[$field])) {\n $data[$field] = $defaultValue[$field];\n }\n }\n return $data;\n }", "public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "protected function fieldData()\n {\n if ($this->field_data_fetched === false) {\n $this->field_data = array(\n 'label' => 'Your date of birth',\n 'description' => 'Please enter your date of birth',\n 'placeholder' => 'dd/mm/yyyy',\n 'size' => 50,\n 'maxlength' => 10\n );\n\n $this->field_data_fetched = true;\n }\n }", "public function defaultData();", "public function set_data($defaultvalues) {\n $this->tool->form_set_data($defaultvalues);\n parent::set_data($defaultvalues);\n }", "protected function setDefaultValueExtra()\n {\n $this->default_data['address'] = 'xxx.atlassian.net';\n $this->default_data['rest_api_resource'] = '/rest/api/latest/';\n $this->default_data['timeout'] = 60;\n\n $this->default_data['clones']['mappingTicket'] = array(\n array(\n 'Arg' => self::ARG_SUMMARY,\n 'Value' => 'Issue {include file=\"file:$centreon_open_tickets_path/providers/' .\n 'Abstract/templates/display_title.ihtml\"}'\n ),\n array('Arg' => self::ARG_DESCRIPTION, 'Value' => '{$body}'),\n array('Arg' => self::ARG_PROJECT, 'Value' => '{$select.jira_project.id}'),\n array('Arg' => self::ARG_ASSIGNEE, 'Value' => '{$select.jira_assignee.id}'),\n array('Arg' => self::ARG_PRIORITY, 'Value' => '{$select.jira_priority.id}'),\n array('Arg' => self::ARG_ISSUETYPE, 'Value' => '{$select.jira_issuetype.id}'),\n );\n }", "public function populateDefaults(){\n\t\tparent::populateDefaults();\n\t\t\n\t\t$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));\n\t}", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function setDefaultData(array $defaultData);", "public function delegateFieldSetDefault(DbalSchema $dbal_schema, $drupal_table_name, $field_name, $default);", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n $request = DRequest::load();\n $this->setFieldValue(self::FIELD_IP_ADDRESS, $request->getIpAddress());\n $this->setFieldValue(self::FIELD_URL, self::getRequestUrl());\n }", "public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}", "protected function setDefaultValues()\n {\n $this->setFieldValue(self::FIELD_CREATED, time());\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "public function setValueDefault()\n {\n $this->isActive = true;\n $this->createdAt = new \\DateTime();\n }", "public function setDefaultValue($fieldName, $value, $encoding = 'UTF-8') {}", "public function set_field( string $field, $data ) {\n\t\t$this->data[ $field ] = $data;\n\t}", "public function updateDefaultsFromObject() {\n parent::updateDefaultsFromObject();\n // Tags\n if(isset($this->widgetSchema['tags'])) {\n $tags = $this->getObject()->getTags();\n if($this->getUser()->getAttribute('enable_keyboard', false)) {\n $tags = implode(', ', $tags);\n }\n $this->widgetSchema['tags']->setDefault($tags);\n }\n // Elements\n if(isset($this->widgetSchema['elements_list'])) {\n $this->widgetSchema['elements_list']->setDefault($this->getObject()->getElements());\n }\n if($this->getUser()->getAttribute('enable_keyboard', false) && isset($this->widgetSchema['demandeur_id']) && !$this->isNew())\n {\n $this->setDefault('demandeur_id', $this->getObject()->getDemandeur()->getName());\n }\n }", "public function set_default($fieldname, $value) {\n\t\t$this->custom_default_values[(string)$fieldname] = (string) $value;\n\t}", "function setDefaultValue($fieldName, $fieldValue=\"\", $overrideRetrieved=false) {\n\t\t$this->defaultValues[$fieldName]['value'] = $fieldValue;\n\t\tif($overrideRetrieved) $this->defaultValues[$fieldName]['override'] = true;\n\t}", "function _simplerdf_content_mappers_default_fields($content_field) {\n $field = array(\n 'title' => $content_field['widget']['label'],\n );\n return array($content_field['field_name'] => $field);\n}", "protected function fill()\n {\n array_map(function ($field) {\n $defaultValue = isset($this->defaultFields[$field]['defaultValue']) ?\n $this->defaultFields[$field]['defaultValue'] :\n null;\n\n $this->values[$field] = (new $this->defaultFields[$field]['format']($defaultValue))\n ->setPosition($this->defaultFields[$field]['position'])\n ->setLength($this->defaultFields[$field]['length']);\n }, array_keys($this->defaultFields));\n }", "public function __construct($data=null,$default_data=null)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t\t$this->default_data = $default_data;\r\n\t}", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "protected function setFieldValue ($field) {\n if ($this->$field instanceof Newforms_File)\n $this->$field->setValue('');\n if (!$this->__bound) return;\n if (is_array($this->__Data)) {\n if (isset($this->__Data[$field])) {\n $this->$field->setValue ($this->__Data[$field]);\n return;\n }\n return;\n }\n if (is_object ($this->__Data)) {\n if (isset($this->__Data->$field)) {\n $this->$field->setValue ($this->__Data->$field);\n return;\n }\n return;\n }\n }", "function setData($data){\n\t\tif(!is_array($data)){\n\t\t\tvar_dump($data);\n\t\t\texit;\n\t\t}\n\t\tforeach($data as $key => $value){\n\t\t\tif(isset(static::$fields[$key]) && static::$fields[$key]['type']=='enum'){\n\t\t\t\tif($value){\n\t\t\t\t\tif(!in_array(strtoupper($value), static::$fields[$key]['values'])){\n\t\t\t\t\t\treturn RetErrorWithMessage('INCORRECT_VALUE', preg_replace('/.+\\\\\\/si', '', get_called_class()).': Wrong field value('.$value.'), field \"'.$key.'\" can be one of: '.print_r(static::$fields[$key]['values'], true));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = strtoupper($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t\tforeach(static::$fields as $field_name => $option){\n\t\t\tif(!isset($this->{$field_name})){\n\t\t\t\tif($option['default']){\n\t\t\t\t\t$this->{$field_name} = $option['default'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n $this->instance_generated = true;\n\t\treturn null;\n\t}", "public function load_with_defaults ()\n {\n parent::load_with_defaults ();\n $this->set_value ('email_type', 'single_mail');\n }", "function init()\n {\n $this->defineAttribute('data', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('stru', false, '', COMPONENT_TYPE_STRING);\n parent::init();\n }", "public function applyDefaultValues()\n {\n $this->phadtype = '';\n $this->phadid = '';\n $this->phadsubid = '';\n $this->phadsubidseq = 0;\n $this->phadcont = '';\n }", "public function setData() \n {\n // Empty, to be overridden \n }", "function field__default( $rg, $var, $post, $fn__desc, $fn__field ){\n\t\t\t$_style = ( $rg->type === 'text' && false === strpos($rg->attr, 'style=') ) ? ' style=\"width:100%;\"' : '';\n\n\t\t\treturn $var->title . $fn__field( '<input '. $rg->attr . $var->class . $var->pholder . $_style .' type=\"'. $rg->type .'\" id=\"'. $rg->id .'\" name=\"'. $var->name .'\" value=\"'. esc_attr($rg->val) .'\">'. $fn__desc() );\n\t\t}", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "protected function normalizeDefaultValue($data) {\n return $data;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "function db_field_set_default(&$ret, $table, $field, $default) {\n if ($default == NULL) {\n $default = 'NULL';\n }\n else {\n $default = is_string($default) ? \"'$default'\" : $default;\n }\n\n $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default);\n}", "function acf_set_form_data($name = '', $data = \\false)\n{\n}", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function setFieldsDefault($event, $user=null)\r\n\t{\r\n\t\t$fields = $this->def->getFields();\r\n\t\tforeach ($fields as $fname=>$field)\r\n\t\t{\r\n\t\t\t// Currently multi-values are not supported for defaults\r\n\t\t\tif ($field->type == \"object_multi\" || $field->type == \"fkey_multi\")\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t$val = $this->getValue($fname);\r\n\t\t\t$new = $field->getDefault($val, $event, $this, $user);\r\n\r\n\t\t\t// If the default was different, then set it\r\n\t\t\tif ($new != $val)\r\n\t\t\t\t$this->setValue($fname, $new);\r\n\t\t}\r\n\t}", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function setValueDefault()\n {\n $this->createdAt = new \\DateTime();\n }", "public function default() {\n \n $this->data = ModuleConfig::settings();\n // [Module_Data]\n }", "function getDefaultValue($data = array())\r\n\t{\r\n\t\tif (!isset($this->_default)) {\r\n\t\t\t$w = new FabrikWorker();\r\n\t\t\t$params = $this->getParams();\r\n\t\t\t$link = $params->get('link_default_url');\r\n\t\t\t// $$$ hugh - no idea what this was here for, but it was causing some BIZARRE bugs!\r\n\t\t\t//$formdata = $this->getForm()->getData();\r\n\t\t\t// $$$ rob only parse for place holder if we can use the element\r\n\t\t\t// otherwise for encrypted values store raw, and they are parsed when the\r\n\t\t\t// form in processsed in form::addEncrytedVarsToArray();\r\n\t\t\tif ($this->canUse()) {\r\n\t\t\t\t$link = $w->parseMessageForPlaceHolder($link, $data);\r\n\t\t\t}\r\n\t\t\t$element = $this->getElement();\r\n\t\t\t$default = $w->parseMessageForPlaceHolder($element->default, $data);\r\n\t\t\tif ($element->eval == \"1\") {\r\n\t\t\t\t$default = @eval(stripslashes($default));\r\n\t\t\t}\r\n\t\t\t$this->_default = array('label'=>$default, 'link'=>$link);\r\n\t\t}\r\n\t\treturn $this->_default;\r\n\t}", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "function setDefaultValues() {}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "function _setDefaults()\n {\n $this->type = $this->rs['type'] = \"unknown\";\n $this->parent = $this->rs['parent'] = 0;\n $this->lecture_id = $this->rs['lecture_id'] = SessionDataBean::getLectureId();\n $this->title = $this->rs['title'] = \"\";\n $this->mtitle = $this->rs['mtitle'] = \"\";\n $this->text = $this->rs['text'] = \"<p></p>\";\n $this->position = $this->rs['position'] = 0;\n $this->redirect = $this->rs['redirect'] = \"\";\n $this->ival1 = $this->rs['ival1'] = 0;\n $this->copy_parent = $this->rs['copy_parent'] = false;\n }", "public function changeFieldDefaultValue($field)\n {\n\tPerfORMController::getBuilder()->changeFieldsDefault($field);\n\t$this->updateFieldSync($field);\n }", "public function onBeforeWrite()\n {\n foreach (self::$defaults as $field => $value) {\n if (empty($this->$field)) {\n $this->$field = $value;\n }\n }\n //TODO: prevent non-heirarichal entries, eg country = '*', then state = 'blah'\n parent::onBeforeWrite();\n }", "private static function addDefaultFields(array $data){\n $data['created_at'] = Carbon::now();\n $data['updated_at'] = Carbon::now();\n\n if(!array_key_exists('provider', $data)){\n $data['provider'] = 'default';\n $data['provider_id'] = NULL;\n }\n\n return $data;\n }", "public function load_with_defaults ()\n {\n parent::load_with_defaults ();\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', User_email_scrambled);\n\n $this->set_required ('password1', true);\n $this->set_required ('password2', true);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n }", "public function addField($data) {\n $field = $data['field'];\n $class = 'AetherORM' . ucfirst($data['type']) . 'Field';\n $this->fields[$field] = new $class($data['default'], $data['null']);\n }", "public function set_data($default) {\n global $CFG;\n\n $mform = $this->_form;\n // Load or freeze room size.\n if ($default->instance) {\n $roomsizes = array();\n $roomsizes[$default->roomsize] = $default->roomsize;\n $roomsize = &$mform->getElement('roomsize');\n $roomsize->loadArray($roomsizes);\n $mform->freeze(array('roomsize'));\n } else {\n $roomsizes = vitero_get_available_roomsizes();\n $roomsize = &$mform->getElement('roomsize');\n $roomsize->loadArray($roomsizes);\n }\n\n // Freeze entire form if meeting is in the past.\n if (isset($default->endtime, $default->endbuffer) && $default->endtime > 0) {\n if ($default->endtime + (int)$default->endbuffer * 60 < time()) {\n $mform->freeze();\n }\n }\n\n // Give id to administration button (or hide if activity hasn't been created yet).\n if ($default->coursemodule) {\n $adminbutton = $mform->getElement('adminlogin');\n $url = $CFG->wwwroot . '/mod/vitero/adminlogin.php?cm=' . $default->coursemodule;\n $url = htmlentities($url);\n $btnstr = 'onclick=\"window.open(\\'' . $url . '\\', \\'\\', \\'\\');\"';\n $adminbutton->updateAttributes($btnstr);\n $mform->removeElement('nologinhint');\n } else {\n $mform->removeElement('adminlogin');\n }\n\n parent::set_data($default);\n }", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "public function save_defaults() {\n\n $tmp_options = $this->options;\n\n foreach( $this->pre_fields as $field ) {\n if( ! empty( $field['id'] ) ) {\n $this->options[$field['id']] = $this->get_default( $field, $this->options );\n }\n }\n\n if( $this->args['save_defaults'] && empty( $tmp_options ) ) {\n $this->save_options( $this->options );\n }\n\n }", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public function prepare_field_data( &$data, $name ) {\n\t\t$default_atts = [\n\t\t\t'label' => '',\n\t\t\t'id' => $this->meta_box['id'].'_'.$name,\n\t\t\t'type' => 'text',\n\t\t\t'default' => '',\n\t\t\t'sanitize' => null,\n\t\t\t'escape_func' => null,\n\t\t\t'file' => 'field-text.php',\n\t\t];\n\t\t$data = wp_parse_args( $data, $default_atts );\n\t\t$data['name'] = $name;\n\t\treturn $data;\n\t}", "public function applyDefaultValues()\n {\n $this->create_date = '2020-04-16 09:40:03';\n $this->last_update = '2020-04-16 09:40:03';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "function SetInitialValues()\n\t{\n\t\t$this->id = -1;\n\t\t$this->title = '';\n\t\t$this->url = '';\n\t\t$this->user_id = -1;\n\t\t$this->timestamp = -1;\n\t}", "public function setdefaultvalues(array $data,$type) \n {\n\n $defualtjsoncontent = json_decode(Storage::disk('local')->get('constants/defaultjson.json'), true);\n \n \n // $defualtjsoncontent->Header->style->language=$type;\n // if($type=\"en\"){\n // $defualtjsoncontent->Header->style->flxdir=\"row\";\n // $defualtjsoncontent->Header->style->direction=\"left\";\n // }else if($type=\"ar\"){\n // $defualtjsoncontent->Header->style->flxdir=\"row-reverse\";\n // $defualtjsoncontent->Header->style->direction=\"right\";\n // }\n \n\n \n $data['sitejson']=$defualtjsoncontent;\n $data['name']=$data['siteurl'];\n $data['enid']=null;\n $data['arid']=null;\n $data['about']=null;\n $data['web']=null;\n $data['email']=null;\n $data['address']=null;\n $data['telephone']=null;\n $data['telephone1']=null;\n $data['orders']='{}';\n $data['reservations']='{}';\n $data['status']=null;\n\n return $data;\n }", "public function set_fields($data)\n\t{\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (isset($this->aliases[$key]))\n\t\t\t\t$key = $this->aliases[$key];\n\n\t\t\tif (array_key_exists($key, $this->data))\n\t\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}", "public function setDefaultValue ($name, $value) {\n // xxx finish\n }", "protected function default_for_attribute( $field_data, $attribute ) {\n\t\treturn null;\n\t}", "protected function field_default() {\n\t\t\treturn array(\n\t\t\t\t'inputmask' => false,\n\t\t\t\t'placeholder' => false,\n\t\t\t\t'prefix' => false,\n\t\t\t\t'options' => false,\n\t\t\t\t'surfix' => false,\n\t\t\t);\n\t\t}", "function setDefaults($defaults) {\n\t\t$this->fieldDefaults = $defaults;\n\t}", "public function setDefaultValue($value);", "function dataDefatult($data, $defaultD) {\r\n if ($data)\r\n return $data;\r\n return $defaultD;\r\n}", "function __construct($dataType, $default = null, $notNull = false) {\n $this->dataType = $dataType;\n $this->value = $default;\n $this->flags = (is_null($default) ? 0 : DATAFLAG_CHANGED) | ($notNull ? DATAFLAG_NOTNULL : 0);\n }", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "protected function setMemberDefaults(){\n parent::setMemberDefaults();\n if(!$this->id) $this->id = UniqId::get(\"faq-\");\n }", "protected function populate_value()\n {\n }", "public function setPostFields($data){\n\t\t$this->post = array();\n\t\t$this->addPostFields($data);\n\t}", "protected abstract function setFields();", "function init() {\n if (!$this->options['persistant']) $this->options['value'] = null;\n }", "public function field($key, $default = null);", "protected function field_default() {\n\t\t\treturn array(\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'theme' => 'monolith',\n\t\t\t\t),\n\t\t\t\t'options' => array(),\n\t\t\t);\n\t\t}", "public function saveEditedFieldData($field) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$field_type_id = getArrayKey($info, 'field_type_id');\n\t\t\t$guide_id = getArrayKey($info, 'guide_id');\n\t\t\t$in_search = getArrayKey($info, 'in_search');\n\t\t\t$in_filter = getArrayKey($info, 'in_filter');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\t\t\t$isRequired = getArrayKey($info, 'is_required');\n\t\t\t$restrictionId = getArrayKey($info, 'restriction_id');\n\t\t\t$isImportant = getArrayKey($info, 'is_important');\n\n\t\t\tif($field instanceof umiField) {\n\t\t\t\t$field->setTitle($title);\n\t\t\t\t$field->setName($name);\n\t\t\t\t$field->setIsVisible($is_visible);\n\t\t\t\t$field->setFieldTypeId($field_type_id);\n\t\t\t\t$field->setIsInSearch($in_search);\n\t\t\t\t$field->setIsInFilter($in_filter);\n\t\t\t\t$field->setTip($tip);\n\t\t\t\t$field->setIsRequired($isRequired);\n\t\t\t\t$field->setRestrictionId($restrictionId);\n\t\t\t\t$field->setImportanceStatus($isImportant);\n\n\t\t\t\t//Choose or create public guide for unlinked relation field\n\t\t\t\t$field_type_obj = umiFieldTypesCollection::getInstance()->getFieldType($field_type_id);\n\t\t\t\t$field_data_type = $field_type_obj->getDataType();\n\n\t\t\t\tif($field_data_type == \"relation\" && $guide_id == 0) {\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title);\n\t\t\t\t}\n\n\t\t\t\tif($field_data_type == \"optioned\" && $guide_id == 0) {\n\t\t\t\t\t$parent_guide_id = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('emarket-itemoption');\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title, $parent_guide_id);\n\t\t\t\t}\n\n\t\t\t\t$field->setGuideId($guide_id);\n\n\t\t\t\t$field->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiField\");\n\t\t\t}\n\t\t}", "public function prepare_for_config_form(\\stdClass $formdata) {\n\n if (!empty($formdata->configdata['defaultvalue'])) {\n $textoptions = $this->value_editor_options();\n $context = $textoptions['context'];\n\n $record = new \\stdClass();\n $record->defaultvalue = $formdata->configdata['defaultvalue'];\n $record->defaultvalueformat = $formdata->configdata['defaultvalueformat'];\n file_prepare_standard_editor($record, 'defaultvalue', $textoptions, $context,\n 'customfield_textarea', 'defaultvalue', $formdata->id);\n $formdata->configdata['defaultvalue_editor'] = $record->defaultvalue_editor;\n }\n }", "public function init()\r\n {\r\n $this->_helper->db->setDefaultModelName('DefaultMetadataValue');\r\n }", "private function field_declaration_builder_from_data( $env, $field_data ) {\n\t\t$field_name = $field_data['name'];\n\t\t$field_builder = $env->field( $field_name );\n\t\t$default_value = isset( $field_data['std'] ) ? $field_data['std'] : $this->default_for_attribute( $field_data, 'std' );\n\t\t$label = isset( $field_data['label'] ) ? $field_data['label'] : $field_name;\n\t\t$description = isset( $field_data['desc'] ) ? $field_data['desc'] : $label;\n\t\t$setting_type = isset( $field_data['type'] ) ? $field_data['type'] : null;\n\t\t$choices = isset( $field_data['options'] ) ? array_keys( $field_data['options'] ) : null;\n\t\t$field_type = 'string';\n\n\t\tif ( 'checkbox' === $setting_type ) {\n\t\t\t$field_type = 'boolean';\n\t\t\tif ( $default_value ) {\n\t\t\t\t// convert our default value as well.\n\t\t\t\t$default_value = $this->bit_to_bool( $default_value );\n\t\t\t}\n\t\t\t$field_builder\n\t\t\t\t->with_serializer( array( $this, 'bool_to_bit' ) )\n\t\t\t\t->with_deserializer( array( $this, 'bit_to_bool' ) );\n\n\t\t} elseif ( 'select' === $setting_type ) {\n\t\t\t$field_type = 'string';\n\t\t} else {\n\t\t\t// try to guess numeric fields, although this is not perfect.\n\t\t\tif ( is_numeric( $default_value ) ) {\n\t\t\t\t$field_type = is_float( $default_value ) ? 'float' : 'integer';\n\t\t\t}\n\t\t}\n\n\t\tif ( $default_value ) {\n\t\t\t$field_builder->with_default( $default_value );\n\t\t}\n\t\t$field_builder\n\t\t\t->with_description( $description )\n\t\t\t->with_dto_name( $field_name )\n\t\t\t->with_type( $env->type( $field_type ) );\n\t\tif ( $choices ) {\n\t\t\t$field_builder->with_choices( $choices );\n\t\t}\n\n\t\t$this->on_field_setup( $field_name, $field_builder, $field_data, $env );\n\n\t\treturn $field_builder;\n\t}", "public function getDataInputField();", "public function get_data_field($field_name, $default_value = null)\n\t\t{\n\t\t\tif (!array_key_exists($field_name, $this->custom_data))\n\t\t\t\treturn $default_value;\n\t\t\t\t\n\t\t\treturn $this->custom_data[$field_name];\n\t\t}", "public function set_data($data)\n {\n }", "public function set_data($data)\n {\n }", "protected function setDefault(Field &$field, $default)\n {\n if (!empty($default)) {\n $field->dataValue = $default;\n }\n\n return $this;\n }", "function data_preprocessing(&$default_values){\n parent::data_preprocessing($default_values);\n if (!empty($default_values['config'])) {\n $values = json_decode($default_values['config'], true);\n foreach ($values as $key => $value) {\n $default_values['config_' . $key] = $value;\n }\n unset($default_values['config']);\n }\n }", "public function setData($data) { \n $this->data = $data; \n }", "function set_defaults()\n {\n $mapper = $this->get_mapper();\n if ($mapper->has_method('set_defaults')) {\n $mapper->set_defaults($this);\n }\n }", "private static function provideDefaults(array &$data)\n {\n if(!array_key_exists('ime', $data))\n $data['ime'] = ''; // a string\n if(!array_key_exists('format', $data))\n $data['format'] = ''; // a string\n if(!array_key_exists('width', $data))\n $data['width'] = 0; // an integer number\n if(!array_key_exists('height', $data))\n $data['height'] = 0; // an integer number\n if(!array_key_exists('size', $data))\n $data['size'] = 0; // an integer number\n if(!array_key_exists('filename', $data))\n $data['filename'] = ''; // a string, calculated by server\n }", "public function setDefaultValue($value=null);", "public static function loadDefaultValues($input = ''){\n\t\t\n $parent = Content::find($input['parent_id']);\n\n if(!@$input['template_id']){\n $parentTemplate = Template::find($parent->template_id);\n\n// dd($parent->template_id);\n if($parentTemplate){\n //since we occasionally want to process a looped back tree (which makes the whole tree \n //invalid, we can't use baum's built in functions to get the first child.\n if($parentTemplate->loopback){\n $parentTemplateChild = Template::find($parentTemplate->loopback);\n }\n else{\n $parentTemplateChild = @$parentTemplate->getImmediateDescendants()->first(); \n } \n $input['template_id'] = @$parentTemplateChild->id; \n \n }\n if(!@$input['template_id']){\n //if it's still nothing we can safely set this to 0;\n $input['template_id'] = null;\n }\n }\n $template = Template::find($input['template_id']);\n\t\t\n\t\t//dd($template->name);\n //TODO: replace with something like this: dd($this->default_fields()->first()->id);\n //$contentDefaultFields = Contentdefaultfield::where('content_type_id', '=', $this->content_type_id)->get();\n \n //plug in the fields we wanted..\n if(!@$input['template_id'])$input['template_id'] = @$template->id;\n if(!@$input['name'])$input['name'] = @$template->name;\n if(!@$input['view'])$input['view'] = @$template->view;\n if(!@$input['identifier'])$input['identifier'] = @$template->identifier;\n\n if(!@$input['package'])$input['package'] = @$template->package;\n\n if(!@$input['edit_view'])$input['edit_view'] = @$template->edit_view;\n if(!@$input['edit_package'])$input['edit_package'] = @$template->edit_package;\n if(!@$input['edit_action'])$input['edit_action'] = @$template->edit_action;\n\n //work out the slug if not manually set\n if(!@$input['slug']){\n $input['slug'] = Content::createSlug($input, $parent);\n }\n\t\t\n\t\t\n //and the user_id (author)\n $input['user_id'] = Auth::user()->id;\n \n //and the application:\n if(!@$input['application_id']){\n $application = Application::getApplication();\n $input['application_id'] = $application->id;\n }\n\t\t\n\t\t//set language\n\t\t\n\t\tif(!@$input['language']){\n $input['language'] = App::getLocale();\n }\n \n\t\t\n \n //and the package if not set\n if(!@$input['package']){\n //set it as parent one..\n $input['package'] = @$parent->package;\n \n //still nothing - set from application\n $application = Application::getApplication();\n if($application->package){\n $input['package'] = $application->package;\n }\n \n //still nothing - we have to set it to default.\n if(!$input['package']){\n //last ditch attempt to put something sensible in here\n $input['package'] = Content::PACKAGE;\n }\n }\n\n\n \n if(!@$input['edit_package']){\n //set it as parent one..\n $input['edit_package'] = @$parent->edit_package;\n \n //still nothing - we have to set it to default.\n if(!$input['edit_package']){\n //last ditch attempt to put something sensible in here\n $input['edit_package'] = Content::PACKAGE;\n }\n }\n\n if(!@$input['edit_view']){\n //set it as parent one..\n $input['edit_view'] = @$parent->edit_view;\n \n //still nothing - we have to set it to default.\n if(!$input['edit_view']){\n //last ditch attempt to put something sensible in here\n $input['edit_view'] = Content::EDIT_VIEW;\n }\n }\n\n if(!@$input['view']){\n $input['view'] = Content::VIEW;\n }\n\t\treturn($input);\n }", "public function setData($data)\n {\n $this->_data = $data;\n }", "protected function getDefaultFields()\n\t{\n\t\tif (empty($this->_default_fields))\n\t\t{\n\t\t\t$default_fields = array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'title',\n\t\t\t\t\t'field_label'\t\t\t=> lang('title'),\n\t\t\t\t\t'field_required'\t\t=> 'y',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> '',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'text',\n\t\t\t\t\t'field_maxl'\t\t\t=> 200\n\t\t\t\t),\n\t\t\t\t'url_title' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'url_title',\n\t\t\t\t\t'field_label'\t\t\t=> lang('url_title'),\n\t\t\t\t\t'field_required'\t\t=> 'y',\n\t\t\t\t\t'field_instructions'\t=> lang('alphadash_desc'),\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'text',\n\t\t\t\t\t'field_maxl'\t\t\t=> 200\n\t\t\t\t),\n\t\t\t\t'entry_date' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'entry_date',\n\t\t\t\t\t'field_label'\t\t\t=> lang('entry_date'),\n\t\t\t\t\t'field_required'\t\t=> 'y',\n\t\t\t\t\t'field_type'\t\t\t=> 'date',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_instructions'\t=> lang('entry_date_desc'),\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'always_show_date'\t\t=> 'y',\n\t\t\t\t\t'default_offset'\t\t=> 0,\n\t\t\t\t\t'selected'\t\t\t\t=> 'y',\n\t\t\t\t),\n\t\t\t\t'expiration_date' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'expiration_date',\n\t\t\t\t\t'field_label'\t\t\t=> lang('expiration_date'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_type'\t\t\t=> 'date',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_instructions'\t=> lang('expiration_date_desc'),\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'default_offset'\t\t=> 0,\n\t\t\t\t\t'selected'\t\t\t\t=> 'y',\n\t\t\t\t),\n\t\t\t\t'comment_expiration_date' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'comment_expiration_date',\n\t\t\t\t\t'field_label'\t\t\t=> lang('comment_expiration_date'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_type'\t\t\t=> 'date',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_instructions'\t=> lang('comment_expiration_date_desc'),\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'default_offset'\t\t=> 0,\n\t\t\t\t\t'selected'\t\t\t\t=> 'y',\n\t\t\t\t\t'populateCallback'\t\t=> array($this, 'populateCommentExpiration')\n\t\t\t\t),\n\t\t\t\t'channel_id' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'channel_id',\n\t\t\t\t\t'field_label'\t\t\t=> lang('channel'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> lang('channel_desc'),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'select',\n\t\t\t\t\t'field_list_items' => array(),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100,\n\t\t\t\t\t'populateCallback'\t\t=> array($this, 'populateChannels')\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'status',\n\t\t\t\t\t'field_label'\t\t\t=> lang('entry_status'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> lang('entry_status_desc'),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'select',\n\t\t\t\t\t'field_list_items' => array(),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100,\n\t\t\t\t\t'populateCallback'\t\t=> array($this, 'populateStatus')\n\t\t\t\t),\n\t\t\t\t'author_id' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'author_id',\n\t\t\t\t\t'field_label'\t\t\t=> lang('author'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> lang('author_desc'),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'select',\n\t\t\t\t\t'field_list_items' => array(),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100,\n\t\t\t\t\t'populateCallback'\t\t=> array($this, 'populateAuthors')\n\t\t\t\t),\n\t\t\t\t'sticky' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'sticky',\n\t\t\t\t\t'field_label'\t\t\t=> lang('sticky'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> lang('sticky_desc'),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'radio',\n\t\t\t\t\t'field_list_items' => array('y' => lang('yes'), 'n' => lang('no')),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100\n\t\t\t\t),\n\t\t\t\t'allow_comments' => array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'allow_comments',\n\t\t\t\t\t'field_label'\t\t\t=> lang('allow_comments'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> lang('allow_comments_desc'),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'radio',\n\t\t\t\t\t'field_list_items' => array('y' => lang('yes'), 'n' => lang('no')),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100,\n\t\t\t\t\t'populateCallback'\t\t=> array($this, 'populateAllowComments')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ($this->Channel && $this->Channel->enable_versioning)\n\t\t\t{\n\t\t\t\t$default_fields['versioning_enabled'] = array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'versioning_enabled',\n\t\t\t\t\t'field_label'\t\t\t=> lang('versioning_enabled'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> sprintf(lang('versioning_enabled_desc'), $this->Channel->max_revisions),\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'radio',\n\t\t\t\t\t'field_list_items' => array('y' => lang('yes'), 'n' => lang('no')),\n\t\t\t\t\t'field_maxl'\t\t\t=> 100\n\t\t\t\t);\n\t\t\t\t$default_fields['revisions'] = array(\n\t\t\t\t\t'field_id'\t\t\t\t=> 'revisions',\n\t\t\t\t\t'field_label'\t\t\t=> lang('revisions'),\n\t\t\t\t\t'field_required'\t\t=> 'n',\n\t\t\t\t\t'field_show_fmt'\t\t=> 'n',\n\t\t\t\t\t'field_instructions'\t=> '',\n\t\t\t\t\t'field_text_direction'\t=> 'ltr',\n\t\t\t\t\t'field_type'\t\t\t=> 'text',\n\t\t\t\t\t'field_maxl'\t\t\t=> 100,\n\t\t\t\t\t'field_wide' => TRUE\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ($this->Channel)\n\t\t\t{\n\t\t\t\t$cat_groups = ee('Model')->get('CategoryGroup')\n\t\t\t\t\t->filter('group_id', 'IN', explode('|', $this->Channel->cat_group))\n\t\t\t\t\t->all();\n\n\t\t\t\tforeach ($cat_groups as $cat_group)\n\t\t\t\t{\n\t\t\t\t\t$metadata = $cat_group->getFieldMetadata();\n\t\t\t\t\t$metadata['categorized_object'] = $this;\n\n\t\t\t\t\tif ($cat_groups->count() == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$metadata['field_label'] = lang('categories');\n\t\t\t\t\t}\n\n\t\t\t\t\t$default_fields['categories[cat_group_id_'.$cat_group->getId().']'] = $metadata;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $this->Channel->comment_system_enabled OR ! bool_config_item('enable_comments'))\n\t\t\t\t{\n\t\t\t\t\tunset($default_fields['comment_expiration_date'], $default_fields['allow_comments']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$module_tabs = $this->getTabFields();\n\n\t\t\tforeach ($module_tabs as $tab_id => $fields)\n\t\t\t{\n\t\t\t\tforeach ($fields as $key => $field)\n\t\t\t\t{\n\t\t\t\t\t$default_fields[$tab_id . '__' . $key] = $field;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_default_fields = $default_fields;\n\t\t}\n\n\t\treturn $this->_default_fields;\n\t}" ]
[ "0.75143987", "0.72825384", "0.70297503", "0.6989107", "0.69391334", "0.6849281", "0.6825262", "0.6777208", "0.67693716", "0.676299", "0.6750364", "0.67424196", "0.65882826", "0.6562928", "0.65315497", "0.6509797", "0.6472962", "0.6461142", "0.646114", "0.64370614", "0.643664", "0.6432315", "0.64317113", "0.6425035", "0.6409885", "0.640472", "0.640306", "0.63935393", "0.6383289", "0.63493854", "0.63230366", "0.63127184", "0.63051677", "0.6291187", "0.62805", "0.6275507", "0.62743604", "0.62650657", "0.6245851", "0.6245254", "0.62402767", "0.62225896", "0.6221877", "0.62062967", "0.61901987", "0.61882716", "0.6183079", "0.61730754", "0.6156899", "0.61517066", "0.6140586", "0.6125736", "0.612059", "0.61195487", "0.60952556", "0.6086493", "0.60802484", "0.60720253", "0.6070167", "0.60616714", "0.6046522", "0.6039639", "0.6023398", "0.60228485", "0.60135055", "0.6007225", "0.6000786", "0.5993515", "0.59500015", "0.5947512", "0.5939688", "0.59227407", "0.59213823", "0.5914617", "0.5907491", "0.5905181", "0.5881725", "0.587896", "0.5875497", "0.5873624", "0.5870128", "0.5868322", "0.5862983", "0.58627737", "0.5859156", "0.58525604", "0.5852333", "0.5839923", "0.58263314", "0.5825093", "0.58245504", "0.582265", "0.5820756", "0.5808099", "0.58075434", "0.5804525", "0.58031803", "0.5798792", "0.57970434", "0.5788248" ]
0.68868864
5
A getter for properties of the package For example: $package>get('name'); $package>get('version'); $package>get('require>php'); Returns whatever there is in the node or false if was unable to find this node
public function get($propertyPath, $filter = null) { $result = $this->traverseGet($this->json, explode('->', $propertyPath)); if ($result && $filter) { foreach ($result as $key => $value) { if (!preg_match($filter, $key)) { unset($result->{$key}); } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProperty();", "public function getProperty(): string;", "public function __get($name)\n {\n if (array_key_exists($name, $this->_properties)) {\n return $this->_properties[$name];\n }\n return false;\n }", "public function getProperty(): ?string;", "public function __get($name) {\r\n\t\tif (method_exists($this, \"get_\" . $name)) {\r\n\t\t\t$methodName = \"get_\" . $name;\r\n\t\t\t$res = $this->$methodName();\r\n\t\t\treturn $res;\r\n\t\t} else if (property_exists($this, $name)) {\r\n\t\t\treturn $this->$name;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function read()\r\n {\r\n return $this->getNamespace()->{$this->getMember()};\r\n }", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperty()\n {\n return \\tabs\\api\\property\\Property::getProperty(\n $this->getPropertyRef(),\n $this->getBrandCode()\n );\n }", "public function getProperty()\n {\n return \\tabs\\api\\property\\Property::getProperty(\n $this->getPropertyRef(),\n $this->getBrandCode()\n );\n }", "public function getProperty($key)\n\t{\n\t\tif(array_key_exists($key, $this->properties))\n\t\t{\n\t\t\treturn $this->properties[$key];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function get($key) {\n\t\t\tif(!is_object($this->package) || !($this->package instanceof Object))\n\t\t\t\t$this->package = $this->getPackage();\n\t\t\t\n\t\t\treturn $this->package->get($key);\n\t\t}", "function __get($name)\n {\n if(property_exists($this,$name))\n return $this->$name;\n\n return false;\n }", "abstract public function getProperties();", "public function __get($name)\n {\n if (!isset($this->_exposedProperties[$name])) {\n return false;\n }\n $key = $this->_exposedProperties[$name];\n if (substr($key, 0, 4) === '_get') {\n return $this->{$key}();\n }\n\n return $this->{$key};\n }", "abstract protected function propertyGet($name);", "public function getProperty() {\n return $this->property;\n }", "public function getProperty($propertyName)\n {\n if (isset($this->properties[$propertyName])) {\n return $this->properties[$propertyName];\n }\n\n $extendsClassDefinition = $this->extendsClassDefinition;\n if ($extendsClassDefinition) {\n if ($extendsClassDefinition->hasProperty($propertyName)) {\n return $extendsClassDefinition->getProperty($propertyName);\n }\n }\n return false;\n }", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "function _getProperties() ;", "public function getPackage() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function getPackage() {\n\t\t\t$packages_json = $this->application->configuration([ \"packagemanager\", \"packages_json\" ]);\n\t\t\t$packages = (new Packages($this->application))->getPackages();\n\t\t\tif(isset($packages->packages->{$this->package_directory}))\n\t\t\t\treturn new Object($packages->packages->{$this->package_directory});\n\t\t\telse return null;\n\t\t}", "public function getProperty($key);", "public function package() {\n\t\treturn $this->package;\n\t}", "function get_properties()\r\n {\r\n return $this->properties;\r\n }", "public function getProperty($property = null);", "abstract protected function getProperties();", "public function __get($name) {\n\t\t$data = $this->_cache->load($this->_namespace);\n\t\tif(isset($data[$name])) {\n\t\t\treturn $data[$name];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function get($property);", "function __get($property) {\n if(in_array($property, array('files', 'folders'))) {\n $this->loadStructure();\n return $this->$property;\n } else return parent::__get($property);\n }", "public function getPackageInfo()\n {\n return $this->getConfig()->getPackageInfo();\n }", "function get($property) {\n if (!empty($this->{$property})) {\n return $this->{$property};\n }\n else {\n return false;\n }\n }", "function getPackageMetaData() ;", "public function __get($key)\n {\n return (array_key_exists($key, $this->props)) ? $this->props[$key] : false;\n }", "public function __get($prop) {}", "public static function get(): string;", "abstract protected function get_properties();", "public function getNodeInfo() {\n return Node::factory($this, $this->get(\"/\")->getJson());\n }", "public function __get($name)\n {\n if (isset($this->{\"_$name\"})) {\n $requested = $this->getReflectedProperty(\"_$name\", $this);\n } else {\n if (isset($this->{\"$name\"})) {\n $requested = $this->getReflectedProperty(\"$name\", $this);\n } else {\n return false;\n }\n\n }\n return $requested;\n }", "public function get() {\r\n if (!xcache_isset($this->key)) {\r\n return false;\r\n }\r\n\r\n return xcache_get($this->key);\r\n }", "public function __get($name) {\n\n\t\tif($name === 'wire') return $this->wire();\n\t\tif($name === 'fuel') return $this->wire('fuel');\n\t\tif($name === 'className') return $this->className();\n\n\t\tif($this->useFuel()) {\n\t\t\t$value = $this->wire($name);\n\t\t\tif($value !== null) return $value; \n\t\t}\n\n\t\t$hooks = $this->wire('hooks'); /** @var WireHooks $hooks */\n\t\tif($hooks && $hooks->isHooked($name)) { // potential property hook\n\t\t\t$result = $hooks->runHooks($this, $name, array(), 'property');\n\t\t\treturn $result['return'];\n\t\t}\n\n\t\treturn null;\n\t}", "public function __get($name)\n {\n if (isset($this->obj->$name)) {\n return $this->obj->$name;\n }\n\n return false;\n }", "public function getProperty($propertyName);", "public function getPackageMetaData() {}", "public function _getProperties() {}", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "public function getProperty(string $name)\n {\n return isset($this->properties[$name]) ? $this->properties[$name] : false;\n }", "public function getSchemaProperty(): ISchemaProperty;", "abstract public function getJsProperties();", "function __get($name) {\n if(array_key_exists($name, $this->_prop)) return $this->_prop[$name];\n switch($name) {\n case 'size':\n return $this->strlen();\n\n case 'baseURI':\n return $this->baseURI();\n\n case 'base_url':\n return @$this->_prop['baseURL'];\n\n case 'location':\n case 'href':\n return $this->location();\n\n case 'charset':\n if($this->html) {\n $this->_prop['charset'] =\n $c = self::detect_charset($this->html);\n return $c;\n }\n break;\n }\n }", "public function __get($name){\n\t\treturn ( !empty($this->properties[$name]) ? $this->properties[$name] : null );\n\t}", "function prop($prop)\n {\n \treturn $this->get_property($prop);\n }", "public function get()\n\t{\n\t\tif ( $this->check() ){\n\t\t\treturn $this->obj;\n\t\t}\n\t\treturn false;\n\t}", "public function getp($property){\n if(property_exists($this, $property)){\n return $this->$property;\n }\n }", "public function __get( $name )\n {\n switch ( $name )\n {\n case \"version\":\n case \"bitFlag\":\n case \"compressionMethod\":\n case \"lastModFileTime\":\n case \"lastModFileDate\":\n case \"crc\":\n case \"compressedSize\":\n case \"uncompressedSize\":\n case \"extraFieldLength\":\n case \"fileNameLength\":\n case \"fileName\":\n return $this->properties[ $name ];\n\n default:\n throw new ezcBasePropertyNotFoundException( $name );\n }\n }", "public function getGet ();", "public function __get($name) {\n\t\t\tif (!in_array($name, array('metadata', 'models'))) {\n\t\t\t\tthrow new Throwable\\InvalidProperty\\Exception('Unable to get property. Expected a valid name, but got \":name\".', array(':name' => $name));\n\t\t\t}\n\t\t\treturn $this->$name;\n\t\t}", "public function hasGet(string $name): bool {}", "public function getProperties() : array;", "private function __get($name)\n {\n// \tprint(\"Property get for [$name]<br/>\");\n if (method_exists($this, ($method = 'get_'.$name)))\n {\n return $this->$method();\n }\n else return;\n }", "public function getPackage()\n {\n return $this->package;\n }", "public function getPackage()\n {\n return $this->package;\n }", "public function __get($key){\r\n\t\tif(array_key_exists($key, $this->_attributes)){\r\n\t\t\treturn $this->_attributes[$key];\r\n\t\t}\r\n\t\t/* else {\r\n\t\t\ttrigger_error(sprintf('Property %s does not exist in class %s.', $key, get_class($this)), E_USER_NOTICE);\r\n\t\t\treturn null;\r\n\t\t} */\r\n\t\t\r\n\t}", "public function __get( $name )\n {\n switch ( $name )\n {\n case \"magic\":\n case \"version\":\n case \"userName\":\n case \"groupName\":\n case \"deviceMajorNumber\":\n case \"deviceMinorNumber\":\n case \"filePrefix\":\n return $this->properties[ $name ];\n }\n\n return parent::__get( $name );\n }", "public function getProperties()\n {\n return $this->getProperty();\n }", "abstract public function getObjectDefinitionProperty();", "public function getNode()\n {\n return parent::getNode();\n }", "public function getReferencedProperty(): string;", "public function __get($property) {}", "public function getSchemaExtensionProperties()\n {\n if (array_key_exists(\"properties\", $this->_propDict)) {\n return $this->_propDict[\"properties\"];\n } else {\n return null;\n }\n }", "public function __get($prop)\n {\n // verifica se existe mtodo get_<propriedade>\n $metodo = 'get' . ucwords($prop);\n if (method_exists($this, $metodo)) {\n return call_user_func(array($this, $metodo));\n } else {\n /* Se o método não existir tentar localizar uma propriedade público */\n if (isset($this->data[$prop])) {\n return $this->data[$prop];\n }\n }\n }", "public function getProperties(): array;", "public function getProperties(): array;" ]
[ "0.64804006", "0.64762205", "0.590431", "0.5828912", "0.579735", "0.5742317", "0.5742317", "0.5742317", "0.57422554", "0.5739994", "0.57294124", "0.57294124", "0.57294124", "0.57294124", "0.5713772", "0.5713772", "0.566371", "0.5655182", "0.5625488", "0.5599513", "0.55763716", "0.5570993", "0.55572295", "0.5555998", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.5532028", "0.55202544", "0.55074716", "0.5487346", "0.5487346", "0.5487346", "0.5487346", "0.5487129", "0.5483702", "0.54728895", "0.5469187", "0.54251206", "0.5419415", "0.541498", "0.54111147", "0.5403617", "0.539365", "0.539271", "0.53899205", "0.53853744", "0.53765994", "0.5375747", "0.5375147", "0.53617394", "0.53591883", "0.53509575", "0.5339875", "0.5339666", "0.5335967", "0.53186345", "0.5314173", "0.5312634", "0.5303083", "0.53025246", "0.5292969", "0.528903", "0.52793723", "0.52775204", "0.52755475", "0.5249483", "0.52486414", "0.5246288", "0.5234664", "0.52321094", "0.5227937", "0.522655", "0.5220731", "0.5212352", "0.5212352", "0.5210204", "0.520835", "0.52071846", "0.5204423", "0.5196811", "0.5195743", "0.519196", "0.5191883", "0.51856667", "0.5185057", "0.5185057" ]
0.0
-1
Traverse an \StdClass object recursively in search of the needed property
private function traverseGet(\StdClass $json, array $chain, $index = 0) { $property = $chain[$index]; if (!property_exists($json, $property)) { return false; } if (isset($chain[$index + 1])) { return $this->traverseGet($json->{$property}, $chain, $index + 1); } else { return $json->{$property}; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRecursiveObjectProp1()\n {\n $test = new TestObj();\n $test->propPublic = array();\n $test->propPublic[] = &$test->propPublic;\n $this->debug->log('test', $test);\n $abstraction = $this->debug->data->get('log/0/args/1');\n self::assertEquals(\n Abstracter::RECURSION,\n $abstraction['properties']['propPublic']['value'][0],\n 'Did not find expected recursion'\n );\n $output = $this->debug->output();\n $select = '.m_log\n > .t_object > .object-inner\n > .property\n > .t_array .array-inner > li\n > .t_recursion';\n self::assertSelectCount($select, 1, $output);\n }", "function propFind($path, PropFind $propFind);", "public function getChildsProperty($object);", "public function find($obj){\n\t}", "public function propfind($key=null,$value=null){\n return $this->methodsData(\"propfind\",$key,$value);\n }", "public function find($object) {\r\n $oReflectionClass = new ReflectionClass($object);\r\n //$properties = $oReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC);\r\n $properties = $oReflectionClass->getProperties();\r\n $this->className = $class = $oReflectionClass->getName();\r\n\r\n foreach ($properties as $key => $reflectionProperty)\r\n $datos_where[$reflectionProperty->getName()] = $reflectionProperty->getValue($object);\r\n $this->setList(null);\r\n $this->setObject(null);\r\n $table = $this->table = CriteriaEntityMgr::instance()->findTable($this->className);\r\n $this->SQL = MySQL_DB::instance()->DBSQLSelect($table, null, $datos_where, $this->array_order, $this->type_order);\r\n $this->execute();\r\n $list = array();\r\n if($this->getNumRows() == 1) {\r\n $row = MySQL_DB::instance()->DBFetchArray($this->result);\r\n $object = $this->iterateProperty($class, $object, $row, $properties);\r\n $this->setObject($object);\r\n $list[] = $object;\r\n }\r\n if($this->getNumRows() > 1) {\r\n while ($row = MySQL_DB::instance()->DBFetchArray($this->result)) {\r\n $object_new = $oReflectionClass->newInstance($oReflectionClass);\r\n $object_new = $this->iterateProperty($class, $object_new, $row, $properties);\r\n $list[] = $object_new;\r\n }\r\n }\r\n $this->setList($list);\r\n return $this;\r\n }", "final public function traverseObject(): Generator\n {\n yield from $this->data;\n }", "public function searchProperty($name){\n\t\tif( array_key_exists($name, $this->properties) )\n\t\t\treturn $this->properties[$name];\n\t\tif( $this->extended === NULL )\n\t\t\treturn NULL;\n\t\telse\n\t\t\treturn $this->extended->searchProperty($name);\n\t}", "public function find($class);", "public function find() {\n return call_user_func_array(array($this->children(), 'find'), func_get_args());\n }", "public function reflectionAccion($obj){\n $reflectionClass = new ReflectionClass(get_class($obj));\n foreach ($reflectionClass->getProperties() as $property) {\n $property->setAccessible(true);\n if(is_array($property->getValue($obj))){\n $arreglo = $this->verificando($property->getValue($obj));\n $this->_filling[str_replace('_','',$property->getName())] = $arreglo;\n }else{\n $this->_filling[str_replace('_','',$property->getName())] = $property->getValue($obj); \n }\n $property->setAccessible(false);\n }\n return $this->_filling;\n }", "public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\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$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}", "public function filterByValueRecursive() {}", "function findProperty($id);", "function BuildProperty($PropNode)\n {\n $objProp = new clsProperty();\n\n foreach ($PropNode->children() as $PropChild)\n {\n switch ($PropChild->getName())\n {\n case \"ID\":\n $objProp->ID = $PropChild;\n break;\n case \"Name\":\n $objProp->Name = $PropChild;\n break;\n case \"Address\":\n $objProp->Address = $PropChild;\n break;\n case \"City\":\n $objProp->City = $PropChild;\n break;\n case \"State\":\n $objProp->State = $PropChild;\n break;\n case \"Zip\":\n $objProp->Zip = $PropChild;\n break;\n case \"Phone\":\n $objProp->Phone = $PropChild;\n break;\n case \"Email\" :\n $objProp->Email = $PropChild;\n break;\n case \"Maint\":\n $objProp->Maint = $PropChild;\n break;\n case \"WebSite\":\n $objProp->WebSite = $PropChild;\n break;\n case \"Desc\" :\n $objProp->Desc = $PropChild;\n break;\n case \"Amenities\":\n $objProp->Amenities = explode(\"--\",$PropChild);\n break;\n case \"Highlights\" :\n $objProp->Highlights = $PropChild;\n break;\n case \"Coupon\" :\n $objProp->Coupon = $PropChild;\n break;\n case \"Vtour\" :\n $objProp->Vtour = $PropChild;\n break;\n case \"MainPic\" :\n $objProp->MainPic = $PropChild;\n break;\n case \"SubPic1\" :\n case \"SubPic2\" :\n case \"SubPic3\" :\n case \"SubPic4\" :\n case \"SubPic5\" :\n array_push($objProp->SubPics, $PropChild) ;\n break;\n case \"OneBedLowPrices\" :\n case \"TwoBedLowPrices\" :\n case \"ThreeBedLowPrices\" :\n case \"FourBedLowPrices\" :\n\n array_push($objProp->BedLowPrices,$PropChild) ;\n // or die(\" Error Creating BedLowPrices object \");\n break;\n\n case \"UnitTypes\" :\n\n $objProp->Units = $this->BuildUnit($objProp->Units,$PropChild);\n // die(\" Error Creating Unit object \") ;\n\n break;\n case \"ReportRoster\" :\n \n\n $objProp->Reports = $this->BuildReport($objProp->Reports,$PropChild) ;\n // or die (\" Error Creating Report object \") ;\n break;\n }\n\n }\n\n return $objProp;\n\n\n }", "function discoverCandidateClasses($recursive = FALSE);", "public function canIterateOverProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $this->object->iterateOn('objIds');\n $expect = $this->object->getArrayCopy();\n foreach ($this->object as $position=>$objectId) {\n $this->assertInternalType('string', $objectId);\n $this->assertEquals($expect[$position], $objectId);\n }\n $this->assertEquals(2, $position);\n }", "function get_class_properties(string|object $class, bool $scope_check = true, bool $assoc = true): array|null\n{\n if ($scope_check) {\n $caller_class = debug_backtrace(2, 2)[1]['class'] ?? null;\n if ($caller_class) {\n $all = ($caller_class === Objects::getName($class));\n }\n }\n\n return Objects::getPropertyValues($class, ($all ?? !$scope_check), $assoc);\n}", "public function getList(){\n foreach ($this as $property => $value) {\n if(is_object($this->{$property})){\n return true;\n }\n }\n }", "function getNestedProperty($object, $name) {\r\n\r\n\r\n\t}", "protected function _getItem($key, $default = null)\n {\n if (is_object($key)) {\n $class = get_class($key);\n } else {\n $class = $key;\n }\n\n // Check for simple existence\n if ($result = parent::_getItem($class, $default)) {\n return $result;\n }\n\n // Check was already found\n if (array_key_exists($class, $this->_subClasses)) {\n return $this->_subClasses[$class];\n }\n\n // Check was already searched and not found\n if (array_key_exists($class, $this->_notSubClasses)) {\n return $default;\n }\n\n // Check the parent classes of the object\n $parents = class_parents($key);\n $result = null;\n foreach ($parents as $parentClass) {\n if ($result = parent::_getItem($parentClass, null)) {\n // Add the current class to the cache\n $this->_subClasses[$class] = $result;\n\n // Add all parents up to the one matching to the cache\n foreach ($parents as $priorParent) {\n $this->_subClasses[$priorParent] = $result;\n if ($parentClass === $priorParent) {\n // Further parents are not automatically in the list\n break;\n }\n }\n return $result;\n }\n }\n\n // Check the interfaces implemented by the object\n $implemented = class_implements($key);\n foreach ($implemented as $interface) {\n if ($result = parent::_getItem($interface, null)) {\n // Add the current class to the cache\n $this->_subClasses[$class] = $result;\n return $result;\n }\n }\n\n // Add to the not found cache\n $this->_notSubClasses[$class] = true;\n\n return $default;\n }", "public abstract function find();", "function searchObject($object){\r\n\t\tif($this->getElem($object->value)!=null) return true;\r\n\t\t\telse false;\r\n\t}", "function class_uses_recursive($class)\n{\n if (is_object($class)) {\n $class = get_class($class);\n }\n\n $results = [];\n\n /* @phpstan-ignore-next-line */\n foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {\n $results += trait_uses_recursive($class);\n }\n\n return array_unique($results);\n}", "public function GetClassSCPropertiesInArray_Advance(DataSource $DS)\n {\n $rtnval = array();\n $propref = new \\ReflectionProperty(get_class($this), 'id');\n $propref->setAccessible(true);\n $PropValue = $propref->getValue($this);\n $rtnval['id'] = $PropValue;\n\n foreach ($DS->getFields() as $f) {\n\n if ($f == 'id') continue;\n $fieldName = $f->getFieldName();\n /*$fieldName=str_replace('_', '\\\\', $fieldName);\n $fieldName=urldecode($fieldName);\n if(strpos($fieldName, '\\\\')>-1) $fieldName=substr($fieldName, strpos($fieldName, '.')+1);\n */\n /*$fieldName=str_replace('.', '->', $fieldName);\n $fieldName='$this->'.$fieldName;\n print_r($fieldName.' TO EVAL . ');\n print_r($this->Title);\n $ap='';\n $b='$this->Title';\n $a=eval($b);\n print_r('eval1='.$a);\n print_r('eval1='.$ap);\n */\n try {\n $fieldName = \\ApplicationHelpers::TranslateFieldName_From_Client2Server($fieldName);\n $parts = explode('.', $fieldName);\n $PropValue = $this;\n $propref = null;\n //print_r($fieldName.':');\n //print_r($parts);\n try {\n for ($i = 0; $i < count($parts); $i++) {\n $_clsname = get_class($PropValue);\n if (\\ApplicationHelpers::IsORMProxyClass($_clsname)) $PropValue->DoctrineLoad();\n $propref = new \\ReflectionProperty(get_class($PropValue), $parts[$i]);\n\n\n //print_r(' | Class:'.$propref->class.' prop:'. $propref->name.' | ');\n $propref->setAccessible(true);\n if (isset($PropValue))\n $PropValue = $propref->getValue($PropValue);\n else {\n $PropValue = NULL;\n //print_r('Break at '.$parts[$i]);\n break;\n }\n /*echo gettype($PropValue);\n if(gettype($PropValue)=='object') echo 'Class:'.get_class($PropValue);\n echo '***';*/\n\n }\n } catch (\\Exception $e) {\n //print_r($e);\n $PropValue = NULL;\n } catch (\\ReflectionException $ec) {\n //print_r($e);\n $PropValue = NULL;\n }\n //print_r($PropValue);\n $rtnval[$f->getFieldName()] = $PropValue;\n } catch (Exception $e) {\n $rtnval[$f->getFieldName()] = null;\n }\n }\n return $rtnval;\n }", "public function search($param, $class) {\n // check each properties\n if (!is_null($val = $this->searchProperty($param, $class))) {\n return $val;\n }\n // check each services\n if (!is_null($val = $this->searchService($param))) {\n return $val;\n }\n // no property or service found\n throw new \\Exception(\"No property or service \\\"$param\\\" found.\");\n }", "public function getPropertyRelatedClasses(): array;", "public function walkClass(ClassMetadata $metadata, $object, $group, $propertyPath)\n {\n $this->context->setCurrentClass($metadata->getClassName());\n\n if ($group === Constraint::DEFAULT_GROUP && $metadata->hasGroupSequence()) {\n $groups = $metadata->getGroupSequence();\n foreach ($groups as $group) {\n $this->walkClassForGroup($metadata, $object, $group, $propertyPath, Constraint::DEFAULT_GROUP);\n\n if (count($this->getViolations()) > 0) {\n break;\n }\n }\n } else {\n $this->walkClassForGroup($metadata, $object, $group, $propertyPath);\n }\n }", "function wp_find_hierarchy_loop($callback, $start, $start_parent, $callback_args = array())\n {\n }", "public function find(...$arguments)\n {\n return $this->children()->find(...$arguments);\n }", "public function getParentProperty($object);", "public function getMainObjectClassOld($item, $property) {\r\n static $depth = 0, $maxDepth = 1;\r\n\r\n $className = is_object($item) ? get_class($item) : $item;\r\n\r\n if (property_exists($item, $property)) {\r\n return $className;\r\n } elseif ($depth < $maxDepth) {\r\n /** @var ClassMetadata $metadata */\r\n $om = $this->getObjectManager();\r\n\r\n $metadata = $om->getClassMetadata($className);\r\n\r\n foreach ($metadata->associationMappings as $field => $mapping) {\r\n //if ($mapping['type'] === ClassMetadata::ONE_TO_ONE || ) {\r\n if (in_array($mapping['type'], [ClassMetadata::ONE_TO_ONE, ClassMetadata::MANY_TO_ONE])) {\r\n $itemClass = $mapping['targetEntity'];\r\n //$getter = 'get' . ucfirst($field);\r\n //$itemWithStatus = $item->{$getter}() ?: new $targetEntity();\r\n\r\n $depth++;\r\n $assigned = $this->getMainObjectClass($itemClass, $property);\r\n $depth--;\r\n\r\n if ($assigned) {\r\n //$setter = 'set' . ucfirst($field);\r\n //$itemWithStatus->getId() ? : $item->{$setter}($itemWithStatus);\r\n\r\n return $assigned;\r\n }\r\n }\r\n }\r\n\r\n throw new Exception\\RuntimeException(sprintf(\r\n 'Cannot find main object in \"%s\" with property \"%s\" and related objects with relation OneToOne or ManyToOne',\r\n $className,\r\n $property\r\n ));\r\n }\r\n\r\n return false;\r\n }", "function asdb_class_uses_recursive($class)\n {\n if (is_object($class)) {\n $class = get_class($class);\n }\n\n $results = [];\n\n foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {\n $results += asdb_trait_uses_recursive($class);\n }\n\n return array_unique($results);\n }", "function discoverExistingClasses($recursive = FALSE);", "public function find();", "private function traverse_class_hierarchy(&$cur_class)\n\t{\n\t\t$this->_sorted_classes[$cur_class->get_name()] = $cur_class;\n\t\tforeach($cur_class->_children as $child)\n\t\t{\n\t\t\t$this->traverse_class_hierarchy($child);\n\t\t}\t\t\t\t\t\t\n\t}", "function propFind(PropFind $propFind, INode $node) {\n\n if ($node instanceof ISharedNode) {\n\n $propFind->handle('{DAV:}share-access', function() use ($node) {\n\n return new Property\\ShareAccess($node->getShareAccess());\n\n });\n $propFind->handle('{DAV:}invite', function() use ($node) {\n\n return new Property\\Invite($node->getInvites());\n\n });\n $propFind->handle('{DAV:}share-resource-uri', function() use ($node) {\n\n return new Property\\Href($node->getShareResourceUri());\n\n });\n\n }\n\n }", "private function iterate($object, $propertyToBeFounded, $validators)\n\t{\n\n\t\tstatic $propertyHasBeenFound = false;\n\n\t\tforeach( $object as $propertyName => $property ) {\n\n\t\t\t// applay the validation and return true is the property has been found\n\t\t\tif( $propertyToBeFounded === $propertyName ) {\n\n\t\t\t\tif ( $this->arrayutil->isArray( $validators ) ) {\n \n\t foreach ( $validators as $validator ) {\n\t\t\t\t\t\t$validator->validate( $propertyName, $object->{$propertyName} ); \n\t }\n\t \n\t } else {\n\t\t\t\t\t$validators->validate( $propertyName, $object->{$propertyName} ); \n\t }\n\n\t\t\t\t$propertyHasBeenFound = true;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// loop recursively if the property founded is an object\n\t\t\t\tif( $this->objectutil->isObject( $property )) {\n\t\t\t\t\t$propertyHasBeenFound = false;\n\t\t\t\t\t$this->iterate($property, $propertyToBeFounded, $validators);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n return $propertyHasBeenFound;\n\n\t}", "public function getByPropertyValue($strSearchProperty, $strSearchValue) {\r\n \t$objReturn = null;\r\n\r\n \tforeach ($this->collection as $objElement) {\r\n \t\t$strProperty = \"get{$strSearchProperty}\";\r\n \t\tif (is_callable(array($objElement, $strProperty))) {\r\n \t\t\tif ($objElement->$strProperty() == $strSearchValue) {\r\n \t\t\t\t$objReturn = $objElement;\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n\r\n \treturn $objReturn;\r\n }", "function findPropertyBy(array $criteria);", "abstract public function getResultObjectProperty();", "private function obj()\n {\n $object = $this->associative ? [] : new \\stdClass;\n\n if (++$this->depth > $this->maxDepth) {\n $this->throwSyntaxError('Maximum stack depth exceeded');\n }\n\n $this->nextOrFail('{');\n $this->white();\n while ($this->currentByte !== null) {\n if ($this->currentByte === '}') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object; // Potentially empty object\n }\n\n // Keys can be unquoted. If they are, they need to be\n // valid JS identifiers.\n if ($this->currentByte === '\"' || $this->currentByte === \"'\") {\n $key = $this->string();\n } else {\n $key = $this->identifier();\n }\n\n $this->white();\n $this->nextOrFail(':');\n if ($this->associative) {\n $object[$key] = $this->value();\n } else {\n $object->{$key} = $this->value();\n }\n $this->white();\n // If there's no comma after this pair, this needs to be\n // the end of the object.\n if ($this->currentByte !== ',') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object;\n }\n $this->nextOrFail(',');\n $this->white();\n }\n\n $this->throwSyntaxError('Invalid object');\n }", "public function loadForClass($obj)\r\n\t{\r\n\t\t/**\r\n\t\t * @var $class_name string full qualified name of class ex. fhibox\\jeeves\\application\\commands\\deploy\\CommandDeploy\r\n\t\t */\r\n\t\t$class_name = (is_string($obj)) ? $obj : get_class($obj);\r\n\t\t/* */ isset($this->logger) && $this->logger->debug(\"class_name=$class_name\");\r\n\r\n\t\t// Read conf file for current class:\r\n\t\t$arr_conf = $this->getArrConf($class_name);\r\n\t\t// ... and process placeholders if applicable\r\n\t\tif (!is_string($obj))\r\n\t\t{\t$arr_conf = $this->processPlaceholders($arr_conf, $obj);\r\n\t\t}\r\n\r\n\t\t/* */ isset($this->logger) && $this->logger->debug(\"arr_conf=\". print_r($arr_conf, true));\r\n\r\n\t\t// If class has parent classes, read their confs and merge them into child conf,\r\n\t\t// with lower precedence (child conf \"redefines\" parent conf)\r\n\t\t$class_parents = $this->getParents($class_name);\r\n\t\t/* */\t isset($this->logger) && $this->logger->debug(\"parents = \" . print_r($class_parents, true));\r\n\r\n\r\n\t\tforeach ($class_parents as $parent_class)\r\n\t\t{ // Read conf file for current class:\r\n\t\t\t$arr_conf_parent = $this->getArrConf($parent_class);\r\n\t\t\t// ... and process placeholders if applicable\r\n\t\t\tif (!is_string($obj))\r\n\t\t\t{\t$arr_conf_parent = $this->processPlaceholders($arr_conf_parent, $obj);\r\n\t\t\t}\r\n\r\n\t\t\t// Merge in already computed conf, with lower precedence:\r\n\t\t\t#$arr_conf = array_merge($arr_conf_parent, $arr_conf);\r\n\t\t\t$arr_conf = ArrayLib::array_merge_recursive($arr_conf_parent, $arr_conf);\r\n\r\n\t\t\t#// Remove new lines from values (Experimental): (Trying to fix the way help looks)\r\n\t\t\t#array_walk_recursive($arr_conf, function(&$i, $k){ $i=StringLib::removeNewlines($i);});\r\n\r\n\t\t}\r\n\t\t/* */ isset($this->logger) && $this->logger->debug(\"merged conf array=\" . print_r($arr_conf, true));\r\n\r\n\r\n\r\n\t\t// If array is empty, return an EmptyConfiguration\r\n\t\tif (empty($arr_conf))\r\n\t\t{\treturn new EmptyConfiguration();\r\n\t\t}\r\n\t\telse\r\n\t\t{\t// @todo polymorphism Return type should be configurable\r\n\t\t\treturn new ArrayConfiguration($arr_conf);\r\n\t\t}\r\n\r\n\t}", "abstract protected function get_properties();", "abstract protected function propertyExists($name);", "protected function _tree($prop = NULL)\n\t{\n\t\t$CI =& get_instance();\n\t\t$return = array();\n\n\n\t\tif (!empty($this->foreign_keys) OR !empty($this->has_many) OR !empty($this->belongs_to))\n\t\t{\n\t\t\tif (empty($prop))\n\t\t\t{\n\t\t\t\tif (!empty($this->foreign_keys))\n\t\t\t\t{\n\t\t\t\t\t$p = $this->foreign_keys;\n\t\t\t\t}\n\t\t\t\telse if (!empty($this->has_many))\n\t\t\t\t{\n\t\t\t\t\t$p = $this->has_many;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (property_exists($this, $prop))\n\t\t\t{\n\t\t\t\t$p = $this->$prop;\n\t\t\t}\n\n\t\t\t$key_field = key($p);\n\t\t\t$loc_field = $key_field;\n\n\t\t\t// get related model info\n\t\t\t$rel_module = current($p);\n\t\t\tif (is_array($rel_module))\n\t\t\t{\n\t\t\t\t$rel_module = current($rel_module);\n\t\t\t}\n\t\t\t$rel_module_obj = $CI->fuel->modules->get($rel_module, FALSE);\n\n\t\t\tif (!$rel_module_obj)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$rel_model = $rel_module_obj->model();\n\t\t\t$rel_key_field = $rel_model->key_field();\n\t\t\t$rel_display_field = $rel_module_obj->info('display_field');\n\n\n\t\t\t$module = strtolower(get_class($this));\n\t\t\t$module_obj = $CI->fuel->modules->get($module, FALSE);\n\t\t\tif (!$module_obj)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$model = $module_obj->model();\n\t\t\t$display_field = $module_obj->info('display_field');\n\t\t\t$rel_col = !empty($rel_module_obj->default_col) ? $rel_module_obj->default_col : $this->key_field();\n\t\t\t$rel_order = !empty($rel_module_obj->default_order) ? $rel_module_obj->default_order : 'asc';\n\n\t\t\tif ($prop == 'foreign_keys')\n\t\t\t{\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_model->key_field().' asc');\n\t\t\t\t$children = $this->find_all_array(array(), $key_field.' asc');\n\t\t\t\t$g_key_field = $rel_model->key_field();\n\t\t\t\t$loc_field = $g_key_field;\n\t\t\t}\n\t\t\telse if ($prop == 'has_many')\n\t\t\t{\n\t\t\t\t$CI->load->module_model(FUEL_FOLDER, 'fuel_relationships_model');\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_col.' '.$rel_order);\n\t\t\t\t$children = $CI->fuel_relationships_model->find_by_candidate($this->table_name(), $rel_model->table_name(), NULL, 'array');\n\t\t\t\t$key_field = 'foreign_id';\n\t\t\t\t$g_key_field = 'candidate_id';\n\t\t\t\t$display_field = 'candidate_'.$display_field;\n\t\t\t\t$loc_field = $key_field;\n\t\t\t}\n\t\t\telse if ($prop == 'belongs_to')\n\t\t\t{\n\t\t\t\t$CI->load->module_model(FUEL_FOLDER, 'fuel_relationships_model');\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_col.' '.$rel_order);\n\t\t\t\t$children = $CI->fuel_relationships_model->find_by_candidate($rel_model->table_name(), $this->table_name(), NULL, 'array');\n\t\t\t\t$key_field = 'candidate_id';\n\t\t\t\t$g_key_field = 'foreign_id';\n\t\t\t\t$display_field = 'foreign_'.$display_field;\n\t\t\t\t$loc_field = $key_field;\n\t\t\t}\n\n\t\t\t// now get this models records\n\t\t\tforeach($children as $child)\n\t\t\t{\n\t\t\t\t$used_groups[$child[$key_field]] = $child[$key_field];\n\t\t\t\t$attributes = ((isset($child['published']) AND $child['published'] == 'no') OR (isset($child['active']) AND $child['active'] == 'no')) ? array('class' => 'unpublished', 'title' => 'unpublished') : NULL;\n\t\t\t\t$return['g'.$child[$g_key_field].'_c_'.$child[$key_field]] = array('parent_id' => $child[$key_field], 'label' => $child[$display_field], 'location' => fuel_url($module_obj->info('module_uri').'/edit/'.$child[$loc_field]), 'attributes' => $attributes);\n\t\t\t}\n\n\t\t\tforeach($groups as $group)\n\t\t\t{\n\t\t\t\tif (isset($used_groups[$group[$rel_key_field]]))\n\t\t\t\t{\n\t\t\t\t\t$attributes = ((isset($group['published']) AND $group['published'] == 'no') OR (isset($group['active']) AND $group['active'] == 'no')) ? array('class' => 'unpublished', 'title' => 'unpublished') : NULL;\n\t\t\t\t\t$return[$group[$rel_key_field]] = array('id' => $group[$rel_key_field], 'parent_id' => 0, 'label' => $group[$rel_display_field], 'location' => fuel_url($rel_module_obj->info('module_uri').'/edit/'.$group[$rel_key_field]), 'attributes' => $attributes);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public function testGetReturnsValueFromObjectBySinglePath()\n {\n $object = (object) ['a' => 1];\n $actual = $this->property->get($object, 'a');\n $this->assertEquals(1, $actual);\n }", "function populate($obj, $prop, $default = '') {\n return ($obj && isset($obj->$prop)) ? $obj->$prop : $default;\n}", "function dump_nodes($node, $indent) {\n\n if($node->hasChildren()) {\n foreach($node->child as $child) {\n if($child->attribute['class'] == 'test') {\n $node_value = new Node_Value();\n echo (\"!!!!-\" . $node_value->get_value($child) . \"-!!!<br/>\");\n unset($node_value);\n }\n dump_nodes($child, $indent+1);\n }\n }\n}", "public function iterateChildren();", "abstract public function get_property( $slug, $child_slug = '' );", "function __get($k) {\n if (isset($this->data[$k])) {\n return $this->data[$k]->value();\n }\n\n //look through our table fields to see if it's in there\n //bubbling up through our parents\n $ref = $this->table;\n do {\n //find data\n if (isset($this->data[$ref->table.\".\".$k])) {\n return $this->data[$ref->table.\".\".$k]->value();\n }\n //find a link\n if (isset($ref->link[$k])) {\n $link = $ref->link[$k];\n \n $dest_table = $link['table'];\n $order = $link['order'];\n \n $binding = \"\";\n foreach ($link['binding'] as $local => $dest) {\n $binding .= $dest_table->table.\".\".$dest.\" = '\".db::escape($this->data[$ref->table.\".\".$local]->value()).\"' AND \";\n }\n \n if ($link['filter']) {\n $binding .= $link['filter'].\" AND \";\n }\n $binding = substr($binding,0,-5);\n \n //drill back to the root item and initiate that\n while ($dest_table->parent && $dest_table->parent['table']) {\n $dest_table = $dest_table->parent['table'];\n }\n \n return $dest_table->get($binding, $order);\n }\n $ref =& $ref->parent['table'];\n } while ($ref);\n \n $m = '_get_'.$k; //use this method name to overload that var\n if (method_exists($this, $m)) {\n if (!isset(self::$get_data[get_class($this)][$this->id][$k])) {\n self::$get_data[get_class($this)][$this->id][$k] = $this->$m(); //save the data so we don't have to call again\n }\n return self::$get_data[get_class($this)][$this->id][$k];\n }\n $trace = debug_backtrace(); //error\n trigger_error('Undefined property via __get(): '.get_class($this).'::'.$k.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);\n return null;\n //to do _get_$k()\n }", "public function findPropertyInScopes($reference)\n {\n // process scopes in reverse order\n $scopes = $this->getScopes();\n $scopes = array_reverse($scopes);\n // remember current content\n $currentContext = $this->getContext();\n $propertyInScope = $this->getRootScope();\n foreach ($scopes as $scope) {\n // set current scope to resolver context\n $this->setContext($scope);\n $propertyInScope = $this->resolvePropertyByReference($reference);\n if ($propertyInScope !== null) {\n // could resolve property in current scope, \n // return it and reset context\n $this->setContext($currentContext);\n return $propertyInScope;\n }\n }\n \n // no property found, reset context\n $this->setContext($currentContext);\n return $propertyInScope;\n }", "public function __get($prop) {}", "abstract protected function fetchObject(string $className = 'stdClass');", "public function testFindAllByClass(): void\n {\n $tree = new Soup('\n <a class=\"1\">Class 1.</a>\n <a class=\"2\">Class 2.</a>\n <b class=\"1\">Class 1.</b>\n <c class=\"3 4\">Class 3 and 4.</c>');\n\n $this->assertSelects(['Class 1.'], $tree->findAll('a', class: '1'));\n $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', class: '3'));\n $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', class: '4'));\n\n $this->assertSelects(['Class 1.'], $tree->findAll('a', '1'));\n $this->assertSelects(['Class 1.', 'Class 1.'], $tree->findAll(attrs: '1'));\n\n // TODO classなのでcontainsでマッチできるようにする必要がありそう。現状だと '3 4' じゃないとマッチングできない。\n // @*=\"xx\" or contains(@*, \"xx\") でよさげか\n // $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', '3'));\n // $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', '4'));\n }", "public function Search($objeto);", "abstract public function processClass (ReflectionClass $class);", "public function testFieldExistsRecursive(): void\n {\n // setup\n $arr = [\n 'f1' => 1,\n 'f2' => [\n 'f21' => 21,\n 'f22' => 22\n ],\n 'f3' => 3\n ];\n\n // test body and assertions\n $this->assertTrue(Fetcher::fieldExists($arr, 'f2'));\n $this->assertTrue(Fetcher::fieldExists($arr, 'f22'));\n $this->assertFalse(Fetcher::fieldExists($arr, 'f22', false));\n }", "private static function _getPrivateProp($obj, $name)\n {\n $arraized = (array)$obj;\n foreach ($arraized as $k => $v) {\n if (substr($k, -strlen($name)) === $name) {\n return $v;\n }\n }\n throw new Exception\\CMS(\n \"Cannot find $name property in \\Zend_Cache_Backend_Memcached; properties are: \" \n . array_map('addslashes', array_keys($arraized))\n );\n }", "abstract protected function getProperties();", "#[Pure]\nfunction class_parents($object_or_class, bool $autoload = true): array|false {}", "public function propertyObject($propertyIdent);", "private function getPropCfgFromObj($debugProp, $path = array(), $forInit = false)\n {\n $obj = null;\n $matches = array();\n if ($debugProp === 'debug') {\n return $this->debug->getCfg($path, Debug::CONFIG_DEBUG);\n }\n if (\\in_array($debugProp, $this->invokedServices, true)) {\n $obj = $this->debug->{$debugProp};\n } elseif ($forInit) {\n return array();\n } elseif (\\preg_match('/^(dump|route)(.+)$/', $debugProp, $matches)) {\n $cat = $matches[1];\n $what = $matches[2];\n $func = 'get' . \\ucfirst($cat);\n $obj = $this->debug->{$func}($what);\n } elseif (isset($this->debug->{$debugProp})) {\n $obj = $this->debug->{$debugProp};\n }\n return $obj\n ? $obj->getCfg(\\implode('/', $path))\n : null; // not invoked or invalid dump/route\n }", "protected static function getPropertyRecursively($enObject, array $aFragments) {\n\t\t// First item in chain.\n\t\t$sProperty = array_shift($aFragments);\n\t\t// Check if the object has the getter.\n\t\tif (static::hasObjectGetMethod($enObject, $sProperty)) {\n\t\t\t// Load data.\n\t\t\t$xRelated = static::callObjectGetMethod($enObject, $sProperty);\n\t\t\t// If it's an object and the chain isn't over, then it loads that data.\n\t\t\tif (is_object($xRelated) and count($aFragments)) {\n\t\t\t\treturn static::getPropertyRecursively($xRelated, $aFragments);\n\t\t\t}\n\t\t\t// Give back the final result.\n\t\t\telse {\n\t\t\t\treturn $xRelated;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new \\Exception(\"Object doesn't have getter! \\n Object: \" . get_class($enObject) . \" \\n Method: get\" . ucfirst($sProperty) . \" \\n\\n \");\n\t\t}\n\t}", "protected function Search_Node_obj($goal_value){\t\t\t\t\t\t\t\t\n\t\t\tforeach ($this->nodes as $key => $obj) {\n\t\t\t\tif ($obj==$goal_value) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "function __get($property) {\n if(in_array($property, array('files', 'folders'))) {\n $this->loadStructure();\n return $this->$property;\n } else return parent::__get($property);\n }", "function member_in_class($class, $member)\n{\n return $class->class_pin == $member->class->class_pin;\n}", "function getProperty($object, $name) {\r\n\r\n\t\t#return (getNestedProperty(bean, name));\r\n\r\n\t}", "protected function getReflectedProperties()\n {\n if (is_null($this->_ReflectedPropertiesCache)) {\n $this->_ReflectedPropertiesCache = array();\n\n $refectionClass = new ReflectionClass($this);\n $propertiesArray = $refectionClass->getProperties();\n if (is_array($propertiesArray) and count($propertiesArray) > 0) {\n while (list(, $property) = each($propertiesArray)) {\n $refectionProperty = new ReflectionProperty($property->class, $property->name);\n if ($refectionProperty->isPublic() || $refectionProperty->isProtected()) {\n $this->_ReflectedPropertiesCache[] = $property->name;\n }\n }\n }\n }\n\n return $this->_ReflectedPropertiesCache;\n }", "private function getReadAccessInfo($class, $property)\n {\n $key = $class.'::'.$property;\n\n if (isset($this->readPropertyCache[$key])) {\n $access = $this->readPropertyCache[$key];\n } else {\n $access = array();\n\n $reflClass = new \\ReflectionClass($class);\n $access[self::ACCESS_HAS_PROPERTY] = $reflClass->hasProperty($property);\n $camelProp = $this->camelize($property);\n $getter = 'get'.$camelProp;\n $getsetter = lcfirst($camelProp); // jQuery style, e.g. read: last(), write: last($item)\n $isser = 'is'.$camelProp;\n $hasser = 'has'.$camelProp;\n\n if ($reflClass->hasMethod($getter) && $reflClass->getMethod($getter)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $getter;\n } elseif ($reflClass->hasMethod($getsetter) && $reflClass->getMethod($getsetter)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $getsetter;\n } elseif ($reflClass->hasMethod($isser) && $reflClass->getMethod($isser)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $isser;\n } elseif ($reflClass->hasMethod($hasser) && $reflClass->getMethod($hasser)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $hasser;\n } elseif ($reflClass->hasMethod('__get') && $reflClass->getMethod('__get')->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n $access[self::ACCESS_REF] = false;\n } elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n $access[self::ACCESS_REF] = true;\n } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {\n // we call the getter and hope the __call do the job\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC;\n $access[self::ACCESS_NAME] = $getter;\n } else {\n $methods = array($getter, $getsetter, $isser, $hasser, '__get');\n if ($this->magicCall) {\n $methods[] = '__call';\n }\n\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_NOT_FOUND;\n $access[self::ACCESS_NAME] = sprintf(\n 'Neither the property \"%s\" nor one of the methods \"%s()\" '.\n 'exist and have public access in class \"%s\".',\n $property,\n implode('()\", \"', $methods),\n $reflClass->name\n );\n }\n\n $this->readPropertyCache[$key] = $access;\n }\n\n return $access;\n }", "function findByPropertyValue($prop_id, $rel_value) {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\n\t\t$propQuery = $this->getEntityManager()->createQuery('SELECT p.datatype FROM :Property p WHERE p.id = ?1');\n\t\t$propQuery->setParameter(1,$prop_id);\n\t\t$propType = $propQuery->getSingleScalarResult();\n\n\t\tif($propType == 'geometry'){\n\t\t\t$qb->where(\"rel.property = ?1 AND rel.geometryvalue = ?2\");\n\t\t}elseif($propType == 'node'){\n\t\t\t$qb->where(\"rel.property = ?1 AND rel.nodevalue = ?2\");\n\t\t}else {\n\t\t\t$qb->where(\"rel.property = ?1 AND lower(rel.value) = lower(?2)\");\n\t\t}\n\n\t\t$qb->setParameters(array(\n\t\t\t1 => $prop_id,\n\t\t\t2 => $rel_value\n\t\t));\n\t\t//return $qb->getQuery();\n\t\treturn $qb->getQuery()->getResult();\n\t}", "protected function generateAdminSearchable()\n {\n $translator = $this->translator();\n $languages = $translator->availableLocales();\n\n $searchKeywords = [];\n\n $searchableProperties = $this->metadata()->get('admin.search.properties');\n\n foreach ($searchableProperties as $propIdent => $searchData) {\n $property = $this->property($propIdent);\n $objValue = $this[$propIdent];\n\n if (empty($objValue)) {\n continue;\n }\n\n if ($property instanceof ObjectProperty) {\n if (empty($searchData['properties'])) {\n continue;\n }\n\n $searchProps = $searchData['properties'];\n $fillKeywords = function ($relObj) use (&$searchKeywords, $searchProps, $translator, $languages) {\n foreach ($searchProps as $searchProp) {\n foreach ($languages as $lang) {\n $relValue = $relObj->get($searchProp);\n $searchKeywords[$lang][] = $translator->translate($relValue, [], null, $lang);\n }\n }\n };\n\n $relObjType = $property->objType();\n if ($property->multiple()) {\n if (!count($objValue)) {\n continue;\n }\n\n $relObjIds = implode($property->multipleSeparator(), $objValue);\n $this->collectionLoader()\n ->setModel($relObjType)\n ->addFilter([\n 'condition' => sprintf('FIND_IN_SET(objTable.id, \"%s\")', $relObjIds),\n ])\n ->setCallback($fillKeywords)\n ->load();\n } else {\n $relObj = $this->modelFactory()->create($relObjType)->load($objValue);\n $fillKeywords($relObj);\n }\n } else {\n foreach ($languages as $lang) {\n $objValue = $property->parseVal($objValue);\n $searchKeywords[$lang][] = $translator->translate($objValue, [], null, $lang);\n }\n }\n }\n\n $this->setAdminSearchKeywords($searchKeywords);\n }", "public function find($value);", "private function getParents($obj)\r\n\t{\r\n\t\t/**\r\n\t\t * @var $class_name string full qualified name of class ex. fhibox\\jeeves\\application\\commands\\deploy\\CommandDeploy\r\n\t\t */\r\n\t\t$class_name = (is_string($obj)) ? $obj : get_class($obj);\r\n\t\t$class = new \\ReflectionClass($class_name);\r\n\t\t$parents = array();\r\n\r\n\t\twhile ($parent = $class->getParentClass())\r\n\t\t{\r\n\t\t\t$parents[] = $parent->getName();\r\n\t\t\t$class = $parent;\r\n\t\t}\r\n\t\treturn $parents;\r\n\t}", "public function find($class)\n\t{\n\t\t$classpath = get_object_vars($this->container->getParameter($this->classpath_key));\n\t\tkrsort($classpath);\n\n\t\t$current_md5 = md5(RokCommon_Utils_ArrayHelper::toString($classpath));\n\t\tif ($this->last_md5 != $current_md5) {\n\t\t\t$this->last_md5 = $current_md5;\n\t\t\t$found_maps = array();\n\t\t\tforeach ($classpath as $priority => $priority_paths) {\n\t\t\t\tforeach ($priority_paths as $path) {\n\t\t\t\t\tif (!in_array($path, $this->checked_paths)) {\n\t\t\t\t\t\t$this->checked_paths[] = $path;\n\t\t\t\t\t\tif (is_dir($path)) {\n\t\t\t\t\t\t\t$path = $path . DIRECTORY_SEPARATOR . self::MAP_FILE_DEFAULT_NAME;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!in_array($path, $this->checked_paths) && is_file($path)) {\n\t\t\t\t\t\t\tif (($path_map = @include($path)) && is_array($path_map)) {\n\t\t\t\t\t\t\t\t$found_maps[] = $path_map;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (defined('ROKCOMMON_CORE_DEBUG') && ROKCOMMON_CORE_DEBUG) {\n\t\t\t\t\t\t\t\t\terror_log(sprintf('%s: Unable to load map file %s as a valid class map', get_class($this), $path));\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}\n\t\t\t\tif (isset($this->maps[$priority]) && !empty($found_maps)) {\n\t\t\t\t\t$this->maps[$priority] = array_merge($this->maps[$priority], (array)$found_maps);\n\t\t\t\t} elseif (!empty($found_maps)) {\n\t\t\t\t\t$this->maps[$priority] = (array)$found_maps;\n\t\t\t\t}\n\t\t\t}\n\t\t\tkrsort($this->maps);\n\t\t}\n\n\t\tif ('\\\\' === $class[0]) {\n\t\t\t$class = substr($class, 1);\n\t\t}\n\n\t\tforeach ($this->maps as $priority_maps) {\n\t\t\tforeach ($priority_maps as $map) {\n\t\t\t\tif (isset($map[$class])) {\n\t\t\t\t\treturn $map[$class];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function findPropertiesBy(array $criteria);", "protected function loadRecursive($model, array $array){\n //Create reflection object\n $reflectionClass = new \\ReflectionClass(get_class($model));\n\n //Iterate over all object property\n foreach ($reflectionClass->getProperties() as $prop) {\n\n //Store the accessibility of the property. If it is not accessible open the accessibility\n $isPublic = $prop->isPublic();\n if(!$isPublic){\n $prop->setAccessible(true);\n }\n\n //Check if the property exists in the array data...\n $propName = $prop->getName();\n if(isset($array[$propName])){\n\n //Get the value from data array\n $arrayValue = $array[$propName];\n\n //If the data is an array, check if the property is a array...\n if(is_array($arrayValue) && $propClassName = ReflectionManager::propertyIsObject($prop, $model)){\n $reflectionClassProp = new \\ReflectionClass($propClassName);\n ReflectionManager::invokeSetOf($propName, $reflectionClassProp->newInstance(), $model, $reflectionClass);\n $this->loadRecursive(ReflectionManager::invokeGetOf($propName, $model, $reflectionClass),\n $arrayValue);\n }else{\n ReflectionManager::invokeSetOf($propName, $arrayValue, $model, $reflectionClass);\n }\n }\n\n //Go back to not accessible mode\n if(!$isPublic){\n $prop->setAccessible(false);\n }\n }\n }", "public function fillFirstLevel($obj)\n {\n return $this->fill($obj, true);\n }", "public function getPathProperty($object);", "public function find($property, $value, $key = false) {\n foreach ($this->list as $index => $model) {\n if ($model->$property === $value) {\n return $key ? $index : $model;\n }\n }\n\n return null;\n }", "public function getAccessibleProperty(string $class, string $property);", "function getpath($path) {\n $findnode = array_shift($path); //pop the first value off the path, we will pass the rest of the path into the delegated object when we find it\n if (isset($findnode)) {\n //each path is a reference into one of our arrays\n if (array_key_exists($findnode, $this->root)) {\n return $this->root[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->fields)) {\n return $this->fields[$findnode];\n } elseif (array_key_exists($findnode, $this->values)) {\n return $this->values[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->statements)) {\n return $this->statements[$findnode]->getpath($path);\n }\n //we don't go looking down 'next', that isn't path referenceable for the purpose of getting a text value\n } else {\n //we reached the end of the path, return what we have.\n return \"$this\";\n }\n }", "private function findAllInstanceProperties(?ReflectionClass $class = null): array\n {\n if ($class === null) {\n return [];\n }\n\n return array_merge(\n $this->findAllInstanceProperties($class->getParentClass() ?: null), // of course PHP is shit.\n array_filter(\n $class->getProperties(),\n static function (ReflectionProperty $property): bool {\n return !$property->isStatic();\n }\n )\n );\n }", "function _getProperties() ;", "public function existsSubdominio(Shop $shop, \\stdClass $std);", "function searchByXML_deep($xml, $table, $recurLevel=0) {\n // if($this->checkIds($xml, $recurLevel)) {\n\n // return 0;\n\n\n // } else {\n foreach ($xml->childNodes as $link) {\n\n //TODO: empty text nodes should be removed \n if($link->nodeType == 3 )\n continue;\n\n foreach($link->childNodes as $child) {\n \n // skip text nodes\n if($child->nodeType == 3)\n continue;\n\n Debug::printMsg('<li><b> '.$this->className.'->'.$link->tagName.'->'.$child->tagName.' </b></li>');\n $node = DataNode::factory($child);\n\n // if node has id, then do not dive any deeper\n if($this->checkIds($child, $recurLevel+1)) {\n\n $level = $recurLevel + 1;\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table, \"root_\".$level);\n\n } else if(get_class($node) == \"IdaTable\") {\n\n $node->searchByXml_new($child, $table, $this, $link->tagName, \"root_\".$recurLevel);\n\n } else {\n Debug::printMsg('<b>Diving in </b>');\n\n/*\n if($node->searchByXml_new($child, $table, $recurLevel+1, $this, $link->tagName, \"root_0\")) {\n Debug::printMsg(\"nodes found<br>\");\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table, \"root_1\");\n } else {\n\n Debug::printMsg(\"nodes NOT found<br>\");\n IdaDb::allJoinsClass_new($this, $link->tagName, $node, $table);\n\n \n }\n */\n }\n }\n }\n // }\n }", "public function dereferenceKeypathOnObject($object, $keypath) {\n // return $object->getParent()->getZipCode();\n if(!is_array($keypath)) {\n $keypath = explode('.', $keypath);\n }\n foreach($keypath as $currentPathComponent) {\n $getter = 'get' . ucfirst($currentPathComponent);\n $object = $object->$getter();\n }\n return $object;\n }", "function find_node($tree, $key='', $val='')\n {\n if(isset($tree[$key]) && $tree[$key] == $val)\n {\n \tif(isset($tree['children']))\n \t{\n \t\tunset($tree['children']);\n \t}\n \t$this->cache['temp_node'] = $tree;\n }\n else\n {\n if(isset($tree['children']))\n {\n foreach($tree['children'] as $child)\n {\n $this->find_node($child, $key, $val);\n } \n }\n }\n \n }", "function onlyWantMyClassObjectsV2(MyClass $obj) {\n print \"processingV2....</br>\";\n}", "public function for(stdClass $record);", "public function resolve($propertyPath, $object);", "private function getRelationshipFields($class) {\n if (method_exists($class, 'getProperties')) {\n return $class->getProperties();\n } else {\n if ($class instanceof \\Doctrine\\ORM\\PersistentCollection) {\n $values = $class->getValues();\n $results = array();\n\n foreach ($values as $val) {\n $reflection = new \\ReflectionClass($val);\n $properties = $reflection->getProperties();\n\n $array = array();\n\n foreach ($properties as $prop) {\n if (in_array($prop->getName(), array('connectionName', 'entityManagerProvider', '__iterable__'))) {\n continue;\n }\n\n $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $prop->getName())));\n $method = $val->$methodName();\n\n if ($method instanceof \\Doctrine\\ORM\\PersistentCollection) {\n continue;\n }\n\n if (is_object($method)) {\n $sub_array = array();\n\n if (get_class($method) == \"DateTime\") {\n $array[$prop->getName()] = $method->format(DATE_ISO8601);\n continue;\n }\n\n foreach ($method->getProperties() as $idx => $v) {\n if (is_object($v)) {\n continue;\n }\n\n $sub_array[$idx] = $v;\n }\n }\n\n $array[$prop->getName()] = (empty($sub_array)) ? $method : $sub_array;\n $sub_array = null;\n }\n\n $results[] = $array;\n\n }\n\n return $results;\n } else {\n return false;\n }\n }\n }", "public abstract function getObjectMembers(string $sObject):?object;", "public function jsonSerialize()\n {\n $class = new ReflectionClass($this);\n $properties = $class->getProperties();\n $results = [];\n foreach ($properties as $property) {\n $propertyName = $property->getName();\n // Build getter method of the property\n $getter = 'get' . join(\n '', array_map('ucfirst', explode('_', $propertyName))\n );\n if (method_exists($this, $getter)) {\n $results[$property->getName()] = $this->$getter();\n }\n }\n return $results;\n }", "function fnGet(&$array, $key, $default = null, $separator = '/')\n{\n if (($sub_key_pos = strpos($key, $separator)) === false) {\n if (is_object($array)) {\n return property_exists($array, $key) ? $array->$key : $default;\n }\n return isset($array[$key]) ? $array[$key] : $default;\n } else {\n $first_key = substr($key, 0, $sub_key_pos);\n if (is_object($array)) {\n $tmp = property_exists($array, $first_key) ? $array->$first_key : null;\n } else {\n $tmp = isset($array[$first_key]) ? $array[$first_key] : null;\n }\n return fnGet($tmp, substr($key, $sub_key_pos + 1), $default, $separator);\n }\n}", "private function setStateToClassHierarchyWithOnlyClasses() {\n\t\t$this->state->method(\"isClass\")->willReturn(true);\n\t\t$this->state->method(\"isTrait\")->willReturn(false);\n\t\t$this->state->method(\"isInterface\")->willReturn(false);\n\n\t\t$this->state->classResolvedBy = [\n\t\t\t\"a\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t\t\"b\" => \"b\",\n\t\t\t\t\"c\" => \"c\",\n\t\t\t\t\"d\" => \"d\",\n\t\t\t\t\"e\" => \"e\",\n\t\t\t],\n\t\t\t\"b\" => [\n\t\t\t\t\"b\" => \"b\",\n\t\t\t\t\"d\" => \"d\",\n\t\t\t\t\"e\" => \"e\",\n\t\t\t],\n\t\t\t\"c\" => [\n\t\t\t\t\"c\" => \"e\",\n\t\t\t],\n\t\t\t\"d\" => [\n\t\t\t\t\"d\" => \"d\",\n\t\t\t],\n\t\t\t\"e\" => [\n\t\t\t\t\"e\" => \"e\",\n\t\t\t],\n\t\t\t\"f\" => [\n\t\t\t\t\"f\" => \"f\",\n\t\t\t],\n\t\t];\n\n\n\t\t$this->state->classResolves = [\n\t\t\t\"a\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t],\n\t\t\t\"f\" => [\n\t\t\t\t\"f\" => \"f\",\n\t\t\t],\n\t\t\t\"b\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t\t\"b\" => \"b\",\n\t\t\t],\n\t\t\t\"c\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t\t\"c\" => \"c\"\n\t\t\t],\n\t\t\t\"d\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t\t\"b\" => \"b\",\n\t\t\t\t\"d\" => \"d\"\n\t\t\t],\n\t\t\t\"e\" => [\n\t\t\t\t\"a\" => \"a\",\n\t\t\t\t\"b\" => \"b\",\n\t\t\t\t\"e\" => \"e\"\n\t\t\t],\n\t\t];\n\t}", "public function getSetters() {\n $fqsen = $this->fqsen;\n $setters = [];\n $propertiesPropertyFound = false;\n do {\n //var_dump($fqsen);\n $class = $this->fqsenToClass($fqsen);\n $methods = $class->getMethods();\n foreach ($methods as $method) {\n if (preg_match('/^set([A-Z0-9].*)$/', $method->getName(), $matches) && !array_key_exists($matches[1], $setters)) {\n $setters[lcfirst($matches[1])] = null;\n }\n }\n if (!$propertiesPropertyFound) {\n $properties = $this->classGetProperty($class, \"properties\");\n if ($properties) {\n $properties = $properties->getDefault();\n $properties = $this->arrayTokenScanner->scan($properties);\n foreach ($properties as $propertyKey => $propertyValue) {\n if (!array_key_exists($propertyKey, $setters)) {\n $setters[$propertyKey] = $propertyValue;\n }\n }\n $propertiesPropertyFound = true;\n }\n }\n $fqsen = strval($class->getParent());\n } while ($fqsen);\n return $setters;\n }", "function recursiveKeyRetrieve($json, $findKey){\n\t\t$output = false;\n\t\tif(is_array($json)){\n\t\t\tforeach($json as $subJSON){\n\t\t\t\tif(is_array($subJSON)){\n\t\t\t\t\tif(array_key_exists($findKey, $subJSON)){\n\t\t\t\t\t\t$output = $subJSON[$findKey];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!is_array($output)){\n\t\t\t\t\t$output = $this->recursiveKeyRetrieve($subJSON, $findKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "public function __get($property) {}" ]
[ "0.5997857", "0.5824439", "0.5547491", "0.5451957", "0.53441703", "0.5264458", "0.5229772", "0.51985496", "0.51910245", "0.5163068", "0.5139445", "0.51038367", "0.5087752", "0.50435704", "0.50390035", "0.5013243", "0.5008105", "0.49605706", "0.4958577", "0.49412888", "0.4910858", "0.48837164", "0.48350835", "0.48178554", "0.48159945", "0.47886267", "0.4769937", "0.47659326", "0.47490662", "0.4736596", "0.47353327", "0.47333503", "0.4692148", "0.4674249", "0.46618578", "0.46568164", "0.4627144", "0.4613999", "0.4589261", "0.45782763", "0.4560658", "0.45489234", "0.4536937", "0.45284888", "0.4519788", "0.45179522", "0.45173746", "0.4504547", "0.4501859", "0.45011148", "0.44975722", "0.44816753", "0.44779685", "0.44768456", "0.44721368", "0.4470895", "0.44382352", "0.44340563", "0.44309095", "0.4429987", "0.4423623", "0.44203794", "0.44182098", "0.44177452", "0.44146442", "0.44084945", "0.44071612", "0.4403773", "0.4395661", "0.43905434", "0.43877965", "0.43792892", "0.4378234", "0.4375217", "0.43746835", "0.4360536", "0.4356009", "0.4351686", "0.43512577", "0.43459016", "0.4345434", "0.43382624", "0.4336805", "0.4335727", "0.4334665", "0.43267092", "0.43259028", "0.4325347", "0.43218994", "0.4319433", "0.43166798", "0.4316515", "0.43101436", "0.43007913", "0.43006143", "0.42984942", "0.42937517", "0.42833236", "0.42828977", "0.4281999" ]
0.5118802
11
Display a listing of the resource.
public function index() { return view('brands.index', [ 'brands' => Brand::all() ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('brands.new'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $validData = $request->validate( ['name_brand' => 'required | min:3 | max:99 | unique:brands,name_brand'], [ 'name_brand.required' => 'El campo Categoría es requerido', 'name_brand.min' => 'El campo Categoría requiere mínimo 3 caracteres', 'name_brand.unique' => 'Ya existe en la base de datos' ] ); $brands = new Brand(); $brands->name_brand = $request->get('name_brand'); $brands->save(); return redirect('/config/brands'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72855324", "0.71447515", "0.7132799", "0.6641042", "0.66208744", "0.6566955", "0.65249777", "0.6509032", "0.6447701", "0.63756555", "0.6373163", "0.63650846", "0.63650846", "0.63650846", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $brands = Brand::find($id); return view('brands/edit', [ 'brands' => $brands ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $validData = $request->validate( ['name_brand' => 'required | min:3 | max:99 | unique:brands,name_brand'], [ 'name_brand.required' => 'El campo Marca es requerido', 'name_brand.min' => 'El campo Marca requiere mínimo 3 caracteres', 'name_brand.unique' => 'Ya existe en la base de datos el registro' ] ); $brands = Brand::find($id); $brands->name_brand = $request->get('name_brand'); $brands->save(); return redirect('/config/brands'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "public function remove($id);", "public function remove($id);", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6671365", "0.6660839", "0.66361386", "0.6632988", "0.6624729", "0.6542195", "0.6541645", "0.6466739", "0.6288393", "0.61767083", "0.6129533", "0.608954", "0.6054169", "0.60443425", "0.60073143", "0.59338665", "0.59317696", "0.592145", "0.5920155", "0.59065086", "0.5897853", "0.58968836", "0.58958197", "0.58958197", "0.58958197", "0.58958197", "0.58800334", "0.5869308", "0.5861188", "0.5811069", "0.5774596", "0.5763277", "0.5755447", "0.5747713", "0.5742094", "0.573578", "0.5727048", "0.57164854", "0.5712422", "0.57092893", "0.57080173", "0.5707143", "0.5704078", "0.5696418", "0.5684556", "0.5684556", "0.56790006", "0.5678463", "0.5658492", "0.564975", "0.5648406", "0.56480885", "0.5641393", "0.5638992", "0.56302536", "0.56228197", "0.5616424", "0.5607389", "0.56033397", "0.5602035", "0.55991143", "0.55988586", "0.5590501", "0.5581284", "0.55681103", "0.5566215", "0.55644745", "0.5563726", "0.55593926", "0.55583876", "0.5548547", "0.5542015", "0.5541403", "0.5541403", "0.55397224", "0.55390894", "0.55376494", "0.5531044", "0.5529739", "0.55279493", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527671", "0.5527155", "0.5526666", "0.55245256", "0.552101", "0.55183184" ]
0.0
-1
Get the entity ID
public function getEntityId() { return $this->activityId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEntityId(){\n return $this->_getData(self::ENTITY_ID);\n }", "public function getEntityId()\n {\n return $this->entity_id;\n }", "function getEntityId() {\n return $this->entity_id;\n }", "public function getEntityId();", "public function getEntityId();", "public function getEntityId();", "public function id() {\n return $this->entity->id();\n }", "public function getEntityId() {\n\n\t\treturn $this->id;\n\n\t}", "public function get_entity_id(){\n return $this->entityId;\n }", "public function getEntityId() {\n return $this->entityId;\n }", "private function getEntityId()\n\t{\n\t\t$id = $this->GetDocumentId();\n\t\t$pairs = explode('_', $id[2]);\n\n\t\treturn count($pairs) > 1 ? $pairs[1] : $pairs[0];\n\t}", "public function getId()\n {\n return $this->getEntityValue('id', '');\n }", "public function getEntityId()\n {\n return $this->element->id;\n }", "public function returnId($entity = null);", "public function getId()\n {\n return $this->getEntityDao()->getId();\n }", "public function getEntityKey()\n\t{\n\t\treturn $this->entity_id;\n\t}", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public function getId(): string\n {\n return (string) $this->_getEntity()->getId();\n }", "function entityID($entity){\n\t\t$entity = strtolower($entity);\n\t\t// Check local copy\n\t\tif(in_array($entity,$this->entities)) return $this->entities[$entity];\n\t\t\n\t\t// Check DB\n\t\tglobal $sess;\n\t\t$db = $sess->db();\n\t\t$entityID = $db->queryUniqueValue('SELECT id FROM `entities` WHERE `name` LIKE \\''.addslashes($entity).'\\'');\n\t\tif(!$entityID){\n\t\t\t// Create new entity\n\t\t\t$db->preparedInsert('entities',array('name'=>$entity));\n\t\t\t$entityID = $db->lastInsertedId();\n\t\t}\n\t\t// Store in local cache\n\t\t$this->entities[$entity] = $entityID;\t\n\t\treturn $entityID;\n\t}", "public function getId(): int\n {\n return $this->getIdentityData('id');\n }", "public function getPersistedId();", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function get_id();", "public function get_id();", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->get(self::_ID);\n }", "public function getId()\n {\n return $this->__get(\"id\");\n }", "public function getId()\n {\n return $this->__get(\"id\");\n }", "public function getId()\n {\n return $this->__get(\"id\");\n }", "public function getId()\n {\n return $this->id->getId();\n }", "public function getEntityId(): ?int;", "public function getEntityId(): ?int;", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "public function getId()\n {\n return $this->get('id', 0);\n }", "public function getId()\n {\n return $this->getData(self::ID);\n }", "public function getEntityIdentifier($entity)\n {\n return $this->entityIdentifiers[spl_object_hash($entity)];\n }", "protected function getId()\n {\n return $this->id;\n }", "public function getId()\n {\n return $this->getValue('id');\n }", "public function getId() {}", "public function getId() {}", "public function determineId() {}", "public function getEntryId();", "public function getId()\n {\n return $this->identifier;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getID();", "public function getID();", "public function getID();", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getEntityId()\n {\n return $this->feedbackId;\n }", "public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getId()\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "public function getId()\n {\n return $this->id ?? null;\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.8758001", "0.8623391", "0.85424787", "0.8532749", "0.8532749", "0.8532749", "0.85200566", "0.8375094", "0.8364044", "0.82916564", "0.8156688", "0.80722386", "0.80521363", "0.7988025", "0.79015577", "0.76993114", "0.7681755", "0.76327443", "0.7587747", "0.75480986", "0.7483234", "0.7476394", "0.7441747", "0.7441747", "0.7386083", "0.7386083", "0.7386083", "0.7386083", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.7385663", "0.73754734", "0.73754734", "0.73754734", "0.7371592", "0.73634803", "0.73634803", "0.7362034", "0.7362034", "0.73354024", "0.7332864", "0.7296412", "0.72914356", "0.72888005", "0.7265001", "0.7265001", "0.72588575", "0.72470665", "0.7242579", "0.7241198", "0.7241198", "0.7237313", "0.7237313", "0.7237313", "0.72241306", "0.72241306", "0.72241306", "0.7212798", "0.7202583", "0.72017205", "0.7189988", "0.71887046", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237", "0.71786237" ]
0.73606294
51
Get the class name the imageables
public function getClassName() { return $this->activityClass; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageClass()\n {\n return $this->image_class;\n }", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName();", "public function getClassName();", "public function getEntityClass() : string\n {\n return Image::class;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getClassName(): string;", "public function getClassName() { return __CLASS__; }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function getClassName() : string;", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getClassName()\n {\n return __CLASS__;;\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "protected function imageName() {}", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->_sClass;\n }", "function getClass() {\n\t\treturn $this->classname ? $this->classname : \"theme\".\"1\";//rand(1, 6);\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "function getName()\n {\n return get_class($this);\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getClassName()\n {\n return get_class($this->element);\n }", "public function getClass()\n {\n return $this->_className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "private function getClass($source) {\n return 'app\\\\Lib\\\\RandomImages\\\\' . ucfirst($source) . 'RandomImages';\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public function getClass($name = null);", "public static function className() : string {\n return get_called_class();\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClassName() : string\n {\n return $this->className;\n }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getClassName() {\n return $this->className;\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName() {\n return self::$className;\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getImageClassNames()\n {\n $classes = $this->styles('figure.image', 'image.fluid');\n \n $this->extend('updateImageClassNames', $classes);\n \n return $classes;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getClass() {}" ]
[ "0.76001406", "0.7398383", "0.734652", "0.734652", "0.734652", "0.734652", "0.73441195", "0.73441195", "0.7077168", "0.7058241", "0.7042681", "0.70299274", "0.70286894", "0.7008899", "0.6992622", "0.69562364", "0.6936795", "0.6935521", "0.69230646", "0.6919051", "0.6905389", "0.68948334", "0.68822527", "0.68796873", "0.6859796", "0.6859796", "0.6852902", "0.6849439", "0.6849439", "0.68340254", "0.6828988", "0.68193924", "0.68120444", "0.67553043", "0.67489266", "0.673874", "0.6730188", "0.6727786", "0.67250246", "0.67249656", "0.6718006", "0.6718006", "0.6715294", "0.67031735", "0.6697542", "0.6697209", "0.6696417", "0.66824496", "0.6679629", "0.66775644", "0.667199", "0.667199", "0.667199", "0.667199", "0.667199", "0.667199", "0.667011", "0.66639537", "0.66552854", "0.66497487", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66467696", "0.66450644", "0.66450644", "0.66429794", "0.6639325", "0.6634225", "0.6632266", "0.6632126", "0.66277695", "0.6623613", "0.66184103", "0.66184103", "0.66184103", "0.66184103", "0.66184103", "0.66184103", "0.66184103", "0.66184103", "0.661069", "0.66105336", "0.66105175", "0.658182" ]
0.0
-1
/ ObjParam = "OBJECTTYPE=" + TypeValue + "&OBJECTID=" + ObjID forms basic query param. any request should have this as basic param. in addition to these one can have additional parameters as per required.
function OBJM_AddNewObjectToSCXML($elemID, $type, $class, $level, $nodeTitle, $parentID, $dataID, $datatype, $dataOrig) { $retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); if($retval != true) return false; $displaystring = $nodeTitle; global $treehandlerfnname; // $elemID = strtoupper($elemID); $type = strtoupper($type); $class = strtoupper($class); $level = strtoupper($level); $parentID = strtoupper($parentID); //$attrdefinition = array("id"=>$elemID, "type"=>$type,"class"=>$class,"level"=>$level, "data-origin"=>"original" , "data-srcid"=>"none", "onclick"=>$treehandlerfnname, "dataid"=>$dataID, "data-type"=>$datatype); $attrdefinition = array("id"=>$elemID, "type"=>$type,"class"=>$class,"level"=>$level, "data-origin"=>$dataOrig , "data-srcid"=>"none", "dataid"=>$dataID, "data-type"=>$datatype, "name"=>$nodeTitle); $retval = CDOC_COMMON_AddXMLElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], "li", $displaystring, $parentID, $attrdefinition, true); if($retval != true) return false; $newObj = $_SESSION['sceneCompXMLDOM']->getElementById($elemID); $retval = $_SESSION['sceneCompXMLDOM']->saveXML($newObj); return $retval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function input (\\stdClass $param);", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "public function base (\\stdClass $param);", "private function ParseQuerystring()\r\n\t{\r\n\t\t$this->Object \t= isset($_GET['obj']) \t\t? $_GET['obj'] \t\t\t\t\t: $this->Object;\r\n\t\t$this->Task \t= isset($_GET['task']) \t\t? '&task='.$_GET['task'] \t\t: '&task='.$this->Task;\r\n\t\t$this->Subtask \t= isset($_GET['subtask']) \t? '&subtask='.$_GET['subtask'] \t: '&subtask='.$this->Subtask;\r\n\t\t$this->Item\t\t= isset($_GET['id']) \t\t? '&id='.$_GET['id'] \t\t\t: '&id='.$this->Item;\r\n\t\t\r\n\t\t$this->Action \t\t= '?obj='.$this->Object.$this->Task.$this->Subtask.$this->Item;\r\n\t\t$this->URL \t\t\t= '?obj='.$this->Object.$this->Task.$this->Item;\r\n\t\t$this->GenericPage \t= '?obj='.$this->Object.$this->Task;\t\r\n\t}", "public function getByIdRequest($object_type)\n {\n // verify the required parameter 'object_type' is set\n if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type when calling getById'\n );\n }\n\n $resourcePath = '/crm/v3/schemas/{objectType}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($object_type !== null) {\n $resourcePath = str_replace(\n '{' . 'objectType' . '}',\n ObjectSerializer::toPathValue($object_type),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', '*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', '*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTypeParam()\n {\n }", "function object(string $data, string $type = 'unknown', string $attributes = '', array $params = [], bool $indexPage = false): string\n {\n if (! _has_protocol($data)) {\n $data = $indexPage === true ? site_url($data) : slash_item('baseURL') . $data;\n }\n\n $object = '<object data=\"' . $data . '\" '\n . $attributes . '>';\n\n if (! empty($params)) {\n $object .= \"\\n\";\n }\n\n foreach ($params as $param) {\n $object .= _space_indent() . $param . \"\\n\";\n }\n\n return $object . \"</object>\\n\";\n }", "public function getRequestParams();", "public function meta (\\stdClass $param);", "protected function loadRequest($obj=null)\r\n {\r\n if (!$obj)\r\n $target = &$this;\r\n else\r\n $target = &$obj;\r\n\r\n foreach ($_REQUEST as $key => $value) { // load query values\r\n $target->$key = $value;\r\n }\r\n }", "Public Function Generate_Request($Object = NULL)\n\t\t{\n\t\t\tTry\n\t\t\t{\n\t\t\t\tIf(IsSet($Object))\n\t\t\t\t{\n\t\t\t\t\t$this->Object = $Object;\n\t\t\t\t}\n\t\t\t\tElse\n\t\t\t\t{\n\t\t\t\t\tIf(IsSet($this->URL))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->Object = $this->URL;\n\t\t\t\t\t}\n\t\t\t\t\tElse\n\t\t\t\t\t{\n\t\t\t\t\t\tThrow New \\Exception(\"Object not specified.\");\n }\n }\n If($Result = \\SYSTEM\\Module\\Template::Load_Template(Static::$AJAX_TEMPLATE));\n Else\n {\n Throw New \\Exception(\"Unable to load template.\");\n }\n }\n Catch(\\Exception $Exception)\n {\n Static::$Diagnostics->Log_Append($Exception);\n // $Result = FALSE;\n Throw $Exception;\n }\n Return $Result;\n }", "public function parse_request($obj) {\n\t\t$taxes = get_taxonomies(array( '_builtin' => false));\n\t\tforeach ($taxes as $key => $tax) {\n\t\t\tif(isset($obj->query_vars[$tax])) {\n\t\t\t\tif(strpos( $obj->query_vars[$tax] ,\"/\") !== false ) {\n\t\t\t\t\t$obj->query_vars[$tax] = array_pop(explode(\"/\", $obj->query_vars[$tax]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function getObjectParams($obj){\n\t\treturn array();\n\t}", "protected final function send($url, $obj, $type)\n\t{\n\t\t$client = new Client($this->_base_url);\n\t\t$request = null;\n\t\tswitch ($type) {\n\t\t\tcase \"GET\":\n\t\t\t{\n\t\t\t\t$request = $client->get($url, array(), array('query' => $obj));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"POST\":\n\t\t\t{\n\t\t\t\t$request = $client->post($url, array(), $obj);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"DELETE\":\n\t\t\t{\n\t\t\t\t$request = $client->delete($url, array(), array(), array('query' => $obj));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tCASE \"PUT\":\n\t\t\t{\n\t\t\t\t$request = $client->put($url, array(), array(), array('query' => $obj));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (isset($request)) {\n\t\t\treturn $request->send()->json();\n\t\t}\n\t}", "abstract public function parseRequestParameters();", "function OBJM_AddNewObject(&$respData)\r\n{\r\n\t parse_str($respData) ;\t \r\n\t\r\n\t//DEPENDING ON OBJECT TYPE CALL THE APPROPRIATE FUNCTION \r\n\t$objectTypeVal = strtoupper($OBJECTTYPE);\r\n\t$objectIDVal = strtoupper($OBJECTID);\r\n\t$parentIDVal = strtoupper($REFID);\r\n\t$dataID\t\t = $objectIDVal; //WILL BE USED TO STORE UNIQIE ID IN HTML DATA PROVIDED FROM THE CLIENT END\r\n\t$nodeTitle\t = $TITLE;\r\n\t$dataType\t = $DATATYPE; \r\n\t$TMObjID \t = \"TM_\".$objectIDVal;\r\n\t$DIVparentID = \"DIV_\".$parentIDVal; \t\r\n\t \r\n\t$htmlCode = \"\"; \r\n\t$respData = \"\"; \r\n\tswitch ($objectTypeVal){\r\n\t\t\r\n\t\tcase \"SCENE\":\t\t\t\r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID, $objectTypeVal, \"treemenu\", \"2\",$nodeTitle, $parentIDVal,$dataID, $dataType, 'original');\t\t\r\n\t\t\tif($retval != true)\r\n\t\t\t{\t\r\n\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\treturn $retval;\r\n\t\t\t} \t\r\n\t\t\t$respData = $retval; \t\t\t\r\n\t\t\tbreak; \r\n\t\t\r\n\t\tcase \"LAYER\":\r\n\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal; \r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"3\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\tif($retval != true)\r\n\t\t\t{\t\r\n\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\treturn $retval;\r\n\t\t\t} \t\r\n\t\t\t$respData = $retval;\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase \"HTMLOBJECT\":\r\n\t\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal;\r\n\t\t\t\t\r\n\t\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"4\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\t\tif($retval != true)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t$respData = $retval;\r\n\t\t\t\t$layerID = $parentIDVal;\r\n\t\t\t\t//add the div element container now all objects under one container\r\n\t\t\t\t$retval = HTML_AddNewObject($dataType,$dataID, $nodeTitle,$layerID, \"DIV_DATA_CONTAINER\", $htmlCode);\r\n\t\t\t\tif($retval != true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\t\treturn $retval;\r\n\t\t\t\t}\r\n\t\t\t\t$respData = $respData . \"#\" . $htmlCode;\r\n\t\t\t\tbreak;\r\n\t\tcase \"SOURCE\":\r\n\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal;\t\t\t\r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"5\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\tif($retval != true)\r\n\t\t\t\treturn false;\r\n\t\t\t$respData = $retval; \r\n\t\tdefault:\r\n\t\t\tbreak; \r\n\t}\r\n\t//ADD THE OBJECT ON THE PAGE SC XML DATA \r\n\t\r\n\t\r\n\treturn true;\r\n\t\r\n\t//NOW GET THE XML CODE OF THE SAME \r\n\t\r\n\t//RETURN XML CODE BACK AS RESPONSE \r\n\t \r\n\treturn true; \r\n}", "abstract public function processRequest(array $objects);", "public abstract function appendToRequest(&$requestBase, $requestObject);", "public function oaprequest($reqType,$data) {\n\t $data = urlencode(urlencode($data));\n\t $postargs = \"appid=\".$this->appid.\"&key=\".$this->key.\"&return_id=2&reqType=\".$reqType. \"&data=\" . $data;\n\t $request = \"https://api.moon-ray.com/cdata.php\";\n\t \n\t //Start the curl session and send the data\n\t $session = curl_init($request);\n\t curl_setopt ($session, CURLOPT_POST, true);\n\t curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs);\n\t curl_setopt($session, CURLOPT_HEADER, false);\n\t curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n\t \n\t //Store the response from the API for confirmation or to process data\n\t return curl_exec($session);\n }", "private function createParam()\n\t{\n\t\t$this->param = Array('http' => Array(), 'url' => null);\n\t}", "protected function _addGeneralInfo($object) {\n\t\t$storeId = $object->getStoreId();\n\t\t$this->_setCompanyCode($storeId);\n $this->_request->setDetailLevel(DetailLevel::$Document);\n $this->_request->setDocDate(date('Y-m-d'));\n $this->_request->setExemptionNo('');\n \t$this->_request->setDiscount(0.00); //cannot be used in Magento\n \t$this->_request->setSalespersonCode(Mage::helper('avatax')->getSalesPersonCode($storeId));\n \t$this->_request->setLocationCode(Mage::helper('avatax')->getLocationCode($storeId));\n\t\t$this->_request->setCountry(Mage::getStoreConfig('shipping/origin/country_id', $storeId));\n\t\t$this->_request->setCurrencyCode(Mage::app()->getStore()->getBaseCurrencyCode());\n\t\t$this->_addCustomer($object);\n\t\tif($object instanceof Mage_Sales_Model_Order && $object->getIncrementId()) {\n\t\t\t$this->_request->setReferenceCode('Magento Order #' . $object->getIncrementId());\n\t\t}\n\t}", "function record($request) {\n\t\t$type = $request->getVar('type');\n\t\t$value = $request->getVar('value');\n\t\tif ($type && $value) {\n\t\t\t$record = DataObject::get_one($this->dataObject->class, \"\\\"$type\\\" = '$value'\");\n\t\t\theader(\"Content-Type: text/plain\");\n\t\t\techo json_encode(array(\"record\"=>$record->toMap()));\n\t\t}\n\t}", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "static public function objectToQuery($type)\n\t{\n\t\treturn QuickBooks_Utilities::actionToObject($type) . 'Query';\n\t}", "public function dispatchRequest($data,$type){\n $data = explode('-',$data);\n $nbStructures = count($data);\n $addRequest = '';\n\n // if multiple structures passed to request, we add them to query\n $addRequest .= '(';\n for($i=0 ; $i<$nbStructures ; $i++){\n $addRequest .= ' '.$type.' = '.(int)$data[$i].' OR';\n }\n $addRequest = substr($addRequest,0,-3);\n $addRequest .= ')';\n\n return $addRequest;\n }", "function FetchObj() {}", "private function setParams()\n {\n $this->params['MERCHANTNUMBER'] = $this->merchantNumber;\n $this->params['OPERATION'] = 'CREATE_ORDER';\n $this->params['ORDERNUMBER'] = $this->operation->getOrderNumber();\n $this->params['AMOUNT'] = $this->operation->getAmount();\n $this->params['CURRENCY'] = $this->operation->getCurrency();\n $this->params['DEPOSITFLAG'] = $this->depositFlag;\n if($this->operation->getMerOrderNum())\n $this->params['MERORDERNUM'] = $this->operation->getMerOrderNum();\n $this->params['URL'] = $this->url;\n\n if($this->operation->getDescription())\n $this->params['DESCRIPTION'] = $this->operation->getDescription();\n if($this->operation->getMd())\n $this->params['MD'] = $this->operation->getMd();\n\n }", "public function parameterFormat() {\n $params = array(\n 'object_type' => array(\n 'help' => _txt('pl.garbagecollectorjob.arg.object_type'),\n 'type' => 'select',\n 'required' => false,\n 'choices' => array('Co')\n ),\n );\n\n return $params;\n }", "function setObjtype($objtype) {\n $this->objtype = $objtype;\n }", "private function parseRequestParameter()\n {\n \t$paramIndentifier = $this->getSettingParameter('identifier');\n \t$paramFileName = $this->getSettingParameter('fileName');\n \t$paramChunkedNumber = $this->getSettingParameter('chunkedNumber');\n \t$paramChunkedSize = $this->getSettingParameter('chunkedSize');\n \t$paramTotalFileSize = $this->getSettingParameter('totalFileSize');\n \t$paramTotalChunkOfFile = $this->getSettingParameter('numberChunkedOfFile');\n\n \t$this->indentifier = (string) $this->request->getParam($paramIndentifier);\n \t$this->fileName = (string) $this->request->getParam($paramFileName);\n \t$this->chunkedNumber = (int) $this->request->getParam($paramChunkedNumber);\n \t$this->chunkedSize = $this->request->getParam($paramChunkedSize);\n \t$this->totalFileSize = $this->request->getParam($paramTotalFileSize);\n \t$this->numberChunkedOfFile = (int) $this->request->getParam($paramTotalChunkOfFile);\n }", "private function addWhereObject($type, $objects) {\r\n\t\tif (!is_array($objects)) {\r\n\t\t\t$objects = array($objects);\r\n\t\t}\r\n\r\n\t\t$idField = $this->_salt_obj->MODEL()->getIdFieldName();\r\n\t\t$class = get_class($this->_salt_obj);\r\n\r\n\t\t$allIds = array();\r\n\t\tforeach($objects as $obj) {\r\n\t\t\tif (!$obj instanceof $class) {\r\n\t\t\t\tthrow new SaltException(L::error_query_mixed_objects(get_class($obj), $class));\r\n\t\t\t}\r\n\t\t\t$allIds[] = $obj->$idField;\r\n\t\t}\r\n\r\n\t\tif (count($allIds) === 1) {\r\n\t\t\t$this->addWhere($type, $idField, '=', first($allIds));\r\n\t\t} else {\r\n\t\t\t$this->addWhere($type, $idField, 'IN', $allIds);\r\n\t\t}\r\n\t}", "public function archiveRequest($object_type, $archived = false)\n {\n // verify the required parameter 'object_type' is set\n if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type when calling archive'\n );\n }\n\n $resourcePath = '/crm/v3/schemas/{objectType}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $archived,\n 'archived', // param base name\n 'boolean', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n\n // path params\n if ($object_type !== null) {\n $resourcePath = str_replace(\n '{' . 'objectType' . '}',\n ObjectSerializer::toPathValue($object_type),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "abstract protected function getRequiredRequestParameters();", "abstract public function objType();", "public function __construct($obj)\r\n\t\t{\r\n\t\t\t$this->_auth = \"Any authentification key you would like to use\";\r\n\t\t\t$this->_WSDataPath = \"WSDictionnary.json\";\r\n\t\t\t$this->_WSData = $this->getWSData();\r\n\t\t\t\r\n\t\t\t$this->_HTTPRequest = $obj;\r\n\r\n\t\t\t$this->_response[\"error\"] = true;\r\n\t\t\t$this->_response[\"msg\"] = \"\";\r\n\t\t\t$this->_response[\"data\"] = null;\r\n\t\t\t$this->_response[\"lastId\"] = null;\r\n\t\t}", "public static function buildObjectAsQueryString($object) {\r\n\t\tif(is_object($object) or die(__METHOD__ . \" requires an object\"));\r\n\t\t$qs = \"\";\r\n\t\t\r\n\t\t$tmp = 0;\r\n\t\tforeach($object as $key => $value) {\r\n\t\t\t$qs.= $key . \"=\" . $value;\r\n\t\t\t\r\n\t\t\tif(count($object) > $tmp) {\r\n\t\t\t\t$qs.=\"&\";\r\n\t\t\t}\r\n\t\t\t$tmp++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $qs;\r\n\t}", "public function __construct($param=NULL){\n if(isset($param['batchSize'])) $this->batchSize=$param['batchSize'];\n if(isset($param['ttl'])) $data['ttl']=$param['ttl'];\n if(isset($param['iscount'])) $data['count']=$param['iscount'];\n if(isset($param['bindVars'])) $data['bindVars']=$param['bindVars'];\n if(isset($param['options'])) $data['options']=$param['options'];\n }", "public function sendRequestXML($object);", "public function get_query_params()\n {\n }", "private function setQueryParams()\n {\n if (empty($this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS]) === false) {\n $queryParams = $this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS];\n $this->openEntity(ConfigInterface::QUERY_PARAMS);\n foreach ($this->queryParams as $param) {\n if (empty($queryParams[$param][ApiInterface::RAML_KEY_DEFAULT]) === false) {\n $this->setParam($param, $queryParams[$param][ApiInterface::RAML_TYPE], $queryParams[$param][ApiInterface::RAML_KEY_DEFAULT], 2);\n }\n }\n $this->closeEntities();\n }\n }", "public static function allocateJSON($type,$obj)\r\n\t{\tswitch($type)\r\n\t\t\t{\r\n\t\t\tcase 'register':\r\n\t\t\t\t$registerobj=$obj['object'];\r\n\t\t\t\t\t$ret = Main::register($registerobj['email'],$registerobj['password'],$registerobj['username']); //call register function\r\n\t\t\t\t\tif($ret != \"OK\")\r\n\t\t\t\t\t\t$data = array('type'=>'User','loggedInUser'=>array('error'=>$ret));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$data = Main::allocateJSON('login',$obj);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'login':\r\n\t\t\t$loginobj=$obj['object'];\r\n\t\t\t\t\t$ret = Main::login($loginobj['email'],$loginobj['password']);\r\n\t\t\t\t\tif(!is_numeric($ret))\r\n\t\t\t\t\t\t$data = array('type'=>'User','loggedInUser'=>array('error'=>$ret));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$data = array('type'=>'User','loggedInUser'=>array('password'=>$loginobj['password']),'userID'=>$ret);\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t//Autor:tom\r\n\t\t\tcase 'gpx':\r\n\t\t\t\t\t$ret=Main::insertGPX($obj);\r\n\t\t\t\t\tif(!is_numeric($ret))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$data = array('success'=>'false','loc'=>array('error'=>$ret));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$obj['id']=$ret;\r\n\t\t\t\t\t\t$obj['success']=true;\r\n\t\t\t\t\t\t$data=$obj;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//$data=$obj;\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'requestGpx':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ret=Main::getGPX($obj['coords']['lat'],$obj['coords']['lon']);\r\n\t\t\t\t\t\tif(is_numeric($ret))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t $data = array('success'=>false, 'type'=>'requestGpx', 'ret'=>$ret);\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t \telse\r\n\t\t\t\t\t \t{\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t $data=$ret;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\tcase 'eigeneRoute':\r\n\t\t\t\t\t$ret=Main::insertOwnRoute($obj['object']);\r\n\t\t\t\t\tif(is_numeric($ret))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t $data = array('success'=>false, 'type'=>'ownRoute', 'error'=>$ret);\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t \telse\r\n\t\t\t\t\t \t{\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t $data=$ret;\r\n\t\t\t\t\t\t $data['success']=true;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'RouteStarten':\r\n\t\t\t\t\t$ret=Main::startRoute($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\t \t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'RouteBeitreten':\r\n\t\t\t\t\t$ret=Main::routeBeitreten($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\t\t\r\n\t\t\t\t\t\r\n\t\t\tcase 'RouteNotfall':\r\n\t\t\t\t\t$ret=Main::routeNotfall($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'insertLoc':\r\n\t\t\t\t\t$ret=Main::routeLocation($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\tcase 'Notfallkontakt':\r\n\t\t\t\t\t$ret=Main::insertNotfallkontakt($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\tcase 'getNotfallkontakt':\r\n\t\t\t\t\t$ret=Main::getNotfallkontakt($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\tcase 'getAllRoutes':\r\n\t\t\t\t\t$ret=Main::getAllRoutes($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 'getRouteById':\r\n\t\t\t\t\tbreak;\t\r\n\t\t\tcase 'stopRoute':\r\n\t\t\t\t\t$ret=Main::routeStop($obj['object']);\r\n\t\t\t\t\t$data=$ret;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\r\n\t\t\tdefault: \r\n\t\t\t\t\t$data=array('success'=>false,'type'=>$type, 'data'=>$obj);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function __construct($type, $request, $paramFactory) {\n parent::__construct($type, $request, $paramFactory);\n }", "function insert_record($obj,$param_method=\"request\",$param_obj=\"\")\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - PARAMETER LIST : ', $param_array);\n\n\t\t\n\n\t\t$initial_qry = \"insert into \" . $obj->cls_tbl . \" (\";\n\n\t\t\n\n\t\t$obj = set_values($obj,$param_method,$param_obj,\"insert\");\n\n\n\n\t\t$fld_arr = get_object_vars($obj);\n\n\n\n\t\t$qry_fld_list = \"\";\n\n\t\t$mid_qry = \") values (\";\n\n\t\t$qry_val_list = \"\";\n\n\t\t$file_attachment_status = 1;\n\n\t\t//added on 26-04-2007\n\n\t\t$del_file_name = array();\n\n\t\t//end\n\n\t\tforeach($fld_arr as $key => $value)\n\n\t\t{\n\n\t\t\n\n\t\t\tif(is_array($value) && strtolower($key) != \"image_copies\" && strtolower($key) != \"image_dimensions\" && strtolower($key) != \"upload_msgs\")\n\n\t\t\t{\n\n\t\t\t\t\n\n\t\t\t\t//print_r($_REQUEST);\n\n\t\t\t\t\n\n\t\t\t\t//if(1 == 1 || isset($GLOBALS['param_arr'][$value['frm_fldname']]) || (!isset($GLOBALS['param_arr'][$value['frm_fldname']]) && $value['save_todb'] == 'true'))\n\n\t\t\t\t//if(isset($value['value']) && !$value['save_todb'])\n\n\t\t\t\t{\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - Start\n\n\n\n\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"file\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\n\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t//end\n\n\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if((strtolower($value['frm_fld_type']) == \"img\" || strtolower($value['frm_fld_type']) == \"imgcopy\") && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['h'] > 0)\n\n\t\t\t\t\t\t\t$h = $obj->image_dimensions[$value['frm_fldname']]['h'];\n\n\t\t\t\t\t\telse if($obj->attachment_h > 0)\n\n\t\t\t\t\t\t\t$h = $obj->attachment_h;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$h = $GLOBALS['site_config']['files_allowed_h'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['w'] > 0)\n\n\t\t\t\t\t\t\t$w = $obj->image_dimensions[$value['frm_fldname']]['w'];\n\n\t\t\t\t\t\telse if($obj->attachment_w > 0)\n\n\t\t\t\t\t\t\t$w = $obj->attachment_w;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$w = $GLOBALS['site_config']['files_allowed_w'];\n\n\n\n\t\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"imgcopy\" && $obj->image_copies[$value['frm_fldname']][0] > 0 && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$ret_val = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\t\t\t\t\t\tif($ret_val == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"img\")\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//$value['value'] = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $obj->attachment_conditions, $s, $h, $w);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$attach_cond = $obj->image_dimensions[$value['frm_fldname']]['chk_cond'];\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif(strlen(trim($attach_cond)) <= 0)\n\n\t\t\t\t\t\t\t$attach_cond = $obj->attachment_conditions;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $attach_cond, $s, $h, $w);\n\n\t\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - End\n\n\n\n\t\t\t\t\tif((((strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\") && $_FILES[$value['frm_fldname']]['size'] > 0 && trim($value['value']) != \"File Not Uploaded.\") || !(strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\")) && $value['value'] != \"do_not_frame_in_sql\" && strtolower($value['frm_fld_type']) != \"imgcopy\")\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$qry_fld_list .= $key . \", \";\n\n\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($value['value']) . \"', \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"imgcopy\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($ret_val as $imgc_key => $imgc_val)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$qry_fld_list .= $imgc_key . \", \";\n\n\t\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($imgc_val) . \"', \";\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $imgc_val;\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\n\n\n\t\t\t}\n\n\t\t\n\n\t\t}//end foreach\n\n\t\t\n\n\t\t$qry_fld_list = substr($qry_fld_list, 0, -2);\n\n\t\t$qry_val_list = substr($qry_val_list, 0, -2);\n\n\t\t\n\n\t\t$final_insert_query = $initial_qry . $qry_fld_list . $mid_qry . $qry_val_list . \")\";\n\n\t\t\n\n\t\tif($file_attachment_status == 1)//10042007\n\n\t\t\t$res = $this->execute_sql($final_insert_query,\"insert\");\n\n\t\telse\n\n\t\t{\n\n\t\t\t//added on 26-04-2006\n\n\t\t\tforeach($del_file_name as $key => $del_value)\n\n\t\t\t{\n\n\t\t\t\t$del_filename = $del_value;\n\n\t\t\t\t$del_filepath = $obj->attachment_path . $del_filename;\n\n\t\t\t\t\n\n\t\t\t\tif(file_exists($del_filepath) && is_file($del_filepath))\n\n\t\t\t\tunlink($del_filepath);\n\n\t\t\t}//end\n\n\t\t\t\n\n\t\t\t$res = array(\"insertion failed\");\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - Return Value : ', $res);\n\n\t\t\n\n\t\treturn $res;\n\n\t\t\n\n\t}", "public function javascript (\\stdClass $param);", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "protected function prepareParams($object, &$params)\n {\n //Get all readable object properties\n $properties = get_object_vars($object);\n\n /**\n * For each property, if it is instance of AbstractRequest, recursive function called\n * Else if value of property is scalar we assign it\n */\n foreach ($properties as $p => $v) {\n if (is_scalar($v)) {\n $params[$p] = $v;\n } elseif (is_array($v)) {\n $params[$p] = json_encode($v);\n } elseif (is_object($v) && $v instanceof AbstractModel) {\n $params[$p] = $v->toJson();\n } elseif (is_object($v) && $v instanceof AbstractRequest) {\n $this->prepareParams($v, $params);\n }\n }\n }", "function ibase_param_info($query, $param_number)\n{\n}", "public function makeHTTPParameters()\n { \n $b =\"&\";\n $b.=\"id=\".$this->id.\"&\";\n $b.=\"title=\".$this->title.\"&\";\n $b.=\"artist=\".$this->artist.\"&\";\n $b.=\"added=\".$this->added.\"&\";\n $b.=\"last_modified=\".$this->last_modified.\"&\";\n $b.=\"lookup_count=\".$this->lookup_count.\"&\";\n $b.=\"modify_count=\".$this->modify_count.\"&\";\n $b.=\"source=\".$this->source.\"&\";\n $b.=\"barcode=\".$this->barcode.\"&\";\n $b.=\"comment=\".$this->comment.\"&\";\n return($b);\n\n\n }", "function constructURL($object);", "public function validate(\\GraphQL\\Type\\Definition\\InputObjectType $inputObj) : void\n {\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public static function initParam($paramName, $type, $isRequired = false, $regexp = '', $default = null, $isPost = false) { // ak je regexp posielany sem v dvojitych uvodzovkach, musia sa escape znaky este raz escapovat !\n\n global $_PARAMS;\n\n $tmp = self::getParamByName($paramName, $type, $isRequired, $regexp, $default, $isPost);\n\n $_PARAMS[$paramName] = $tmp;\n }", "public function getChildObjects(){\n\t\tset_time_limit(0);\n\t\tif(!isset($_REQUEST['column'])) $_REQUEST['column'] = null;\n\t\t$Column = isset($_REQUEST['column']) ? explode(\",\",$_REQUEST['column']) : null;\n\t\tif(!isset($_REQUEST['value'])) $_REQUEST['value'] = null;\n\t\t$Value = isset($_REQUEST['value']) ? explode(\",\",$_REQUEST['value']) : null;\n\t\t$Object = $this->urlParams['ID'];\n\t\tif(!isset($_REQUEST['orderBy'])) $_REQUEST['orderBy'] = null;\n\t\tif(!isset($_REQUEST['orderByDirection'])) $_REQUEST['orderByDirection'] = 'DESC';\n\t\t$orderByString = \"\";\n\t\t// order by stuff...\n\t\t$dbFields = Object::create($Object)->db();\n\t\tif ($_REQUEST['orderBy']){\n\t\t\tforeach (explode(',',$_REQUEST['orderBy']) as $oc){\n\t\t\t\t$OrderByTemp = \"\";\n\t\t\t\tif(count(explode('.',$oc))>1){\n\t\t\t\t\t$OrderByTmpArr = explode('.',$oc);\n\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t$has_one = $tmpObj->has_one();\n\t\t\t\t\t$subObj = '';\n\t\t\t\t\tforeach($has_one as $key=>$value) {\n\t\t\t\t\t\tif($key == $OrderByTmpArr[0]) {\n\t\t\t\t\t\t\t$subObj = ($value == \"Image\") ? \"File\" : $value;\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$OrderByTmp = $subObj ? \"{$subObj}.{$OrderByTmpArr[1]}\" : \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$OrderByTmp = (in_array($oc, $dbFields)) ? \"{$Object}.{$oc}\" : \"\";\n\t\t\t\t}\t\n\t\t\t\t$orderByString .= $OrderByTemp ? \"{$OrderByTmp} {$_REQUEST['orderByDirection']}, \" : \"\";\n\t\t\t}\n\t\t\t$orderByString = $orderByString ? substr($orderByString, 0, -2) : \"\";\n\t\t}\n\t\t$OrderBy = $_REQUEST['orderBy'] ? \"{$orderByString}\" : \"{$Object}.ID DESC\";\n\t\t$Query = '';\n\t\tif($Column != null && $Value != null) {\n\t\t\t$i = 0;\n\t\t\tforeach ($Column as $col) {\n\t\t\t\t$Query .= \"{$col}='{$Value[$i]}' AND \";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$Query = substr($Query, 0, -5);\n\t\t}\n\t\tif($results = DataObject::get($Object, $Query, $OrderBy)) {\n\t\t\t$f = new JSONDataFormatter(); \n\t\t\t$json = $f->convertDataObjectSet($results);\n\t\t\treturn $json;\n\t\t} else {\n\t\t\treturn '{\"results\": 0, \"rows\":[], \"query\":\"'.$Query.'\"}';\n\t\t}\n\t}", "function fetchObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute )\n {\n\n\t\t$classAttribute =&$contentObjectAttribute->attribute('contentclass_attribute' );\n\n\t\t$edit_id_list=$http->sessionVariable('enhancedobjectrelation_id_' .$classAttribute->ID . '_edit_id_list');\n\n//\t\teZDebug::writeError($contentObjectAttribute);\n\n\t\tif (is_array($edit_id_list)) {\n\t\t foreach ($edit_id_list as $subObjectID) {\n $attributeBase = $base . '_ezorl_edit_object_' . $subObjectID;\n $object = eZContentObject::fetch( $subObjectID );\n if ( $object ) {\n $attributes = $object->contentObjectAttributes();\n $customActionAttributeArray = array();\n \n $fetchResult = $object->fetchInput( $attributes, $attributeBase,\n $customActionAttributeArray,\n $contentObjectAttribute->inputParameters() );\n\n\t\t\t\t\t\t\n\t\t\t\t \n unset( $attributeInputMap );\n $attributeInputMap =& $fetchResult['attribute-input-map'];\n\t\t\t\t\t$object->storeInput($attributes, $attributeInputMap );\n \t\t\t\t\t$object_contentclass=$object->contentClass();\n\t\t\t\t\t$object->setAttribute('published', time());\n\t $object->setAttribute('modified', time());\n\t\t\t\t\t$object->setAttribute('status', EZ_CONTENT_OBJECT_STATUS_PUBLISHED);\n\n\t\t\t\t\t$object_name=$object_contentclass->contentObjectName($object);\n\t\t\t\t\n\t\t\t\t\teZDebug::writeError(\"name\".$object_name);\n\t\t\t\t\t$object->setName( $object_name);\n\n//\t\t\t\t\teZDebug::writeError($object);\n\t\t\t\t $object->store();\n// $content['temp'][$subObjectID]['attribute-input-map'] =& $attributeInputMap;\n// $content['temp'][$subObjectID]['attributes'] =& $attributes;\n// $content['temp'][$subObjectID]['object'] =& $object;\n }\n }\n\t\t}\n\n\t\t//old starts here\n\t\t$ContentClassAttributeID =$contentObjectAttribute->ContentClassAttributeID;\n\t\t\n\t\t$contentObjectID = $contentObjectAttribute->ContentObjectID;\n\t\t$contentObjectVersion = $contentObjectAttribute->Version;\n\n//\t\techo \"$contentObjectID : $contentObjectVersion : $ContentClassAttributeID\";\n\t\t$postVariableName = $base . \"_data_object_relation_id_list_\" . $contentObjectAttribute->attribute( \"id\" );\n\t\t\n\t\n\t\tif ( !$http->hasPostVariable( $postVariableName ) )\n\t\t\treturn false;\n\t\t\t\n\t\t$id_list =& $http->postVariable( $postVariableName );\n\t\tif (empty ($id_list))\n\t\t\treturn false;\n\t\tforeach ($id_list as $objectID)\n\t\t\t$contentObjectAttribute->Content ['id_list'][] = $objectID;\n return true;\n }", "public function GRadio (\\stdClass $param);", "public function getParamHistory($object)\n {\n $params = array();\n if (isset($object['upload_songs']))\n {\n $params['selling_total_upload_songs'] = $object['upload_songs'];\n }\n else\n {\n $params['selling_total_upload_songs'] = 0; \n }\n if (isset($object['download_songs']))\n {\n $params['selling_total_download_songs'] = $object['download_songs'];\n }\n else\n {\n $params['selling_total_download_songs'] = 0; \n }\n if (isset($object['sold_songs']))\n {\n $params['selling_sold_songs'] = $object['sold_songs'];\n }\n else\n {\n $params['selling_sold_songs'] = 0; \n }\n if (isset($object['sold_albums']))\n {\n $params['selling_sold_albums'] = $object['sold_albums'];\n }\n else\n {\n $params['selling_sold_albums'] = 0; \n }\n if (isset($object['new_accounts']))\n {\n $params['selling_final_new_account'] = $object['new_accounts'];\n }\n else\n {\n $params['selling_final_new_account'] = 0; \n }\n if (isset($object['transaction_succ']))\n {\n $params['selling_transaction_succ'] = $object['transaction_succ'];\n }\n else\n {\n $params['selling_transaction_succ'] = 0; \n }\n if (isset($object['transaction_fail']))\n {\n $params['selling_transaction_fail'] = $object['transaction_fail'];\n }\n else\n {\n $params['selling_transaction_fail'] = 0; \n }\n if (isset($object['total_amount']))\n {\n $params['selling_total_amount'] = $object['total_amount'];\n }\n else\n {\n $params['selling_total_amount'] = 0; \n }\n if (isset($object['params']))\n {\n $params['params'] = serialize($object['params']);\n }\n else\n {\n $params['params'] = ''; \n }\n return $params;\n \n \n }", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "private function GetSymbolParams($obj)\n {\n if(isset($obj->MarginRateInitial))\n $this->GetMarginRateInitialForJson($obj);\n if(isset($obj->MarginRateMaintenance))\n $this->GetMarginRateMaintenanceForJson($obj);\n //---\n unset($obj->MarginRateInitial);\n unset($obj->MarginRateMaintenance);\n //--- re-map to real json name\n if(isset($obj->MarginRateLiquidity))\n $obj->MarginLiquidity = $obj->MarginRateLiquidity;\n if(isset($obj->MarginRateCurrency))\n $obj->MarginCurrency = $obj->MarginRateCurrency;\n //---\n return MTJson::Encode($obj);\n }", "private function getUrl($object=NULL, $params=NULL) {\n $url = $this->getEndpoint();\n $url = sprintf('%s/%s%s', $url, $this->options['store_container'], $object ? '/' . $object : '');\n if (is_array($params)) {\n foreach(array_keys($params) as $i => $param) {\n $url .= ($i ? '&' : '?') . $param . ($params[$param] ? '=' . $params[$param] : '');\n }\n }\n return $url;\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function filterRequest($msg){\n if(isset($_GET['type'])){\n $type = $_GET['type'];\n\n // Verify data type\n if($type == 'data'){\n handleDataRequest($msg);\n }else if($type == 'multiple'){\n handleMultipleData($msg);\n }else if($type == 'station'){\n handleStationsRequest($msg);\n }else{\n $msg->message = 'Requested type not existing!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Type not set!';\n $msg->toJson();\n }\n}", "public function readObject($theRequest, $typeObject, $bindValues = \"\") {\n $typeObject = $this->conversionNameEntities($typeObject);\n\n try {\n $sql = $this->theConnexion->prepare($theRequest);\n\n if ($bindValues != \"\") {\n foreach ($bindValues as $variable => $value) {\n $requestCopy = $theRequest;\n $matchesQty = substr_count($requestCopy, $variable);\n\n if ($matchesQty) {\n for ($count = 0; $count < $matchesQty; $count++) {\n $charPos = strpos($requestCopy, \":\" . $variable);\n if ($charPos) {\n $charPos = $charPos + strlen($variable) + 1;\n $theChar = substr($requestCopy, $charPos, 1);\n if ($theChar == \" \" || $theChar == \",\" || $theChar == \")\" || $theChar == null) {\n $sql->bindValue($variable, $bindValues[$variable], PDO::PARAM_STR);\n }\n $requestCopy = substr($requestCopy, $charPos);\n }\n }\n }\n }\n }\n $sql->execute();\n\n $count = 0;\n $arrayObjects = \"\";\n foreach ($sql->fetchAll(PDO::FETCH_CLASS, $typeObject) as $currentObject) {\n $arrayObjects[$count] = $currentObject;\n $count++;\n }\n $sql->closeCursor();\n\n return($arrayObjects);\n } catch (Exception $e) {\n $message = \"\";\n if ($this->ShortCuts->getDbErrors() == 1) {\n $message = $this->formatError($e);\n }\n if ($this->ShortCuts->getFatalError() == 0) {\n $this->ShortCuts->setFatalError(1);\n $erreur = new controllers_Error();\n $erreur->start('<strong>Impossible to read the record!</strong>' . $message);\n }\n }\n }", "public function updateRequest($object_type, $object_type_definition_patch)\n {\n // verify the required parameter 'object_type' is set\n if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type when calling update'\n );\n }\n // verify the required parameter 'object_type_definition_patch' is set\n if ($object_type_definition_patch === null || (is_array($object_type_definition_patch) && count($object_type_definition_patch) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type_definition_patch when calling update'\n );\n }\n\n $resourcePath = '/crm/v3/schemas/{objectType}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($object_type !== null) {\n $resourcePath = str_replace(\n '{' . 'objectType' . '}',\n ObjectSerializer::toPathValue($object_type),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', '*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', '*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($object_type_definition_patch)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($object_type_definition_patch));\n } else {\n $httpBody = $object_type_definition_patch;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function getParams($passAry,$base){\r\n\t\t$getName=$passAry['param_1'];\r\n\t\t$workAry=$base->utlObj->retrieveValue($getName,&$base);\r\n\t\tif ($workAry != null){\r\n\t\t\tforeach ($workAry as $paramName=>$paramValue){\r\n\t\t\t\t$base->paramsAry[$paramName]=$paramValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getRequestData();", "function buildRESTAPIUrl($SiteURL, $APILink, $ObjectType, $ObjectIdentifier){\n\t\t//TODO: add ability to remove double slashes\n\t\t$url = $SiteURL . $APILink . \"/\" . $ObjectIdentifier . $ObjectType;\n\t\treturn $url;\n\t}", "protected function loadParams() {\n\t $this->cpParams = new api_crud_param($this->attribs);\n\t \n // These commands need an id and a method in the url\n\t $this->cpParams->setCommand(Array('read','update','delete'))->setMethod(api_crud_param::MATTRIBUTE)->setNeed(api_crud_param::RMANDATORY)\n\t ->setType(api_crud_param::TINT)->addParam('id')\n\t ->setType(api_crud_param::TSTRING)->addParam('method');\n\t \n\t // yes, for delete, the delete param needs to be repeated in the POST as well as the id\n\t $this->cpParams->setCommand('delete')->setMethod(api_crud_param::MPOST)->setNeed(api_crud_param::RMANDATORY)\n\t ->setType(api_crud_param::TINT)->addParam('id')\n ->setType(api_crud_param::TSTRING)->addParam('method');\n\t}", "function _saverequest($req_type,$v_id){\r\n\tglobal $dbi,$usertoken;\r\n\tif (!$req_type>0){debug('Error :: Request Type not set ...');return;}\r\n\tif (!$v_id>0){debug('Error :: Verein not set ...');return;}\r\n\t\r\n\t$rkey='r'.time();\r\n\t$d = getdate();\r\n\t$rtdate = $d['year'].'-'.$d['mon'].'-'.$d['mday'];\r\n\t\r\n\tif (is_array($usertoken)){$uid=$usertoken['id'];} else {die('E1');}\r\n\t/*\r\n\t * create request with STATUS=CREATE, using the param: v_id instead of the usertoken ...\r\n\t */\r\n\t$qry='insert into wfrequest(wfrequest_id,reqdate,user_id,verein_id,wfrequesttype_id,wfstate_id,rkey)'\r\n\t.' values(0,\\''.$rtdate.'\\','.$usertoken['id'].','.$v_id.','.$req_type.',1,\\''.$rkey.'\\')';\r\n\t#debug($qry);\r\n\t$prec=sql_query($qry,$dbi);\r\n\t# get ID\r\n\t$p=sql_query('select R.*,T.wftablename wfobject from wfrequest R,wfrequesttype T where R.wfrequesttype_id=T.wfrequesttype_id and rkey=\\''.$rkey.'\\'',$dbi);\r\n\t$ret=sql_fetch_array($p,$dbi);\r\n\tif (sizeof($ret)<2) die ('<h3>Error creating initial request object</h3>');\r\n\t// create child records ...\r\n\tswitch($ret['wfobject']){\r\n\t\tcase 'wflineup':\r\n\t\t\t$qry='INSERT INTO wflineup(wflineup_id,wfrequest_id,rkey) VALUES (0,'.$ret['wfrequest_id'].',\\''.$rkey.'\\')';\r\n\t\t\t$p=sql_query($qry,$dbi);\r\n\t\t\tbreak;\r\n\t\tcase 'wfplayer':\r\n\t\t\t$qry='INSERT INTO wfplayer(wfplayer_id,wfrequest_id,rkey) VALUES (0,'.$ret['wfrequest_id'].',\\''.$rkey.'\\')';\r\n\t\t\t$p=sql_query($qry,$dbi);\r\n\t\t\tbreak;\r\n\t\tcase 'wfteam':\r\n\t\t\t// create empty wfteam \r\n\t\t\t$qry='INSERT INTO wfteam(wfteam_id,wfrequest_id,rkey) VALUES (0,'.$ret['wfrequest_id'].',\\''.$rkey.'\\')';\r\n\t\t\t$p=sql_query($qry,$dbi);\r\n\t\t\tbreak;\r\n\t\tcase 'wfmessage':\r\n\t\t\t// create empty wfmessage\r\n\t\t\t$qry='INSERT INTO wfmessage(wfmessage_id,wfrequest_id,rkey) VALUES (0,'.$ret['wfrequest_id'].',\\''.$rkey.'\\')';\r\n\t\t\t$p=sql_query($qry,$dbi);\r\n\t\t\tbreak;\r\n\t}\r\n\t\r\n\treturn $ret['wfrequest_id'];\r\n}", "public function __construct(Object $object, $queryURL, $prePopulate = null) {\n $this->object = $object;\n if($object->ID != null) {\n $this->ID = $object->ID;\n } else {\n $this->ID = uniqid();\n }\n \n $this->queryURL = $queryURL;\n \n if(is_array($prePopulate)) {\n $this->prePopulate = Convert::array2json($prePopulate);\n } else {\n $this->prePopulate = null;\n }\n \n $this->initialize();\n parent::__construct();\n }", "public function title (\\stdClass $param);", "public static function getVehicleQueryString($requestObject, $db) {\n $result = \"\";\n $counter = 0; // Stores the number of values specified\n\n // Check for VTNAME\n if ($requestObject['VTNAME'] != 'all' && $requestObject['VTNAME'] != '') {\n if ($counter == 0) {\n $result = $result . \" WHERE \";\n $counter++;\n } else if ($counter >= 1) {\n // If there is already something there, add AND\n $result = $result . \" AND \";\n $counter++;\n } else {\n $counter++;\n }\n $result = $result . \"v.VTNAME = '\" . $requestObject['VTNAME'] . \"'\";\n }\n\n // DATE = YYYY-MM-DD\n // TIME = HH:MM\n if ($requestObject['FROM_DATE']) {\n if ($counter == 0) {\n $result = $result . \" WHERE \";\n $counter++;\n } else if ($counter >= 1) {\n // If there is already something there, add AND\n $result = $result . \" AND \";\n $counter++;\n } else {\n $counter++;\n }\n\n if (!$requestObject['FROM_TIME']) {\n echo ProjectUtils::getErrorBox(\"Please fill a complete time interval\");\n return false;\n }\n\n // $date_format = \"'YYYY-MM-DD:HH24:MI'\";\n $from_date = ProjectUtils::constructDate($requestObject['FROM_DATE'], $requestObject['FROM_TIME']);\n \n if (!$requestObject['TO_DATE']) {\n echo ProjectUtils::getErrorBox(\"Please fill a complete time interval\");\n return false;\n }\n\n if (!$requestObject['TO_TIME']) {\n echo ProjectUtils::getErrorBox(\"Please fill a complete time interval\");\n return false;\n }\n\n $to_date = ProjectUtils::constructDate($requestObject['TO_DATE'], $requestObject['TO_TIME']);\n\n $date_format = 'YYYY-MM-DD:HH24:MI';\n $idate = \"'\" . $requestObject['FROM_DATE'] . \":\" . $requestObject['FROM_TIME'] . \"'\";\n $fdate = \"'\" . $requestObject['TO_DATE'] . \":\" . $requestObject['TO_TIME'] . \"'\";\n \n $diffHours = ProjectUtils::getDateDifference($idate, $fdate, $date_format, $db);\n\n if ($diffHours < 0) {\n echo ProjectUtils::getErrorBox(\"Initial date must be less than final date.\");\n return false;\n }\n\n $result = $result . \"NOT EXISTS ( SELECT * FROM rentals rent, reservations resv WHERE (\" . $from_date . \", \" . $to_date . \") OVERLAPS (resv.FROM_DATETIME, resv.TO_DATETIME) AND rent.vlicense = v.vlicense AND resv.conf_no = rent.conf_no )\";\n } else if ($requestObject['FROM_TIME'] || $requestObject['TO_DATE'] || $requestObject['TO_TIME']) {\n echo ProjectUtils::getErrorBox(\"Please fill a complete time interval\");\n return false;\n } \n\n if ($requestObject['LOCATION'] != 'all' && $requestObject['LOCATION'] != '') {\n if ($counter == 0) {\n $result = $result . \" WHERE \";\n $counter++;\n } else if ($counter >= 1) {\n // If there is already something there, add AND\n $result = $result . \" AND \";\n $counter++;\n } else {\n $counter++;\n }\n $result = $result . \"v.LOCATION = '\" . $requestObject['LOCATION'] . \"'\"; \n }\n\n // echo $result;\n return $result;\n }", "public function getObjectByID($objectID);", "public static function requireParams() {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET': $parameters = $_GET; break;\n\t\t\tcase 'POST': $parameters = $_POST; break;\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE': $parameters = static::getInputVars(); break;\n\t\t}\n\n\t\t$params = func_get_args();\n\t\t$class = new \\stdClass;\n\t\tforeach ($params as $param) {\n\t\t\tif (!isset($parameters[$param])) {\n\t\t\t\tif (Application::inDevelopment()) {\n\t\t\t\t\t$passedParams = implode(',', array_keys($parameters));\n\t\t\t\t\tLog::debug(\"Missing {$_SERVER['REQUEST_METHOD']} parameter '{$param}', only got \" . (strlen($passedParams) > 0 ? $passedParams : '[nothing]'));\n\t\t\t\t}\n\t\t\t\tApplication::error(400, 'Missing one of the parameters');\n\t\t\t}\n\n\t\t\t$class->$param = $parameters[$param];\n\t\t}\n\n\t\treturn $class;\n\t}", "public function send(object $query);", "protected static function createParameter($name, $element = 'input', $type = 'text', $value = '') {\n\t\t$param = new \\stdClass();\n\t\t$param->element = $element;\n\t\t$param->prefix = '';\n\t\t$param->postfix = '';\n\t\t$param->label = '';\n\t\t$param->attributes = new \\stdClass();\n\t\tif ($type !== 'submit') {\n\t\t\t$param->label = $name;\n\t\t\t$param->attributes->required = true;\n\t\t}\n\t\t$param->attributes->id = 'shortcalc_'.rand(0,1000000);\n\t\t$param->attributes->name = $name;\n\t\t$param->attributes->type = $type;\n\t\t$param->attributes->value = $value;\n\t\treturn $param;\n\t}", "public function __construct(\\SimpleObjects\\SimpleObjects $so, $urlPrefix = '/api/'){\n $this->_so = $so;\n //parse URL in the way /prefix/action/param1/value1/param2/value2/...\n $uri = $_SERVER['REQUEST_URI'];\n //remove prefix to get the result: $uri = action/param1/value1/param2/value2/...\n $uri = str_replace($urlPrefix, '', $uri);\n $parts = explode('/', $uri);\n //convert dashes to camelCase for Action param\n $action = array_shift($parts);\n if (!empty($action)) $this->_action = str_replace(' ', '', ucwords(str_replace('-', ' ', $action)));\n\n while (!empty($parts)) {\n $param = array_shift($parts);\n $value = array_shift($parts);\n $this->$param = $value;\n }\n }", "public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {\n\t\t\t$intId = QApplication::QueryString('intId');\n\t\t\treturn StewardshipBatchMetaControl::Create($objParentObject, $intId, $intCreateType);\n\t\t}", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public function create($obj, $request)\n {\n }", "public function addParam($name, $value){\r\n $obj = $this->root->appendChild(new KwixoXMLElement('obj'));\r\n $obj->appendChild(new KwixoXMLElement('name', $name));\r\n $obj->appendChild(new KwixoXMLElement('value', $value));\r\n return $obj;\r\n }", "protected function load_objtype_list()\n {\n header('Content-type: application/json');\n\n $l_dao = $_GET['dao'];\n\n if (class_exists($l_dao))\n {\n return isys_factory::get_instance($l_dao, $this->m_database_component)\n ->set_object_type((int) $_GET['object_type'])\n ->get_list_data((int) $_POST['offset_block']);\n } // if\n\n return '';\n }", "private function fillObj($obj) {\n\t\t\n\t\t$obj->publisher = $_POST['publisher'];\n\t\t\n\t\t$obj->theme = $_POST['theme'];\n\t\t$obj->other = $_POST['other'];\n\n\t\t$obj->end \t= $_POST['date'];\n\n\t\t$obj->title = $_POST['title'];\n\t\t$obj->text \t= $_POST['text'];\r\n\t}", "public function get_value($object_id, $request)\n {\n }", "function AjaxForm ( $object )\r\n \t{\r\n \t\t$this->form_id = uniqid();\r\n \t\tif ( is_subclass_of($object, 'StoredObjectDB') )\r\n \t\t{\r\n \t\t\t$this->object = $object;\r\n \t\t\t$this->action = CO_ACTION_CREATE;\r\n \t\t}\r\n \t\telseif ( is_subclass_of($object, 'IteratorBase') )\r\n \t\t{\r\n \t\t\t$this->object_it = $object;\r\n \t\t\t$this->object = $this->object_it->object;\r\n \t\t\t$this->action = CO_ACTION_MODIFY;\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\t$this->action = CO_ACTION_CREATE;\r\n \t\t} \t\t\t\r\n \t\t\r\n \t\t$this->setRedirectUrl( SanitizeUrl::parseSystemUrl($_REQUEST['redirect']) );\r\n \t}", "public function setParam($paramName, $value){\n\t\t\tparent::setParam($paramName, $value, self::NAG_OBJ_NAME_PARAM, self::$stringListParams);\n\n\t\t\tif(!array_key_exists($paramName, self::$stringListExclude) && !is_array($value)){\n\t\t\t\t$value = $this->convertStringListToArray($value);\n\t\t\t}\n\n\t\t\t$this->params[$paramName] = $value;\n\t\t}", "public function getMediaInfo( $media_type ,$objectId) ;", "private static function validate_type( $object_type ) {\n\t\tif ( ! in_array( $object_type, array( 'post', 'term' ), true ) ) {\n\t\t\tthrow WPSEO_Invalid_Argument_Exception::invalid_type( $object_type );\n\t\t}\n\t}", "public abstract function FetchObject();", "function _wp_http_get_object()\n {\n }", "public abstract function formRequest($responseObject, $pack, $instanceNumber, $memberDetail=null);", "function run(&$x = NULL, $q = NULL) {\n $this->query = $q;\n if(is_string($x))\n\t $req = json_decode($x);\n\telseif(is_array($x))\n\t\t$req = (object)$x;\n\telseif(is_object($x))\n\t\t$req = $x;\n\telse\n\t\t$req = (object)NULL;\n $this->init($req);\n $this->invoke();\n //var_dump($this->request);\n \n unset($req->method, $req->params, $req->uri);\n \n \n return $req;\n }", "public function expectObjectType($var, $strict = false) {\n\t\t\t$object_type_id = (int) getRequest($var);\n\t\t\treturn umiObjectTypesCollection::getInstance()->getType($object_type_id);\n\t\t}", "private function Request($url,$params=false,$type=HTTP_GET){\n \n // Populate data for the GET request\n if($type == HTTP_GET) $url = $this->MakeUrl($url,$params);\n \n \n // borrowed from Andy Langton: http://andylangton.co.uk/\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n if ( isset($_SERVER['HTTP_USER_AGENT']) ) {\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );\n } else {\n // Handle the useragent like we are Google Chrome\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.X.Y.Z Safari/525.13.');\n }\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //$acceptLanguage[] = \"Accept-Language:\" . $this->ClientLanguage;\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $acceptLanguage); \n // Populate the data for POST\n if($type == HTTP_POST) {\n curl_setopt($ch, CURLOPT_POST, 1); \n if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n }\n\n //execute\n $response=curl_exec($ch);\n $headers=curl_getinfo($ch);\n\n //fetch errors\n $errorNumber = curl_errno($ch);\n $errorMessage = curl_error($ch);\n\n curl_close($ch);\n\n // replace ids with their string values, added because of some\n // PHP-version can't handle these large values\n $response = preg_replace('/id\":(\\d+)/', 'id\":\"\\1\"', $response);\n\n // we expect JSON, so decode it\n $json = @json_decode($response, true);\n\n // validate JSON\n if ($json === null) {\n // should we provide debug information\n if (self::DEBUG) {\n // make it output proper\n echo '<pre>';\n\n // dump the header-information\n var_dump($headers);\n\n // dump the error\n var_dump($errorMessage);\n\n // dump the raw response\n var_dump($response);\n\n // end proper format\n echo '</pre>';\n }\n\n // throw exception\n throw new Exception('Invalid response.');\n }\n\n // any errors\n if (isset($json['diagnostic']['error_msgs'])) {\n // should we provide debug information\n if (self::DEBUG) { \n\n echo '<pre>';\n echo \"<h3>Header</h3>\";\n // dump the header-information\n var_dump($headers);\n\n echo \"<h3>Error message</h3>\";\n // dump the error\n var_dump($errorMessage);\n\n echo \"<h3>Raw Response</h3>\";\n // dump the raw response\n var_dump($response);\n\n echo \"<h3>Response</h3>\";\n var_dump($json);\n \n echo '</pre>';\n exit();\n }\n\n // throw exception\n /*\n if (isset($json['errors'][0]['message'])) {\n throw new Exception($json['errors'][0]['message']);\n } elseif (isset($json['errors']) && is_string($json['errors'])) {\n throw new Exception($json['errors']);\n } else throw new Exception('Invalid response.');\n */\n }\n\n return $json;\n }", "public function prepareRequest(&$params)\n {\n $tproperties = self::getAxProperties();\n \n if (is_array($this->_props) && count($this->_props) > 0) {\n foreach ($this->_props as $prop => $req) {\n if ($req) {\n \n if (isset($required)) {\n $required .= ','.$prop;\n } else {\n $required = $prop;\n }\n } else {\n if (isset($optional)) {\n $optional .= ','.$prop;\n } else {\n $optional = $prop;\n }\n }\n if (array_key_exists($prop,$tproperties))\n $params['openid.ax.type.'.$prop] = $tproperties[$prop];\n }\n \n $params['openid.ns.ax'] = GoogleAuth_OpenId_Extension_Ax::NAMESPACE_1_0;\n $params['openid.ax.mode'] = GoogleAuth_OpenId_Extension_Ax::MODE;\n\n if (!empty($required)) {\n $params['openid.ax.required'] = $required;\n }\n if (!empty($optional)) {\n $params['openid.ax.if_available'] = $optional;\n }\n\n }\n return true;\n }" ]
[ "0.5894033", "0.5652512", "0.5639989", "0.5597167", "0.5488477", "0.54536086", "0.54096574", "0.5395612", "0.5384274", "0.5352673", "0.531419", "0.52928174", "0.5280646", "0.527582", "0.5211525", "0.51857144", "0.5077404", "0.50649196", "0.50590193", "0.5058375", "0.50527734", "0.50517887", "0.5025309", "0.5000842", "0.49965438", "0.49711937", "0.49601385", "0.49593776", "0.4950432", "0.49461642", "0.49330652", "0.49301654", "0.49296856", "0.49242923", "0.49086422", "0.49078262", "0.48861915", "0.48811144", "0.4867499", "0.4860742", "0.48551515", "0.4848097", "0.4828182", "0.482135", "0.4818001", "0.48138314", "0.48138314", "0.48138314", "0.48138314", "0.48065183", "0.48062742", "0.47973996", "0.4796814", "0.47877502", "0.47839746", "0.47839746", "0.478376", "0.47661716", "0.4758316", "0.4757156", "0.47558954", "0.47543737", "0.47543737", "0.47543737", "0.47505164", "0.47493538", "0.4735705", "0.47353935", "0.47322655", "0.47307518", "0.472809", "0.47278035", "0.47213846", "0.47065994", "0.469702", "0.46918124", "0.46894035", "0.4688332", "0.46824726", "0.46804297", "0.46781117", "0.46771798", "0.46769634", "0.4676751", "0.46666", "0.46595302", "0.46556258", "0.46520513", "0.46458745", "0.46431598", "0.4641877", "0.46333566", "0.46260285", "0.4624808", "0.46242324", "0.46214134", "0.46203437", "0.46197382", "0.46185333", "0.46012527", "0.46010837" ]
0.0
-1
PARSE THE STRING AND FORM A QUERY PARAMS
function OBJM_AddNewObject(&$respData) { parse_str($respData) ; //DEPENDING ON OBJECT TYPE CALL THE APPROPRIATE FUNCTION $objectTypeVal = strtoupper($OBJECTTYPE); $objectIDVal = strtoupper($OBJECTID); $parentIDVal = strtoupper($REFID); $dataID = $objectIDVal; //WILL BE USED TO STORE UNIQIE ID IN HTML DATA PROVIDED FROM THE CLIENT END $nodeTitle = $TITLE; $dataType = $DATATYPE; $TMObjID = "TM_".$objectIDVal; $DIVparentID = "DIV_".$parentIDVal; $htmlCode = ""; $respData = ""; switch ($objectTypeVal){ case "SCENE": $retval = OBJM_AddNewObjectToSCXML($TMObjID, $objectTypeVal, "treemenu", "2",$nodeTitle, $parentIDVal,$dataID, $dataType, 'original'); if($retval != true) { $respData = "FAIL"; return $retval; } $respData = $retval; break; case "LAYER": $TMparentIDVal = "TM_".$parentIDVal; $retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,"treemenu","3", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original'); if($retval != true) { $respData = "FAIL"; return $retval; } $respData = $retval; break; case "HTMLOBJECT": $TMparentIDVal = "TM_".$parentIDVal; $retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,"treemenu","4", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original'); if($retval != true) return false; $respData = $retval; $layerID = $parentIDVal; //add the div element container now all objects under one container $retval = HTML_AddNewObject($dataType,$dataID, $nodeTitle,$layerID, "DIV_DATA_CONTAINER", $htmlCode); if($retval != true) { $respData = "FAIL"; return $retval; } $respData = $respData . "#" . $htmlCode; break; case "SOURCE": $TMparentIDVal = "TM_".$parentIDVal; $retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,"treemenu","5", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original'); if($retval != true) return false; $respData = $retval; default: break; } //ADD THE OBJECT ON THE PAGE SC XML DATA return true; //NOW GET THE XML CODE OF THE SAME //RETURN XML CODE BACK AS RESPONSE return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_query($str) {\n \n $str = html_entity_decode($str);\n\n $arr = array();\n \n $pairs = explode('&', $str);\n \n foreach ($pairs as $i) {\n list($name,$value) = explode('=', $i, 2);\n\n if (isset($arr[$name])) {\n if (is_array($arr[$name])) {\n $arr[$name][] = $value;\n }\n else {\n $arr[$name] = array($arr[$name], $value);\n }\n }\n else {\n $arr[$name] = $value;\n }\n }\n return $arr;\n }", "private function ParseQuerystring()\r\n\t{\r\n\t\t$this->Object \t= isset($_GET['obj']) \t\t? $_GET['obj'] \t\t\t\t\t: $this->Object;\r\n\t\t$this->Task \t= isset($_GET['task']) \t\t? '&task='.$_GET['task'] \t\t: '&task='.$this->Task;\r\n\t\t$this->Subtask \t= isset($_GET['subtask']) \t? '&subtask='.$_GET['subtask'] \t: '&subtask='.$this->Subtask;\r\n\t\t$this->Item\t\t= isset($_GET['id']) \t\t? '&id='.$_GET['id'] \t\t\t: '&id='.$this->Item;\r\n\t\t\r\n\t\t$this->Action \t\t= '?obj='.$this->Object.$this->Task.$this->Subtask.$this->Item;\r\n\t\t$this->URL \t\t\t= '?obj='.$this->Object.$this->Task.$this->Item;\r\n\t\t$this->GenericPage \t= '?obj='.$this->Object.$this->Task;\t\r\n\t}", "function string2params($params_string)\n{\n\n\tif (is_string($params_string))\n\t{\n\t\t$params\t\t= array();\n\t\tif (strpos($params_string , '/') !== false )\n\t\t{\n\t\t\t$raw_params = explode('/', $params_string);\n\n\t\t\tif (($c = count($raw_params)) % 2 == 0)\n\t\t\t{\n\t\t\t\t$i\t= 0;\n\t\t\t\tforeach ($raw_params as $param )\t// Step in twos\n\t\t\t\t{\n\t\t\t\t\tif ($i % 2 == 0)\n\t\t\t\t\t\t$params [$raw_params[$i]] = $raw_params[$i + 1];\t\t// Do the magic\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (strpos($params_string, '=') !== false )\n\t\t{\n\t\t\t$params_q\t= explode('&' , $params_string);\n\t\t\t\n\t\t\tforeach ($params_q as $this_q)\n\t\t\t{\n\t\t\t\tif (strpos($this_q, '='))\n\t\t\t\t{\n\t\t\t\t\tlist($key, $value)\t= explode('=', $this_q, 2);\n\t\t\t\t\t$params[$key]\t= $value;\n\t\t\t\t}\t\t\n\t\t\t}\n//\t\t\t// Join the two\n//\t\t\t$params\t\t= array_merge($params, $params_q);\n\t\t}\n\t\treturn $params;\n\t}\n}", "protected function parseQueryString($string) {\n $query = array();\n\n $string = ltrim($string, '?');\n\n parse_str($string, $query);\n\n return $query;\n }", "function queryStringToArray($string) {\n $url = explode('&', $string);\n /* Request variable to store all parameters */\n $request = array();\n foreach ($url as $value) {\n $new = explode('=', $value);\n $request[$new[0]] = $new[1];\n }\n return $request;\n}", "public function parseQuery()\n {\n $var = parse_url($var, PHP_URL_QUERY);\n $var = html_entity_decode($var);\n $var = explode('&', $var);\n $queries = array();\n \n foreach($var as $val) {\n\n $x = explode('=', $val);\n $queries[$x[0]] = $x[1];\n\n }\n \n unset($val, $x, $var);\n \n return $queries;\n \n }", "abstract public function parseRequestParameters();", "public function parse_query_vars()\n {\n }", "public function getQueryStrParams ()\n {\n return $this->getParams(\"string\");\n }", "private function _parseQueryString($queryString)\n {\n preg_match_all('/(\\w+?):\"(.*?)\"/', $queryString, $queryMatches);\n foreach ($queryMatches[0] as $i => $match) {\n $fieldMatched = false;\n $fieldName = $queryMatches[1][$i];\n $values = preg_split('/\\s*,\\s*/', $queryMatches[2][$i]);\n\n switch ($fieldName) {\n case 'lifespan':\n if (preg_match('/([<>])(.+)/', $values[0], $matches)) {\n $op = $matches[1];\n $lifespan = $matches[2];\n $this->_query->andWhere('o.lifespan '.$op.' ?', $lifespan);\n $fieldMatched = true;\n }\n break;\n case 'lifespanBase':\n if (preg_match('/([<>])(.+)/', $values[0], $matches)) {\n $op = $matches[1];\n $lifespan = $matches[2];\n $this->_query->andWhere('o.lifespanBase '.$op.' ?', $lifespan);\n $fieldMatched = true;\n }\n break;\n case 'lifespanChange':\n if (preg_match('/([<>])(.+)/', $values[0], $matches)) {\n $op = $matches[1];\n $lifespanChange = $matches[2];\n $this->_query->andWhere('o.lifespanChange '.$op.' ?', $lifespanChange);\n $fieldMatched = true;\n }\n break;\n\n case 'species':\n $species = $this->_getSpecies($values);\n $this->_query->andWhereIn('o.species', $species);\n $fieldMatched = true;\n break;\n case 'strain':\n $this->_query->andWhereIn('o.strain', $values);\n $fieldMatched = true;\n break;\n case 'lifespanEffect':\n $this->_query->andWhereIn('o.lifespanEffect', $values);\n $fieldMatched = true;\n break;\n case 'cellType':\n $this->_query->andWhereIn('o.cellType', $values);\n $fieldMatched = true;\n break;\n case 'matingType':\n $this->_query->andWhereIn('o.matingType', $values);\n $fieldMatched = true;\n break;\n case 'citationPubmedId':\n $this->_query->andWhereIn('o.citationPubmedId', $values);\n $fieldMatched = true;\n break;\n case 'geneSymbol':\n $symbols = $this->_getGeneSymbols($values);\n $this->_query->andWhereIn('og.symbol', $symbols);\n $fieldMatched = true;\n break;\n case 'geneAlleleType':\n $this->_query->andWhereIn('og.alleleType', $values);\n $fieldMatched = true;\n break;\n }\n\n if ($fieldMatched) {\n // strip out the match so it isnt processed anymore\n $queryString = trim(str_replace($match, '', $queryString));\n }\n }\n\n // extract terms and add to dql\n $terms = array();\n preg_match_all('/\"(.+?)\"/', $queryString, $matches);\n foreach ($matches[0] as $i => $match) {\n $terms[] = $matches[1][$i];\n $queryString = str_replace($match, '', $queryString);\n }\n preg_match_all('/(\\s*.+\\s*)/', $queryString, $matches);\n foreach ($matches[0] as $i => $match) {\n $terms[] = $matches[1][$i];\n $queryStrign = str_replace($match, '', $queryString);\n }\n if (count($terms) > 0) {\n foreach ($terms as $term) {\n $whereString = '\n o.body REGEXP ?\n OR o.citationAuthor REGEXP ?\n OR o.citationTitle REGEXP ?\n ';\n $whereParams = array(\n '[[:<:]]'.$term.'[[:>:]]',\n '[[:<:]]'.$term.'[[:>:]]',\n '[[:<:]]'.$term.'[[:>:]]',\n );\n\n // add fetched gene symbols to where clause\n $symbols = $this->_getGeneSymbols(array($term));\n\n foreach ($symbols as $symbol) {\n if ($symbol != $term) {\n $whereString .= ' OR og.symbol = ?';\n $whereParams[] = $symbol;\n }\n }\n\n // add fetched species to where clause\n $species = $this->_getSpecies(array($term));\n foreach ($species as $name) {\n if ($name != $term) {\n $whereString .= ' OR o.species = ?';\n $whereParams[] = $name;\n }\n }\n $this->_query->andWhere($whereString, $whereParams);\n }\n }\n }", "function parse_query( $query = null ) {\n\n\t\tif ( $query == null ) {\n\t\t\t$query = $_SERVER['QUERY_STRING'];\n\t\t}\n\n\t\tparse_str( $query, $parts );\n\n\t\t$defaults = array(\n\t\t\t'db' => null,\n\t\t\t'table' => null,\n\t\t\t'order_by' => null,\n\t\t\t'direction' => 'ASC',\n\t\t\t'column' => null,\n\t\t\t'value' => null,\n\t\t\t'limit' => null,\n\t\t\t'format' => 'json',\n\t\t\t'callback' => null,\n\t\t);\n\n\t\t$parts = shortcode_atts( $defaults, $parts );\n\n\t\tif ( $parts['db'] == null ) {\n\t\t\t$this->error( 'Must select a database', 400 );\n\t\t}\n\n\t\tif ( $parts['table'] == null ) {\n\t\t\t$this->error( 'Must select a table', 400 );\n\t\t}\n\n\t\t$db = $this->get_db( $parts['db'] );\n\n\t\tif ( in_array( $parts['table'], $db->table_blacklist ) ) {\n\t\t\t$this->error( 'Invalid table', 404 );\n\t\t}\n\n\t\tif ( !in_array( $parts['direction'], array( 'ASC', 'DESC' ) ) ) {\n\t\t\t$parts['direction'] = null;\n\t\t}\n\n\t\tif ( !in_array( $parts['format'], array( 'html', 'xml', 'json' ) ) ) {\n\t\t\t$parts['format'] = null;\n\t\t}\n\n\t\treturn $parts;\n\n\t}", "function parse_query($var)\n {\n $var = parse_url($var, PHP_URL_QUERY);\n $var = html_entity_decode($var);\n $var = explode('&', $var);\n $arr = array();\n\n foreach($var as $val)\n {\n $x = explode('=', $val);\n $arr[$x[0]] = $x[1];\n }\n unset($val, $x, $var);\n return $arr;\n }", "public static function parseUrlQuery($query_string) {\n $query = array();\n $pairs = explode('&', $query_string);\n foreach ($pairs as $pair) {\n list($key, $value) = explode('=', $pair);\n $query[$key] = urldecode($value);\n }\n\n return $query;\n }", "public function parse($queryString) {\n\t\t\tparse_str($queryString, $params);\n\t\t\tforeach ($params as $name => $value) {\n\t\t\t\t$this->set($name, $value);\n\t\t\t}\n\t\t}", "public static function httpParseQuery($query) {\n if ($query === '') {\n return array();\n }\n // Explode parameters into arrays to check for duplicate names.\n $params = array();\n $seen = array();\n $duplicate = array();\n foreach (explode('&', $query) as $chunk) {\n $param = explode('=', $chunk, 2);\n if (isset($seen[$param[0]])) {\n $duplicate[$param[0]] = TRUE;\n }\n $seen[$param[0]] = TRUE;\n $params[] = $param;\n }\n // Implode back into a string.\n $query = '';\n foreach ($params as $param) {\n $query .= $param[0];\n if (isset($duplicate[$param[0]])) {\n $query .= '[]';\n }\n if (isset($param[1])) {\n $query .= '=' . $param[1];\n }\n $query .= '&';\n }\n // Parse query string as usual.\n parse_str($query, $result);\n return $result;\n }", "function parse_string($string, $data = array(), $options = array()) {\n\n if (!$this->string_has_params($string)) {\n return $string;\n }\n\n //check if string is once param\n if ($this->parse_string_is_once_param($string)) {\n $param_key = $this->parse_string_extract_param($string);\n //print_r(compact('param_key'));\n if ($this->parse_param_exists($param_key, $data)) {\n return $this->parse_param_value($param_key, $data);\n }\n return $string; //param_key not exists, return string as is\n }\n\n $string1 = str_replace(\n array(\n $this->parse['before'],\n $this->parse['after']), array(\n '!-=0=-!' . $this->parse['before'],\n $this->parse['after'] . '!-=0=-!'), $string);\n\n $parsed = explode('!-=0=-!', $string1);\n $finded = array();\n foreach ($parsed as $ix => $item) {\n if ($item) {\n if ($this->parse_string_is_once_param($item)) {\n $param_key = $this->parse_string_extract_param($item);\n\n if ($this->parse_param_exists($param_key, $data)) {\n $parsed[$ix] = $this->parse_param_value($param_key, $data);\n }\n }\n }\n }\n return join($parsed);\n }", "private function __parseParams($params=array()) {\r\n\t\t$out = '';\r\n\t\t// CONDITIONS\r\n\t\tif (!empty($params['conditions'])) {\r\n\t\t\t$i = 1;\r\n\t\t\tforeach ($params['conditions'] as $key => $val) {\r\n\t\t\t\tif (is_array($val)) {\r\n\t\t\t\t\tforeach ($val as $operator => $v) {\r\n\t\t\t\t\t\t$out .= 'Filter'.$i++.'='.$key.\"+\".$operator.\"+\".$v.\"&\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$out .= 'Filter'.$i++.'='.$key.\"+Contains+\".$val.\"&\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// ORDER\r\n\t\tif (isset($params['order'])) {\r\n\t\t\t$e = explode(\" \", $params['order']);\r\n\t\t\tif (!empty($e[0])) {\r\n\t\t\t\t$e[1] = (empty($e[1])) ? 'ASC' : $e[1];\r\n\t\t\t\t$out .= \"sort=\".$e[0].\"&sortDirection=\".$e[1].\"&\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// PAGE\r\n\t\tif (isset($params['page'])) {\r\n\t\t\t$out .= \"pageStart=\".$params['page'].\"&\";\r\n\t\t}\r\n\t\t// LIMIT\r\n\t\tif (isset($params['limit'])) {\r\n\t\t\t$out .= \"pageSize=\".$params['limit'].\"&\";\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "private function parseQueryString()\n {\n $queryString = isset($_GET['q']) ? $_GET['q'] : false;\n return $queryString;\n }", "public function buildQueryString();", "public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }", "function query($arg_str) // call this function from other units and configs\n\t\t{\n\t\t\t$query_segments = explode(';',$arg_str);\n\n\t\t\t\n\t\t\t$response = [];\n\t\t\tforeach($query_segments as $q_str) \n\t\t\t{\t\t\t\t\n\t\t\t\t$matches=[];\n\t\t\t\tif(preg_match_all( \"#^(.+)\\:\\:([[:alnum:]]+)$#Uis\",$q_str,$matches))\n\t\t\t\t{\n\t\t\t\t\t$q_str = $matches[1][0];\n\t\t\t\t\t$_q_id = $matches[2][0];\n\t\t\t\t}\n\n\t\t\t\t$_res_obj = $this->get_obj_by_route($q_str);\n\t\t\t\t\n\t\t\t\t$_new_query_obj=[\n\t\t\t\t\t'query'=>$q_str,\n\t\t\t\t\t'response'=>$_res_obj,\n\t\t\t\t];\n\t\t\t\tif(isset($_q_id))\n\t\t\t\t{\n\t\t\t\t\t$_new_query_obj['key']=$_q_id;\n\t\t\t\t\tunset($_q_id);\n\t\t\t\t}\n\n\t\t\t\t$response[]=$_new_query_obj;\n\t\t\t}\n\t\t\treturn $response;\n\t\t}", "private function parseParams() : array\n {\n $querySting = (parse_url($_SERVER['QUERY_STRING']))['path'];\n parse_str($querySting, $params);\n return $params;\n }", "private function getQueryString(): array\n {\n parse_str($this->request->getUri()->getQuery(), $queryString);\n\n if (isset($queryString['p'])) {\n unset($queryString['p']);\n }\n\n return $queryString;\n }", "public static function parse_query($str, $urlEncoding = true)\n {\n $result = [];\n\n if ($str === '') {\n return $result;\n }\n\n if ($urlEncoding === true) {\n $decoder = function ($value) {\n return rawurldecode(str_replace('+', ' ', $value));\n };\n } elseif ($urlEncoding === PHP_QUERY_RFC3986) {\n $decoder = 'rawurldecode';\n } elseif ($urlEncoding === PHP_QUERY_RFC1738) {\n $decoder = 'urldecode';\n } else {\n $decoder = function ($str) {\n return $str;\n };\n }\n\n foreach (explode('&', $str) as $kvp) {\n $parts = explode('=', $kvp, 2);\n $key = $decoder($parts[0]);\n $value = isset($parts[1]) ? $decoder($parts[1]) : null;\n if (!isset($result[$key])) {\n $result[$key] = $value;\n } else {\n if (!is_array($result[$key])) {\n $result[$key] = [$result[$key]];\n }\n $result[$key][] = $value;\n }\n }\n\n return $result;\n }", "protected function parseString($sQueryString)\n\t{\n\t\t$aParsedQuery = array();\n\t\t$aItems = explode('&', $sQueryString);\n\t\tforeach ($aItems as $sItem) {\n\t\t\tif (strpos($sItem, '=') !== false) {\n\t\t\t\tlist($sKey, $sValue) = explode('=', $sItem, 2);\n\t\t\t\t$sValue = urldecode($sValue);\n\t\t\t} else {\n\t\t\t\t$sKey = $sItem;\n\t\t\t\t$sValue = '';\n\t\t\t}\n\n\t\t\t$aParsedQuery[$sKey] = $sValue;\n\t\t}\n\n\t\treturn $aParsedQuery;\n\t}", "function parse_search_query(array $paramList, string $query): array\n{\n // grammar definitions of correct gramatically elements\n $valueDef = \"(('|\\\")[^\\\"']*('|\\\")|[a-zA-Z0-9]+)\";\n $paramDef = \"[a-zA-Z0-9]+\";\n $expressionDef = \"$paramDef:$valueDef\";\n\n // loose grammar definitions for elements so we can detect incorrect data\n $valueLooseDef = \"(('|\\\")[^\\\"']*('|\\\")|['\\\"]?[a-zA-Z0-9]+|[a-zA-Z0-9]+['\\\"]?)\";\n $paramLooseDef = \"[a-zA-Z0-9]+\";\n $expressionLooseDef = \"$paramLooseDef(\\:$valueLooseDef)?\";\n\n $expressions = get_matches_for_regex(\"/$expressionDef/\", $query);\n\n $result = array();\n foreach($expressions as $expression) {\n $param = get_matches_for_regex(\"/^$paramDef/\", $expression)[0];\n $value = get_matches_for_regex(\"/$valueDef$/\", $expression)[0];\n\n if(!in_array($param, $paramList)) {\n throw new ParamNotFoundException($param);\n }\n\n $quotesArr = ['\"', \"'\"];\n if(in_array($value[0], $quotesArr) && in_array($value[strlen($value)-1], $quotesArr)) {\n $value = substr($value, 1, strlen($value)-2);\n }\n\n $result[$param] = $value;\n }\n\n $potentialExpressions = get_matches_for_regex(\"/$expressionLooseDef/\", $query);\n $notValidExpressions = array_diff($potentialExpressions, $expressions);\n\n if(count($notValidExpressions) > 0) {\n throw new GrammarException($notValidExpressions);\n }\n\n return $result;\n}", "public function parseQueryString($query)\n {\n if (empty($query)) {\n return [];\n }\n\n parse_str($query, $split);\n\n $query = [];\n\n foreach ($split as $key => $value) {\n $mapped = call_user_func_array([$this, 'filterQueryParams'], [$key, $value]);\n if ($mapped !== false) {\n $query[$key] = $mapped;\n }\n }\n\n return $query;\n }", "function parseGetParams()\n {\n $this->parameters = array();\n\n $uriParts = explode('?', $this->userURI);\n $itemCount = count($uriParts);\n if ($itemCount == 0)\n {\n return;\n }\n\n //remove last item if it's empty\n if (isset($uriParts[$itemCount - 1]) && $uriParts[$itemCount - 1] == '')\n {\n array_pop($uriParts);\n }\n \n //remove first item if it's empty\n if (isset($uriParts[0]) && $uriParts[0] == '')\n {\n array_shift($uriParts);\n }\n\n //if has no valid item then return\n if (count($uriParts) == 0)\n {\n return;\n }\n writeLog(print_r($uriParts, true));\n \n foreach($uriParts as $inputData)\n {\n $data = html_entity_decode($inputData);\n $pair = explode('=', $data);\n\n if (count($pair)>1)\n {\n $this->parameters[$pair[0]] = $pair[1];\n }\n }\n \n writeLog(\"params = \".print_r($this->parameters, true));\n }", "public static function http_parse_query(string $queryString, string $argSeparator = '&', int $decType = PHP_QUERY_RFC1738): array\n {\n if (empty($queryString)) { return []; }\n $result = [];\n $parts = explode($argSeparator, $queryString);\n\n foreach ($parts as $part) {\n list($paramName, $paramValue) = array_pad(explode('=', $part, 2), 2, '');\n\n switch ($decType) {\n case PHP_QUERY_RFC3986:\n $paramName = rawurldecode($paramName);\n $paramValue = rawurldecode($paramValue);\n break;\n\n case PHP_QUERY_RFC1738:\n default:\n $paramName = urldecode($paramName);\n $paramValue = urldecode($paramValue);\n break;\n }\n\n\n if (preg_match_all('/\\[([^\\]]*)\\]/m', $paramName, $matches)) {\n $paramName = substr($paramName, 0, intval(strpos($paramName, '[')));\n $keys = array_merge([$paramName], $matches[1]);\n } else {\n $keys = [$paramName];\n }\n\n $target = &$result;\n\n foreach ($keys as $index) {\n if ('' === $index) {\n if (isset($target)) {\n if (is_array($target)) {\n $intKeys = array_filter(array_keys($target), 'is_int');\n $index = count($intKeys) ? max($intKeys)+1 : 0;\n } else {\n $target = [$target];\n $index = 1;\n }\n } else {\n $target = [];\n $index = 0;\n }\n } elseif (isset($target[$index]) && !is_array($target[$index])) {\n $target[$index] = [$target[$index]];\n }\n\n $target = &$target[$index];\n }\n\n if (is_array($target)) {\n $target[] = $paramValue;\n } else {\n $target = $paramValue;\n }\n }\n\n return $result;\n }", "public static function parseQueryString($queryString) {\n if (is_array($queryString)) {\n return $queryString;\n }\n if ($queryString === '' || $queryString === null) {\n return array();\n }\n if (!is_string($queryString)) {\n throw new \\InvalidArgumentException('Query string must be a string, null, or already parsed array');\n }\n return call_user_func_array('array_merge', array_map(function($queryPart) {\n $keyValue = explode('=', $queryPart, 2);\n return array(urldecode($keyValue[0]) => urldecode($keyValue[1]));\n }, explode('&', $queryString)));\n }", "public function parse($string);", "public function formParams() {\n\t\tswitch($this->method()) {\n\t\tcase 'GET':\n\t\tcase 'DELETE':\n\t\tcase 'HEAD':\n\t\tcase 'OPTIONS':\n\t\tcase 'TRACE':\n\t\t\t$query_str = $this->queryString();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// TODO Validate Content-Type\n\t\t\t$query_str = $this->getBody();\n\t\t}\n\t\tparse_str($query_str, $result);\n\t\treturn $result;\n\t}", "public function makeQueryString($params)\n {\n $query = array();\n $paramsReturn = array();\n foreach($params as $p => $param)\n {\n if($param > 0 && $param != '' && !is_array($param))\n {\n $paramName = str_replace('.', '_', $p);\n $query[] = $p.' = :'.$paramName;\n $paramsReturn[$paramName] = $param;\n }\n elseif(is_array($param))\n {\n if($param['type'] == 'BETWEEN' && $param['to'] > $param['from'])\n {\n $paramNameFrom = str_replace('.', '_', $p.'_from');\n $paramNameTo = str_replace('.', '_', $p.'_to');\n $query[] = $p.' BETWEEN :'.$paramNameFrom.' AND :'.$paramNameTo;\n $paramsReturn[$paramNameFrom] = $param['from'];\n $paramsReturn[$paramNameTo] = $param['to'];\n }\n }\n }\n $queryString = implode(' AND ', $query);\n return array('query' => $queryString, 'params' => $paramsReturn);\n }", "private function getParameters()\n {\n $inputParametersStr = \"\";\n\n foreach ($_GET as $key => $input) {\n\n if(empty($input)){\n continue ; //ignore empty field \n }\n $inputParametersStr .= \"$key=\" . urlencode($input) . \"&\"; // convert string into url syntax.\n\n }\n $inputParametersStr = trim($inputParametersStr, '&'); // separate parameters by \"&\" .\n\n return $inputParametersStr ;\n }", "public function parse_query_vars($qv)\n {\n }", "function decode_custom_param_str($param_struct, $uri_string)\n {\n preg_match_all('#%(.*?)%#', $param_struct, $struct_matches);\n \n // Get the uri matches (param values)\n $match_str = '#'.$this->get_custom_forwarding_rule($param_struct).'#';\n preg_match($match_str, $uri_string, $uri_matches);\n \n $param_array = array();\n for($i = 0; $i < count($struct_matches[1]); $i++)\n $param_array[$struct_matches[1][$i]] = $uri_matches[$i+1];\n \n return $param_array;\n }", "public function parse(string $input);", "function ds_swap_search_parameter($query_string) {\n\n $query_string_array = array();\n\n // convert the query string to an array\n parse_str($query_string, $query_string_array);\n\n // if \"search\" is in the query string\n if(isset($query_string_array['q'])){\n $query_string_array['s'] = $query_string_array['q']; // replace \"s\" with value of \"search\"\n unset($query_string_array['q']); // delete \"search\" from query string\n }\n\n return http_build_query($query_string_array, '', '&'); // Return our modified query variables\n}", "private function convertUrlQuery($query) {\n/* print_r();\nexit; */\n $query = ($query);\n /* echo htmlspecialchars_decode($query);\n echo '<br/>'; */\n $queryParts = explode('&', htmlspecialchars_decode($query));\n /* print_r($queryParts);\n exit;*/\n $params = array();\n foreach ($queryParts as $param)\t{\n\n $item = explode('=', $param);\n $params[$item[0]] = $item[1];\n }\n return $params;\n\n }", "function convertStringUrl($string){\n\n $wasteValue = [3];\n $url = parse_url($string);\n\n $scheme = $url['scheme'];\n $host = $url['host'];\n $path = $url['path'];\n\n $query = explode('&', $url['query']);\n\n $params = getFilteredArrayFromString($query, $wasteValue);\n\n //sort params by value\n asort($params);\n\n //add path parameter from input link to array\n $params['url'] = $path;\n\n //form get params as a string\n $paramsString = http_build_query($params);\n\n //form a valid url as a string\n $result = $scheme . '://' . $host . '/?' . $paramsString;\n\n return $result;\n\n}", "public function parse(string $text)\n {\n $lexer = new Lexer($text);\n\n try {\n while (!$lexer->finished()) {\n $key = trim($lexer->expression('[^;=]+'));\n $value = null;\n\n if ($lexer->maybeChar('=')) {\n $value = $lexer->maybeDoubleQuotedString();\n\n if (!$value) {\n $value = $lexer->expression('[^;]+');\n }\n }\n\n // Parameters renamed in OData 4.01\n switch ($key) {\n case Constants::odataStreaming:\n $key = Constants::streaming;\n break;\n\n case Constants::odataMetadata:\n $key = Constants::metadata;\n break;\n }\n\n $this->addParameter($key, $value);\n $lexer->maybeWhitespace();\n $lexer->maybeChar(';');\n }\n } catch (LexerException $e) {\n throw new InternalServerErrorException('invalid_parameter', 'An invalid parameter was provided', $e);\n }\n }", "function parse_query($query){\n $patern='/^SELECT\\s+\\w+\\s+FROM(\\s+(\\w+|\\w+\\.\\w+|\\.\\w+))?(\\s+WHERE\\s+((NOT\\s+)?)*((\\w+)|(\\w+\\.\\w+)|(\\.\\w+))(\\s+)*(=|>|<|CONTAINS)(\\s+)*((\\\"\\w+\\\")|(\\d+)))?(\\s+)?(\\s+LIMIT\\s+\\d+)?(\\s+)?$/';\n $constants = array('SELECT','FROM', 'LIMIT','WHERE','ROOT','NOT');\n\n if(! preg_match($patern, $query))\n {\n exit_program(\"Bad query, try to use -help or --help\\n\",code_error::error_query);\n }\n\n // SELECT\n\n preg_match('/SELECT\\s+(\\w+)\\s/', $query, $parsed['SELECT']);\n $parsed['SELECT']=$parsed['SELECT'][1];\n if((in_array($parsed['SELECT'], $constants)) | (is_numeric($parsed['SELECT'])))\n {\n exit_program(\"Bad query (SELECT), try to use -help or --help\\n\",code_error::error_query);\n }\n\n // FROM \n preg_match('/FROM(\\s*)(\\w+|\\w+\\.\\w+|\\.\\w+)?($|\\s+)/', $query, $parsed['FROM']);\n $parsed['FROM'] = preg_split(\"/\\./\",$parsed['FROM'][2]);\n if(preg_match('/FROM\\s+WHERE\\s+WHERE\\s+/', $query) | (is_numeric($parsed['FROM'])))\n {\n exit_program(\"Bad query (FROM), try to use -help or --help\\n\",code_error::error_query);\n }\n if((in_array($parsed['FROM'], $constants)) && ($parsed['FROM'] != \"ROOT\"))\n {\n if($parsed['FROM']==\"WHERE\")\n {\n $parsed['FROM']=\"\";\n }\n else\n {\n exit_program(\"Bad query (FROM), try to use -help or --help\\n\",code_error::error_query);\n }\n } \n\n // WHERE\n \n if(strpos($query,'WHERE'))\n {\n if(preg_match('/WHERE\\s+(((NOT\\s+)?)*((\\w+)|(\\w+\\.\\w+)|(\\.\\w+))(\\s+)*(=|>|<|CONTAINS)(\\s+)*((\\\"\\w+\\\")|(\\d+)))($|\\s)/', $query, $parsed['WHERE']) == 0)\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n $parsed['WHERE']=$parsed['WHERE'][1];\n // REMOVE NOT\n $parsed['WHERE']=str_replace(\"NOT \", \"\", $parsed['WHERE'], $not_clause);\n preg_match('/(\\w+|\\w+\\.\\w+|\\.\\w+)\\s*?(=|>|<|CONTAINS)\\s*?(\\\"\\w+\\\"|\\d+)/', $parsed['WHERE'],$clause);\n $parsed['WHERE']=array();\n // OPERATOR FOR WHERE\n $parsed['WHERE'][2]=$clause[2];\n // VALUE OF LITERAL\n if(substr($clause[3], 0,1) == '\"' && substr($clause[3], -1) == '\"')\n {\n $clause[3] = substr($clause[3], 1, -1);\n }\n else\n $clause[3] = (double)$clause[3];\n $parsed['WHERE'][3]=$clause[3];\n // VALUE OF ATTRIBUTTE\n $clause=preg_split(\"/[.]/\", $clause[1]);\n $parsed['WHERE'][0]=$clause[0];\n if(isset($clause[1]))\n {\n $parsed['WHERE'][1]=$clause[1];\n if(is_numeric($parsed['WHERE'][1][0]))\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n }\n else\n $parsed['WHERE'][1]=\"\";\n\n // NOT\n if(($not_clause%2)==0)\n {\n $parsed['WHERE'][4]=false;\n }\n else\n $parsed['WHERE'][4]=true;\n\n if(($parsed['WHERE'][2] == \"CONTAINS\")&&(gettype($parsed['WHERE'][3])!=\"string\"))\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n }\n // LIMIT\n if(strpos($query,'LIMIT'))\n {\n preg_match('/LIMIT\\s(\\d+)(\\s+)?$/', $query, $parsed['LIMIT']);\n $parsed['LIMIT']=(int)$parsed['LIMIT'][1];\n }\n return $parsed;\n}", "function getURLString(){\n $url = $_SERVER['REQUEST_URI'];\n $aurl = explode('?', $url);\n if(count($aurl) > 1)\n { \n $query = $aurl[1];\n parse_str($query, $params);\n return $params;\n }\n return array();\n}", "function _expr_token_parse_params($expr)\n {\n $params = array();\n $cpos = 0;\n $instring = FALSE;\n $instring_delim = '';\n $bnl = 0;\n $size = strlen($expr);\n $param = '';\n while ($cpos <= $size)\n {\n if ($cpos == $size) {$params[] = $this->_expr_token($param); break;}\n $char = $expr[$cpos];\n if (!$instring)\n {\n if ($char == '\"' or $char == '\\'') {$instring = TRUE; $instring_delim = $char;}\n elseif ($char == '(') {$bnl++;}\n elseif ($char == ')') {$bnl--;}\n }\n else\n {\n if ($char == $instring_delim and $expr[$cpos-1] != '\\\\') {$instring = FALSE;}\n }\n if (!$instring and $bnl == 0 and $char == ',') {$params[] = $this->_expr_token($param); $param = '';}\n else {$param .= $char;}\n $cpos++;\n }\n return $params;\n }", "abstract public function parse($string);", "public function parseParams(string $param): self;", "function parse_request($req) {\n\t\tif (substr($req, 0, 1) != '{' || substr($req, strlen($req) - 1, strlen($req)) != '}')\n\t\t\treturn 'Request must be encapsulated in { }.';\n\t\t$req = substr($req, 1, strlen($req) - 2);\n\t\twhile (substr($req, strlen($req) - 1, strlen($req)) == ';')\n\t\t\t$req = substr($req, 0, strlen($req) - 1);\n\t\t$pairs = explode(';', $req);\n\t\t$specs = array(\n\t\t\t'maxresults' => 15,\n\t\t\t'startwith' => 0,\n\t\t\t'sortby' => 'newvers',\n\t\t\t'filterbyid' => false,\n\t\t\t'filterbyitunesid' => false,\n\t\t\t'filterbytext' => false,\n\t\t\t'filterbycategory' => false,\n\t\t\t'fields' => false,\n\t\t\t'showtotal' => 'false',\n\t\t\t'full' => false);\n\t\t$specregex = array(\n\t\t\t'maxresults' => '\\\\d+',\n\t\t\t'startwith' => '\\\\d+',\n\t\t\t'sortby' => '(newvers|newapps|appname|relevance)',\n\t\t\t'filterbyid' => '\\\\d+',\n\t\t\t'filterbyitunesid' => '\\\\d+',\n\t\t\t'filterbytext' => '.*',\n\t\t\t'filterbycategory' => '\\\\d+',\n\t\t\t'showtotal' => '(true|false)',\n\t\t\t'fields' => '.*');\n\t\t$fields = array('name' => false,\n\t\t\t'itunesid' => false,\n\t\t\t'latestversion' => false,\n\t\t\t'releasedate' => false,\n\t\t\t'addeddate' => false,\n\t\t\t'company' => false,\n\t\t\t'price' => false,\n\t\t\t'seller' => false,\n\t\t\t'size' => false,\n\t\t\t'category' => false,\n\t\t\t'description' => true,\n\t\t\t'whatsnew' => true,\n\t\t\t'languages' => true,\n\t\t\t'requirements' => true,\n\t\t\t'icon100' => false,\n\t\t\t'icon57' => false,\n\t\t\t'screenshots' => false,\n\t\t\t'links' => false,\n\t\t\t'latestcracker' => false);\n\t\tforeach ($pairs as $pair) {\n\t\t\t$kv = explode(':', $pair);\n\t\t\tif (count($kv) != 2)\n\t\t\t\treturn 'Invalid key:value structure in: [' . $pair . ']';\n\t\t\t$found = false;\n\t\t\tforeach ($specregex as $key => $val) {\n\t\t\t\tif ($kv[0] == $key) {\n\t\t\t\t\tif (!preg_match('/^' . $val . '$/', $kv[1]))\n\t\t\t\t\t\treturn \"Invalid value for spec '$key': [\" . $kv[1] . \"]\";\n\t\t\t\t\t$found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$found)\n\t\t\t\treturn \"Invalid spec type: '\" . $kv[0] . \"'\";\n\t\t\tif ($kv[0] == 'fields') {\n\t\t\t\t$fnames = explode(',', $kv[1]);\n\t\t\t\tforeach ($fnames as $fname) {\n\t\t\t\t\t$found = false;\n\t\t\t\t\tforeach ($fields as $key => $value) {\n\t\t\t\t\t\tif ($fname == $key) {\n\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t\tif ($value)\n\t\t\t\t\t\t\t\t$specs['full'] = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!$found)\n\t\t\t\t\t\treturn \"Invalid field name in 'fields' spec: [$fname]\";\n\t\t\t\t\tif (!is_array($specs['fields']))\n\t\t\t\t\t\t$specs['fields'] = array();\n\t\t\t\t\t$specs['fields'][count($specs['fields'])] = $fname;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\t$specs[$kv[0]] = $kv[1];\n\t\t}\n\t\treturn $specs;\n\t}", "function getQueryParams()\n {\n $queryString = $_SERVER['QUERY_STRING'];\n $queryArray = explode('&', $queryString);\n $response = array();\n foreach ($queryArray as $query) {\n $query = explode('=', $query);\n $response[$query[0]] = $query[1];\n }\n return $response;\n }", "public function parse_request($extra_query_vars = '')\n {\n }", "public function parseQuery($url) {\n $params = array();\n\n $args = parse_url($url);\n if (isset($args['query'])) {\n parse_str($args['query'], $params);\n }\n\n return $params;\n }", "public static function parseUrl()\n {\n $route = trim($_SERVER['QUERY_STRING'], '/');\n $params = explode('/', $route);\n $params = array_slice($params, 2);\n\n return [$route, $params];\n }", "protected function parseParameters($params) {\n $uri = \"\";\n if (array_key_exists(\"days\", $params)) {\n $uri .= '&days=' . $params['days'];\n }\n\n if (array_key_exists(\"results\", $params)) {\n $uri .= '&results=' . $params['results'];\n }\n\n if (array_key_exists(\"min\", $params)) {\n $uri .= '&min=' . $params['min'];\n }\n\n if (array_key_exists(\"max\", $params)) {\n $uri .= '&max=' . $params['max'];\n }\n\n if (array_key_exists(\"metadata\", $params)) {\n if ($params['metadata'] == true || $params['metadata'] == false) {\n $uri .= '&metadata=' . $params['metadata'];\n }\n }\n\n if (array_key_exists(\"round\", $params)) {\n $uri .= '&round=' . $params['round'];\n }\n\n if(array_key_exists(\"start\", $params)) {\n $uri .= '&start=' . $params['start'];\n }\n\n if (array_key_exists(\"end\", $params)) {\n $uri .= '&end=' . $params['end'];\n }\n\n if (array_key_exists(\"timezone\", $params)) {\n $uri .= '&timezone=' . $params['timezone'];\n }\n\n if (array_key_exists(\"location\", $params)) {\n $uri .= '&location=' . $params['location'];\n }\n\n if (array_key_exists(\"median\", $params)) {\n $uri .= '&median=' . $params['median'];\n }\n\n\n\n return $uri;\n }", "public static function getParamsFromString($str)\n\t{\n\t\t$params = unserialize($str, [ 'allowed_classes' => false ]);\n\n\t\tif (\n\t\t\t!is_array($params)\n\t\t\t&& !empty($str)\n\t\t)\n\t\t{\n\t\t\t$tmp = explode(\"&\", $str);\n\t\t\tif (is_array($tmp) && count($tmp) > 0)\n\t\t\t{\n\t\t\t\t$params = array();\n\t\t\t\tforeach($tmp as $pair)\n\t\t\t\t{\n\t\t\t\t\tlist ($key, $value) = explode(\"=\", $pair);\n\t\t\t\t\t$params[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "protected function parse()\n {\n preg_match('/(user|ip)\\:\\\"?([0-9a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ._ -]{1,})\\\"?/', $this->inputQuery, $matches);\n\n if (empty($matches)) {\n return $this->filteredQuery = $this->inputQuery;\n }\n\n list($original, $key, $value) = $matches;\n\n $this->filteredQuery = str_replace($original, '', $this->inputQuery);\n $this->filters[$key] = trim($value, '\"');\n }", "protected function parse_query($query) {\n $this->query = array();\n if ($query)\n foreach (explode('&', $query) as $p) {\n list($k, $v) = explode('=', $p);\n if ($k) $this->query[urldecode($k)] = urldecode($v);\n }\n return $this;\n }", "private function parseRequestParams($req){\n\t $req = str_replace(\"__JOBID__\", $this->job_id, $req);\n\t return $req;\n }", "public static function parse_query($query) {\n $tags = explode(\" \",$query);\n return $tags;\n }", "function get_url_query() {\r\n $query = array();\r\n\r\n // get the URL query string\r\n $query_str = $_SERVER['QUERY_STRING'];\r\n\r\n // parse the URL query string to array\r\n parse_str($query_str, $query);\r\n\r\n return $query;\r\n}", "function _parse_raw_http_request_urlencoded($input)\n{\n $post_data = array();\n\n $pairs = explode('&', $input);\n foreach ($pairs as $pair) {\n $exploded = explode('=', $pair, 2);\n if (count($exploded) == 2) {\n $key = urldecode($exploded[0]);\n $val = urldecode($exploded[1]);\n if (get_magic_quotes_gpc()) {\n $val = addslashes($val);\n }\n\n if (substr($key, -2) == '[]') {\n $key = substr($key, 0, strlen($key) - 2);\n if (!isset($post_data[$key])) {\n $post_data[$key] = array();\n }\n $post_data[$key][] = $val;\n } else {\n $post_data[$key] = $val;\n }\n }\n }\n\n return $post_data;\n}", "public function queryString();", "function queryString($param_array){\n\t$cnt = 0;\n\t$qstring = null;\n\tforeach ($param_array as $key => $value){\n\t\tif($cnt > 0){\n\t\t\t$qstring .= \"&\" . $key . \"=\" . $value;\n\t\t} else {\n\t\t\t$qstring = $key . \"=\" . $value;\n\t\t}\n\t\t$cnt++;\n\t}\n\treturn $qstring;\n}", "abstract protected function buildQuery(): string;", "public static function parseQuery($query)\n {\n $query = explode(\"&\", $query);\n $parsed = array();\n foreach ($query as $i => $q) {\n @list ($name, $value) = explode(\"=\", $q, 2);\n if ($name == \"\") {\n continue;\n }\n $name = urldecode($name);\n $value = urldecode($value);\n // Reconstruct array value\n if (preg_match(\"/^(.*?)\\[(.*)]$/u\", $name, $matches)) {\n $path = array_merge(array($matches[1]),\n explode(\"][\", $matches[2]));\n ArrayX::pathSet($parsed, $path, $value);\n }\n else {\n $parsed[$name] = $value;\n }\n }\n return $parsed;\n }", "function buildQueryString($q) {\r\n\t\t$i=0;\r\n\t\tforeach($q['RuleValuePair'] as $rule_id=>$value) {\r\n\t\t\t#Sintax for \"AND\", empty logical means \"AND\" as well, by default\r\n\t\t\tif(eregi('and',$q['logical'][$i]) || $q['logical'][$i]=='') {\r\n\t\t\t\t$AND[$i] = TRUE;\r\n\t\t\t} elseif(eregi('or',$q['logical'][$i])) {\r\n\t\t\t\t$OR[$i] = TRUE;\r\n\t\t\t} elseif(eregi('not', $q['logical'][$i])) {\r\n\t\t\t\t$NOT[$i] = TRUE;\r\n\t\t\t}\r\n\t\t\t#There is a small difference in MySQL and Postgres\r\n\t\t\t$regex = $GLOBALS['regexp'];\r\n\r\n\t\t\t#Basic query string\r\n\t\t\t$sql[$i] = \"select resource_id from s3db_statement where rule_id='\".$rule_id.\"' and value \".$logical.$regex.\"'\".$value.\"'\";\r\n\t\r\n\t\t\t#Increment the queries\r\n\t\t\t#Case when only one thing is queried\r\n\t\t\tif(count($q['RuleValuePair'])==1) {\r\n\t\t\t\t$sqlComplete .= \"\".$sql[$i].\"\";\r\n\t\t\t} else {\r\n\t\t\t\tif($i==0) {\r\n\t\t\t\t\tif($AND[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($NOT[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($OR[$i]) { $sqlComplete = \"(\".$sql[0].\")\"; }\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($AND[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t\telseif($OR[$i-1]) { $sqlComplete = \"(\".$sql[$i].\") union \".$sqlComplete.\"\"; }\r\n\t\t\t\t\telseif($NOT[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id not in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $sqlComplete;\r\n\t}", "public function build_http_query($params) {\n\t\tif (!$params) return '';\n\n\t\t// Urlencode both keys and values\n\t\t$keys = $this->urlencode_rfc3986(array_keys($params));\n\t\t$values = $this->urlencode_rfc3986(array_values($params));\n\t\t$params = array_combine($keys, $values);\n\n\t\t// Parameters are sorted by name, using lexicographical byte value ordering.\n\t\t// Ref: Spec: 9.1.1 (1)\n\t\tuksort($params, 'strcmp');\n\n\t\t$pairs = array();\n\t\tforeach ($params as $parameter => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t// If two or more parameters share the same name, they are sorted by their value\n\t\t\t\t// Ref: Spec: 9.1.1 (1)\n\t\t\t\tnatsort($value);\n\n\t\t\t\tforeach ($value as $duplicate_value) {\n\t\t\t \t\t$pairs[] = $parameter . '=' . $duplicate_value;\n\t\t\t\t}\n\t\t \t} else {\n\t\t\t $pairs[] = $parameter . '=' . $value;\n\t\t\t}\n\t\t}\n\n\t\t// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)\n\t\t// Each name-value pair is separated by an '&' character (ASCII code 38)\n\t\treturn implode('&', $pairs);\n\t}", "public static function getParamaters($query) {\n $params = [];\n foreach(explode('&', $query) as $param) {\n @list($key, $value) = explode('=', $param);\n $params[$key] = $value;\n }\n return $params;\n }", "protected function _parameterizeSQL($query) {\n\t\t\t$queryChunks = explode($this->keys['start'], $query);\n\t\t\t$parameterValues = array();\n\n\t\t\tforeach ($queryChunks as $key => $queryChunk) {\n\t\t\t\tif (\n\t\t\t\t\t($position = strpos($queryChunk, $this->keys['stop'])) !== false &&\n\t\t\t\t\t$queryChunk = str_replace($this->keys['stop'], '?', $queryChunk)\n\t\t\t\t) {\n\t\t\t\t\t$queryChunks[$key] = str_replace(($between = substr($queryChunk, 0, $position)), '', $queryChunk);\n\t\t\t\t\t$parameterValues[] = $between;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$response = array(\n\t\t\t\t'parameterizedQuery' => implode('', $queryChunks),\n\t\t\t\t'parameterizedValues' => $parameterValues\n\t\t\t);\n\t\t\treturn $response;\n\t\t}", "protected function _buildQuery( $params ) {\n if (!is_array($params)) {\n // POST string body is sent as-is\n return $params;\n }\n $namevals = array();\n foreach ($params as $name => $value) {\n if (is_array($value)) {\n if ($value === array_values($value)) {\n // encode a numerically indexed array as a[]=&a[]=\n foreach ($value as $val)\n $namevals[] = \"{$name}[]=$val\";\n }\n else {\n foreach ($value as $nam => $val)\n $namevals[] = \"{$name}[$nam]=$val\";\n }\n }\n else {\n $namevals[] = \"$name=$value\";\n }\n }\n return implode('&', $namevals);\n }", "function array_toquerystring ($args) {\r\n if (!is_array($args)) {\r\n return false;\r\n }\r\n $out = '';\r\n foreach($args as $name => $value)\r\n {\r\n if(is_array($value))\r\n {\r\n foreach($value as $key => $val) {\r\n $out .= $name.'['.$key.']'.'=';\r\n $out .= $val.'&';\r\n\r\n }\r\n }else{\r\n $out .= $name.'=';\r\n $out .= $value.'&';\r\n }\r\n }\r\n return substr($out,0,-1); //trim the last & }\r\n}", "public function parseQuery($extensionsQuery);", "private function format_search_parameters($str) {\n\n $filter_str = $_SESSION['search_filter'];\n $search_str = '';\n if (strlen($filter_str) > 0 && substr($str, 0, strlen($filter_str)) == $filter_str) {\n // filter supplied, remove them from '$str'\n $search_str = trim(substr($str, strlen($filter_str)));\n } else {\n $search_str = $str;\n }\n\n $response = new stdClass();\n $response->filters = $filter_str;\n $response->search = $search_str;\n\n return $response;\n\n\n $formatted_search = array();\n $formatted_filter = array();\n\n /*\n * init response container\n */\n $response = new stdClass();\n $response->formatted_filter_str = '';\n $response->formatted_search_str = '';\n $response->additional_join_tables = FALSE;\n $search_join_headers_table = FALSE;\n $search_join_partlist_table = FALSE;\n $filter_join_headers_table = FALSE;\n\n /*\n * Search string management \n */\n if (strlen($search_str) > 0) {\n\n $exploded_search_str = explode(\" \", $search_str);\n $current_index = 0;\n\n while ($exploded_search_str) {\n\n $current_item = (array_key_exists($current_index, $exploded_search_str) ? $exploded_search_str[$current_index] : FALSE);\n\n // search for operators\n if (strtoupper($current_item) != 'OR') {\n\n // search term could contain multiple words, try to match them\n $search_term_offset = $current_index + (strtoupper($current_item) == 'HEADER' ? 2 : 1);\n\n $search_term = trim($exploded_search_str[$search_term_offset]);\n\n // remove item from list\n unset($exploded_search_str[$search_term_offset]);\n\n // search term begins with double quotes?\n if (substr($search_term, 0, 1) == '\"') {\n\n // remove leading double quotes (multi words search term)\n $search_term = ltrim($search_term, '\"');\n\n $exploded_search_str = array_values($exploded_search_str);\n $exploded_search_str_length = count($exploded_search_str);\n\n for ($search_term_offset = $search_term_offset++; $search_term_offset < $exploded_search_str_length; $search_term_offset++) {\n\n $next_item = trim($exploded_search_str[$search_term_offset]);\n\n // remove item from list\n unset($exploded_search_str[$search_term_offset]);\n\n // item ends with double quotes?\n if (substr($next_item, -1) == '\"') {\n // ok - last element\n $search_term .= \" \" . substr($next_item, 0, -1);\n break;\n } else {\n $search_term .= \" \" . $next_item;\n }\n }\n }\n\n if (strtoupper($current_item) == 'HEADER') {\n\n // 3 items - eg. HEADER FROM 123456\n $header_name = strtolower($exploded_search_str[($current_index + 1)]);\n $header_id = $this->get_header_id_by_header_name($header_name);\n\n unset($exploded_search_str[$current_index]);\n unset($exploded_search_str[($current_index + 1)]);\n\n $search_join_headers_table = TRUE;\n\n $formatted_search[] = \" \"\n . \" ( \"\n . \" search_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND search_dbmail_headervalue.headervalue LIKE '%{$this->dbmail->escape($search_term)}%' \"\n . \" ) \";\n } elseif (strtoupper($current_item) == 'BODY') {\n // 2 items - eg. BODY 123456\n\n $search_join_partlist_table = TRUE;\n\n $formatted_search[] = \" \"\n . \" ( \"\n . \" search_dbmail_partlists.is_header = 0 \"\n . \" AND search_dbmail_mimeparts.data LIKE '%{$this->dbmail->escape($search_term)}%' \"\n . \" ) \";\n \n unset($exploded_search_str[$current_index]);\n } elseif (strtoupper($current_item) == 'TEXT') {\n // 2 items - eg. TEXT 123456\n\n $search_join_partlist_table = TRUE;\n\n $formatted_search[] = \" \"\n . \" ( \"\n . \" search_dbmail_partlists.is_header = 0 \"\n . \" AND search_dbmail_mimeparts.data LIKE '%{$this->dbmail->escape($search_term)}%' \"\n . \" ) \";\n\n unset($exploded_search_str[$current_index]);\n } else {\n // unsupported operand - break!\n return FALSE;\n }\n\n if (array_key_exists(($current_index - 1), $exploded_search_str)) {\n // remove leading operator (if found)\n unset($exploded_search_str[($current_index - 1)]);\n }\n\n // restart fetch on updated $exploded_search_str array\n $exploded_search_str = array_values($exploded_search_str);\n $current_index = 0;\n continue;\n } else {\n // operator - skip to next item\n $current_index++;\n continue;\n }\n }\n }\n\n // implode formatted_search array\n if (count($formatted_search) > 0) {\n $response->formatted_search_str = \" ( \" . implode(' OR ', $formatted_search) . \" ) \";\n }\n\n /*\n * Filters management\n */\n if (strlen($filter_str) > 0) {\n switch ($filter_str) {\n case 'ALL':\n // DO NOTHING!!!!\n break;\n case 'UNSEEN':\n\n $formatted_filter[] = \" dbmail_messages.seen_flag = 0 \";\n\n break;\n case 'FLAGGED':\n\n $formatted_filter[] = \" dbmail_messages.flagged_flag = 1 \";\n\n break;\n case 'UNANSWERED':\n\n $formatted_filter[] = \" dbmail_messages.answered_flag = 0 \";\n\n break;\n case 'DELETED':\n\n $formatted_filter[] = \" dbmail_messages.deleted_flag = 1 \";\n\n break;\n case 'UNDELETED':\n\n $formatted_filter[] = \" dbmail_messages.deleted_flag = 0 \";\n\n break;\n case 'OR OR OR HEADER Content-Type application/ HEADER Content-Type multipart/m HEADER Content-Type multipart/signed HEADER Content-Type multipart/report':\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('content-type');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND \"\n . \" ( \"\n . \" filter_dbmail_headervalue.headervalue LIKE 'application/%' \"\n . \" OR filter_dbmail_headervalue.headervalue LIKE 'multipart/%' \"\n . \" ) \"\n . \" ) \";\n\n break;\n case 'HEADER X-PRIORITY 1':\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('x-priority');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND filter_dbmail_headervalue.headervalue = 1 \"\n . \" ) \";\n\n break;\n case 'HEADER X-PRIORITY 2':\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('x-priority');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND filter_dbmail_headervalue.headervalue = 2 \"\n . \" ) \";\n\n break;\n case 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5':\n\n // normal priority\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('x-priority');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND filter_dbmail_headervalue.headervalue = 3 \"\n . \" ) \";\n\n break;\n case 'HEADER X-PRIORITY 4':\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('x-priority');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND filter_dbmail_headervalue.headervalue = 4 \"\n . \" ) \";\n\n break;\n case 'HEADER X-PRIORITY 5':\n\n $filter_join_headers_table = TRUE;\n\n $header_id = $this->get_header_id_by_header_name('x-priority');\n\n $formatted_filter[] = \" \"\n . \" ( \"\n . \" filter_dbmail_header.headername_id = '{$this->dbmail->escape($header_id)}' \"\n . \" AND filter_dbmail_headervalue.headervalue = 5 \"\n . \" ) \";\n\n break;\n default:\n // unsupported filter - EXIT!\n return FALSE;\n }\n }\n\n // implode formatted_filter array\n if (count($formatted_filter) > 0) {\n $response->formatted_filter_str = \" ( \" . implode(' AND ', $formatted_filter) . \" ) \";\n }\n\n // set additional joins needed\n if ($search_join_headers_table) {\n $response->additional_join_tables .= \" \"\n . \" INNER JOIN dbmail_header AS search_dbmail_header ON dbmail_physmessage.id = search_dbmail_header.physmessage_id \"\n . \" INNER JOIN dbmail_headervalue AS search_dbmail_headervalue ON search_dbmail_header.headervalue_id = search_dbmail_headervalue.id \";\n }\n\n if ($search_join_partlist_table) {\n $response->additional_join_tables .= \" \"\n . \" INNER JOIN dbmail_partlists AS search_dbmail_partlists ON dbmail_physmessage.id = search_dbmail_partlists.physmessage_id AND search_dbmail_partlists.is_header = 0 \"\n . \" INNER JOIN dbmail_mimeparts AS search_dbmail_mimeparts ON search_dbmail_partlists.part_id = search_dbmail_mimeparts.id \";\n }\n\n if ($filter_join_headers_table) {\n $response->additional_join_tables .= \" \"\n . \" INNER JOIN dbmail_header AS filter_dbmail_header ON dbmail_physmessage.id = filter_dbmail_header.physmessage_id \"\n . \" INNER JOIN dbmail_headervalue AS filter_dbmail_headervalue ON filter_dbmail_header.headervalue_id = filter_dbmail_headervalue.id \";\n }\n\n return $response;\n }", "private function parse_query( $query ) {\n\n\t\treturn json_decode( json_encode( $query ) );\n\n\t}", "protected function parseSearchParameters($unParsed)\n {\n // Strip params that come with the request string\n $unParsed = trim($unParsed, '()');\n // Now we have an array of \"key:value\" strings.\n $splitFields = explode(',', $unParsed);\n $mapped = [];\n // Split the strings at their colon, set left to key, and right to value.\n foreach ($splitFields as $field) {\n $splitField = explode(':', $field);\n $mapped[$splitField[0]] = $splitField[1];\n }\n\n return $mapped;\n }", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "static function getParams(){\n\t\t\tif (count(self::$query)>0){\n\t\t\t\t//comprovar si és parell\n\t\t\t\tif((count(self::$query)%2)==0){\n\t\t\t\t\tCoder::codear(self::$query);\n\t\t\t\t\treturn self::$query;\n\n\t\t\t\t}else{\n\t\t\t\t\techo 'ERROR in params array';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "function getParams()\n{\n $queryParams = array();\n $params = filter_input_array(INPUT_GET);\n if ($params) {\n foreach (array('page', 'pageSize', 'orderBy', 'fields', 'searchId') as $term) {\n if (filter_input(INPUT_GET, $term)) {\n $queryParams[$term] = filter_input(INPUT_GET, $term);\n unset($params[$term]);\n }\n }\n \n $queryParams['filter'] = http_build_query($params, null, ':');\n }\n \n return $queryParams;\n}", "function serverStringToArray($str, &$array, &$frontParam)\n{\n // init param\n $array = array();\n $fronParam = \"\";\n\n // split front param, e.g. /index.php, and others, e.g. blogid=1&page=2\n if (strstr($str, \"?\")){\n list($frontParam, $args) = preg_split(\"/\\?/\", $str, 2);\n }\n else {\n $args = $str;\n $frontParam = \"\";\n }\n\n // If there is no args like blogid=1&page=2, return\n if (!strstr($str, \"=\") && !strlen($frontParam)) {\n $frontParam = $str;\n return;\n }\n\n $array = explode(\"&\", $args);\n}", "public function getParams() {\n\n parse_str($this->params, $return);\n return $return;\n }", "protected function parseTokenizedQuery($query)\n {\n $tokenizedParams =\n $untokenizedParams = array();\n\n // Test to see if there are tokens in the query and if so, extract and append them to the end of the tracked link\n if (preg_match('/(\\{\\S+?\\})/', $query)) {\n // Equal signs in tokens will confuse parse_str so they need to be encoded\n $query = preg_replace('/\\{(\\S+?)=(\\S+?)\\}/', '{$1%3D$2}', $query);\n\n parse_str($query, $queryParts);\n\n if (is_array($queryParts)) {\n foreach ($queryParts as $key => $value) {\n if (preg_match('/(\\{\\S+?\\})/', $key) || preg_match('/(\\{\\S+?\\})/', $value)) {\n $tokenizedParams[$key] = $value;\n } else {\n $untokenizedParams[$key] = $value;\n }\n }\n }\n }\n\n return array($tokenizedParams, $untokenizedParams);\n }", "private function setQueryStrings()\n {\n $params = explode('?', $this->url);\n $queries = array();\n\n if (count($params) > 1) {\n $params = end($params);\n $relations = explode('&', $params);\n\n $queries = array();\n\n foreach ($relations as $relation) {\n $camps = explode('=', $relation);\n $queries[ $camps[0] ] = $camps[1];\n }\n }\n\n $this->querystrings = $queries;\n }", "function interpolateQuery($query, $params) {\n\t\t $keys = array();\n\t\t # build a regular expression for each parameter\n\t\t foreach ($params as $key => $value) {\n\t\t if (is_string($key)) {\n\t\t $keys[] = '/:'.$key.'/';\n\t\t } else {\n\t\t $keys[] = '/[?]/';\n\t\t }\n\t\t }\n\t\t $query = preg_replace($keys, $params, $query, 1, $count);\n\t\t return $query;\n\t\t}", "private function processQueryParameters(): void\n {\n // Check if a collection alias was defined\n $matches = [];\n preg_match_all('~(IN @\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $matches = array_pop($matches);\n\n if (count($matches)) {\n // Stores if found.\n $collection = [];\n $match = array_pop($matches);\n preg_match_all('~(@\\w+)~', $match, $collection, PREG_PATTERN_ORDER);\n $occurrence = array_shift($collection);\n $this->collectionAlias = array_pop($occurrence);\n }\n\n $matches = [];\n preg_match_all('~(@\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $this->queryParameters = array_pop($matches);\n }", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "abstract protected function queryString(): string;", "function getInputParams()\n {\n $params = array();\n parse_str( $this->getInput() , $params );\n return $params;\n }", "function process_str_vars($params = array())\n\t{\n\t\tglobal $HTTP_POST_VARS, $HTTP_GET_VARS;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (!empty($HTTP_POST_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_POST_VARS[$param])));\n\t\t\t}\n\t\t\telse if (!empty($HTTP_GET_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_GET_VARS[$param])));\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "function PKG_listParams($paramStr)\n{\n\t$params = explodeAssoc(\"?#*\",$paramStr);\n\n\t$out = \"\";\n\n\t$keys = array_keys($params);\n\n\tfor ($i=0; $i < count($keys); $i++)\n\t\tif ((strlen($keys[$i]) > 0) && (strlen($params[$keys[$i]]) > 0))\n\t\t$out.=wordwrap($keys[$i].\": \".$params[$keys[$i]].\"<br>\",60);\n\n\treturn($out);\n}", "public final function parse($param_str) {\n $params = explode(\",\", $param_str);\n foreach ($params as $param_item) {\n $param_kv = explode(\"=\", $param_item);\n $param_key = trim($param_kv[0]);\n $param_value = trim($param_kv[1]);\n if ('\"' === substr($param_key, 0, 1) && '\"' === substr($param_key, -1, 1)) {\n $param_key = substr($param_key, 1, strlen($param_key) - 2);\n }\n if ('\"' === substr($param_value, 0, 1) && '\"' === substr($param_value, -1, 1)) {\n // This param_value is a string type, which could be set directly\n if (property_exists($this, $param_key)) {\n $this->$param_key = substr($param_value, 1, strlen($param_value) - 2);\n } else {\n // @TODO support special variables like from `@use`\n }\n }\n }\n }", "public static function fetchParams($string, $split = '|', $pairSplit = ':')\r\n {\r\n $params = array();\r\n if (!empty($string))\r\n {\r\n $tmp = explode($split, $string);\r\n foreach ($tmp as $value)\r\n {\r\n $split = explode($pairSplit, $value);\r\n $params[$split[0]] = $split[1];\r\n }\r\n }\r\n return $params;\r\n }", "public function getQueryParams() {}", "private function getQueryString() : string\n {\n return http_build_query($this->parameters);\n }", "public function getQuery() {\n\t\t$queries = $_SERVER['QUERY_STRING'];\n\t\t$queries = explode('&', $queries);\n\t\t$ret = array();\n\t\tforeach($queries as $q) {\n\t\t\t$q_exp = explode('=', $q);\n\t\t\t$ret[$q_exp[0]] = isset($q_exp[1]) ? $q_exp[1] : null;\n\t\t}\n\t\treturn $ret;\n\t}", "function readAPIparams($required_str, $optional_str = '', $div = ',') {\n $required_arr = explode($div, $required_str);\n $not_found_arr = [];\n foreach($required_arr as $name) {\n if (!isset($_REQUEST[$name])) {\n $not_found_arr[] = $name;\n }\n }\n if (count($not_found_arr)) {\n return $not_found_arr;\n }\n foreach(array_merge($required_arr, explode($div, $optional_str)) as $name) {\n $GLOBALS['api_req'][$name] = isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;\n }\n return [];\n}", "private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n\n return $querystring;\n }\n }", "protected function buildHttpQuery( $aParams ) {\n\t\t// than urlencoding all the parts ourselves in a loop\n\t\t$sQueryString = http_build_query( $aParams, null, $this->_queryStringDelimiter );\n\n\t\t// because http_build_query treats arrays differently than we want to, correct the query\n\t\t// string by changing foo[#]=bar (# being an actual number) parameter strings to just\n\t\t// multiple foo=bar strings. This regex should always work since '=' will be urlencoded\n\t\t// anywhere else the regex isn't expecting it\n\t\t$sQueryString = preg_replace( '/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $sQueryString );\n\n\t\treturn $this->_queryDelimiter.$sQueryString;\n\t}", "public function getQueryParams() {\n if ($pos = strpos ( $this->url, '?' )) {\n $queryStr = substr ( $this->url, $pos + 1 );\n $params = array ();\n parse_str ( $queryStr, $params );\n return $params;\n }\n return array ();\n }", "protected function parseParams ($ary) {\n $str = '';\n foreach($ary as $val) {\n $str.= $this->getTab() . \"@param \" . $val . $this->getNL();\n }\n return $str;\n }", "function StrToArray($Qstr)\r\n\t{\r\n\t$finalArr=array();\r\n\t\t\r\n\t\t$qryArr=split(\"&\",$Qstr);\r\n\t\t\r\n\t\t\tif(!empty($Qstr))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\tforeach($qryArr as $item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Qarr=split(\"=\",$item);\r\n\t\t\t\t\tif(count($Qarr)==2)\r\n\t\t\t\t\t$finalArr[$Qarr[0]]=$Qarr[1];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $finalArr;\r\n\t\t\t}\r\n\t}", "function urlQueryToArray($url) {\n $params = array();\n $query = explode('&', parse_url($url, PHP_URL_QUERY));\n foreach($query as $tok) {\n list($var, $val) = explode('=', $tok);\n $params[$var] = urldecode($val);\n }\n return $params;\n }", "private function detectQueryParams()\n {\n $uri = new Uri('http://example.org'.$this->getRequestTarget());\n parse_str($uri->getQuery(), $params);\n return array_merge($_GET, $params);\n }", "function getParams($input)\n {\n $filterParams = [];\n foreach($input as $param => $value)\n {\n $filterParams[] = \"$param=:$param\";\n }\n return implode(\", \", $filterParams);\n }" ]
[ "0.7255325", "0.7105226", "0.6935991", "0.6826799", "0.65007764", "0.64642876", "0.6438787", "0.6360737", "0.63376856", "0.6293293", "0.62723595", "0.6203748", "0.6183269", "0.6178459", "0.6175572", "0.61610895", "0.6090867", "0.60734004", "0.6036056", "0.6019035", "0.6015328", "0.5975224", "0.59742886", "0.5959085", "0.59468883", "0.59389967", "0.59233284", "0.5897551", "0.5877456", "0.58741313", "0.5828398", "0.58261293", "0.5788633", "0.57748675", "0.576751", "0.5744456", "0.574358", "0.57310075", "0.5728693", "0.5725761", "0.5722009", "0.5718105", "0.571487", "0.5701059", "0.56676066", "0.5655316", "0.56441516", "0.5640482", "0.5636459", "0.5618939", "0.5616776", "0.5612103", "0.55834615", "0.5578234", "0.5575016", "0.55731744", "0.5557063", "0.5541751", "0.55358344", "0.5531478", "0.55288315", "0.55215424", "0.5517422", "0.5510862", "0.5503293", "0.55029684", "0.55006266", "0.5496848", "0.54957217", "0.54938465", "0.5486819", "0.5484353", "0.5476483", "0.54764163", "0.5467545", "0.54648674", "0.54546326", "0.54435927", "0.5428097", "0.5416931", "0.54114544", "0.5410969", "0.54095227", "0.5394658", "0.5386873", "0.5385431", "0.53763443", "0.5371422", "0.5364311", "0.5353372", "0.53533113", "0.53502434", "0.5350002", "0.5346533", "0.5322828", "0.5322306", "0.5321101", "0.53198946", "0.53194886", "0.5316806", "0.53141576" ]
0.0
-1
Here $respData is in form of OBJECTID and OBJECTTYPE only
function OBJM_DeleteObject($respdata) { //PARSE THE STRING AND FORM A QUERY PARAMS parse_str($respdata) ; $objectTypeVal = strtoupper($OBJECTTYPE); $objectIDVal = strtoupper($OBJECTID); $respdata = 'FAIL'; if($objectTypeVal == "PAGE") return false; //GET THE TARGET OBJECT ID TO BE DELETED $TMObjectID = "TM_".$objectIDVal; $DIVObjectID = "DIV_".$objectIDVal; //Before that check if the item is already referred somewhere in which case delete that first //get the list of nodes with tag as div $tag = "li"; //later it can be li as well while using JQX $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); $nodelist = $_SESSION['sceneCompXMLDOM']->getElementsByTagName($tag); $arrTodelete = array(); $arrIndex=0; if($objectTypeVal == "LAYER") { for($i = 0; $i < $nodelist->length; $i++) { //get the node $currNode = $nodelist->item($i); //check if the nodes' type is that of Layer type $type = $currNode->getAttribute("type"); if($type == "LAYER") { /// then check if the node has data-srcid same as that of the target $srcid = $currNode->getAttribute("data-srcid"); if($srcid == $TMObjectID) { //then get the ID of the node and call for deletion $nodeID = $currNode->getAttribute("id"); $arrTodelete[$arrIndex++] = $nodeID; } } } //now delete the copied nodes from the stored IDs in the array foreach ($arrTodelete as $index => $arrValue) { $ID = $arrValue; $retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $ID, true, "type", $objectTypeVal); if($retval != true) return $retval; } } //DELETE IT FROM SC SML DATA $retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $TMObjectID, true, "type", $objectTypeVal); if($retval != true) return $retval; //CALL APPROPRIATE OBJECT SPECIFIC FUNCTION TO DELETE IT FROM HTML DOM if(!isset($_SESSION['projHTMLDOM'])) return false; if(!isset($_SESSION['projHTMLFilename'])) return false; if($objectTypeVal == 'HTMLOBJECT') { $retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $DIVObjectID); $respdata = 'OK'; } else if($objectTypeVal == 'SOURCE') { $retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $objectIDVal); $respdata = 'OK'; } return $retval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponseData();", "abstract protected function getReponseData() ;", "public function getData()\n {\n return (object) $this->_response;\n }", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "function OBJM_AddNewObject(&$respData)\r\n{\r\n\t parse_str($respData) ;\t \r\n\t\r\n\t//DEPENDING ON OBJECT TYPE CALL THE APPROPRIATE FUNCTION \r\n\t$objectTypeVal = strtoupper($OBJECTTYPE);\r\n\t$objectIDVal = strtoupper($OBJECTID);\r\n\t$parentIDVal = strtoupper($REFID);\r\n\t$dataID\t\t = $objectIDVal; //WILL BE USED TO STORE UNIQIE ID IN HTML DATA PROVIDED FROM THE CLIENT END\r\n\t$nodeTitle\t = $TITLE;\r\n\t$dataType\t = $DATATYPE; \r\n\t$TMObjID \t = \"TM_\".$objectIDVal;\r\n\t$DIVparentID = \"DIV_\".$parentIDVal; \t\r\n\t \r\n\t$htmlCode = \"\"; \r\n\t$respData = \"\"; \r\n\tswitch ($objectTypeVal){\r\n\t\t\r\n\t\tcase \"SCENE\":\t\t\t\r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID, $objectTypeVal, \"treemenu\", \"2\",$nodeTitle, $parentIDVal,$dataID, $dataType, 'original');\t\t\r\n\t\t\tif($retval != true)\r\n\t\t\t{\t\r\n\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\treturn $retval;\r\n\t\t\t} \t\r\n\t\t\t$respData = $retval; \t\t\t\r\n\t\t\tbreak; \r\n\t\t\r\n\t\tcase \"LAYER\":\r\n\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal; \r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"3\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\tif($retval != true)\r\n\t\t\t{\t\r\n\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\treturn $retval;\r\n\t\t\t} \t\r\n\t\t\t$respData = $retval;\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase \"HTMLOBJECT\":\r\n\t\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal;\r\n\t\t\t\t\r\n\t\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"4\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\t\tif($retval != true)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t$respData = $retval;\r\n\t\t\t\t$layerID = $parentIDVal;\r\n\t\t\t\t//add the div element container now all objects under one container\r\n\t\t\t\t$retval = HTML_AddNewObject($dataType,$dataID, $nodeTitle,$layerID, \"DIV_DATA_CONTAINER\", $htmlCode);\r\n\t\t\t\tif($retval != true)\r\n\t\t\t\t{\r\n\t\t\t\t\t$respData = \"FAIL\";\r\n\t\t\t\t\treturn $retval;\r\n\t\t\t\t}\r\n\t\t\t\t$respData = $respData . \"#\" . $htmlCode;\r\n\t\t\t\tbreak;\r\n\t\tcase \"SOURCE\":\r\n\t\t\t$TMparentIDVal = \"TM_\".$parentIDVal;\t\t\t\r\n\t\t\t$retval = OBJM_AddNewObjectToSCXML($TMObjID,$objectTypeVal,\"treemenu\",\"5\", $nodeTitle, $TMparentIDVal, $dataID, $dataType, 'original');\r\n\t\t\tif($retval != true)\r\n\t\t\t\treturn false;\r\n\t\t\t$respData = $retval; \r\n\t\tdefault:\r\n\t\t\tbreak; \r\n\t}\r\n\t//ADD THE OBJECT ON THE PAGE SC XML DATA \r\n\t\r\n\t\r\n\treturn true;\r\n\t\r\n\t//NOW GET THE XML CODE OF THE SAME \r\n\t\r\n\t//RETURN XML CODE BACK AS RESPONSE \r\n\t \r\n\treturn true; \r\n}", "public function get_response_object()\n {\n }", "public function parseResponse($response_object){\n $retval = null;\n if (is_object($response_object)) {\n if (!empty($response_object->data)){\n $temp_array = drupal_json_decode($response_object->data);\n $retval = (object)$temp_array;\n }\n }\n return $retval;\n }", "private function _prepareReturnData($data) {\n $o = new Agana_Model_Object($data);\n $o->setId($data['objid']);\n $o->setTableName($data['tablename']);\n return $o;\n }", "public function testFromOkResponse() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(Response::fromQueriedRecords(null, $bob));\n foreach ($result as $object) {\n $this->assertInstanceOf(SalesforceObject::class, $object);\n }\n\n $first = $result->first();\n $this->assertInstanceOf(SalesforceObject::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }", "protected final function parse_model_response($data = NULL) {\n \t$parsed = false;\n\t\tswitch ($this->request_method) {\n\t\t\tcase 'read':\n\t\t\t\t$parsed = $this->parse_model_response_read($data);\t\t\t\t\t\n\t\t\tbreak;\t\t\t\t\n\t\t\tcase 'create':\t\n\t\t\t\t$parsed = $this->parse_model_response_create($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\t$parsed = $this->parse_model_response_update($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$parsed = $this->parse_model_response_delete($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif($parsed === false) {\n\t\t\t$this->set_error( 355, 'No response was parsed' );\n\t\t\treturn;\t\n\t\t}\n\t\t\n\t\t$this->parsed_model_response = $parsed;\n }", "public function parse_multiple_response($resp, $data)\n {\n if ($resp['data']==null)\n {\n return ['error'=>404, 'message'=>'Data from youtube not found'];\n }\n else\n {\n $resp['data']->attribute=$data;\n return ['error'=>0, 'data'=>$resp['data']];\n }\n }", "public function processResponseData($rawResponseData);", "abstract public function prepare_response( $object, $context );", "public function populate(stdClass $response);", "function cleanresponse_resource_infos($resourceinfos_response){\n\n $treated_object=new stdClass();\n\n $resourcegengen_infos= clean_object_forX5GON($resourceinfos_response, 'moduleinfos');\n $treated_object=$resourcegengen_infos;\n\n if( property_exists($resourceinfos_response,'course_module_instance') ){\n $resourceinstance_infos= clean_object_forX5GON($resourceinfos_response->course_module_instance, 'moduleinstanceinfos');\n $treated_object->course_module_instance=$resourceinstance_infos;\n }\n\n if( property_exists($resourceinfos_response,'course_module_file') ){\n $resourcefile_infos= clean_object_forX5GON($resourceinfos_response->course_module_file, 'fileinfos');\n $treated_object->course_module_file=$resourcefile_infos;\n }\n if( property_exists($resourceinfos_response,'course_module_file_licence') ){\n $resourcelicence_infos= clean_object_forX5GON($resourceinfos_response->course_module_file_licence, 'licenceinfos');\n $treated_object->course_module_file_licence=$resourcelicence_infos;\n }\n if( property_exists($resourceinfos_response,'course_gen_infos') ){\n $resourcecourse_infos= clean_object_forX5GON($resourceinfos_response->course_gen_infos, 'courseinfos');\n $treated_object->course_gen_infos=$resourcecourse_infos;\n }\n\n if( property_exists($resourceinfos_response,'course_cat_infos') ){\n $resourcecategory_infos= clean_object_forX5GON($resourceinfos_response->course_cat_infos, 'categoryinfos');\n $treated_object->course_cat_infos=$resourcecategory_infos;\n }\n //For return status feedback\n if( property_exists($resourceinfos_response,'response_notice') ){\n $treated_object->response_notice=$resourceinfos_response->response_notice;\n //This is to be sure to not render anyinfos if it's not permitted\n if($resourceinfos_response->response_notice==\"No permitted informations to be rendered. Check with admin.\"){\n $treated_object=new stdClass();\n $treated_object->response_notice=$resourceinfos_response->response_notice;\n }\n }\n\n return $treated_object;\n\n }", "protected function asObject()\n\t{\n\t\treturn \\json_decode($this->response);\n\t}", "function api_create_response($payload, $status, $message) {\n if (is_numeric($payload)) {\n\n if ($payload == 1)\n $payload = array();\n elseif ($payload == 2)\n $payload = new \\stdClass();\n }\n\n $response_array = array('payload' => $payload, 'status' => $status, 'message' => $message);\n return $response_array;\n}", "private function response($data) {\n\t\treturn json_decode($data);\n\t}", "protected function load_objtype_list()\n {\n header('Content-type: application/json');\n\n $l_dao = $_GET['dao'];\n\n if (class_exists($l_dao))\n {\n return isys_factory::get_instance($l_dao, $this->m_database_component)\n ->set_object_type((int) $_GET['object_type'])\n ->get_list_data((int) $_POST['offset_block']);\n } // if\n\n return '';\n }", "function parse($data) {\n global $USER;\n if (!is_object($data)) {\n return false;\n }\n // An id may not always exists, like if this is a new ticket.\n if (isset($data->id)) {\n $this->id = $data->id;\n }\n $this->detail = $data->detail;\n $this->summary = $data->summary;\n if (empty($data->userid)) {\n $this->userid = $USER->id;\n } else {\n $this->userid = $data->userid;\n }\n if (isset($data->timecreated)) {\n $this->timecreated = $data->timecreated;\n } else {\n $this->timecreated = time();\n }\n if (isset($data->timemodified)) {\n $this->timemodified = $data->timemodified;\n } else {\n $this->timemodified = time(); \n }\n return true;\n\n }", "private function _loadResponse()\n {\n $sroObjects = Mage::getModel('pedroteixeira_correios/sro_object_collection');\n $trackList = $this->getRequestCollection();\n $response = $this->getResponse();\n \n if (isset($response->return) && $response->return->qtd > 0) {\n foreach ((array)$response->return->objeto as $obj) {\n $track = $trackList->getItemByColumnValue('number', $obj->numero);\n if ($track) {\n $item = Mage::getModel('pedroteixeira_correios/sro_object');\n $item->setTrack($track)\n ->setInfo($obj);\n $sroObjects->addItem($item);\n } else {\n Mage::log(\"Cant locate track for {$obj->numero}\");\n }\n }\n }\n \n $this->setLog(\"{$sroObjects->count()} identified of {$this->getLog()}\");\n \n return $this->setResponseCollection($sroObjects);\n }", "public function create(): array\n {\n $url = sprintf(\n '%s%s/sobjects/%s/',\n static::getApiPrefix(),\n config('salesforce.api_version'),\n static::$objectApiName\n );\n $record = $this->encode($this->raw());\n $response = self::guzzleRequest('post', $url, [\n 'json' => $record,\n ]);\n if ($response['success']) {\n $this->Id = $response['id'];\n }\n return $response;\n }", "abstract function parse_api_response();", "public function getResponseClass();", "public static function addNewResponse($objResponse) {\n $response = array();\n try{\n //'contentType', 'content', 'size', 'designerId'\n $sharcResponse = SharcResponse::create(array(\n 'id' => $objResponse['id'],\n 'experienceId' => $objResponse['experienceId'],\n 'userId' => $objResponse['userId'], \n 'contentType' => $objResponse['contentType'], \n 'content' => $objResponse['content'],\n 'description' => $objResponse['description'],\n 'entityType' => $objResponse['entityType'], \n 'entityId' => $objResponse['entityId'],\n 'status' => $objResponse['status'],\n 'size' => $objResponse['size'],\n 'submittedDate' => $objResponse['submittedDate'],\n 'fileId' => $objResponse['fileId']\n ));\n \n $experience = SharcExperience::find($sharcResponse->experienceId);\n $status = \"\";\n if($experience != null){//change status of response based on moderation mode\n switch($experience->moderationMode){\n case 0:\n $sharcResponse->status = \"accepted\";\n $status = \"accepted. Other people will be able to see your response\";\n //Create a mew POI here if response is for a new location\n if($sharcResponse->entityType == \"NEW\"){\n //Create a new POI\n $objPoi = array();\n $objPoi['id'] = 0;\n $objPoi['experienceId'] = $sharcResponse->experienceId;\n $objPoi['description'] = \"Created from a response\";\n $objPoi['typeList'] = \"\";\n $objPoi['eoiList'] = \"\";\n $objPoi['routeList'] = \"\"; \n $objPoi['poiDesigner'] = array();\n $objPoi['poiDesigner']['id'] = 0;\n $objPoi['poiDesigner']['name'] = $sharcResponse->description.\" (created by a user named $curResponse->userId)\";\n $objPoi['poiDesigner']['coordinate'] = $sharcResponse->entityId;\n $objPoi['poiDesigner']['triggerZone'] = \"circle 00ff00 20 \".$sharcResponse->entityId;\n $objPoi['poiDesigner']['designerId'] = $experience->designerId; \n $response = PoiService::addNewPoi($objPoi);\n \t//Create a media\n if($response[\"status\"] == SUCCESS){ \n $objMedia = array();\n $objMedia['id'] = 0;\n $objMedia['entityType'] = \"POI\";\n $objMedia['entityId'] = $response['data']['id'];\n $objMedia['experienceId'] = $sharcResponse->experienceId; \n $objMedia['caption'] = $sharcResponse->description; \n $objMedia['context'] = \"\";\n if($sharcResponse->contentType == \"image\")\n $objMedia['mainMedia'] = 1;\n else\n $objMedia['mainMedia'] = 0; \n $objMedia['visible'] = 1;\n $objMedia['order'] = 0; \n $objMedia['mediaDesigner'] = array();\n $objMedia['mediaDesigner']['id'] = $sharcResponse->id; \n $objMedia['mediaDesigner']['name'] = $sharcResponse->description;\n $objMedia['mediaDesigner']['contentType'] = $sharcResponse->contentType;\n $objMedia['mediaDesigner']['content'] = $sharcResponse->content;\n $objMedia['mediaDesigner']['size'] = $sharcResponse->size;\n $objMedia['mediaDesigner']['createdDate'] = $sharcResponse->submittedDate;\n $objMedia['mediaDesigner']['fileId'] = $sharcResponse->fileId;\n $objMedia['mediaDesigner']['designerId'] = $experience->designerId; \n \n $response = MediaService::addNewMedia($objMedia);\n }\n $sharcResponse->status = \"Made a new POI\";\n }\n break;\n case 1:\n $sharcResponse->status = \"waiting\";\n $status = \"submitted and is waiting for moderation. We will notify you the outcome once the moderator has made a decision\";\n break;\n case 2:\n $sharcResponse->status = \"private\";\n $status = \"submitted successfully. However only you can see this response via our SPVT tool because the designer of this experience has chosen not to show responses in their experience\";\n break; \n }\n }\n \n $result = $sharcResponse->save();\n \n if ($result){ //= 1 success\n $response[\"status\"] = SUCCESS;\n $response[\"data\"] = $sharcResponse->toArray();\n $proName\t= $experience->name;\n \n //Get consumer info\n $user = SharcUser::find($sharcResponse->userId);\n $conEmail\t= $user->email;\n $conName\t= $user->username;\n \n //Sending email to designer if moderate is needed\n $subject = \"A new response from SMEP\";\n if($experience->moderationMode == 1){\n $user = SharcUser::find($experience->designerId); \n $authEmail \t\t= $user->email; \n $authName \t\t= $user->username; \n $msg = \"Dear $authName \\n\\nA response has been submitted to your $proName experience by $conName. Please sign into SLAT to moderate the response. Once you have logged in, please go to menu Response -> Moderate new responses \\n\\nPlease do not reply to this automatic email. You can contact us at [email protected].\\n\\nThank you.\\n\\nThe SHARC project team.\";\n $headers = \"From: SHARC-Authoring-Tool\" . \"\\r\\n\" . \"CC: [email protected]\";\n // use wordwrap() if lines are longer than 70 characters //$msg = wordwrap($msg,70);\n mail($authEmail,$subject,$msg,$headers);\t\t\n }\n \n $msg = \"Dear $conName \\n\\nYour response to the $proName experience has been $status.\\n\\nPlease do not reply to this automatic email. You can contact us at [email protected].\\n\\nThank you.\\n\\nThe SHARC project team.\";\n $headers = \"From: SMET\" . \"\\r\\n\" . \"CC: [email protected]\";\n mail($conEmail,$subject,$msg,$headers);\n } \n else { //error\n $response[\"status\"] = ERROR;\n $response[\"data\"] = INTERNAL_SERVER_ERROR; \n } \n }\n catch(Exception $e) {\n $response[\"status\"] = ERROR;\n $response[\"data\"] = Utils::getExceptionMessage($e);\n } \n return $response; \n }", "function getResponseData( $response ) {\n\t\t\n\t\tif ( is_array( $response ) && !empty( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\t}", "public function getResponseObject()\n {\n return $this->response_object;\n }", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "function parseUserInfo($response){\n\t$userinfo = json_decode($response);\n\tif (is_object($userinfo) && property_exists($userinfo,'id')){\n\t\treturn $userinfo;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "public static function parseApiList($data, $object_type)\n {\n //print_r($data); die;\n $schema = fn_get_schema('api', $object_type, 'php', false);\n //$parsed = Twigmo::parseDocument($data, $format);\n\n if (empty($schema)) {\n return false;\n }\n\n if (isset($data[$schema['object_name']])) {\n $sc_data = ApiData::getObjects($data[$schema['object_name']]);\n } else {\n $sc_data = ApiData::getObjects($data);\n }\n\n $objects = array();\n\n foreach ($sc_data as $k => $v) {\n $objects[] = self::convertFromSchema($schema, $v);\n }\n\n return $objects;\n }", "function parse_response($raw_data, $data_type) {\r\n if ($data_type == 'json') {\r\n $parsed_data = json_decode($raw_data);\r\n }\r\n else if ($data_type == 'xml') {\r\n $namespace_pattern = '/([<\\/\\s])[a-z]+\\:/';\r\n $clean_data = preg_replace($namespace_pattern, '\\1', $raw_data);\r\n if ($clean_data[0] == '<') {\r\n $parsed_data = simplexml_load_string($clean_data);\r\n }\r\n else {\r\n $parsed_data = false;\r\n }\r\n }\r\n return $parsed_data;\r\n }", "public function interpretResponse($resparr) {\n\t\t//validate\n\t\tif(count($resparr) < 1 || !is_array($resparr)) {\n\t\t\tthrow new Tivoka_Exception('Expected batch response, but none was received', Tivoka::ERR_INVALID_RESPONSE);\n\t\t}\n\t\n\t\t$requests = $this->id;\n\t\t$nullresps = array();\n\t\t$responses = array();\n\t\n\t\t//split..\n\t\tforeach($resparr as $resp)\n\t\t{\n\t\t\tif(!is_array($resp)) throw new Tivoka_Exception('Expected batch response, but no array was received', Tivoka::ERR_INVALID_RESPONSE);\n\t\t\t\t\n\t\t\t//is jsonrpc protocol?\n\t\t\tif(!isset($resp['jsonrpc']) && !isset($resp['id'])) throw new Tivoka_Exception('The received reponse doesn\\'t implement the JSON-RPC prototcol.', Tivoka::ERR_INVALID_RESPONSE);\n\t\t\t\t\n\t\t\t//responds to an existing request?\n\t\t\tif(!array_key_exists($resp['id'], $requests))\n\t\t\t{\n\t\t\t\tif($resp['id'] != null) continue;\n\t\n\t\t\t\t$nullresps[] = $resp;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//normal response...\n\t\t\t$requests[ $resp['id'] ]->setResponse(json_encode($resp));\n\t\t\tunset($requests[ $resp['id'] ]);\n\t\t}\n\t\n\t\t//handle id:null responses...\n\t\tforeach($requests as $req)\n\t\t{\n\t\t\t$resp = array_shift($nullresps);\n\t\t\t$requests[ $req->id ]->setResponse(json_encode($resp));\n\t\t}\n\t}", "public function prepareDataObjects($inputData) {\n\t\t\t$data = array();\n\n\t\t\t$objectsCollection = umiObjectsCollection::getInstance();\n\t\t\t$objects = array();\n\n\t\t\tforeach ($inputData as $object) {\n\t\t\t\tif(is_numeric($object)) {\n\t\t\t\t\t$object = $objectsCollection->getObject($object);\n\t\t\t\t}\n\n\t\t\t\tif($object instanceof umiObject) {\n\t\t\t\t\tif(getRequest('viewMode') == 'full') {\n\t\t\t\t\t\t$objects[] = array('full:' => $object);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$objects[] = $object;\n\t\t\t\t\t\t$objectsCollection->unloadObject($object->getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['nodes:object'] = $objects;\n\n\t\t\treturn $data;\n\t\t}", "abstract protected function to_primitive($res);", "function decodeResponse($method, $data) \n {\n return $data;\n }", "public function prepareResponse();", "function _fetch_object()\n\t{\n\t\treturn sqlsrv_fetch_object($this->result_id);\n\t}", "private static function get_data($response)\r\n {\r\n $data = $response->resultList->result;\r\n\r\n $result = array();\r\n\r\n foreach($data as $row)\r\n {\r\n $result[] = array\r\n (\r\n 'pmid' => property_exists($row, \"pmid\") ? $row->pmid : \"\",\r\n 'doi' => property_exists($row, \"doi\") ? $row->doi : \"\",\r\n 'title' => property_exists($row, \"title\") ? $row->title : \"\",\r\n 'authors' => property_exists($row, \"authorString\") ? $row->authorString : \"\",\r\n 'journal' => property_exists($row, \"journalTitle\") ? $row->journalTitle : \"\",\r\n 'issue' => property_exists($row, \"issue\") ? $row->issue : '',\r\n 'volume' => property_exists($row, \"journalVolume\") ? $row->journalVolume : \"\",\r\n 'year' => property_exists($row, \"pubYear\") ? $row->pubYear : \"\",\r\n 'pages' => property_exists($row, \"pageInfo\") ? $row->pageInfo : '',\r\n 'citedByCount' => property_exists($row, \"citedByCount\") ? $row->citedByCount : \"\",\r\n 'publicatedDate' => property_exists($row, \"firstPublicationDate\") ? \r\n date('d-m-Y', strtotime($row->firstPublicationDate)) : \"\"\r\n );\r\n }\r\n\r\n return $result;\r\n }", "private function parseResponse($data = array(), $dataKey = '') {\n if(!empty($data) && is_array($data)) {\n $res = array();\n foreach ($this->default['field_mapping'] as $key => $label) {\n //merge keys are used to prepare single json by adding non json fields in it, only for stats\n if (array_key_exists($label, $this->default['merge_keys'])) {\n $mergeArray = $this->default['merge_keys'][$label];\n foreach($mergeArray as $field) {\n if(isset($data[$field])) {\n $data[$label][$field] = $data[$field];\n }\n }\n }\n if(isset($data[$label]) && !empty($data[$label])) {\n $res[$key] = $data[$label];\n }\n }\n return $res;\n }\n return false;\n }", "protected function validate_return_data($data_obj)\r\n {\r\n // Transfer the error message when previous object execution fail\r\n if($data_obj->is_error === true)\r\n {\r\n $status_data = $data_obj->get_return_data_set();\r\n $this->set_error(\r\n $status_data[\"status\"], \r\n $status_data[\"status_information\"],\r\n $status_data[\"status_information\"]\r\n );\r\n } \r\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['uuid'])) $tmp['uuid'] = $data['uuid'];\n\t\tif(isset($data['aid'])) $tmp['aid'] = $data['aid'];\n\t\tif(isset($data['denomination'])) $tmp['denomination'] = $data['denomination'];\n\t\tif(isset($data['use_denomination'])) $tmp['use_denomination'] = $data['use_denomination'];\n\t\tif(isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif(isset($data['send_type'])) $tmp['send_type'] = $data['send_type'];\n\t\tif(isset($data['sub_send_type'])) $tmp['sub_send_type'] = $data['sub_send_type'];\n\t\tif(isset($data['consume_time'])) $tmp['consume_time'] = $data['consume_time'];\n\t\tif(isset($data['out_order_id'])) $tmp['out_order_id'] = $data['out_order_id'];\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = $data['end_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n\t\tif(isset($data['densection'])) $tmp['densection'] = $data['densection'];\n\t\tif(isset($data['description'])) $tmp['description'] = $data['description'];\n\t\tif(isset($data['third_type'])) $tmp['third_type'] = $data['third_type'];\n\t\treturn $tmp;\n\t}", "public function responseType ();", "public function prepare_response( $data ) {\n\t\tif ( ! defined( 'WP_JSON_SERIALIZE_COMPATIBLE' ) || WP_JSON_SERIALIZE_COMPATIBLE === false ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\tswitch ( gettype( $data ) ) {\n\t\t\tcase 'boolean':\n\t\t\tcase 'integer':\n\t\t\tcase 'double':\n\t\t\tcase 'string':\n\t\t\tcase 'NULL':\n\t\t\t\t// These values can be passed through\n\t\t\t\treturn $data;\n\n\t\t\tcase 'array':\n\t\t\t\t// Arrays must be mapped in case they also return objects\n\t\t\t\treturn array_map( array( $this, 'prepare_response' ), $data);\n\n\t\t\tcase 'object':\n\t\t\t\tif ( $data instanceof JsonSerializable ) {\n\t\t\t\t\t$data = $data->jsonSerialize();\n\t\t\t\t} else {\n\t\t\t\t\t$data = get_object_vars( $data );\n\t\t\t\t}\n\n\t\t\t\t// Now, pass the array (or whatever was returned from\n\t\t\t\t// jsonSerialize through.)\n\t\t\t\treturn $this->prepare_response( $data );\n\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "protected static function _rawurldecode_object($data){\n\n\t\t$result = new stdClass;\n\n\t\tforeach ($data as $key => &$value) {\n\n\t\t\tif(is_array($value) || is_object($value)){\n\n\t\t\t\t$result->{$key} = static::_rawurldecode($value);\n\n\t\t\t}else{\n\n\t\t\t\tif(!empty($value)){\n\n\t\t\t\t\t$result->{$key} = rawurldecode($value);\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$result->{$key} = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($key, $value);\n\t\t}\n\n\t\treturn (object) $result;\n\t}", "private function getResponseData()\n {\n $response = Shopware()->Front()->Response();\n\n return array(\n 'Class' => get_class($response),\n 'Raw header' => $response->getRawHeaders(),\n 'Response code' => $response->getHttpResponseCode(),\n 'Exception' => $response->getException()\n );\n }", "public function getResponseData()\n {\n if($this->getHttpStatusCode() === 200){\n try{\n $resp = $this->getResponse();\n if(isset($resp->data)){\n $this->responseData = $resp->data;\n }\n }catch (Exception $e){\n\n }\n }\n return $this->responseData;\n }", "#[Pure]\n public function getResponseData() {}", "public function getDataWithTypeParameters() {}", "protected function _parse_response($data)\n\t{\n\t\t// Since this module currently uses POST to make the gateway request\n\t\t// We know our current object can be simply typecasted back to an array.\n\t\t// IF THIS EVER CHANGES, USE $this->payments->arrayize_object($data);\n\t\t$results = explode('&',urldecode($data));\n\t\tforeach($results as $result)\n\t\t{\n\t\t\tlist($key, $value) = explode('=', $result);\n\t\t\t$gateway_response[$key]=$value;\n\t\t}\t\t\n\t\t\n\t\t$details = (object) array();\n\t\t$details->timestamp = gmdate('c');\n\t\t$details->gateway_response = $gateway_response; // Full Gateway Response\t\t\n\t\t\n\t\t//Set response types\n\t\t$response_types = array(\n\t\t\t'E' => $this->payments->payment_type.'_gateway_failure', \n\t\t\t'1' => $this->payments->payment_type.'_success', \n\t\t\t'0' => $this->payments->payment_type.'_local_failure'\n\t\t);\n\t\t\n\t\t// Default to Failure if data is not what is expected\n\t\t$status = 'failure';\n\t\t\n\t\t// Setup Final Response \n\t\tif(isset($gateway_response['MESSAGE']))\n\t\t{\t\t\n\t\t\t$details->reason = $gateway_response['MESSAGE'];\n\t\t}\n\t\t\n\t\tif(isset($gateway_response['STATUS']))\n\t\t{\n\t\t\t$details->status = $gateway_response['STATUS']; // The request can be successful, yet have the card be declined\n\t\t}\n\t\t\n\t\t// Setup additional properties if successful\n\t\tif(isset($gateway_response['TRANS_ID']))\n\t\t{\n\t\t\t$details->identifier = $gateway_response['TRANS_ID'];\n\t\t}\n\t\t\t\t\n\t\t// Return Local Response, because we didn't get an expected response from server\n\t\tif( ! isset($gateway_response['STATUS'], $gateway_response['MESSAGE']))\n\t\t{\n\t\t\t// @todo - Don't know if this should be a different response than \"gateway\" \n\t\t\treturn $this->payments->return_response($status, $response_types['E'], 'gateway_response', $details);\n\t\t}\n\t\t\t\t\n\t\t// Possible Responses are 1 = Approved, 0 = Decline, 'E' = Error\n\t\t$is_success = ($data['STATUS'] === '1');\n\t\t\n\t\t// Setup Response\n\t\t$status = ($is_success) ? 'success': 'failure';\n\t\t$response = $response_types[$gateway_response['STATUS']];\n\t\t\n\t\t// Send it back!\t\n\t\treturn $this->payments->return_response($status, $response, 'gateway_response', $details);\n\t}", "function hpm_api_object_dependents( $object_type, $object_id ) {\n\n // Only Projects Supported for Now\n if ( $object_type !== 'project' ) { return; }\n\n $response = new stdClass();\n global $wpdb;\n\n // Get Each Dependent Type\n foreach ( ['messages', 'resources'] as $type ) {\n $table = $wpdb->prefix . 'hpm_' . $type;\n\n // Get Rows from DB\n $results = $wpdb->get_results( \"SELECT * FROM $table WHERE project_id = '$object_id';\" );\n\n // Typify into Primitives\n $primitives = array_map( function( $result ) {\n return hpm_typify_data_from_db( $result );\n }, $results );\n\n $response->$type = $primitives;\n }\n\n return $response;\n\n}", "public function fromAPI($data);", "public function verifyResponse(?array $data, array $fields, $objectId): void\n {\n //====================================================================//\n // Verify Response Block\n $this->assertNotEmpty($data, \"Data Block is Empty\");\n $this->assertIsArray($data, \"Data Block is Not an Array\");\n //====================================================================//\n // Verify Object Id is Present\n $this->assertArrayHasKey(\n \"id\",\n $data,\n \"Object Identifier ['id'] is not defined in returned Data Block.\"\n );\n $this->assertEquals(\n $data[\"id\"],\n $objectId,\n \"Object Identifier ['id'] is different in returned Data Block.\"\n );\n //====================================================================//\n // Verify Field Data\n foreach ($fields as $field) {\n //==============================================================================\n // Filter Non-Readable Fields\n if (!$field['read']) {\n continue;\n }\n //==============================================================================\n // Validate Field Data\n $this->isValidFieldData($data, $field['id'], $field['type']);\n }\n }", "function getData(){ \n return json_decode($this->data); \n }", "public function testDataResponse()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $data = $driverPassesEndpoint->setClassId(1000)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->getRequest();\n\n $this->assertNotEmpty($data);\n $this->assertTrue(is_object($data));\n $this->assertEquals(1, $data->RequestValid);\n }", "function rest_filter_response_by_context($response_data, $schema, $context)\n {\n }", "public function convertToObject(\\SetaPDF_Core_Type_Raw $data) {}", "public function getResponseData()\n {\n return json_decode($this->responseData);\n }", "function cleanresponse_course_infos($courseinfos_response){\n\n $treated_object=new stdClass();\n\n $treated_object->course_gen_infos=clean_object_forX5GON($courseinfos_response->course_gen_infos, 'courseinfos');\n\n $treated_object->course_cat_infos=clean_object_forX5GON($courseinfos_response->course_cat_infos, 'categoryinfos');\n\n\n foreach ($courseinfos_response->course_modules as $key => $value) {\n\n $treated_object->course_modules[\"$key\"] =new stdClass();\n $treated_object->course_modules[\"$key\"] = cleanresponse_resource_infos($value) ;\n\n }\n\n if( property_exists($courseinfos_response,'response_notice') ){\n $treated_object->response_notice=$courseinfos_response->response_notice;\n //This is to be sure to not render anyinfos if it's not permitted\n if($courseinfos_response->response_notice==\"No permitted informations to be rendered for this course. Check with admin.\"){\n $treated_object=new stdClass();\n $treated_object->response_notice=$courseinfos_response->response_notice;\n }\n }\n return $treated_object;\n\n }", "public function getData(){ \n return json_decode($this->data); \n }", "protected function getContentObject()\n {\n return json_decode($this->response->getContent());\n }", "protected function getCimResponse() {\r\n\t\t$result = new Varien_Object;\r\n\t\t$r \t\t= explode( $this->cim->getDelimiter(), str_replace('\"','',$this->cim->getDirectResponse()) );\r\n\t\t\r\n\t\tif( count($r) > 0 ) {\r\n\t\t\t$result->setResponseCode((int)$r[0])\r\n\t\t\t\t->setResponseSubcode((int)$r[1])\r\n\t\t\t\t->setResponseReasonCode((int)$r[2])\r\n\t\t\t\t->setResponseReasonText($r[3])\r\n\t\t\t\t->setApprovalCode($r[4])\r\n\t\t\t\t->setAvsResultCode($r[5])\r\n\t\t\t\t->setTransactionId($r[6])\r\n\t\t\t\t->setInvoiceNumber($r[7])\r\n\t\t\t\t->setDescription($r[8])\r\n\t\t\t\t->setAmount($r[9])\r\n\t\t\t\t->setMethod($r[10])\r\n\t\t\t\t->setTransactionType($r[11])\r\n\t\t\t\t->setCustomerId($r[12])\r\n\t\t\t\t->setMd5Hash($r[37])\r\n\t\t\t\t->setCardCodeResponseCode($r[38])\r\n\t\t\t\t->setCAVVResponseCode( (isset($r[39])) ? $r[39] : null)\r\n\t\t\t\t->setAccNumber($r[50])\r\n\t\t\t\t->setCardType($r[51])\r\n\t\t\t\t->setSplitTenderId($r[52])\r\n\t\t\t\t->setRequestedAmount($r[53])\r\n\t\t\t\t->setBalanceOnCard($r[54]);\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "static function checkObj(&$data) \n\t{\n\t\tif(!$data)\n\t\t\treturn false;\n\t\tif(preg_match('/((?![\\x20-\\x7E]).)/', $data)){\n\t\t\t//todo:now just int\n\t\t\t$data = unpack('I',$data);\n\t\t\t$data = $data[1];\n\t\t\treturn false;\n\t\t}\n\t\tif(substr_compare($data,'{',0,1)==0){\n\t\t\t$ndata = json_decode($data,true);\n\t\t\tif($ndata){\n\t\t\t\t$data = $ndata;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public function createResponse() {\n\t\t\t$query = \"SELECT * FROM $this->table_name WHERE name=:name AND drink=:drink\";\n\n\t\t\t// prepare \n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind values\n\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t$stmt->bindParam(':drink', $this->drink);\n\n\t\t\t$stmt->execute();\n\n\t\t\t// get retrieved row\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\t// set values to object properties\n\t\t\t$this->id = $row['id'];\n\t\t\t$this->name = $row['name'];\n\t\t\t$this->drink = $row['drink'];\n\t\t}", "private function process($data) {\n\t\treturn json_decode($data, true);\n\t}", "function rest_prepare($data, $post = null, $request = 0)\n {\n\n $response_data = $data->get_data();\n\n $response_data['_meta'] = get_post_meta($response_data['id']);\n $response_data['_terms'] = wp_get_post_terms( $response_data['id'], 'link-types' );\n $data->set_data($response_data);\n\n return $data;\n }", "public function parseResponseStringToObject()\n {\n /** @var TransporterInterface $transporter */\n $transporter = TransporterFactory::build();\n\n return $transporter->parseResponseStringToObject($this->response);\n }", "abstract public function getData(): object;", "function ctools_export_unpack_object($table, $data) {\r\n $schema = ctools_export_get_schema($table);\r\n return _ctools_export_unpack_object($schema, $data, $schema['export']['object']);\r\n}", "public function getInnerResponse();", "public function result_object()\n\t{\n\t\tif (count($this->result_object) > 0)\n\t\t{\n\t\t\treturn $this->result_object;\n\t\t}\n\t\telseif (count($this->result_array) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->result_array); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$this->result_object[] = (object) $this->result_array[$i];\n\t\t\t}\n\n\t\t\treturn $this->result_object;\n\t\t}\n\t\telseif (is_array($this->row_data))\n\t\t{\n\t\t\tif (count($this->row_data) === 0)\n\t\t\t{\n\t\t\t\treturn $this->result_object;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t\tfor ($i = 0; $i < $row_index; $i++)\n\t\t\t\t{\n\t\t\t\t\t$this->result_object[$i] = (object) $this->row_data[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_index = 0;\n\t\t\t$this->row_data = array();\n\t\t}\n\n\t\t$row = NULL;\n\t\twhile ($row = $this->_fetch_object())\n\t\t{\n\t\t\t$this->row_data[$row_index] = (array) $row;\n\t\t\t$this->result_object[$row_index++] = $row;\n\t\t}\n\n\t\t// Un-comment the following line, in case it becomes needed\n\t\t// $this->_data_seek();\n\t\treturn $this->result_object;\n\t}", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "protected function c_parseOperationAttributes() {\n\n //if ($this->clientoutput->status != \"successfull-ok\")\n // return false;\n \n $op = -1;\n for ($i = 0 ; $i < count($this->clientoutput->response) ; $i++) {\n\t\t\n if ($this->clientoutput->response[$i]['attributes'] == \"operation-attributes\")\n $op ++;\n\t\t\t\t\n $k = -1; \n for ($j = 0 ; $j < (count($this->clientoutput->response[$i]) - 1) ; $j ++)\n if (!empty($this->clientoutput->response[$i][$j]['name'])) {\n $k++;\n $l = 0;\n $this->parsed[$op][$k]['range'] = $this->clientoutput->response[$i]['attributes'];\n $this->parsed[$op][$k]['name'] = $this->clientoutput->response[$i][$j]['name'];\n $this->parsed[$op][$k]['type'] = $this->clientoutput->response[$i][$j]['type'];\n $this->parsed[$op][$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n } else {\n $l ++;\n $this->parsed[$op][$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n }\n }\n \n //$this->clientoutput->response = array();\n\n $this->client_operation_attributes = new stdClass();\n\t\t\n for ($op_nbr = 0 ; $op_nbr <= $op ; $op_nbr ++) {\n\t\t\n $op_index = \"op_\".$op_nbr;\n $this->client_operation_attributes->$op_index = new stdClass();\n\t\t\t\n for ($i = 0 ; $i < count($this->parsed[$op_nbr]) ; $i ++) {\n $name = $this->parsed[$op_nbr][$i]['name'];\n $php_name = str_replace('-','_',$name);\n $type = $this->parsed[$op_nbr][$i]['type'];\n $range = $this->parsed[$op_nbr][$i]['range'];\n $this->client_operation_attributes->$op_index->$php_name = new stdClass();\n $this->client_operation_attributes->$op_index->$php_name->_type = $type;\n $this->client_operation_attributes->$op_index->$php_name->_range = $range;\n for ($j = 0 ; $j < (count($this->parsed[$op_nbr][$i]) - 3) ; $j ++) {\n # This causes incorrect parsing of integer job attributes.\n # 2010-08-16\n # bpkroth\n #$value = self::_interpretAttribute($name,$type,$this->parsed[$job_nbr][$i][$j]);\n $value = $this->parsed[$op_nbr][$i][$j];\n $index = '_value'.$j;\n $this->client_operation_attributes->$op_index->$php_name->$index = $value;\n }\n }\n }\n \n $this->parsed = array();\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n $fields = array(\n 'htype', 'title', 'hd_start_time', 'hd_end_time', 'status', 'hd_object',\n 'condition_type', 'condition_value', 'rule_type', 'game_version', 'game_object',\n 'denomination','deadline','rule_content','rule_content_percent','create_time','subject_id',\n 'hd_object_addition_info', 'game_object_addition_info'\n );\n foreach ($fields as $field) {\n if(isset($data[$field])) {\n $tmp[$field] = $data[$field];\n }\n }\n\t\treturn $tmp;\n\t}", "function createRepID($sfConn, $dataArray){\n\t\techo(\"<P> createRepID <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Rep_ID_c <P>\");\n $sObject = new sObject();\n $sObject->type = 'Rep_ID_c'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "protected function getObjectData() {\n return $this->data;\n }", "public function asObject(): stdClass\n {\n return json_decode($this->result);\n }", "public function selectSingleObject() {\n\t\t$Object = $this->urlParams['ID'];\n\t\t$ID = $this->urlParams['OtherID'];\n\t\tif($result = DataObject::get_by_id($Object,(int)$ID)) {\n\t\t\t$f = new JSONDataFormatter();\n\t\t\t$json = $f->convertDataObject($result);\n\t\t\treturn \"{\\\"success\\\":true, \\\"data\\\":[$json]}\";\n\t\t} else {\n\t\t\treturn '{\"success\": false, \"data\":[]}';\n\t\t}\n\t}", "protected function parse_model_response_read($data) {\n\t \n\t /* access the unparsed query items */\n/* \t $items = $this->query; */\n\t /* error checks */\n\t if( empty($data) ) {\n\t\t\t// $this->set_error( 3, 'No items found in database' );\n\t\t\treturn;\t\t \n\t }\n\t \n\t /* parse the query items */\n\t\t$parsed = $this->model_response_parser($data, $this->properties->data_package_fields);\n\t\t\t\n\t\t/* return a multidimensial array when read-all-models was requested or a single array when only one model was requested*/\n \tif($this->id)\n\t\t\treturn $parsed[0];\n\t else\n\t\t\treturn $parsed;\n }", "public function get_request($obj,$qData){\n\t\t\n\t\t$response = array();\n\n\t\t//in the event that an empty obj gets passed in\n\t\tif(empty($obj)) return $response;\n\n\t\t//build the sql query\n\t\t$sql = \"SELECT * FROM $obj->table\";\n\t\t$first = true;\n\t\tforeach($qData as $key => $val){\n\t\t\tif($first){\n\t\t\t\t$sql .= \" WHERE $key = :$key\";\n\t\t\t\t$first = false;\n\t\t\t}else{\n\t\t\t\t$sql .= \" AND $key = :$key\";\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\t//prepare in pdo\n\t\t$stmt = $this->_pdo->prepare($sql);\n\t\t$stmt->execute($qData);\n\n\t\twhile($qobj = $stmt->fetch()){\n\t\t\t$row = array();\n\t\t\tforeach($qobj as $key => $val){\n\t\t\t\tif($val == NULL && (empty($obj->display_null) || !$obj->display_null)) continue;\n\t\t\t\t$row[$key] = $val;\n\t\t\t}\n\n\t\t\t//rather than building nested array, maybe should build join?\n\t\t\t//hard to do when returning one-to-many and many-to-many\n\t\t\tif(is_array($obj->_related)){\n\t\t\t\tforeach($obj->_related as $key => $rel){\n\t\t\t\t\t$rObj = $rel[\"obj\"];\n\t\t\t\t\t$column = $rel[\"column\"];\n\t\t\t\t\t$host_column = $rel[\"host_column\"];\n\t\t\t\t\tif(isset($row[$host_column])){\n\t\t\t\t\t\t$rData = array($column => $row[$host_column]);\n\t\t\t\t\t\t$row[$key] = $this->get_request($rObj,$rData);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$response[] = $row;\n\t\t}\n\t\treturn $response;\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['guide'])) $tmp['guide'] = $data['guide'];\n\t\tif(isset($data['gtype'])) $tmp['gtype'] = $data['gtype'];\n\t\tif(isset($data['ntype'])) $tmp['ntype'] = $data['ntype'];\n\t\tif(isset($data['btype'])) $tmp['btype'] = $data['btype'];\n\t\tif(isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = intval($data['end_time']);\n\t\treturn $tmp;\n\t}", "private function parse()\n {\n if ($this->isError()) {\n // error parsing\n if (empty($this->body) || !isset($this->body['errors'])) {\n // response body isn't an error object, return a custom one\n $error = new Entity\\Error();\n $error->message = \"Error $this->http_status\";\n $error->name = \"INVALID REQUEST\";\n $error->at = \"\";\n $this->objects[] = $error;\n } else {\n // parse error\n $errors = $this->body['errors'];\n foreach ($errors as $error) {\n $this->objects[] = Entity\\Error::parse($error);\n }\n }\n } else if (isset($this->body['card'])) {\n // card parsing\n $cards = $this->body['card'];\n foreach ($cards as $card) {\n $this->objects[] = Entity\\Card::parse($card);\n }\n } else if (isset($this->body['paymentmethod'])) {\n // payment parsing\n $this->objects[] = Entity\\Payment::parse($this->body);\n if (isset($this->body['subscription_plan'])) {\n // subscription also found, payment is a subscription\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n }\n } else if (isset($this->body['vendor'])) {\n // vendor parsing\n $this->objects[] = Entity\\Vendor::parse($this->body['vendor']);\n } else if (isset($this->body['item'])) {\n // item parsing\n $this->objects[] = Entity\\Item::parse($this->body['item']);\n } else if (isset($this->body['refunded'])) {\n // refund parsing, same as payment\n $this->objects[] = Entity\\Payment::parse($this->body);\n } else if (isset($this->body['subscription_plan'])) {\n // subscription parsing\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n } else if (isset($this->body['deleted'])) {\n // nothing to return\n } else {\n throw new \\RuntimeException('Could not recognize response type');\n }\n }", "public function getAuthDataFromResponse(): array;", "private function parse_result(){\n return json_decode($this->result);\n }", "public function getProcessedData(): object|array;", "function prepData($responseCode,$data){\n header('Content-Type: application/json');\n echo json_encode($data);\n http_response_code($responseCode);\n }", "protected/* OXPS Patch - End */ function prepareResponseData($data)\n {\n\t\t// select right parameters which can be used in payment method setup (use clientData)\n\t\t$filteredData = $this->filterClientData($data);\n \n // add PM_PREFIX to data keys\n $outputData = array();\n\n if (!is_null($filteredData)) {\n foreach ($filteredData as $key => $value) {\n $newKey = PaymorrowGateway::PM_PREFIX . $key;\n $outputData[$newKey] = $value;\n }\n }\n\n return $outputData;\n }", "private function stat_response_object() {\n\t\t\t$stats = ( new WpProQuiz_Model_StatisticMapper() )->fetchAllByRef( $this->current()->getStatisticRefId() );\n\t\t\t$stat_response = new stdClass();\n\t\t\t$stat_response->id = $this->current()->getStatisticRefId();\n\t\t\t$stat_response->quiz = $this->getQuizId();\n\t\t\t$stat_response->user = $this->current()->getUserId();\n\t\t\t$stat_response->date = mysql_to_rfc3339( wp_date( 'Y-m-d H:i:s', $this->current()->getCreateTime() ) ); //phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n\t\t\t$stat_response->answers_correct = $this->get_count( $stats, 'getCorrectCount' );\n\t\t\t$stat_response->answers_incorrect = $this->get_count( $stats, 'getIncorrectCount' );\n\t\t\t$stat_response->points_scored = $this->get_count( $stats, 'getPoints' );\n\t\t\t$stat_response->points_total = (int) $this->current()->getMapper()->fetchTotalPoints( $this->current()->getStatisticRefId() );\n\n\t\t\treturn $stat_response;\n\t\t}", "public function oaprequest($reqType,$data) {\n\t $data = urlencode(urlencode($data));\n\t $postargs = \"appid=\".$this->appid.\"&key=\".$this->key.\"&return_id=2&reqType=\".$reqType. \"&data=\" . $data;\n\t $request = \"https://api.moon-ray.com/cdata.php\";\n\t \n\t //Start the curl session and send the data\n\t $session = curl_init($request);\n\t curl_setopt ($session, CURLOPT_POST, true);\n\t curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs);\n\t curl_setopt($session, CURLOPT_HEADER, false);\n\t curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n\t \n\t //Store the response from the API for confirmation or to process data\n\t return curl_exec($session);\n }", "public function getResponse() : array;", "private function extractObjects(&$data){\n\t\tif(!preg_match_all($this->patObject, $data, $matches)){\n\t\t\tthrow new Exception(\"No objects found\"); \n\t\t} else {\n\t\t\t// Trim the results, because \\R in regex assertion (lookback) causes problems.\n\t\t\tforeach($matches[0] as $key => $match){\n\t\t\t\t$newObject = new pdfObject(trim($match));\n\t\t\t\t$this->objects[$newObject->objectNumber] = $newObject;\n\t\t\t}\n\t\t\treturn $this->objects;\n\t\t}\n\t}", "protected function c_parseClientAttributes() {\n\n //if (!preg_match('#successful#',$this->clientoutput->status))\n // return false;\n\n $k = -1;\n for ($i = 0 ; $i < count($this->clientoutput->response) ; $i++) {\t\n\t\t\n for ($j = 0 ; $j < (count($this->clientoutput->response[$i]) - 1) ; $j ++)\n if (!empty($this->clientoutput->response[$i][$j]['name'])) {\n $k++;\n $l = 0;\n $this->parsed[$k]['range'] = $this->clientoutput->response[$i]['attributes'];\n $this->parsed[$k]['name'] = $this->clientoutput->response[$i][$j]['name'];\n $this->parsed[$k]['type'] = $this->clientoutput->response[$i][$j]['type'];\n $this->parsed[$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n } else {\n $l ++;\n $this->parsed[$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n }\n\t\t}\t\t\t\n //$this->clientoutput->response = array();\n \n $this->client_attributes = new stdClass();\n for ($i = 0 ; $i < count($this->parsed) ; $i ++) {\n $name = $this->parsed[$i]['name'];\n $php_name = str_replace('-','_',$name);\n $type = $this->parsed[$i]['type'];\n $range = $this->parsed[$i]['range'];\n $this->client_attributes->$php_name = new stdClass();\n $this->client_attributes->$php_name->_type = $type;\n $this->client_attributes->$php_name->_range = $range;\n for ($j = 0 ; $j < (count($this->parsed[$i]) - 3) ; $j ++) {\n $value = $this->parsed[$i][$j];\n $index = '_value'.$j;\n $this->client_attributes->$php_name->$index = $value;\n }\n }\n \n $this->parsed = array();\n \n \n }", "protected function get_data_for_response( $object, $request ) {\n\t\t$formatter = new ProductResponse();\n\n\t\treturn $formatter->prepare_response( $object, $this->get_request_context( $request ) );\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['badwords'])) $tmp['badwords'] = $data['badwords'];\n\t\tif(isset($data['uname'])) $tmp['uname'] = $data['uname'];\n\t\tif(isset($data['uuid'])) $tmp['uuid'] = $data['uuid'];\n\t\tif(isset($data['nickname'])) $tmp['nickname'] = $data['nickname'];\n\t\tif(isset($data['imei'])) $tmp['imei'] = $data['imei'];\n\t\tif(isset($data['imcrc'])) $tmp['imcrc'] = intval($data['imcrc']);\n\t\tif(isset($data['game_id'])) $tmp['game_id'] = $data['game_id'];\n\t\tif(isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n\t\tif(isset($data['check_time'])) $tmp['check_time'] = $data['check_time'];\n\t\tif(isset($data['is_sensitive'])) $tmp['is_sensitive'] = $data['is_sensitive'];\n\t\tif(isset($data['is_filter'])) $tmp['is_filter'] = $data['is_filter'];\n\t\tif(isset($data['model'])) $tmp['model'] = $data['model'];\n\t\tif(isset($data['version'])) $tmp['version'] = $data['version'];\n\t\tif(isset($data['sys_version'])) $tmp['sys_version'] = $data['sys_version'];\n\t\tif(isset($data['is_top'])) $tmp['is_top'] = $data['is_top'];\n\t\tif(isset($data['top_time'])) $tmp['top_time'] = $data['top_time'];\n\t\tif(isset($data['utype'])) $tmp['utype'] = $data['utype'];\n\t\tif(isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif(isset($data['is_del'])) $tmp['is_del'] = $data['is_del'];\n\t\tif(isset($data['is_blacklist'])) $tmp['is_blacklist'] = $data['is_blacklist'];\n\t\tif(isset($data['client_pkg'])) $tmp['client_pkg'] = $data['client_pkg'];\n\t\treturn $tmp;\n\t}" ]
[ "0.62855977", "0.60015136", "0.58495194", "0.57778627", "0.57778627", "0.57778627", "0.57778627", "0.57778627", "0.57501084", "0.5688988", "0.5684497", "0.5663222", "0.565002", "0.5622255", "0.5555347", "0.5535939", "0.5508196", "0.54841113", "0.54477096", "0.53603834", "0.53560036", "0.5338142", "0.5333026", "0.5306083", "0.53015906", "0.5291983", "0.52885866", "0.5230241", "0.52292264", "0.5228193", "0.52124757", "0.5207051", "0.51930946", "0.5187664", "0.51637256", "0.5147927", "0.51208365", "0.51092476", "0.51082504", "0.51081264", "0.5074295", "0.50706995", "0.5070367", "0.5069111", "0.5052491", "0.5051437", "0.504895", "0.5047431", "0.50401103", "0.5038051", "0.503773", "0.5026982", "0.5023026", "0.50210327", "0.50115055", "0.5010559", "0.50051326", "0.50042814", "0.49935377", "0.4987368", "0.49858454", "0.49827626", "0.49783352", "0.49763793", "0.4976084", "0.49725372", "0.4965511", "0.49635446", "0.49589938", "0.4957076", "0.49546862", "0.49484456", "0.49467036", "0.49410364", "0.49406692", "0.4938494", "0.49303344", "0.49303344", "0.49303344", "0.49234283", "0.49224693", "0.49192294", "0.49123532", "0.4907246", "0.49040043", "0.49003705", "0.4898515", "0.48955515", "0.48947805", "0.48788598", "0.48783985", "0.4877139", "0.48758775", "0.48745644", "0.4869097", "0.48681152", "0.48614252", "0.48561102", "0.48469073", "0.4840973", "0.48408505" ]
0.0
-1
first get the params e.g. sourceid, newLayerId from client, parentID where Layer has to be referred to
function OBJM_AddLayerReference(&$respdata) { $retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); if(!isset($_SESSION['sceneCompXMLDOM'])) return false; if(!isset($_SESSION['sceneCompXMLFilePath'])) return false; $retval = $_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); if($retval != true) { $respdata ="FAIL"; return false; } parse_str($respdata) ; $objID = $OBJECTID; $refID = $REFERENCEID; $parentID = $SCENEID; //get the source node $refNode = $_SESSION['sceneCompXMLDOM']->getElementById($refID); if(!$refNode) return false; $nodeTitle = $refNode->getAttribute('name'); $parentNode = $_SESSION['sceneCompXMLDOM']->getElementById($parentID); if(!$parentNode) return false; $dataID = $refNode->getAttribute("dataid"); $nodeType = $refNode->getAttribute("type"); if($nodeType != "LAYER") { $respdata = "FAIL"; return false; } //$TMparentIDVal = "TM_".$parentID; $retval = OBJM_AddNewObjectToSCXML($objID,$nodeType,"treemenu","3", $nodeTitle, $parentID, $dataID, $nodeType, 'reference'); if($retval == false) { $respData = ""; return false; } //$retval = $_SESSION['sceneCompXMLDOM']->save($_SESSION['sceneCompXMLFilePath']); //send OK back to client $respdata = $retval; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getLayers($params) {\n $service = $params['service'];\n $user = $params['user'];\n $password = $params['password'];\n\n $physical_id = -1;\n\n $db = JFactory::getDbo();\n $pos = strstr($service, 'physical_');\n if ($pos) {\n $id = substr($service, strrpos($service, '_') + 1);\n $query = $db->getQuery(true);\n $query->select('s.resourceurl as url, sc.value as connector');\n $query->from('#__sdi_physicalservice s');\n $query->innerJoin('#__sdi_sys_serviceconnector sc ON sc.id = s.serviceconnector_id');\n $query->where('s.id=' . (int) $id);\n\n $db->setQuery($query);\n $resource = $db->loadObject();\n\n $query = $db->getQuery(true);\n $query->select('sv.value as value, sc.id as id');\n $query->from('#__sdi_physicalservice_servicecompliance ssc');\n $query->innerJoin('#__sdi_sys_servicecompliance sc ON sc.id = ssc.servicecompliance_id');\n $query->innerJoin('#__sdi_sys_serviceversion sv ON sv.id = sc.serviceversion_id');\n $query->where('ssc.service_id =' . (int) $id);\n $query->order('sv.ordering DESC');\n\n $db->setQuery($query, 0, 1);\n $compliance = $db->loadObject();\n $physical_id = $id;\n } else {\n $id = substr($service, strrpos($service, '_') + 1);\n\n $query = $db->getQuery(true);\n $query->select('ps.id as physicalservice_id, ps.resourceurl as url, sc.value as connector');\n $query->from('#__sdi_virtualservice vs');\n $query->innerJoin('#__sdi_physicalservice ps ON ps.id = vs.physicalservice_id');\n $query->innerJoin('#__sdi_sys_serviceconnector sc ON sc.id = ps.serviceconnector_id');\n $query->where('vs.id=' . (int) $id);\n\n $db->setQuery($query);\n $resource = $db->loadObject();\n\n $query = $db->getQuery(true);\n $query->select('sv.value as value, sc.id as id');\n $query->from('#__sdi_physicalservice_servicecompliance pssc');\n $query->innerJoin('#__sdi_sys_servicecompliance sc ON sc.id = pssc.servicecompliance_id');\n $query->innerJoin('#__sdi_sys_serviceversion sv ON sv.id = sc.serviceversion_id');\n $query->where('pssc.service_id =' . $resource->physicalservice_id);\n $query->order('sv.ordering DESC');\n\n $db->setQuery($query, 0, 1);\n $compliance = $db->loadObject();\n $physical_id = $resource->physicalservice_id;\n }\n\n $url = $resource->url;\n $connector = ($resource->connector == \"WMSC\") ? \"WMS\" : $resource->connector;\n $pos1 = stripos($url, \"?\");\n $separator = \"&\";\n if ($pos1 === false) {\n $separator = \"?\";\n }\n\n $completeurl = $url . $separator . \"REQUEST=GetCapabilities&SERVICE=\" . $connector;\n if ($compliance && $compliance->value) {\n $completeurl .= \"&version=\" . $compliance->value;\n }\n\n $session = curl_init($completeurl);\n $httpHeader = array();\n $httpHeader[] = 'Expect:';\n if (!empty($user) && !empty($password)) {\n $httpHeader[] = 'Authorization: Basic ' . base64_encode($user . ':' . $password);\n }\n curl_setopt($session, CURLOPT_HTTPHEADER, $httpHeader);\n curl_setopt($session, CURLOPT_HEADER, false);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($session);\n $http_status = curl_getinfo($session, CURLINFO_HTTP_CODE);\n curl_close($session);\n\n //HTTP status error\n if ($http_status != '200') {\n $result['ERROR'] = JText::_('COM_EASYSDI_MAP_GET_CAPABILITIES_HTTP_ERROR') . $http_status;\n echo json_encode($result);\n die();\n }\n\n $xmlCapa = simplexml_load_string($response);\n $result = array();\n\n //Response empty\n if ($xmlCapa === false) {\n $result['ERROR'] = JText::_('COM_EASYSDI_MAP_GET_CAPABILITIES_ERROR');\n echo json_encode($result);\n die();\n }\n\n //OGC exception returned\n if ($xmlCapa->getName() == \"ServiceExceptionReport\") {\n foreach ($xmlCapa->children() as $exception) {\n $ogccode = $exception['code'];\n break;\n }\n $result['ERROR'] = JText::_('COM_EASYSDI_MAP_GET_CAPABILITIES_OGC_ERROR') . $ogccode;\n echo json_encode($result);\n die();\n }\n\n //Parse capabilities to get layers\n $namespaces = $xmlCapa->getNamespaces(true);\n foreach ($namespaces as $key => $value) {\n if ($key == '') {\n $xmlCapa->registerXPathNamespace(\"dflt\", $value);\n } else {\n $xmlCapa->registerXPathNamespace($key, $value);\n }\n }\n $version = $xmlCapa->xpath('@version');\n $version = (string) $version[0];\n\n switch ($resource->connector) {\n case \"WMS\":\n case \"WMSC\":\n switch ($version) {\n case \"1.3.0\":\n $wmsLayerList = $xmlCapa->xpath('//dflt:Layer');\n break;\n default:\n $wmsLayerList = $xmlCapa->xpath('/Capability//Layer[Name]');\n break;\n }\n\n //flushing the wmslayer table\n $tab_layer = JTable::getInstance('wmslayer', 'Easysdi_serviceTable');\n $tab_layer->wipeByPhysicalId($physical_id);\n unset($tab_layer);\n\n //inserting each wmslayer\n foreach ($wmsLayerList as $wmsLayer) {\n $tab_layer = JTable::getInstance('wmslayer', 'Easysdi_serviceTable');\n $tab_layer->save(Array(\n 'name' => (String) $wmsLayer->Name,\n 'description' => (String) $wmsLayer->Title,\n 'physicalservice_id' => $physical_id\n ));\n unset($tab_layer);\n }\n break;\n case \"WMTS\":\n $time_stack = 0;\n $wmtsLayerList = $xmlCapa->xpath('/dflt:Capabilities/dflt:Contents/dflt:Layer');\n //flushing the wmtslayer table\n $tab_layer = JTable::getInstance('wmtslayer', 'Easysdi_serviceTable');\n $tab_layer->wipeByPhysicalId($physical_id);\n unset($tab_layer);\n\n //inserting each wmtslayer\n foreach ($wmtsLayerList as $wmtsLayer) {\n\n $tab_layer = JTable::getInstance('wmtslayer', 'Easysdi_serviceTable');\n $tab_layer->save(Array(\n 'name' => (String) $wmtsLayer->children('ows', true)->Identifier,\n 'description' => (String) $wmtsLayer->children('ows', true)->Title,\n 'physicalservice_id' => $physical_id\n ));\n\n $wmtslayer_id = $tab_layer->id;\n\n foreach ($wmtsLayer->TileMatrixSetLink as $tileMatrixSet) {\n $tileMatrixSetIdentifier = (String) $tileMatrixSet->TileMatrixSet;\n\n //we save the tilematrixset\n $supported_CRS = $xmlCapa->xpath(\"/dflt:Capabilities/dflt:Contents/dflt:TileMatrixSet[ows:Identifier = '\" . $tileMatrixSetIdentifier . \"']\");\n $supported_CRS = (String) $supported_CRS[0]->children('ows', true)->SupportedCRS;\n\n $tab_tileMatrixSet = JTable::getInstance('tileMatrixSet', 'Easysdi_serviceTable');\n $tab_tileMatrixSet->save(Array(\n 'identifier' => $tileMatrixSetIdentifier,\n 'supported_crs' => $supported_CRS,\n 'wmtslayer_id' => $wmtslayer_id,\n ));\n\n //we probe if the tilematrixset has limits\n $hasLimits = isset($tileMatrixSet->TileMatrixSetLimits);\n\n //we get the list of authorized tilematrix for this tilematrixset\n if ($hasLimits) {\n $authorized_tiles = Array();\n foreach ($tileMatrixSet->TileMatrixSetLimits->TileMatrixLimits as $limits) {\n $tileMatrixIdentifier = (String) $limits->TileMatrix;\n $authorized_tiles[] = $tileMatrixIdentifier;\n }\n }\n\n //we get the list of all the tilematrix for this tilematrixset\n $tileMatrixList = $xmlCapa->xpath(\"/dflt:Capabilities/dflt:Contents/dflt:TileMatrixSet[ows:Identifier = '\" . $tileMatrixSetIdentifier . \"']/dflt:TileMatrix\");\n\n //we sanitize the output of the xpath\n $tileMatrixArray = Array();\n foreach ($tileMatrixList as $tileMatrix) {\n $identifier = (String) $tileMatrix->children('ows', true)->Identifier;\n //if there are limits on the tilematrixset we filter the list of tilematrix with authorized tilematrixes and we save\n if (!$hasLimits || in_array($identifier, $authorized_tiles)) {\n $tileMatrixArray[] = Array(\n 'identifier' => $identifier,\n 'scaledenominator' => (String) $tileMatrix->ScaleDenominator,\n 'topleftcorner' => (String) $tileMatrix->TopLeftCorner,\n 'tilewidth' => (String) $tileMatrix->TileWidth,\n 'tileheight' => (String) $tileMatrix->TileHeight,\n 'matrixwidth' => (String) $tileMatrix->MatrixWidth,\n 'matrixheight' => (String) $tileMatrix->MatrixHeight,\n 'tilematrixset_id' => $tab_tileMatrixSet->id,\n );\n }\n }\n $tab_tileMatrix = JTable::getInstance('tileMatrix', 'Easysdi_serviceTable');\n $tab_tileMatrix->saveBatch($tileMatrixArray);\n unset($tab_tileMatrixSet, $tab_tileMatrix, $tileMatrixArray);\n }\n unset($tab_layer);\n }\n\n break;\n case \"WFS\":\n $featureTypeList = $xmlCapa->xpath('//dflt:FeatureType');\n\n //flushing the featureClass table\n $tab_layer = JTable::getInstance('featureclass', 'Easysdi_serviceTable');\n $tab_layer->wipeByPhysicalId($physical_id);\n unset($tab_layer);\n\n //inserting each featureClass\n foreach ($featureTypeList as $featureType) {\n $tab_layer = JTable::getInstance('featureclass', 'Easysdi_serviceTable');\n $tab_layer->save(Array(\n 'name' => (String) $featureType->Name,\n 'description' => (String) $featureType->Title,\n 'physicalservice_id' => $physical_id\n ));\n unset($tab_layer);\n }\n break;\n }\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function getParams()\n {\n }", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "private function extract_params($params)\r\n {\r\n if(isset($params->id))\r\n {\r\n $this->id = $params->id;\r\n } \r\n $this->grade = $params->grade;\r\n $this->ucaspoints = $params->ucaspoints;\r\n $this->bcgttargetqualid = $params->bcgttargetqualid;\r\n $this->upperscore = $params->upperscore;\r\n $this->lowerscore = $params->lowerscore;\r\n $this->ranking = $params->ranking;\r\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function getParams()\n {\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function getParams() {}", "function getParams() {\n global $id;\n global $file;\n global $teg;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n\n\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n}", "abstract public function getParameters();", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n\n\n}", "public function GetMatchedParams ();", "function getParameters()\r\n {\r\n }", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "protected function populateParams() {\r\n /**\r\n *\r\n * @var Dzit_RequestParser\r\n */\r\n $requestParser = Dzit_RequestParser::getInstance();\r\n $this->adsId = $requestParser->getPathInfoParam(1);\r\n /**\r\n *\r\n * @var Vushop_Bo_TextAds_IAdsDao\r\n */\r\n $adsDao = $this->getDao(DAO_TEXTADS);\r\n $this->ads = $adsDao->getAdsById($this->adsId);\r\n }", "abstract protected function getRequiredRequestParameters();", "public function get_url_params()\n {\n }", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "private function getAllInputParameters () {\n// \t\t$params = $this->getInputParameters();\n\t\t$params = array();\n\t\t$catalogId = $this->session->getCourseCatalogId();\n\t\tif (!$catalogId->isEqual($this->session->getCombinedCatalogId()))\n\t\t\t$params[':catalog_id'] = $this->session->getCatalogDatabaseId($catalogId);\n\t\t\n\t\t$params[':subj_code'] = $this->session->getSubjectFromCourseId($this->courseId);\n\t\t$params[':crse_numb'] = $this->session->getNumberFromCourseId($this->courseId);\n\t\t\n\t\treturn $params;\n\t}", "protected function loadParams() {\n\t $this->cpParams = new api_crud_param($this->attribs);\n\t \n // These commands need an id and a method in the url\n\t $this->cpParams->setCommand(Array('read','update','delete'))->setMethod(api_crud_param::MATTRIBUTE)->setNeed(api_crud_param::RMANDATORY)\n\t ->setType(api_crud_param::TINT)->addParam('id')\n\t ->setType(api_crud_param::TSTRING)->addParam('method');\n\t \n\t // yes, for delete, the delete param needs to be repeated in the POST as well as the id\n\t $this->cpParams->setCommand('delete')->setMethod(api_crud_param::MPOST)->setNeed(api_crud_param::RMANDATORY)\n\t ->setType(api_crud_param::TINT)->addParam('id')\n ->setType(api_crud_param::TSTRING)->addParam('method');\n\t}", "public function getCurrentLayerParams(array $params = null)\n {\n $layerParams = Mage::registry('layer_params');\n\n if (!is_array($layerParams)) {\n $layerParams = array();\n }\n\n if (!empty($params)) {\n foreach ($params as $key => $value) {\n if ($value === null) {\n unset($layerParams[$key]);\n } else {\n $layerParams[$key] = $value;\n }\n }\n }\n\n unset($layerParams['isLayerAjax']);\n\n // Sort by key - small LAYRED improvement\n ksort($layerParams);\n return $layerParams;\n }", "public function getRequestParams();", "protected function populateParams()\n\t{\n\n\t\tparent::populateParams();\n\t\t//$acl = ZefaniabibleHelper::getAcl();\n\t\t$mdl_acl = new ZefaniabibleHelper;\n\t\t$acl = $mdl_acl->getAcl();\n\t\tif (!isset($this->_data))\n\t\t\treturn;\n\n\t\t// Convert the parameter fields into objects.\n\t\tforeach ($this->_data as &$item)\n\t\t{\n\n\t\t\tif ($acl->get('core.edit.state')\n\t\t\t\t|| (bool)$item->publish)\n\t\t\t\t$item->params->set('access-view', true);\n\n\t\t\tif ($acl->get('core.edit'))\n\t\t\t\t$item->params->set('access-edit', true);\n\n\t\t\tif ($acl->get('core.delete'))\n\t\t\t\t$item->params->set('access-delete', true);\n\n\n\t\t}\n\n\t}", "function getParameters();", "function getParameters();", "protected function _getAddUrlParams()\n {\n if ($this->getListType() == \"search\") {\n return $this->getDynUrlParams();\n }\n }", "public function getParameters() {}", "protected function mollieGetAdditionalParameters()\n {\n $oRequest = Registry::getRequest();\n $oSession = Registry::getSession();\n\n $sAddParams = '';\n\n foreach ($this->aMollieUrlCopyParameters as $sParamName) {\n $sValue = $oRequest->getRequestEscapedParameter($sParamName);\n if (!empty($sValue)) {\n $sAddParams .= '&'.$sParamName.'='.$sValue;\n }\n }\n\n $sSid = $oSession->sid(true);\n if ($sSid != '') {\n $sAddParams .= '&'.$sSid;\n }\n\n if (!$oRequest->getRequestEscapedParameter('stoken')) {\n $sAddParams .= '&stoken='.$oSession->getSessionChallengeToken();\n }\n $sAddParams .= '&ord_agb=1';\n $sAddParams .= '&rtoken='.$oSession->getRemoteAccessToken();\n\n return $sAddParams;\n }", "function getParams($passAry,$base){\r\n\t\t$getName=$passAry['param_1'];\r\n\t\t$workAry=$base->utlObj->retrieveValue($getName,&$base);\r\n\t\tif ($workAry != null){\r\n\t\t\tforeach ($workAry as $paramName=>$paramValue){\r\n\t\t\t\t$base->paramsAry[$paramName]=$paramValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function populateParams() {\r\n /**\r\n *\r\n * @var Dzit_RequestParser\r\n */\r\n $requestParser = Dzit_RequestParser::getInstance();\r\n $this->adsId = $requestParser->getPathInfoParam(1);\r\n /**\r\n *\r\n * @var Vushop_Bo_TextAds_IAdsDao\r\n */\r\n $adsDao = $this->getDao(DAO_TEXTADS);\r\n $this->ads = $adsDao->getAdsById($this->adsId);\r\n if ($this->ads !== NULL) {\r\n $r = md5($this->ads->getImageId());\r\n $this->sessionKey .= $r;\r\n $_SESSION[$this->sessionKey] = $this->ads->getImageId();\r\n }\r\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "static function getTree($xmap, $parent, &$params)\n {\n $db = JFactory::getDBO();\n $app = JFactory::getApplication();\n $user = JFactory::getUser();\n $date =& JFactory::getDate(); \n $result = null;\n\n $link_query = parse_url($parent->link);\n if (!isset($link_query['query'])) {\n return;\n }\n\n parse_str(html_entity_decode($link_query['query']), $link_vars);\n $view = JArrayHelper::getValue($link_vars, 'view', '');\n $id = intval(JArrayHelper::getValue($link_vars, 'id', ''));\n\n /** Parameters Initialitation **/\n // Set expand_categories param\n $expand_categories = JArrayHelper::getValue($params, 'expand_categories', 1);\n $expand_categories = ( $expand_categories == 1\n || ( $expand_categories == 2 && $xmap->view == 'xml')\n || ( $expand_categories == 3 && $xmap->view == 'html')\n || $xmap->view == 'navigator');\n $params['expand_categories'] = $expand_categories;\n\n // Set expand_archived param\n $include_archived = JArrayHelper::getValue($params, 'include_archived', 2);\n $include_archived = ( $include_archived == 1\n || ( $include_archived == 2 && $xmap->view == 'xml')\n || ( $include_archived == 3 && $xmap->view == 'html')\n || $xmap->view == 'navigator');\n $params['include_archived'] = $include_archived;\n\n // Set show_unauth param\n $show_unauth = JArrayHelper::getValue($params, 'show_unauth', 1);\n $show_unauth = ( $show_unauth == 1\n || ( $show_unauth == 2 && $xmap->view == 'xml')\n || ( $show_unauth == 3 && $xmap->view == 'html'));\n $params['show_unauth'] = $show_unauth;\n\n $params['cat_priority'] = $parent->priority;\n $params['cat_changefreq'] = $parent->changefreq;\n\n $params['media_priority'] = $parent->priority;\n $params['media_changefreq'] = $parent->changefreq;\n\n $params['max_media'] = intval(JArrayHelper::getValue($params, 'max_media', 9999));\n $params['max_media_age'] = intval(JArrayHelper::getValue($params, 'max_media_age', 9999));\n\n $params['nullDate'] = $db->Quote($db->getNullDate());\n\n $params['nowDate'] = $db->Quote($date->toSql());\n $params['groups'] = implode(',', $user->getAuthorisedViewLevels());\n\n // Define the language filter condition for the query\n $params['language_filter'] = $app->getLanguageFilter();\n\n switch ($view) {\n case 'media':\n $result = self::includeMedia($xmap, $parent, $id, $params, $parent->id);\n break; \n case 'category':\n if ($params['expand_categories'] && $id) {\n $result = self::expandCategory($xmap, $parent, $id, $params, $parent->id);\n }\n break;\n case 'categories':\n if ($params['expand_categories']) {\n $result = self::expandCategory($xmap, $parent, 1, $params, $parent->id);\n }\n break;\n }\n return $result;\n }", "public function _getParamsCreate()\n {\n extract($this->modelOptions);\n $model = $this->modelOptions;\n\n $params['modeloptions'] = $this->modelOptions;\n $referenceValues = array();\n $mapValues = array();\n foreach ($this->modelOptions['modelfield'] as $key => $value) {\n if (array_key_exists('reference', $value)) {\n $ref = $value['reference'];\n if (array_key_exists('type', $ref) && $ref['type'] == 'reference_table') {\n $getValues = $this->db->query('SELECT * from '.$ref['table_name'].' where is_delete = 0')->result_array();\n $referenceValues[$key] = $getValues;\n\n $getMap = $this->db->query('SELECT * from '.$ref['reference_table'].' order by id ASC')->result_array();\n $mapValues[$key] = $getMap;\n } elseif ((array_key_exists('type', $ref) && $ref['type'] == 'master_table') || !array_key_exists('type', $ref)) {\n $source = 'name';\n if (array_key_exists('source_key', $ref)) $source = $ref['source_key'];\n\n $getValues = $this->db->query('SELECT * from '.$ref['table_name'].' where is_delete = 0 ORDER by '.$source.' ASC')->result_array();\n $referenceValues[$key] = $getValues;\n } \n }\n\n if (array_key_exists('values', $value)) {\n $referenceValues[$key] = $value['values'];\n }\n\n if (count($referenceValues) > 0) $params['referencevalues'] = $referenceValues;\n if (count($mapValues) > 0) $params['mapValues'] = $mapValues;\n }\n \n $params['activemenu'] = $model['modulename'];\n $params['pagetitle'] = 'Create New '.$model['modulename'];\n $params['modulename'] = $model['modulename'];\n $params['breadcrumb'] = array(\n $modulename => base_url().$route,\n 'Create new '.$modulename => ''\n );\n if (isset($parentmenu)) $params['parentmenu'] = $parentmenu;\n return $params;\n }", "function SetUpMasterParms() {\r\n\t\tglobal $rekeningju;\r\n\r\n\t\t// Hide foreign keys\r\n\t\t$sMasterTblVar = $rekeningju->getCurrentMasterTable();\r\n\t\tif ($sMasterTblVar == \"master_transaksi2\") {\r\n\t\t\t$rekeningju->kode_otomatis_master->Visible = FALSE;\r\n\t\t\tif ($GLOBALS[\"master_transaksi2\"]->EventCancelled) $rekeningju->EventCancelled = TRUE;\r\n\t\t}\r\n\t\t$this->DbMasterFilter = $rekeningju->getMasterFilter(); // Get master filter\r\n\t\t$this->DbDetailFilter = $rekeningju->getDetailFilter(); // Get detail filter\r\n\t}", "protected function _set_request_data_from_params(){\n \n //if( !$this->request->is('post') && !empty($this->request->params['named'])){\n// $this->request->data['Region']['id'] = $this->request->params['named']['region_id'];\n// $this->request->data['Area']['id'] = $this->request->params['named']['area_id'];\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// \n// if( isset($this->request->params['named']['house_id']) ){\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// }\n// if( isset($this->request->params['named']['representative_id']) ){\n// $this->request->data['Representative']['id'] = $this->request->params['named']['representative_id'];\n// }\n// if( isset($this->request->params['named']['section_id']) ){\n// $this->request->data['Section']['id'] = $this->request->params['named']['section_id'];\n// }\n// if( isset($this->request->params['named']['outlet_id']) ){\n// $this->request->data['Outlet']['id'] = $this->request->params['named']['outlet_id'];\n// }\n// if( isset($this->request->params['named']['from_date']) ){\n// $this->request->data['from_date'] = $this->request->params['named']['from_date'];\n// }\n// if( isset($this->request->params['named']['till_date']) ){\n// $this->request->data['till_date'] = $this->request->params['named']['till_date'];\n// }\n //} \n \n $this->request->data['Region']['id'] = $this->request->query['region_id'];\n $this->request->data['Area']['id'] = $this->request->query['area_id'];\n $this->request->data['House']['id'] = $this->request->query['house_id'];\n \n \n if( isset($this->request->params['named']['representative_id']) ){\n $this->request->data['Representative']['id'] = $this->request->query['representative_id'];\n }\n if( isset($this->request->params['named']['section_id']) ){\n $this->request->data['Section']['id'] = $this->request->query['section_id'];\n }\n if( isset($this->request->params['named']['outlet_id']) ){\n $this->request->data['Outlet']['id'] = $this->request->query['outlet_id'];\n }\n if( isset($this->request->params['named']['from_date']) ){\n $this->request->data['from_date'] = $this->request->query['from_date'];\n }\n if( isset($this->request->params['named']['till_date']) ){\n $this->request->data['till_date'] = $this->request->query['till_date'];\n }\n }", "public function getUrlParameters() {\n\t\t$parameters = $this->parameters;\n\t\tif ($this->profile) {\n\t\t\t$parameters['profile'] = $this->profile;\n\t\t}\n\t\treturn $parameters;\n\t}", "public function getParams(){\n return $this->params;\n }", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "function getParentsIdArray($sourceArr, $id) {\r\n\t$arrParents [] = $id;\r\n\t//$this->findParents ( $sourceArr, $id, &$arrParents );\r\n\treturn $arrParents;\r\n}", "private function _getUrlParamsForFormAction() {\n\n $param = $this->params()->fromRoute('param');\n $param2 = $this->params()->fromRoute('param2');\n $value = $this->params()->fromRoute('value', 0);\n $value2 = $this->params()->fromRoute('value2', 0);\n\n $params = array(\n 'productId' => 0,\n 'categoryId' => 0,\n 'parentId' => 0\n );\n\n// $productId = $categoryId = null;\n// if ($param == \"product\") {\n// $productId = $value;\n// $categoryId = $value2;\n// } else if ($param == \"category\") {\n// $productId = $value2;\n// $categoryId = $value;\n// }\n\n switch ($param) {\n case 'product':\n $params['productId'] = $value;\n $params['categoryId'] = $value2;\n break;\n case 'category':\n $params['productId'] = $value2;\n $params['categoryId'] = $value;\n break;\n case 'parent':\n $params['parentId'] = $value;\n break;\n default:\n break;\n }\n\n return $params;\n }", "function getRouteParameters();", "private function getExternalSourceFields()\r\n\t{\r\n\t\t// Get global var\r\n\t\tglobal $realtime_webservice_url_metadata, $lang;\r\n\t\t// Call the URL as POST request\r\n\t\t$params = array('user'=>USERID, 'project_id'=>$this->project_id, 'redcap_url'=>APP_PATH_WEBROOT_FULL);\r\n\t\t$metadata_json = http_post($realtime_webservice_url_metadata, $params, 30);\r\n\t\t// Decode json into array\r\n\t\t$metadata_array = json_decode($metadata_json, true);\r\n\t\t// Display an error if the web service can't be reached or if the response is not JSON encoded\r\n\t\tif (!$metadata_json || !is_array($metadata_array)) {\r\n\t\t\t$msg = $lang['ws_159'].\"<br>\";\r\n\t\t\tif ($metadata_json !== false && !is_array($metadata_array)) {\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_160'];\r\n\t\t\t} elseif ($metadata_json === false) {\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_161'];\r\n\t\t\t}\r\n\t\t\t$msg = RCView::div(array('class'=>'red', 'style'=>'margin-top:20px;'), $msg);\r\n\t\t\tif (SUPER_USER) {\r\n\t\t\t\t$msg .= RCView::div(array('style'=>'margin-top:50px;font-size:14px;font-weight:bold;'),\r\n\t\t\t\t\t\t\t$lang['global_01'] . $lang['colon']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'max-width:800px;border:1px solid #ccc;padding:5px;'), $metadata_json);\r\n\t\t\t}\r\n\t\t\texit($msg);\r\n\t\t}\r\n\t\t// Loop through array of source fields to ensure that one is the identifier\r\n\t\t$num_id_fields = 0;\r\n\t\tforeach ($metadata_array as $key=>&$attr) {\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$num_id_fields++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($num_id_fields != 1) {\r\n\t\t\t$msg = $lang['ws_159'].\"<br>\";\r\n\t\t\tif ($num_id_fields == 0) {\r\n\t\t\t\t// No id field\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_162'];\r\n\t\t\t} elseif ($num_id_fields > 1) {\r\n\t\t\t\t// More than one id field\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_163'];\r\n\t\t\t}\r\n\t\t\t$msg .= \" \".$lang['ws_164'].\" (e.g., [{\\\"field\\\":\\\"mrn\\\",\\\"identifier\\\":\\\"1\\\",...}])\".$lang['period'].\" \".$lang['ws_165'];\r\n\t\t\texit( RCView::div(array('class'=>'red'), $msg));\r\n\t\t}\r\n\t\t\r\n\t\t// Keep an array with the cat-subcat-fieldname concatenated together for sorting purposes later\r\n\t\t$field_sorter = array();\r\n\t\t\r\n\t\t// Make sure we have all the correct elements for each field\r\n\t\t$metadata_array2 = array();\r\n\t\t$id_field_key = null;\r\n\t\tforeach ($metadata_array as $key=>&$attr) \r\n\t\t{\r\n\t\t\t$attr2 = array(\t'field'=>$attr['field'], \r\n\t\t\t\t\t\t\t'temporal'=>($attr['temporal'] == '1' ? 1 : 0),\r\n\t\t\t\t\t\t\t'label'=>$attr['label'], \r\n\t\t\t\t\t\t\t'description'=>$attr['description'], \r\n\t\t\t\t\t\t\t'category'=>$attr['category'], \r\n\t\t\t\t\t\t\t'subcategory'=>$attr['subcategory']\r\n\t\t\t\t\t\t );\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$attr2['identifier'] = 1;\r\n\t\t\t\t// Always set the source id field's cat and subcat to blank so that it's viewed separate from the other fields\r\n\t\t\t\t$attr2['category'] = $attr2['subcategory'] = '';\r\n\t\t\t\t// Set key value for $id_field_key\r\n\t\t\t\t$id_field_key = $key;\r\n\t\t\t} else {\r\n\t\t\t\t// Add cat-subcat-fieldname concatenated together (don't do this for ID field)\r\n\t\t\t\t$field_sorter[] = $attr['category'].'---'.$attr['subcategory'].'---'.$attr['field'];\r\n\t\t\t}\r\n\t\t\t// Add to new array\r\n\t\t\t$metadata_array2[$key] = $attr2;\r\n\t\t}\r\n\t\t$metadata_array = $metadata_array2;\r\n\t\tunset($metadata_array2);\r\n\t\t\r\n\t\t## Put ID field first and then order all cats, subcats, and fields alphabetically\r\n\t\t// Remove ID field for now since we'll add it back at the end\r\n\t\t$id_field_array = $metadata_array[$id_field_key];\r\n\t\tunset($metadata_array[$id_field_key]);\r\n\t\t\r\n\t\t// Sort all fields by cat, subcat, field name\r\n\t\tarray_multisort($field_sorter, SORT_REGULAR, $metadata_array);\r\n\t\t\r\n\t\t// Finally, add ID field back to array at beginning\r\n\t\t$metadata_array = array_merge(array($id_field_array), $metadata_array);\r\n\t\t\r\n\t\t// Return array of fields (or false if not JSON encoded)\r\n\t\treturn (is_array($metadata_array) ? $metadata_array : false);\r\n\t}", "function getAdditionalParams() {\n return array(\n 'route' => $this->getRouteName(),\n ); // array\n }", "abstract public function getVerticesTarget();", "function get_layer_connection($layer_id) {\n\t\t# $layer_id < 0 Rollenlayer else normal layer\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t`connection_id`,\n\t\t\t\t\" . ($layer_id < 0 ? \"'\" . CUSTOM_SHAPE_SCHEMA . \"' AS \" : \"\") . \"`schema`\n\t\t\tFROM\n\t\t\t\t\" . ($layer_id < 0 ? \"rollenlayer\" : \"layer\") . \"\n\t\t\tWHERE\n\t\t\t\t\" . ($layer_id < 0 ? \"-id\" : \"Layer_ID\") . \" = \" . $layer_id . \" AND\n\t\t\t\t`connectiontype` = 6\n\t\t\";\n\t\t$this->debug->write(\"<p>file:kvwmap class:db_mapObj->get_layer_connection - Lesen der connection Daten des Layers:<br>\" . $sql, 4);\n\t\t$this->db->execSQL($sql);\t\t\n\t\tif ($this->db->success) {\n\t\t\treturn $this->db->result->fetch_assoc();\n\t\t}\n\t\telse {\n\t\t\t$this->debug->write(\"<br>Abbruch beim Lesen der Layer connection in get_layer_connection, Zeile: \" . __LINE__ . \"<br>\" . $this->db->mysqli->error, 4);\n\t\t\treturn array();\n\t\t}\n\t}", "public function getParams() :array\n \t{\n \t\treturn $this->finalParams;\n \t}" ]
[ "0.57760984", "0.5748526", "0.5623432", "0.5569858", "0.5569858", "0.5569858", "0.5569858", "0.55681133", "0.5532781", "0.55246586", "0.54457885", "0.543907", "0.543907", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.54380983", "0.5384091", "0.5384091", "0.5384091", "0.5373542", "0.5373542", "0.5339883", "0.5287517", "0.5218714", "0.5209252", "0.5205946", "0.52028036", "0.5163021", "0.51569146", "0.5110714", "0.51057446", "0.5096991", "0.50440097", "0.50348467", "0.50342774", "0.5030366", "0.50004375", "0.49775302", "0.49775302", "0.4955657", "0.4934142", "0.49290347", "0.4920915", "0.49185574", "0.490468", "0.490468", "0.490468", "0.490468", "0.490468", "0.490468", "0.490468", "0.490468", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.49040934", "0.48946717", "0.48788255", "0.48641515", "0.48539406", "0.4841618", "0.4817871", "0.48159125", "0.48159125", "0.48115894", "0.48115322", "0.48114553", "0.48092306", "0.48044774", "0.47895926", "0.47859082", "0.477353" ]
0.47866136
98