repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
titon/db
src/Titon/Db/Query.php
Query.attribute
public function attribute($key, $value = null) { if (is_array($key)) { $this->_attributes = array_replace($this->_attributes, $key); } else { $this->_attributes[$key] = $value; } return $this; }
php
public function attribute($key, $value = null) { if (is_array($key)) { $this->_attributes = array_replace($this->_attributes, $key); } else { $this->_attributes[$key] = $value; } return $this; }
[ "public", "function", "attribute", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "$", "this", "->", "_attributes", "=", "array_replace", "(", "$", "this", "->", "_attributes", ",", ...
Set an attribute. @param string $key @param mixed $value @return $this
[ "Set", "an", "attribute", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L224-L232
titon/db
src/Titon/Db/Query.php
Query.bindCallback
public function bindCallback($callback, $argument = null) { if ($callback instanceof Closure) { call_user_func_array($callback, [$this, $argument]); } return $this; }
php
public function bindCallback($callback, $argument = null) { if ($callback instanceof Closure) { call_user_func_array($callback, [$this, $argument]); } return $this; }
[ "public", "function", "bindCallback", "(", "$", "callback", ",", "$", "argument", "=", "null", ")", "{", "if", "(", "$", "callback", "instanceof", "Closure", ")", "{", "call_user_func_array", "(", "$", "callback", ",", "[", "$", "this", ",", "$", "argume...
Bind a Closure callback to this query and execute it. @param \Closure $callback @param mixed $argument @return $this
[ "Bind", "a", "Closure", "callback", "to", "this", "query", "and", "execute", "it", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L251-L257
titon/db
src/Titon/Db/Query.php
Query.cache
public function cache($key, $expires = null) { if ($this->getType() !== self::SELECT) { return $this; } $this->_cacheKey = $key; $this->_cacheLength = $expires; return $this; }
php
public function cache($key, $expires = null) { if ($this->getType() !== self::SELECT) { return $this; } $this->_cacheKey = $key; $this->_cacheLength = $expires; return $this; }
[ "public", "function", "cache", "(", "$", "key", ",", "$", "expires", "=", "null", ")", "{", "if", "(", "$", "this", "->", "getType", "(", ")", "!==", "self", "::", "SELECT", ")", "{", "return", "$", "this", ";", "}", "$", "this", "->", "_cacheKey...
Set the cache key and duration length. @param mixed $key @param mixed $expires @return $this
[ "Set", "the", "cache", "key", "and", "duration", "length", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L266-L275
titon/db
src/Titon/Db/Query.php
Query.count
public function count() { $repo = $this->getRepository(); return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey()); }
php
public function count() { $repo = $this->getRepository(); return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey()); }
[ "public", "function", "count", "(", ")", "{", "$", "repo", "=", "$", "this", "->", "getRepository", "(", ")", ";", "return", "$", "repo", "->", "aggregate", "(", "$", "this", "->", "limit", "(", "0", ")", ",", "__FUNCTION__", ",", "$", "repo", "->"...
Pass the query to the repository to interact with the database. Return the count of how many records exist. @return int
[ "Pass", "the", "query", "to", "the", "repository", "to", "interact", "with", "the", "database", ".", "Return", "the", "count", "of", "how", "many", "records", "exist", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L283-L287
titon/db
src/Titon/Db/Query.php
Query.data
public function data($data) { if ($data instanceof Arrayable) { $data = $data->toArray(); } else if (!is_array($data)) { throw new InvalidArgumentException('Data passed must be an array or extend the Titon\Type\Contract\Arrayable interface'); } $type = $this->ge...
php
public function data($data) { if ($data instanceof Arrayable) { $data = $data->toArray(); } else if (!is_array($data)) { throw new InvalidArgumentException('Data passed must be an array or extend the Titon\Type\Contract\Arrayable interface'); } $type = $this->ge...
[ "public", "function", "data", "(", "$", "data", ")", "{", "if", "(", "$", "data", "instanceof", "Arrayable", ")", "{", "$", "data", "=", "$", "data", "->", "toArray", "(", ")", ";", "}", "else", "if", "(", "!", "is_array", "(", "$", "data", ")", ...
Set the data to use in an update, insert, or create index statement. We should also extract data to later bind during a prepared statement. @param array|\Titon\Type\Contract\Arrayable $data @return $this @throws \Titon\Db\Exception\InvalidArgumentException
[ "Set", "the", "data", "to", "use", "in", "an", "update", "insert", "or", "create", "index", "statement", ".", "We", "should", "also", "extract", "data", "to", "later", "bind", "during", "a", "prepared", "statement", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L297-L331
titon/db
src/Titon/Db/Query.php
Query.except
public function except(Query $query, $flag = null) { if ($flag === Dialect::ALL) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::EXCEPT, $query); }
php
public function except(Query $query, $flag = null) { if ($flag === Dialect::ALL) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::EXCEPT, $query); }
[ "public", "function", "except", "(", "Query", "$", "query", ",", "$", "flag", "=", "null", ")", "{", "if", "(", "$", "flag", "===", "Dialect", "::", "ALL", ")", "{", "$", "query", "->", "attribute", "(", "'flag'", ",", "$", "flag", ")", ";", "}",...
Add a select query as an except. @param \Titon\Db\Query $query @param string $flag @return $this
[ "Add", "a", "select", "query", "as", "an", "except", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L349-L355
titon/db
src/Titon/Db/Query.php
Query.fields
public function fields($fields, $merge = false) { if (!is_array($fields)) { $fields = func_get_args(); $merge = false; } if ($merge) { $fields = array_merge($this->_fields, $fields); } // When doing a select, unique the field list if ...
php
public function fields($fields, $merge = false) { if (!is_array($fields)) { $fields = func_get_args(); $merge = false; } if ($merge) { $fields = array_merge($this->_fields, $fields); } // When doing a select, unique the field list if ...
[ "public", "function", "fields", "(", "$", "fields", ",", "$", "merge", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "fields", ")", ")", "{", "$", "fields", "=", "func_get_args", "(", ")", ";", "$", "merge", "=", "false", ";", "}"...
Set the list of fields to return. @param string|array $fields @param bool $merge @return $this
[ "Set", "the", "list", "of", "fields", "to", "return", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L364-L382
titon/db
src/Titon/Db/Query.php
Query.getAlias
public function getAlias() { if ($this->getJoins() || $this instanceof SubQuery || in_array($this->getType(), [self::CREATE_INDEX, self::DROP_INDEX])) { return $this->_alias; } return null; }
php
public function getAlias() { if ($this->getJoins() || $this instanceof SubQuery || in_array($this->getType(), [self::CREATE_INDEX, self::DROP_INDEX])) { return $this->_alias; } return null; }
[ "public", "function", "getAlias", "(", ")", "{", "if", "(", "$", "this", "->", "getJoins", "(", ")", "||", "$", "this", "instanceof", "SubQuery", "||", "in_array", "(", "$", "this", "->", "getType", "(", ")", ",", "[", "self", "::", "CREATE_INDEX", "...
Only return the alias if joins have been set or this is a sub-query. @return string
[ "Only", "return", "the", "alias", "if", "joins", "have", "been", "set", "or", "this", "is", "a", "sub", "-", "query", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L424-L430
titon/db
src/Titon/Db/Query.php
Query.getFields
public function getFields() { $fields = $this->_fields; if ($this->getJoins() && !$fields && $this->getType() === self::SELECT) { return array_keys($this->getRepository()->getSchema()->getColumns()); } return $fields; }
php
public function getFields() { $fields = $this->_fields; if ($this->getJoins() && !$fields && $this->getType() === self::SELECT) { return array_keys($this->getRepository()->getSchema()->getColumns()); } return $fields; }
[ "public", "function", "getFields", "(", ")", "{", "$", "fields", "=", "$", "this", "->", "_fields", ";", "if", "(", "$", "this", "->", "getJoins", "(", ")", "&&", "!", "$", "fields", "&&", "$", "this", "->", "getType", "(", ")", "===", "self", ":...
Return the list of fields and or values. Return all table fields if a join exists and no fields were whitelisted. @return string[]
[ "Return", "the", "list", "of", "fields", "and", "or", "values", ".", "Return", "all", "table", "fields", "if", "a", "join", "exists", "and", "no", "fields", "were", "whitelisted", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L483-L491
titon/db
src/Titon/Db/Query.php
Query.groupBy
public function groupBy() { $fields = func_get_args(); if (is_array($fields[0])) { $fields = $fields[0]; } $this->_groupBy = array_unique(array_merge($this->_groupBy, $fields)); return $this; }
php
public function groupBy() { $fields = func_get_args(); if (is_array($fields[0])) { $fields = $fields[0]; } $this->_groupBy = array_unique(array_merge($this->_groupBy, $fields)); return $this; }
[ "public", "function", "groupBy", "(", ")", "{", "$", "fields", "=", "func_get_args", "(", ")", ";", "if", "(", "is_array", "(", "$", "fields", "[", "0", "]", ")", ")", "{", "$", "fields", "=", "$", "fields", "[", "0", "]", ";", "}", "$", "this"...
Set what fields to group on. @return $this
[ "Set", "what", "fields", "to", "group", "on", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L601-L611
titon/db
src/Titon/Db/Query.php
Query.having
public function having($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value); }
php
public function having($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value); }
[ "public", "function", "having", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_having", ",", "Predicate", "::", "ALSO", ",", "$", ...
Will modify or create a having predicate using the AND conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "having", "predicate", "using", "the", "AND", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L621-L623
titon/db
src/Titon/Db/Query.php
Query.innerJoin
public function innerJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::INNER, $table, $fields, $on); }
php
public function innerJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::INNER, $table, $fields, $on); }
[ "public", "function", "innerJoin", "(", "$", "table", ",", "array", "$", "fields", "=", "[", "]", ",", "array", "$", "on", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_addJoin", "(", "Join", "::", "INNER", ",", "$", "table", ",", "$", ...
Add a new INNER join. @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "INNER", "join", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L633-L635
titon/db
src/Titon/Db/Query.php
Query.intersect
public function intersect(Query $query, $flag = null) { if ($flag === Dialect::ALL) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::INTERSECT, $query); }
php
public function intersect(Query $query, $flag = null) { if ($flag === Dialect::ALL) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::INTERSECT, $query); }
[ "public", "function", "intersect", "(", "Query", "$", "query", ",", "$", "flag", "=", "null", ")", "{", "if", "(", "$", "flag", "===", "Dialect", "::", "ALL", ")", "{", "$", "query", "->", "attribute", "(", "'flag'", ",", "$", "flag", ")", ";", "...
Add a select query as an intersect. @param \Titon\Db\Query $query @param string $flag @return $this
[ "Add", "a", "select", "query", "as", "an", "intersect", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L644-L650
titon/db
src/Titon/Db/Query.php
Query.last
public function last(array $options = []) { if ($order = $this->getOrderBy()) { $this->_orderBy = []; foreach ($order as $field => $dir) { if ($dir === 'asc') { $dir = 'desc'; } else if ($dir === 'desc') { $dir = 'a...
php
public function last(array $options = []) { if ($order = $this->getOrderBy()) { $this->_orderBy = []; foreach ($order as $field => $dir) { if ($dir === 'asc') { $dir = 'desc'; } else if ($dir === 'desc') { $dir = 'a...
[ "public", "function", "last", "(", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "order", "=", "$", "this", "->", "getOrderBy", "(", ")", ")", "{", "$", "this", "->", "_orderBy", "=", "[", "]", ";", "foreach", "(", "$", "ord...
Return the last record from the results. Reverse the direction of any order by declarations. @param array $options @return \Titon\Db\Entity
[ "Return", "the", "last", "record", "from", "the", "results", ".", "Reverse", "the", "direction", "of", "any", "order", "by", "declarations", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L659-L681
titon/db
src/Titon/Db/Query.php
Query.leftJoin
public function leftJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::LEFT, $table, $fields, $on); }
php
public function leftJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::LEFT, $table, $fields, $on); }
[ "public", "function", "leftJoin", "(", "$", "table", ",", "array", "$", "fields", "=", "[", "]", ",", "array", "$", "on", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_addJoin", "(", "Join", "::", "LEFT", ",", "$", "table", ",", "$", ...
Add a new LEFT join. @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "LEFT", "join", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L691-L693
titon/db
src/Titon/Db/Query.php
Query.lists
public function lists($value = null, $key = null, array $options = []) { $repo = $this->getRepository(); $key = $key ?: $repo->getPrimaryKey(); $value = $value ?: $repo->getDisplayField(); $options['key'] = $key; $options['value'] = $value; return $this->fields([$key, $...
php
public function lists($value = null, $key = null, array $options = []) { $repo = $this->getRepository(); $key = $key ?: $repo->getPrimaryKey(); $value = $value ?: $repo->getDisplayField(); $options['key'] = $key; $options['value'] = $value; return $this->fields([$key, $...
[ "public", "function", "lists", "(", "$", "value", "=", "null", ",", "$", "key", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "repo", "=", "$", "this", "->", "getRepository", "(", ")", ";", "$", "key", "=", "$", "key"...
Return all records as a key value list. @param string $value @param string $key @param array $options @return array
[ "Return", "all", "records", "as", "a", "key", "value", "list", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L720-L729
titon/db
src/Titon/Db/Query.php
Query.orderBy
public function orderBy($field, $direction = self::DESC) { if (is_array($field)) { foreach ($field as $key => $dir) { $this->orderBy($key, $dir); } } else if ($field === 'RAND') { $this->_orderBy[] = $this->func('RAND'); } else if ($field ins...
php
public function orderBy($field, $direction = self::DESC) { if (is_array($field)) { foreach ($field as $key => $dir) { $this->orderBy($key, $dir); } } else if ($field === 'RAND') { $this->_orderBy[] = $this->func('RAND'); } else if ($field ins...
[ "public", "function", "orderBy", "(", "$", "field", ",", "$", "direction", "=", "self", "::", "DESC", ")", "{", "if", "(", "is_array", "(", "$", "field", ")", ")", "{", "foreach", "(", "$", "field", "as", "$", "key", "=>", "$", "dir", ")", "{", ...
Set the fields and direction to order by. @param string|array $field @param string $direction @return $this @throws \Titon\Db\Exception\InvalidArgumentException
[ "Set", "the", "fields", "and", "direction", "to", "order", "by", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L771-L794
titon/db
src/Titon/Db/Query.php
Query.orHaving
public function orHaving($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::EITHER, $field, $op, $value); }
php
public function orHaving($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::EITHER, $field, $op, $value); }
[ "public", "function", "orHaving", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_having", ",", "Predicate", "::", "EITHER", ",", "$"...
Will modify or create a having predicate using the OR conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "having", "predicate", "using", "the", "OR", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L804-L806
titon/db
src/Titon/Db/Query.php
Query.orWhere
public function orWhere($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value); }
php
public function orWhere($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value); }
[ "public", "function", "orWhere", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_where", ",", "Predicate", "::", "EITHER", ",", "$", ...
Will modify or create a where predicate using the OR conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "where", "predicate", "using", "the", "OR", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L816-L818
titon/db
src/Titon/Db/Query.php
Query.outerJoin
public function outerJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::OUTER, $table, $fields, $on); }
php
public function outerJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::OUTER, $table, $fields, $on); }
[ "public", "function", "outerJoin", "(", "$", "table", ",", "array", "$", "fields", "=", "[", "]", ",", "array", "$", "on", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_addJoin", "(", "Join", "::", "OUTER", ",", "$", "table", ",", "$", ...
Add a new OUTER join. @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "OUTER", "join", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L828-L830
titon/db
src/Titon/Db/Query.php
Query.rightJoin
public function rightJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::RIGHT, $table, $fields, $on); }
php
public function rightJoin($table, array $fields = [], array $on = []) { return $this->_addJoin(Join::RIGHT, $table, $fields, $on); }
[ "public", "function", "rightJoin", "(", "$", "table", ",", "array", "$", "fields", "=", "[", "]", ",", "array", "$", "on", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_addJoin", "(", "Join", "::", "RIGHT", ",", "$", "table", ",", "$", ...
Add a new RIGHT join. @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "RIGHT", "join", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L840-L842
titon/db
src/Titon/Db/Query.php
Query.save
public function save($data = null, array $options = []) { if ($data) { $this->data($data); } return $this->getRepository()->save($this, $options); }
php
public function save($data = null, array $options = []) { if ($data) { $this->data($data); } return $this->getRepository()->save($this, $options); }
[ "public", "function", "save", "(", "$", "data", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "data", ")", "{", "$", "this", "->", "data", "(", "$", "data", ")", ";", "}", "return", "$", "this", "->", "ge...
Pass the query to the repository to interact with the database. Return the count of how many records were affected. @param array|\Titon\Type\Contract\Arrayable $data @param array $options @return int
[ "Pass", "the", "query", "to", "the", "repository", "to", "interact", "with", "the", "database", ".", "Return", "the", "count", "of", "how", "many", "records", "were", "affected", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L852-L858
titon/db
src/Titon/Db/Query.php
Query.setType
public function setType($type) { if (!in_array($type, [ self::INSERT, self::MULTI_INSERT, self::SELECT, self::UPDATE, self::DELETE, self::TRUNCATE, self::CREATE_TABLE, self::CREATE_INDEX, self::DROP_TABLE, self::DROP_INDEX ], true)) { throw new UnsupportedTypeExceptio...
php
public function setType($type) { if (!in_array($type, [ self::INSERT, self::MULTI_INSERT, self::SELECT, self::UPDATE, self::DELETE, self::TRUNCATE, self::CREATE_TABLE, self::CREATE_INDEX, self::DROP_TABLE, self::DROP_INDEX ], true)) { throw new UnsupportedTypeExceptio...
[ "public", "function", "setType", "(", "$", "type", ")", "{", "if", "(", "!", "in_array", "(", "$", "type", ",", "[", "self", "::", "INSERT", ",", "self", "::", "MULTI_INSERT", ",", "self", "::", "SELECT", ",", "self", "::", "UPDATE", ",", "self", "...
Set the type of query. @param string $type @return $this @throws \Titon\Db\Exception\UnsupportedTypeException
[ "Set", "the", "type", "of", "query", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L879-L894
titon/db
src/Titon/Db/Query.php
Query.straightJoin
public function straightJoin($table, array $fields, array $on = []) { return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on); }
php
public function straightJoin($table, array $fields, array $on = []) { return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on); }
[ "public", "function", "straightJoin", "(", "$", "table", ",", "array", "$", "fields", ",", "array", "$", "on", "=", "[", "]", ")", "{", "return", "$", "this", "->", "_addJoin", "(", "Join", "::", "STRAIGHT", ",", "$", "table", ",", "$", "fields", "...
Add a new STRAIGHT join. @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "STRAIGHT", "join", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L904-L906
titon/db
src/Titon/Db/Query.php
Query.subQuery
public function subQuery() { $query = new SubQuery(Query::SELECT, $this->getRepository()); $query->fields(func_get_args()); return $query; }
php
public function subQuery() { $query = new SubQuery(Query::SELECT, $this->getRepository()); $query->fields(func_get_args()); return $query; }
[ "public", "function", "subQuery", "(", ")", "{", "$", "query", "=", "new", "SubQuery", "(", "Query", "::", "SELECT", ",", "$", "this", "->", "getRepository", "(", ")", ")", ";", "$", "query", "->", "fields", "(", "func_get_args", "(", ")", ")", ";", ...
Instantiate a new query object that will be used for sub-queries. @return \Titon\Db\Query\SubQuery
[ "Instantiate", "a", "new", "query", "object", "that", "will", "be", "used", "for", "sub", "-", "queries", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L913-L918
titon/db
src/Titon/Db/Query.php
Query.union
public function union(Query $query, $flag = null) { if ($flag === Dialect::ALL || $flag === Dialect::DISTINCT) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::UNION, $query); }
php
public function union(Query $query, $flag = null) { if ($flag === Dialect::ALL || $flag === Dialect::DISTINCT) { $query->attribute('flag', $flag); } return $this->_addCompound(Dialect::UNION, $query); }
[ "public", "function", "union", "(", "Query", "$", "query", ",", "$", "flag", "=", "null", ")", "{", "if", "(", "$", "flag", "===", "Dialect", "::", "ALL", "||", "$", "flag", "===", "Dialect", "::", "DISTINCT", ")", "{", "$", "query", "->", "attribu...
Add a select query as a union. @param \Titon\Db\Query $query @param string $flag @return $this
[ "Add", "a", "select", "query", "as", "a", "union", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L946-L952
titon/db
src/Titon/Db/Query.php
Query.where
public function where($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::ALSO, $field, $op, $value); }
php
public function where($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::ALSO, $field, $op, $value); }
[ "public", "function", "where", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_where", ",", "Predicate", "::", "ALSO", ",", "$", "f...
Will modify or create a where predicate using the AND conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "where", "predicate", "using", "the", "AND", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L962-L964
titon/db
src/Titon/Db/Query.php
Query.xorHaving
public function xorHaving($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value); }
php
public function xorHaving($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value); }
[ "public", "function", "xorHaving", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_having", ",", "Predicate", "::", "MAYBE", ",", "$"...
Will modify or create a having predicate using the XOR conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "having", "predicate", "using", "the", "XOR", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L974-L976
titon/db
src/Titon/Db/Query.php
Query.xorWhere
public function xorWhere($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::MAYBE, $field, $op, $value); }
php
public function xorWhere($field, $op = null, $value = null) { return $this->_modifyPredicate($this->_where, Predicate::MAYBE, $field, $op, $value); }
[ "public", "function", "xorWhere", "(", "$", "field", ",", "$", "op", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "_modifyPredicate", "(", "$", "this", "->", "_where", ",", "Predicate", "::", "MAYBE", ",", "$", ...
Will modify or create a where predicate using the XOR conjunction. @param string $field @param string $op @param mixed $value @return $this
[ "Will", "modify", "or", "create", "a", "where", "predicate", "using", "the", "XOR", "conjunction", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L986-L988
titon/db
src/Titon/Db/Query.php
Query._addCompound
protected function _addCompound($type, Query $query) { if ($query->getType() !== self::SELECT) { throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type)); } $query->attribute('compound', $type); $this->_compounds[] = $query; return...
php
protected function _addCompound($type, Query $query) { if ($query->getType() !== self::SELECT) { throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type)); } $query->attribute('compound', $type); $this->_compounds[] = $query; return...
[ "protected", "function", "_addCompound", "(", "$", "type", ",", "Query", "$", "query", ")", "{", "if", "(", "$", "query", "->", "getType", "(", ")", "!==", "self", "::", "SELECT", ")", "{", "throw", "new", "InvalidQueryException", "(", "sprintf", "(", ...
Add a new compound query. Only select queries can be used with compounds. @param string $type @param \Titon\Db\Query $query @return $this @throws \Titon\Db\Exception\InvalidQueryException
[ "Add", "a", "new", "compound", "query", ".", "Only", "select", "queries", "can", "be", "used", "with", "compounds", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L998-L1008
titon/db
src/Titon/Db/Query.php
Query._addJoin
protected function _addJoin($type, $table, $fields, $on = []) { $repo = $this->getRepository(); $join = new Join($type); $conditions = []; if (is_array($table)) { $alias = $table[1]; $table = $table[0]; } else { $alias = $table; } ...
php
protected function _addJoin($type, $table, $fields, $on = []) { $repo = $this->getRepository(); $join = new Join($type); $conditions = []; if (is_array($table)) { $alias = $table[1]; $table = $table[0]; } else { $alias = $table; } ...
[ "protected", "function", "_addJoin", "(", "$", "type", ",", "$", "table", ",", "$", "fields", ",", "$", "on", "=", "[", "]", ")", "{", "$", "repo", "=", "$", "this", "->", "getRepository", "(", ")", ";", "$", "join", "=", "new", "Join", "(", "$...
Add a new join type. @param string $type @param string|array $table @param array $fields @param array $on @return $this
[ "Add", "a", "new", "join", "type", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L1019-L1046
titon/db
src/Titon/Db/Query.php
Query._modifyPredicate
protected function _modifyPredicate(&$predicate, $type, $field, $op, $value) { if (!$predicate) { $predicate = new Predicate($type); } else if ($predicate->getType() !== $type) { throw new ExistingPredicateException(sprintf('Predicate clause already created using "%s" conjunctio...
php
protected function _modifyPredicate(&$predicate, $type, $field, $op, $value) { if (!$predicate) { $predicate = new Predicate($type); } else if ($predicate->getType() !== $type) { throw new ExistingPredicateException(sprintf('Predicate clause already created using "%s" conjunctio...
[ "protected", "function", "_modifyPredicate", "(", "&", "$", "predicate", ",", "$", "type", ",", "$", "field", ",", "$", "op", ",", "$", "value", ")", "{", "if", "(", "!", "$", "predicate", ")", "{", "$", "predicate", "=", "new", "Predicate", "(", "...
Modify a predicate by adding additional clauses. @param \Titon\Db\Query\Predicate $predicate @param int $type @param string $field @param mixed $op @param mixed $value @return $this @throws \Titon\Db\Exception\ExistingPredicateException
[ "Modify", "a", "predicate", "by", "adding", "additional", "clauses", "." ]
train
https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query.php#L1059-L1081
askupasoftware/amarkal
Extensions/WordPress/Editor/Plugin.php
Plugin.register
public function register() { add_action( 'admin_head', array( $this, 'add_filters' ) ); add_action( 'wp_head', array( $this, 'add_filters' ) ); if( is_array( $this->config['callback'] ) ) { foreach( $this->config['callback'] as $handle => $callback ) ...
php
public function register() { add_action( 'admin_head', array( $this, 'add_filters' ) ); add_action( 'wp_head', array( $this, 'add_filters' ) ); if( is_array( $this->config['callback'] ) ) { foreach( $this->config['callback'] as $handle => $callback ) ...
[ "public", "function", "register", "(", ")", "{", "add_action", "(", "'admin_head'", ",", "array", "(", "$", "this", ",", "'add_filters'", ")", ")", ";", "add_action", "(", "'wp_head'", ",", "array", "(", "$", "this", ",", "'add_filters'", ")", ")", ";", ...
Register the plugin to the TinyMCE plugin registry and add a form callback or callbacks.
[ "Register", "the", "plugin", "to", "the", "TinyMCE", "plugin", "registry", "and", "add", "a", "form", "callback", "or", "callbacks", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Editor/Plugin.php#L33-L49
askupasoftware/amarkal
Extensions/WordPress/Editor/Plugin.php
Plugin.add_filters
public function add_filters() { // check if WYSIWYG is enabled if ( get_user_option('rich_editing') ) { add_filter( 'mce_external_plugins', array( $this, 'register_plugin' ) ); add_filter( 'mce_buttons'.($this->config['row'] > 1 ? '_'.$this->config['row'] : ''), arr...
php
public function add_filters() { // check if WYSIWYG is enabled if ( get_user_option('rich_editing') ) { add_filter( 'mce_external_plugins', array( $this, 'register_plugin' ) ); add_filter( 'mce_buttons'.($this->config['row'] > 1 ? '_'.$this->config['row'] : ''), arr...
[ "public", "function", "add_filters", "(", ")", "{", "// check if WYSIWYG is enabled ", "if", "(", "get_user_option", "(", "'rich_editing'", ")", ")", "{", "add_filter", "(", "'mce_external_plugins'", ",", "array", "(", "$", "this", ",", "'register_plugin'", ")", "...
Add a button to the tinyMCE editor, if the user has the required settings.
[ "Add", "a", "button", "to", "the", "tinyMCE", "editor", "if", "the", "user", "has", "the", "required", "settings", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Editor/Plugin.php#L54-L62
xinix-technology/norm
src/Norm/Cursor/MemoryCursor.php
MemoryCursor.next
public function next() { // Try to get the next element in our data buffer. $this->next = each($this->buffer); // Past the end of the data buffer if (false === $this->next && !$this->isQueried) { $this->isQueried = true; $connection = $this->collection->getC...
php
public function next() { // Try to get the next element in our data buffer. $this->next = each($this->buffer); // Past the end of the data buffer if (false === $this->next && !$this->isQueried) { $this->isQueried = true; $connection = $this->collection->getC...
[ "public", "function", "next", "(", ")", "{", "// Try to get the next element in our data buffer.", "$", "this", "->", "next", "=", "each", "(", "$", "this", "->", "buffer", ")", ";", "// Past the end of the data buffer", "if", "(", "false", "===", "$", "this", "...
{@inheritDoc}
[ "{" ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MemoryCursor.php#L49-L83
xinix-technology/norm
src/Norm/Cursor/MemoryCursor.php
MemoryCursor.count
public function count($foundOnly = false) { if ($foundOnly) { throw new Exception('Unimplemented '.__METHOD__); } else { $this->rewind(); return count($this->buffer); } }
php
public function count($foundOnly = false) { if ($foundOnly) { throw new Exception('Unimplemented '.__METHOD__); } else { $this->rewind(); return count($this->buffer); } }
[ "public", "function", "count", "(", "$", "foundOnly", "=", "false", ")", "{", "if", "(", "$", "foundOnly", ")", "{", "throw", "new", "Exception", "(", "'Unimplemented '", ".", "__METHOD__", ")", ";", "}", "else", "{", "$", "this", "->", "rewind", "(", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MemoryCursor.php#L114-L123
phpmob/changmin
src/PhpMob/CmsBundle/Model/Page.php
Page.getTemplateName
public function getTemplateName(): ?string { return $this->template ? TemplateInterface::PREFIX.$this->template->getName() : null; }
php
public function getTemplateName(): ?string { return $this->template ? TemplateInterface::PREFIX.$this->template->getName() : null; }
[ "public", "function", "getTemplateName", "(", ")", ":", "?", "string", "{", "return", "$", "this", "->", "template", "?", "TemplateInterface", "::", "PREFIX", ".", "$", "this", "->", "template", "->", "getName", "(", ")", ":", "null", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Model/Page.php#L206-L209
xinix-technology/norm
src/Norm/Hookable.php
Hookable.applyFilter
public function applyFilter($name, $filterArg = null) { if (!isset($this->hooks[$name])) { $this->hooks[$name] = array(array()); } if (!empty($this->hooks[$name])) { // Sort by priority, low to high, if there's more than one priority if (count($this->hook...
php
public function applyFilter($name, $filterArg = null) { if (!isset($this->hooks[$name])) { $this->hooks[$name] = array(array()); } if (!empty($this->hooks[$name])) { // Sort by priority, low to high, if there's more than one priority if (count($this->hook...
[ "public", "function", "applyFilter", "(", "$", "name", ",", "$", "filterArg", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "hooks", "[", "$", "name", "]", ")", ")", "{", "$", "this", "->", "hooks", "[", "$", "name", "...
Invoke filter @param string $name The hook name @param mixed $filterArg (Optional) Argument for hooked functions @return mixed
[ "Invoke", "filter" ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Hookable.php#L75-L96
liugene/framework
src/Make.php
Make.url
static public function url($c=null,$a=null,$p=null) { switch(Config::get('url_module')){ case 0: $platform = isset($_GET[Config::get('var_platform')]) ? ucfirst($_GET[Config::get('var_platform')]) : Config::get('var_platform'); $p = is_null($p) ? $platform : $p; ...
php
static public function url($c=null,$a=null,$p=null) { switch(Config::get('url_module')){ case 0: $platform = isset($_GET[Config::get('var_platform')]) ? ucfirst($_GET[Config::get('var_platform')]) : Config::get('var_platform'); $p = is_null($p) ? $platform : $p; ...
[ "static", "public", "function", "url", "(", "$", "c", "=", "null", ",", "$", "a", "=", "null", ",", "$", "p", "=", "null", ")", "{", "switch", "(", "Config", "::", "get", "(", "'url_module'", ")", ")", "{", "case", "0", ":", "$", "platform", "=...
Make::url方法自动生成URL @param $c [string] 需要设置跳转的控制器 默认为空获取当前控制器名 @param $a [string] 需要设置跳转的方法名 默认为空获取当前方法名 @param $p [string] 需要设置跳转的模块名 默认为空获取当前的模块名 @return url [string] 返回拼接好的URL跳转地址
[ "Make", "::", "url方法自动生成URL" ]
train
https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Make.php#L35-L50
liugene/framework
src/Make.php
Make.buildDir
public static function buildDir($list) { foreach ($list as $dir) { // 目录不存在则创建目录 !is_dir(APPLICATION_PATH . $dir) && mkdir(APPLICATION_PATH . $dir, 0755, true); } }
php
public static function buildDir($list) { foreach ($list as $dir) { // 目录不存在则创建目录 !is_dir(APPLICATION_PATH . $dir) && mkdir(APPLICATION_PATH . $dir, 0755, true); } }
[ "public", "static", "function", "buildDir", "(", "$", "list", ")", "{", "foreach", "(", "$", "list", "as", "$", "dir", ")", "{", "// 目录不存在则创建目录", "!", "is_dir", "(", "APPLICATION_PATH", ".", "$", "dir", ")", "&&", "mkdir", "(", "APPLICATION_PATH", ".", ...
创建目录 @access protected @param array $list 目录列表 @return void
[ "创建目录" ]
train
https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Make.php#L58-L64
mgallegos/decima-file
src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php
DecimaFileServiceProvider.boot
public function boot() { include __DIR__.'/../../routes.php'; // include __DIR__.'/../../helpers.php'; $this->loadViewsFrom(__DIR__.'/../../views', 'decima-file'); $this->loadTranslationsFrom(__DIR__.'/../../lang', 'decima-file'); $this->publishes([ __DIR__ . '/../../config/config.php' => config_path...
php
public function boot() { include __DIR__.'/../../routes.php'; // include __DIR__.'/../../helpers.php'; $this->loadViewsFrom(__DIR__.'/../../views', 'decima-file'); $this->loadTranslationsFrom(__DIR__.'/../../lang', 'decima-file'); $this->publishes([ __DIR__ . '/../../config/config.php' => config_path...
[ "public", "function", "boot", "(", ")", "{", "include", "__DIR__", ".", "'/../../routes.php'", ";", "// include __DIR__.'/../../helpers.php';", "$", "this", "->", "loadViewsFrom", "(", "__DIR__", ".", "'/../../views'", ",", "'decima-file'", ")", ";", "$", "this", ...
Bootstrap any application services. @return void
[ "Bootstrap", "any", "application", "services", "." ]
train
https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php#L21-L66
mgallegos/decima-file
src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php
DecimaFileServiceProvider.registrerSecurityFileInterface
protected function registrerSecurityFileInterface() { $this->app->bind('Mgallegos\DecimaFile\System\Repositories\File\FileInterface', function($app) { return new \Mgallegos\DecimaFile\System\Repositories\File\EloquentFile( new \Mgallegos\DecimaFile\System\File()); }); }
php
protected function registrerSecurityFileInterface() { $this->app->bind('Mgallegos\DecimaFile\System\Repositories\File\FileInterface', function($app) { return new \Mgallegos\DecimaFile\System\Repositories\File\EloquentFile( new \Mgallegos\DecimaFile\System\File()); }); }
[ "protected", "function", "registrerSecurityFileInterface", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'Mgallegos\\DecimaFile\\System\\Repositories\\File\\FileInterface'", ",", "function", "(", "$", "app", ")", "{", "return", "new", "\\", "Mgallegos",...
Register a ... interface instance. @return void
[ "Register", "a", "...", "interface", "instance", "." ]
train
https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php#L95-L101
mgallegos/decima-file
src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php
DecimaFileServiceProvider.registrerFileInterface
protected function registrerFileInterface() { $this->app->bind('Mgallegos\DecimaFile\File\Repositories\File\FileInterface', function($app) { $AuthenticationManager = $app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface'); return new \Mgallegos\DecimaFile\File\Re...
php
protected function registrerFileInterface() { $this->app->bind('Mgallegos\DecimaFile\File\Repositories\File\FileInterface', function($app) { $AuthenticationManager = $app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface'); return new \Mgallegos\DecimaFile\File\Re...
[ "protected", "function", "registrerFileInterface", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'Mgallegos\\DecimaFile\\File\\Repositories\\File\\FileInterface'", ",", "function", "(", "$", "app", ")", "{", "$", "AuthenticationManager", "=", "$", "ap...
Register a ... interface instance. @return void
[ "Register", "a", "...", "interface", "instance", "." ]
train
https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php#L108-L116
mgallegos/decima-file
src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php
DecimaFileServiceProvider.registerFileManagementInterface
protected function registerFileManagementInterface() { $this->app->bind('Mgallegos\DecimaFile\File\Services\FileManagement\FileManagementInterface', function($app) { return new \Mgallegos\DecimaFile\File\Services\FileManagement\FileManager( $app->make('App\Kwaai\Security\Services\AuthenticationManagement\Au...
php
protected function registerFileManagementInterface() { $this->app->bind('Mgallegos\DecimaFile\File\Services\FileManagement\FileManagementInterface', function($app) { return new \Mgallegos\DecimaFile\File\Services\FileManagement\FileManager( $app->make('App\Kwaai\Security\Services\AuthenticationManagement\Au...
[ "protected", "function", "registerFileManagementInterface", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'Mgallegos\\DecimaFile\\File\\Services\\FileManagement\\FileManagementInterface'", ",", "function", "(", "$", "app", ")", "{", "return", "new", "\\",...
Register a ... interface instance. @return void
[ "Register", "a", "...", "interface", "instance", "." ]
train
https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/DecimaFileServiceProvider.php#L123-L154
photogabble/laravel-remember-uploads
src/RememberUploadsServiceProvider.php
RememberUploadsServiceProvider.register
public function register() { $this->mergeConfigFrom( __DIR__.DIRECTORY_SEPARATOR.'config.php', 'remember-uploads' ); /** @var Router $router */ $router =$this->app->make(Router::class); $router->aliasMiddleware('remember.files', RememberFileUploads::class); }
php
public function register() { $this->mergeConfigFrom( __DIR__.DIRECTORY_SEPARATOR.'config.php', 'remember-uploads' ); /** @var Router $router */ $router =$this->app->make(Router::class); $router->aliasMiddleware('remember.files', RememberFileUploads::class); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "mergeConfigFrom", "(", "__DIR__", ".", "DIRECTORY_SEPARATOR", ".", "'config.php'", ",", "'remember-uploads'", ")", ";", "/** @var Router $router */", "$", "router", "=", "$", "this", "->", "app...
Register the service provider. @return void
[ "Register", "the", "service", "provider", "." ]
train
https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/RememberUploadsServiceProvider.php#L35-L44
steeffeen/FancyManiaLinks
FML/Components/CheckBox.php
CheckBox.setEnabledDesign
public function setEnabledDesign($style, $subStyle = null) { if ($style instanceof CheckBoxDesign) { $this->feature->setEnabledDesign($style); } else { $checkBoxDesign = new CheckBoxDesign($style, $subStyle); $this->feature->setEnabledDesign($checkBoxDesign); ...
php
public function setEnabledDesign($style, $subStyle = null) { if ($style instanceof CheckBoxDesign) { $this->feature->setEnabledDesign($style); } else { $checkBoxDesign = new CheckBoxDesign($style, $subStyle); $this->feature->setEnabledDesign($checkBoxDesign); ...
[ "public", "function", "setEnabledDesign", "(", "$", "style", ",", "$", "subStyle", "=", "null", ")", "{", "if", "(", "$", "style", "instanceof", "CheckBoxDesign", ")", "{", "$", "this", "->", "feature", "->", "setEnabledDesign", "(", "$", "style", ")", "...
Set the enabled design @api @param string|CheckBoxDesign $style Style name, image url or checkbox design @param string $subStyle SubStyle name @return static
[ "Set", "the", "enabled", "design" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Components/CheckBox.php#L124-L133
steeffeen/FancyManiaLinks
FML/Components/CheckBox.php
CheckBox.setDisabledDesign
public function setDisabledDesign($style, $subStyle = null) { if ($style instanceof CheckBoxDesign) { $this->feature->setDisabledDesign($style); } else { $checkBoxDesign = new CheckBoxDesign($style, $subStyle); $this->feature->setDisabledDesign($checkBoxDesign); ...
php
public function setDisabledDesign($style, $subStyle = null) { if ($style instanceof CheckBoxDesign) { $this->feature->setDisabledDesign($style); } else { $checkBoxDesign = new CheckBoxDesign($style, $subStyle); $this->feature->setDisabledDesign($checkBoxDesign); ...
[ "public", "function", "setDisabledDesign", "(", "$", "style", ",", "$", "subStyle", "=", "null", ")", "{", "if", "(", "$", "style", "instanceof", "CheckBoxDesign", ")", "{", "$", "this", "->", "feature", "->", "setDisabledDesign", "(", "$", "style", ")", ...
Set the disabled design @api @param string|CheckBoxDesign $style Style name, image url or checkbox design @param string $subStyle SubStyle name @return static
[ "Set", "the", "disabled", "design" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Components/CheckBox.php#L154-L163
tomphp/patch-builder
src/TomPHP/PatchBuilder/LineTracker/LineTracker.php
LineTracker.trackLine
public function trackLine(LineNumber $lineNumber) { $this->trackedLine = $lineNumber->getNumber(); foreach ($this->actions as $action) { $actionLine = $action['line']; switch ($action['name']) { case 'add': $this->trackLineAdded($actionLi...
php
public function trackLine(LineNumber $lineNumber) { $this->trackedLine = $lineNumber->getNumber(); foreach ($this->actions as $action) { $actionLine = $action['line']; switch ($action['name']) { case 'add': $this->trackLineAdded($actionLi...
[ "public", "function", "trackLine", "(", "LineNumber", "$", "lineNumber", ")", "{", "$", "this", "->", "trackedLine", "=", "$", "lineNumber", "->", "getNumber", "(", ")", ";", "foreach", "(", "$", "this", "->", "actions", "as", "$", "action", ")", "{", ...
@param int $lineNumber @return int
[ "@param", "int", "$lineNumber" ]
train
https://github.com/tomphp/patch-builder/blob/4419eaad23016c7db1deffc6cce3f539096c11ce/src/TomPHP/PatchBuilder/LineTracker/LineTracker.php#L27-L45
barebone-php/barebone-core
lib/Config.php
Config.instance
public static function instance() { if (null === self::$_instance) { if (!defined('APP_ROOT')) { $path = __DIR__ . '/../../app/config.json'; } else { $path = APP_ROOT . 'config.json'; } if (!file_exists($path)) { ...
php
public static function instance() { if (null === self::$_instance) { if (!defined('APP_ROOT')) { $path = __DIR__ . '/../../app/config.json'; } else { $path = APP_ROOT . 'config.json'; } if (!file_exists($path)) { ...
[ "public", "static", "function", "instance", "(", ")", "{", "if", "(", "null", "===", "self", "::", "$", "_instance", ")", "{", "if", "(", "!", "defined", "(", "'APP_ROOT'", ")", ")", "{", "$", "path", "=", "__DIR__", ".", "'/../../app/config.json'", ";...
Instantiate Loader @return Config
[ "Instantiate", "Loader" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Config.php#L69-L85
barebone-php/barebone-core
lib/Config.php
Config.read
public static function read($key = '', $default = null) { if (empty($key)) { return self::instance()->all(); } if (!self::exists($key)) { return $default; } return self::instance()->get($key); }
php
public static function read($key = '', $default = null) { if (empty($key)) { return self::instance()->all(); } if (!self::exists($key)) { return $default; } return self::instance()->get($key); }
[ "public", "static", "function", "read", "(", "$", "key", "=", "''", ",", "$", "default", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "key", ")", ")", "{", "return", "self", "::", "instance", "(", ")", "->", "all", "(", ")", ";", "}", ...
Read configuration value @param string $key Configuration-Key Path @param mixed $default Default value if key is empty/not-found @return mixed
[ "Read", "configuration", "value" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Config.php#L95-L104
nyeholt/silverstripe-external-content
thirdparty/Zend/Validate/Ccnum.php
Zend_Validate_Ccnum.isValid
public function isValid($value) { $this->_setValue($value); if (null === self::$_filter) { /** * @see Zend_Filter_Digits */ require_once 'Zend/Filter/Digits.php'; self::$_filter = new Zend_Filter_Digits(); } $valueFilter...
php
public function isValid($value) { $this->_setValue($value); if (null === self::$_filter) { /** * @see Zend_Filter_Digits */ require_once 'Zend/Filter/Digits.php'; self::$_filter = new Zend_Filter_Digits(); } $valueFilter...
[ "public", "function", "isValid", "(", "$", "value", ")", "{", "$", "this", "->", "_setValue", "(", "$", "value", ")", ";", "if", "(", "null", "===", "self", "::", "$", "_filter", ")", "{", "/**\n * @see Zend_Filter_Digits\n */", "requir...
Defined by Zend_Validate_Interface Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum) @param string $value @return boolean
[ "Defined", "by", "Zend_Validate_Interface" ]
train
https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Ccnum.php#L73-L109
lmammino/e-foundation
src/Product/Model/AttributeValue.php
AttributeValue.setSubject
public function setSubject(AttributeSubjectInterface $subject = null) { $this->subject = $this->product = $subject; return $this; }
php
public function setSubject(AttributeSubjectInterface $subject = null) { $this->subject = $this->product = $subject; return $this; }
[ "public", "function", "setSubject", "(", "AttributeSubjectInterface", "$", "subject", "=", "null", ")", "{", "$", "this", "->", "subject", "=", "$", "this", "->", "product", "=", "$", "subject", ";", "return", "$", "this", ";", "}" ]
{@inheritDoc}
[ "{" ]
train
https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Product/Model/AttributeValue.php#L39-L44
anime-db/app-bundle
src/Service/Downloader.php
Downloader.download
public function download($url, $target, $override = false) { if (!$override && file_exists($target)) { return true; } $this->fs->mkdir(dirname($target), 0755); return $this->client ->get($url) ->setResponseBody($target) ->send() ...
php
public function download($url, $target, $override = false) { if (!$override && file_exists($target)) { return true; } $this->fs->mkdir(dirname($target), 0755); return $this->client ->get($url) ->setResponseBody($target) ->send() ...
[ "public", "function", "download", "(", "$", "url", ",", "$", "target", ",", "$", "override", "=", "false", ")", "{", "if", "(", "!", "$", "override", "&&", "file_exists", "(", "$", "target", ")", ")", "{", "return", "true", ";", "}", "$", "this", ...
@param string $url @param string $target @param bool $override @return bool
[ "@param", "string", "$url", "@param", "string", "$target", "@param", "bool", "$override" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L96-L109
anime-db/app-bundle
src/Service/Downloader.php
Downloader.image
public function image($url, $target, $override = false) { if (!$this->download($url, $target, $override)) { return false; } // check file type $fi = new \finfo(FILEINFO_MIME_TYPE); if (strpos($fi->file($target), 'image/') !== 0) { unlink($target); // ...
php
public function image($url, $target, $override = false) { if (!$this->download($url, $target, $override)) { return false; } // check file type $fi = new \finfo(FILEINFO_MIME_TYPE); if (strpos($fi->file($target), 'image/') !== 0) { unlink($target); // ...
[ "public", "function", "image", "(", "$", "url", ",", "$", "target", ",", "$", "override", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "download", "(", "$", "url", ",", "$", "target", ",", "$", "override", ")", ")", "{", "return", ...
@param string $url @param string $target @param bool $override @return bool
[ "@param", "string", "$url", "@param", "string", "$target", "@param", "bool", "$override" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L118-L132
anime-db/app-bundle
src/Service/Downloader.php
Downloader.isExists
public function isExists($url) { $request = $this->client->get($url); $request->getCurlOptions()->set(CURLOPT_NOBODY, true); try { return $request->send()->isSuccessful(); } catch (HttpException $e) { return false; } }
php
public function isExists($url) { $request = $this->client->get($url); $request->getCurlOptions()->set(CURLOPT_NOBODY, true); try { return $request->send()->isSuccessful(); } catch (HttpException $e) { return false; } }
[ "public", "function", "isExists", "(", "$", "url", ")", "{", "$", "request", "=", "$", "this", "->", "client", "->", "get", "(", "$", "url", ")", ";", "$", "request", "->", "getCurlOptions", "(", ")", "->", "set", "(", "CURLOPT_NOBODY", ",", "true", ...
@param string $url @return bool
[ "@param", "string", "$url" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L139-L149
anime-db/app-bundle
src/Service/Downloader.php
Downloader.favicon
public function favicon($host, $override = false) { $target = $this->favicon_root.$host.'.ico'; if ($this->image(sprintf($this->favicon_proxy, $host), $target, $override)) { return $target; } return false; }
php
public function favicon($host, $override = false) { $target = $this->favicon_root.$host.'.ico'; if ($this->image(sprintf($this->favicon_proxy, $host), $target, $override)) { return $target; } return false; }
[ "public", "function", "favicon", "(", "$", "host", ",", "$", "override", "=", "false", ")", "{", "$", "target", "=", "$", "this", "->", "favicon_root", ".", "$", "host", ".", "'.ico'", ";", "if", "(", "$", "this", "->", "image", "(", "sprintf", "("...
@param string $host @param bool $override @return string|false
[ "@param", "string", "$host", "@param", "bool", "$override" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L157-L166
anime-db/app-bundle
src/Service/Downloader.php
Downloader.entity
public function entity($url, EntityInterface $entity, $override = false) { if (!($path = parse_url($url, PHP_URL_PATH))) { throw new \InvalidArgumentException('It is invalid URL: '.$url); } $entity->setFilename(pathinfo($path, PATHINFO_BASENAME)); $target = $this->root.$e...
php
public function entity($url, EntityInterface $entity, $override = false) { if (!($path = parse_url($url, PHP_URL_PATH))) { throw new \InvalidArgumentException('It is invalid URL: '.$url); } $entity->setFilename(pathinfo($path, PATHINFO_BASENAME)); $target = $this->root.$e...
[ "public", "function", "entity", "(", "$", "url", ",", "EntityInterface", "$", "entity", ",", "$", "override", "=", "false", ")", "{", "if", "(", "!", "(", "$", "path", "=", "parse_url", "(", "$", "url", ",", "PHP_URL_PATH", ")", ")", ")", "{", "thr...
@param string $url @param EntityInterface $entity @param bool $override @return bool
[ "@param", "string", "$url", "@param", "EntityInterface", "$entity", "@param", "bool", "$override" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L175-L188
anime-db/app-bundle
src/Service/Downloader.php
Downloader.getTargetDirForImageField
protected function getTargetDirForImageField(Image $entity, $override = false) { $target = $this->root.$entity->getDownloadPath().'/'.$entity->getFilename(); if (!$override) { $target = $this->getUniqueFilename($target); $entity->setFilename(pathinfo($target, PATHINFO_BASENAM...
php
protected function getTargetDirForImageField(Image $entity, $override = false) { $target = $this->root.$entity->getDownloadPath().'/'.$entity->getFilename(); if (!$override) { $target = $this->getUniqueFilename($target); $entity->setFilename(pathinfo($target, PATHINFO_BASENAM...
[ "protected", "function", "getTargetDirForImageField", "(", "Image", "$", "entity", ",", "$", "override", "=", "false", ")", "{", "$", "target", "=", "$", "this", "->", "root", ".", "$", "entity", "->", "getDownloadPath", "(", ")", ".", "'/'", ".", "$", ...
@param Image $entity @param bool $override @return string
[ "@param", "Image", "$entity", "@param", "bool", "$override" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L247-L256
anime-db/app-bundle
src/Service/Downloader.php
Downloader.getUniqueFilename
public function getUniqueFilename($filename) { $info = pathinfo($filename); $name = $info['filename']; $ext = isset($info['extension']) ? '.'.$info['extension'] : ''; for ($i = 1; file_exists($info['dirname'].'/'.$name.$ext); ++$i) { $name = $info['filename'].'['.$i.']'; ...
php
public function getUniqueFilename($filename) { $info = pathinfo($filename); $name = $info['filename']; $ext = isset($info['extension']) ? '.'.$info['extension'] : ''; for ($i = 1; file_exists($info['dirname'].'/'.$name.$ext); ++$i) { $name = $info['filename'].'['.$i.']'; ...
[ "public", "function", "getUniqueFilename", "(", "$", "filename", ")", "{", "$", "info", "=", "pathinfo", "(", "$", "filename", ")", ";", "$", "name", "=", "$", "info", "[", "'filename'", "]", ";", "$", "ext", "=", "isset", "(", "$", "info", "[", "'...
@param string $filename @return string
[ "@param", "string", "$filename" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/Downloader.php#L263-L273
koriym/Koriym.QueryLocator
src/QueryLocatorModule.php
QueryLocatorModule.configure
protected function configure() { $this->bind()->annotatedWith('sql_dir')->toInstance($this->sqlDir); $this->bind(QueryLocatorInterface::class)->toConstructor(QueryLocator::class, 'sqlDir=sql_dir'); }
php
protected function configure() { $this->bind()->annotatedWith('sql_dir')->toInstance($this->sqlDir); $this->bind(QueryLocatorInterface::class)->toConstructor(QueryLocator::class, 'sqlDir=sql_dir'); }
[ "protected", "function", "configure", "(", ")", "{", "$", "this", "->", "bind", "(", ")", "->", "annotatedWith", "(", "'sql_dir'", ")", "->", "toInstance", "(", "$", "this", "->", "sqlDir", ")", ";", "$", "this", "->", "bind", "(", "QueryLocatorInterface...
{@inheritdoc}
[ "{" ]
train
https://github.com/koriym/Koriym.QueryLocator/blob/4e9b9ecfdd99c4850e39e88204a597af503c3823/src/QueryLocatorModule.php#L25-L29
GrafiteInc/Mission-Control-Package
src/WebhookService.php
WebhookService.send
public function send($title, $content, $flag) { $headers = []; $query = [ 'title' => $title, 'content' => $content, 'flag' => $flag, ]; if (is_null($this->webhook)) { throw new Exception("Missing webhook", 1); } $res...
php
public function send($title, $content, $flag) { $headers = []; $query = [ 'title' => $title, 'content' => $content, 'flag' => $flag, ]; if (is_null($this->webhook)) { throw new Exception("Missing webhook", 1); } $res...
[ "public", "function", "send", "(", "$", "title", ",", "$", "content", ",", "$", "flag", ")", "{", "$", "headers", "=", "[", "]", ";", "$", "query", "=", "[", "'title'", "=>", "$", "title", ",", "'content'", "=>", "$", "content", ",", "'flag'", "=...
Send the data to Mission Control @param string $title @param string $content @param string $flag @return bool
[ "Send", "the", "data", "to", "Mission", "Control" ]
train
https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/WebhookService.php#L30-L52
fubhy/graphql-php
src/Type/Definition/Types/ObjectType.php
ObjectType.getField
public function getField($field) { $fields = $this->getFields(); if (!isset($fields[$field])) { throw new \LogicException(sprintf('Undefined field %s.', $field)); } return $fields[$field]; }
php
public function getField($field) { $fields = $this->getFields(); if (!isset($fields[$field])) { throw new \LogicException(sprintf('Undefined field %s.', $field)); } return $fields[$field]; }
[ "public", "function", "getField", "(", "$", "field", ")", "{", "$", "fields", "=", "$", "this", "->", "getFields", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "fields", "[", "$", "field", "]", ")", ")", "{", "throw", "new", "\\", "LogicExce...
@param string $field @return \Fubhy\GraphQL\Type\Definition\FieldDefinition
[ "@param", "string", "$field" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/ObjectType.php#L95-L103
fubhy/graphql-php
src/Type/Definition/Types/ObjectType.php
ObjectType.isTypeOf
public function isTypeOf($value) { return isset($this->isTypeOf) ? call_user_func($this->isTypeOf, $value) : NULL; }
php
public function isTypeOf($value) { return isset($this->isTypeOf) ? call_user_func($this->isTypeOf, $value) : NULL; }
[ "public", "function", "isTypeOf", "(", "$", "value", ")", "{", "return", "isset", "(", "$", "this", "->", "isTypeOf", ")", "?", "call_user_func", "(", "$", "this", "->", "isTypeOf", ",", "$", "value", ")", ":", "NULL", ";", "}" ]
@param mixed $value @return bool|null
[ "@param", "mixed", "$value" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/ObjectType.php#L118-L121
shrink0r/workflux
src/State/StateSet.php
StateSet.add
public function add(StateInterface $state): self { $cloned_set = clone $this; $cloned_set->internal_set->add($state); return $cloned_set; }
php
public function add(StateInterface $state): self { $cloned_set = clone $this; $cloned_set->internal_set->add($state); return $cloned_set; }
[ "public", "function", "add", "(", "StateInterface", "$", "state", ")", ":", "self", "{", "$", "cloned_set", "=", "clone", "$", "this", ";", "$", "cloned_set", "->", "internal_set", "->", "add", "(", "$", "state", ")", ";", "return", "$", "cloned_set", ...
@param StateInterface @return self
[ "@param", "StateInterface" ]
train
https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/State/StateSet.php#L69-L75
aedart/config-loader
src/Providers/ConfigurationLoaderServiceProvider.php
ConfigurationLoaderServiceProvider.register
public function register() { $this->app->singleton(ParserFactoryInterface::class, function ($application) { return new DefaultParserFactory(); }); $this->app->bind(ConfigLoaderInterface::class, function ($application) { return new ConfigLoader(); }); }
php
public function register() { $this->app->singleton(ParserFactoryInterface::class, function ($application) { return new DefaultParserFactory(); }); $this->app->bind(ConfigLoaderInterface::class, function ($application) { return new ConfigLoader(); }); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "ParserFactoryInterface", "::", "class", ",", "function", "(", "$", "application", ")", "{", "return", "new", "DefaultParserFactory", "(", ")", ";", "}", ")"...
Register the service provider. @return void
[ "Register", "the", "service", "provider", "." ]
train
https://github.com/aedart/config-loader/blob/9e1cf592bee46ba4930bb9c352aaf475d81266ea/src/Providers/ConfigurationLoaderServiceProvider.php#L28-L37
ARCANEDEV/Sanitizer
src/Filters/FormatDateFilter.php
FormatDateFilter.filter
public function filter($value, array $options = []) { if ( ! is_string($value) || empty(trim($value))) return $value; $this->checkOptions($options); list($currentFormat, $targetFormat) = array_map('trim', $options); return DateTime::createFromFormat($currentFormat, $va...
php
public function filter($value, array $options = []) { if ( ! is_string($value) || empty(trim($value))) return $value; $this->checkOptions($options); list($currentFormat, $targetFormat) = array_map('trim', $options); return DateTime::createFromFormat($currentFormat, $va...
[ "public", "function", "filter", "(", "$", "value", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "is_string", "(", "$", "value", ")", "||", "empty", "(", "trim", "(", "$", "value", ")", ")", ")", "return", "$", "value", ...
Format date of the given string. @param mixed $value @param array $options @return string|mixed
[ "Format", "date", "of", "the", "given", "string", "." ]
train
https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Filters/FormatDateFilter.php#L27-L37
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionIndex
public function actionIndex() { $auth = \Yii::$app->getAuthManager(); $items = $auth->getRoles(); $dataProvider = new ArrayDataProvider(); $dataProvider->setModels($items); return $this->render('index',[ 'dataProvider' => $dataProvider, ]); }
php
public function actionIndex() { $auth = \Yii::$app->getAuthManager(); $items = $auth->getRoles(); $dataProvider = new ArrayDataProvider(); $dataProvider->setModels($items); return $this->render('index',[ 'dataProvider' => $dataProvider, ]); }
[ "public", "function", "actionIndex", "(", ")", "{", "$", "auth", "=", "\\", "Yii", "::", "$", "app", "->", "getAuthManager", "(", ")", ";", "$", "items", "=", "$", "auth", "->", "getRoles", "(", ")", ";", "$", "dataProvider", "=", "new", "ArrayDataPr...
角色列表
[ "角色列表" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L16-L25
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionCreate
public function actionCreate() { $model = new RoleForm(); $model->isNewRecord = true; if($model->load(\Yii::$app->getRequest()->post())) { $auth = \Yii::$app->getAuthManager(); if($auth->getRole($model->name)) { $model->addError('name','角色标识已存在'); ...
php
public function actionCreate() { $model = new RoleForm(); $model->isNewRecord = true; if($model->load(\Yii::$app->getRequest()->post())) { $auth = \Yii::$app->getAuthManager(); if($auth->getRole($model->name)) { $model->addError('name','角色标识已存在'); ...
[ "public", "function", "actionCreate", "(", ")", "{", "$", "model", "=", "new", "RoleForm", "(", ")", ";", "$", "model", "->", "isNewRecord", "=", "true", ";", "if", "(", "$", "model", "->", "load", "(", "\\", "Yii", "::", "$", "app", "->", "getRequ...
创建角色
[ "创建角色" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L28-L47
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionUpdate
public function actionUpdate($id) { $name = $id; $model = new RoleForm(); $model->isNewRecord = false; $auth = \Yii::$app->getAuthManager(); $item = $auth->getRole($name); if($model->load(\Yii::$app->getRequest()->post())) { $item->name = $model->name; ...
php
public function actionUpdate($id) { $name = $id; $model = new RoleForm(); $model->isNewRecord = false; $auth = \Yii::$app->getAuthManager(); $item = $auth->getRole($name); if($model->load(\Yii::$app->getRequest()->post())) { $item->name = $model->name; ...
[ "public", "function", "actionUpdate", "(", "$", "id", ")", "{", "$", "name", "=", "$", "id", ";", "$", "model", "=", "new", "RoleForm", "(", ")", ";", "$", "model", "->", "isNewRecord", "=", "false", ";", "$", "auth", "=", "\\", "Yii", "::", "$",...
更新角色
[ "更新角色" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L76-L95
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionView
public function actionView($id) { $name = $id; $auth = \Yii::$app->getAuthManager(); $item = $auth->getRole($name); return $this->render('view',[ 'item' => $item ]); }
php
public function actionView($id) { $name = $id; $auth = \Yii::$app->getAuthManager(); $item = $auth->getRole($name); return $this->render('view',[ 'item' => $item ]); }
[ "public", "function", "actionView", "(", "$", "id", ")", "{", "$", "name", "=", "$", "id", ";", "$", "auth", "=", "\\", "Yii", "::", "$", "app", "->", "getAuthManager", "(", ")", ";", "$", "item", "=", "$", "auth", "->", "getRole", "(", "$", "n...
查看角色详细信息
[ "查看角色详细信息" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L98-L106
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionUserindex
public function actionUserindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $roleUserIds = $auth->getUserIdsByRole($id); $dataProvider = new ActiveDataProvider([ 'query' => $auth->getUserQuery()->where('`status`!=9'), 'pagination'...
php
public function actionUserindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $roleUserIds = $auth->getUserIdsByRole($id); $dataProvider = new ActiveDataProvider([ 'query' => $auth->getUserQuery()->where('`status`!=9'), 'pagination'...
[ "public", "function", "actionUserindex", "(", "$", "id", ")", "{", "$", "auth", "=", "\\", "Yii", "::", "$", "app", "->", "getAuthManager", "(", ")", ";", "$", "role", "=", "$", "auth", "->", "getRole", "(", "$", "id", ")", ";", "$", "roleUserIds",...
查看角色用户列表
[ "查看角色用户列表" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L109-L125
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionSetuser
public function actionSetuser($name) { if (\Yii::$app->getRequest()->getIsPost() && isset($_POST['act'],$_POST['val'])) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($name); try { $flag = true; if($_POST['act'] == 'add') { ...
php
public function actionSetuser($name) { if (\Yii::$app->getRequest()->getIsPost() && isset($_POST['act'],$_POST['val'])) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($name); try { $flag = true; if($_POST['act'] == 'add') { ...
[ "public", "function", "actionSetuser", "(", "$", "name", ")", "{", "if", "(", "\\", "Yii", "::", "$", "app", "->", "getRequest", "(", ")", "->", "getIsPost", "(", ")", "&&", "isset", "(", "$", "_POST", "[", "'act'", "]", ",", "$", "_POST", "[", "...
设置角色用户
[ "设置角色用户" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L128-L148
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionPermissionindex
public function actionPermissionindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $allItems = $auth->getPermissions(); $roleItems = $auth->getPermissionsByRole($id); $ownItems = $auth->getChildren($id); // var_dump($roleItems);exit(); ...
php
public function actionPermissionindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $allItems = $auth->getPermissions(); $roleItems = $auth->getPermissionsByRole($id); $ownItems = $auth->getChildren($id); // var_dump($roleItems);exit(); ...
[ "public", "function", "actionPermissionindex", "(", "$", "id", ")", "{", "$", "auth", "=", "\\", "Yii", "::", "$", "app", "->", "getAuthManager", "(", ")", ";", "$", "role", "=", "$", "auth", "->", "getRole", "(", "$", "id", ")", ";", "$", "allItem...
查看角色权限列表
[ "查看角色权限列表" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L151-L168
JeanWolf/yii2-jrbac
controllers/RoleController.php
RoleController.actionSubindex
public function actionSubindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $allItems = $auth->getRoles(); $subItems = $auth->getChildren($id); $dataProvider = new ArrayDataProvider(); $dataProvider->setModels($allItems); return $t...
php
public function actionSubindex($id) { $auth = \Yii::$app->getAuthManager(); $role = $auth->getRole($id); $allItems = $auth->getRoles(); $subItems = $auth->getChildren($id); $dataProvider = new ArrayDataProvider(); $dataProvider->setModels($allItems); return $t...
[ "public", "function", "actionSubindex", "(", "$", "id", ")", "{", "$", "auth", "=", "\\", "Yii", "::", "$", "app", "->", "getAuthManager", "(", ")", ";", "$", "role", "=", "$", "auth", "->", "getRole", "(", "$", "id", ")", ";", "$", "allItems", "...
子角色列表
[ "子角色列表" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/RoleController.php#L195-L209
fubhy/graphql-php
src/Type/Definition/Types/Scalars/IntType.php
IntType.coerce
public function coerce($value) { if ((is_numeric($value) && $value <= PHP_INT_MAX && $value >= -PHP_INT_MAX) || is_bool($value)) { return (int) $value; } return NULL; }
php
public function coerce($value) { if ((is_numeric($value) && $value <= PHP_INT_MAX && $value >= -PHP_INT_MAX) || is_bool($value)) { return (int) $value; } return NULL; }
[ "public", "function", "coerce", "(", "$", "value", ")", "{", "if", "(", "(", "is_numeric", "(", "$", "value", ")", "&&", "$", "value", "<=", "PHP_INT_MAX", "&&", "$", "value", ">=", "-", "PHP_INT_MAX", ")", "||", "is_bool", "(", "$", "value", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/Scalars/IntType.php#L19-L26
fubhy/graphql-php
src/Type/Definition/Types/Scalars/IntType.php
IntType.coerceLiteral
public function coerceLiteral(Node $node) { if ($node instanceof IntValue) { $num = $node->get('value'); if ($num <= PHP_INT_MAX && $num >= -PHP_INT_MAX) { return intval($num); } } return NULL; }
php
public function coerceLiteral(Node $node) { if ($node instanceof IntValue) { $num = $node->get('value'); if ($num <= PHP_INT_MAX && $num >= -PHP_INT_MAX) { return intval($num); } } return NULL; }
[ "public", "function", "coerceLiteral", "(", "Node", "$", "node", ")", "{", "if", "(", "$", "node", "instanceof", "IntValue", ")", "{", "$", "num", "=", "$", "node", "->", "get", "(", "'value'", ")", ";", "if", "(", "$", "num", "<=", "PHP_INT_MAX", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/Scalars/IntType.php#L31-L42
inpsyde/inpsyde-filter
src/ArrayValue.php
ArrayValue.add_filter_by_key
public function add_filter_by_key( FilterInterface $filter, $key ) { if ( ! is_scalar( $key ) ) { throw new Exception\InvalidArgumentException( 'key should be a scalar value.' ); } $key = (string) $key; if ( ! isset ( $this->filters_by_key[ $key ] ) ) { $this->filters_by_key[ $key ] = [ ]; } $this...
php
public function add_filter_by_key( FilterInterface $filter, $key ) { if ( ! is_scalar( $key ) ) { throw new Exception\InvalidArgumentException( 'key should be a scalar value.' ); } $key = (string) $key; if ( ! isset ( $this->filters_by_key[ $key ] ) ) { $this->filters_by_key[ $key ] = [ ]; } $this...
[ "public", "function", "add_filter_by_key", "(", "FilterInterface", "$", "filter", ",", "$", "key", ")", "{", "if", "(", "!", "is_scalar", "(", "$", "key", ")", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentException", "(", "'key should be a scal...
Adding a filter grouped by array key. @throws Exception\InvalidArgumentException if type of $key is not scalar. @param FilterInterface $filter @param $key @return ArrayValue
[ "Adding", "a", "filter", "grouped", "by", "array", "key", "." ]
train
https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/ArrayValue.php#L50-L65
inpsyde/inpsyde-filter
src/ArrayValue.php
ArrayValue.filter
public function filter( $values ) { if ( ! is_array( $values )&& ! $values instanceof \Traversable ) { return $values; } $values = $this->all_filters( $values ); $values = $this->filter_by_key( $values ); return $values; }
php
public function filter( $values ) { if ( ! is_array( $values )&& ! $values instanceof \Traversable ) { return $values; } $values = $this->all_filters( $values ); $values = $this->filter_by_key( $values ); return $values; }
[ "public", "function", "filter", "(", "$", "values", ")", "{", "if", "(", "!", "is_array", "(", "$", "values", ")", "&&", "!", "$", "values", "instanceof", "\\", "Traversable", ")", "{", "return", "$", "values", ";", "}", "$", "values", "=", "$", "t...
{@inheritdoc}
[ "{" ]
train
https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/ArrayValue.php#L70-L81
inpsyde/inpsyde-filter
src/ArrayValue.php
ArrayValue.all_filters
private function all_filters( $values ) { foreach ( $values as $key => $value ) { foreach ( $this->filters as $filter ) { $values[ $key ] = $filter->filter( $value ); } } return $values; }
php
private function all_filters( $values ) { foreach ( $values as $key => $value ) { foreach ( $this->filters as $filter ) { $values[ $key ] = $filter->filter( $value ); } } return $values; }
[ "private", "function", "all_filters", "(", "$", "values", ")", "{", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "{", "foreach", "(", "$", "this", "->", "filters", "as", "$", "filter", ")", "{", "$", "values", "[", "$",...
@param mixed $values @return mixed
[ "@param", "mixed", "$values" ]
train
https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/ArrayValue.php#L88-L97
inpsyde/inpsyde-filter
src/ArrayValue.php
ArrayValue.filter_by_key
protected function filter_by_key( $values ) { if ( count( $this->filters_by_key ) < 1 ) { return $values; } foreach ( $values as $key => $value ) { if ( ! is_scalar( $value ) || ! isset( $this->filters_by_key[ $key ] ) ) { continue; } /** @var FilterInterface[] */ $filters = $this->filters_b...
php
protected function filter_by_key( $values ) { if ( count( $this->filters_by_key ) < 1 ) { return $values; } foreach ( $values as $key => $value ) { if ( ! is_scalar( $value ) || ! isset( $this->filters_by_key[ $key ] ) ) { continue; } /** @var FilterInterface[] */ $filters = $this->filters_b...
[ "protected", "function", "filter_by_key", "(", "$", "values", ")", "{", "if", "(", "count", "(", "$", "this", "->", "filters_by_key", ")", "<", "1", ")", "{", "return", "$", "values", ";", "}", "foreach", "(", "$", "values", "as", "$", "key", "=>", ...
Filters all values by array-key. @param mixed $values @return mixed $value
[ "Filters", "all", "values", "by", "array", "-", "key", "." ]
train
https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/ArrayValue.php#L106-L125
tomphp/siren-php
src/EntityBuilder.php
EntityBuilder.addLink
public function addLink( $linkOrRel, string $href = null, $classes = [], string $title = null, string $type = null ) : self { $link = $linkOrRel; if (!$linkOrRel instanceof Link) { $rels = is_array($linkOrRel) ? $linkOrRel : [$linkOrRel]; ...
php
public function addLink( $linkOrRel, string $href = null, $classes = [], string $title = null, string $type = null ) : self { $link = $linkOrRel; if (!$linkOrRel instanceof Link) { $rels = is_array($linkOrRel) ? $linkOrRel : [$linkOrRel]; ...
[ "public", "function", "addLink", "(", "$", "linkOrRel", ",", "string", "$", "href", "=", "null", ",", "$", "classes", "=", "[", "]", ",", "string", "$", "title", "=", "null", ",", "string", "$", "type", "=", "null", ")", ":", "self", "{", "$", "l...
@param Link|string|string[] $linkOrRel @param string $href @param string|string[] $classes @param string $title @param string $type @return $this
[ "@param", "Link|string|string", "[]", "$linkOrRel", "@param", "string", "$href", "@param", "string|string", "[]", "$classes", "@param", "string", "$title", "@param", "string", "$type" ]
train
https://github.com/tomphp/siren-php/blob/22bdce3d7d87693df29011a5139dbad349c875db/src/EntityBuilder.php#L89-L107
fond-of/spryker-brand
src/FondOfSpryker/Zed/Brand/BrandDependencyProvider.php
BrandDependencyProvider.provideBusinessLayerDependencies
public function provideBusinessLayerDependencies(Container $container): Container { $container = parent::provideBusinessLayerDependencies($container); $container = $this->addBrandTransferExpanderPlugins($container); return $container; }
php
public function provideBusinessLayerDependencies(Container $container): Container { $container = parent::provideBusinessLayerDependencies($container); $container = $this->addBrandTransferExpanderPlugins($container); return $container; }
[ "public", "function", "provideBusinessLayerDependencies", "(", "Container", "$", "container", ")", ":", "Container", "{", "$", "container", "=", "parent", "::", "provideBusinessLayerDependencies", "(", "$", "container", ")", ";", "$", "container", "=", "$", "this"...
@param \Spryker\Zed\Kernel\Container $container @return \Spryker\Zed\Kernel\Container
[ "@param", "\\", "Spryker", "\\", "Zed", "\\", "Kernel", "\\", "Container", "$container" ]
train
https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Zed/Brand/BrandDependencyProvider.php#L16-L22
fond-of/spryker-brand
src/FondOfSpryker/Zed/Brand/BrandDependencyProvider.php
BrandDependencyProvider.addBrandTransferExpanderPlugins
public function addBrandTransferExpanderPlugins(Container $container): Container { $container[static::PLUGINS_BRAND_TRANSFER_EXPANDER] = function (Container $container) { return $this->getBrandTransferExpanderPlugins(); }; return $container; }
php
public function addBrandTransferExpanderPlugins(Container $container): Container { $container[static::PLUGINS_BRAND_TRANSFER_EXPANDER] = function (Container $container) { return $this->getBrandTransferExpanderPlugins(); }; return $container; }
[ "public", "function", "addBrandTransferExpanderPlugins", "(", "Container", "$", "container", ")", ":", "Container", "{", "$", "container", "[", "static", "::", "PLUGINS_BRAND_TRANSFER_EXPANDER", "]", "=", "function", "(", "Container", "$", "container", ")", "{", "...
@param \Spryker\Zed\Kernel\Container $container @return \Spryker\Zed\Kernel\Container
[ "@param", "\\", "Spryker", "\\", "Zed", "\\", "Kernel", "\\", "Container", "$container" ]
train
https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Zed/Brand/BrandDependencyProvider.php#L29-L36
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.create
public static function create($maniaLinkId = null, $version = null, $name = null, array $children = null) { return new static($maniaLinkId, $version, $name, $children); }
php
public static function create($maniaLinkId = null, $version = null, $name = null, array $children = null) { return new static($maniaLinkId, $version, $name, $children); }
[ "public", "static", "function", "create", "(", "$", "maniaLinkId", "=", "null", ",", "$", "version", "=", "null", ",", "$", "name", "=", "null", ",", "array", "$", "children", "=", "null", ")", "{", "return", "new", "static", "(", "$", "maniaLinkId", ...
Create a new ManiaLink @api @param string $maniaLinkId (optional) ManiaLink ID @param int $version (optional) Version @param string $name (optional) Name @param Renderable[] $children (optional) Children @return static
[ "Create", "a", "new", "ManiaLink" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L109-L112
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.setId
public function setId($maniaLinkId) { $this->maniaLinkId = (string)$maniaLinkId; if ($this->maniaLinkId && !$this->name) { $this->setName($this->maniaLinkId); } return $this; }
php
public function setId($maniaLinkId) { $this->maniaLinkId = (string)$maniaLinkId; if ($this->maniaLinkId && !$this->name) { $this->setName($this->maniaLinkId); } return $this; }
[ "public", "function", "setId", "(", "$", "maniaLinkId", ")", "{", "$", "this", "->", "maniaLinkId", "=", "(", "string", ")", "$", "maniaLinkId", ";", "if", "(", "$", "this", "->", "maniaLinkId", "&&", "!", "$", "this", "->", "name", ")", "{", "$", ...
Set the ID @api @param string $maniaLinkId ManiaLink ID @return static
[ "Set", "the", "ID" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L165-L172
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.getDico
public function getDico($createIfEmpty = true) { if (!$this->dico && $createIfEmpty) { $this->setDico(new Dico()); } return $this->dico; }
php
public function getDico($createIfEmpty = true) { if (!$this->dico && $createIfEmpty) { $this->setDico(new Dico()); } return $this->dico; }
[ "public", "function", "getDico", "(", "$", "createIfEmpty", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "dico", "&&", "$", "createIfEmpty", ")", "{", "$", "this", "->", "setDico", "(", "new", "Dico", "(", ")", ")", ";", "}", "return",...
Get the Dictionary @api @param bool $createIfEmpty (optional) If the Dico should be created if it doesn't exist yet @return Dico
[ "Get", "the", "Dictionary" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L438-L444
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.getStylesheet
public function getStylesheet($createIfEmpty = true) { if (!$this->stylesheet && $createIfEmpty) { return $this->createStylesheet(); } return $this->stylesheet; }
php
public function getStylesheet($createIfEmpty = true) { if (!$this->stylesheet && $createIfEmpty) { return $this->createStylesheet(); } return $this->stylesheet; }
[ "public", "function", "getStylesheet", "(", "$", "createIfEmpty", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "stylesheet", "&&", "$", "createIfEmpty", ")", "{", "return", "$", "this", "->", "createStylesheet", "(", ")", ";", "}", "return",...
Get the Stylesheet @api @return Stylesheet
[ "Get", "the", "Stylesheet" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L465-L471
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.createStylesheet
public function createStylesheet() { if ($this->stylesheet) { return $this->stylesheet; } $stylesheet = new Stylesheet(); $this->setStylesheet($stylesheet); return $this->stylesheet; }
php
public function createStylesheet() { if ($this->stylesheet) { return $this->stylesheet; } $stylesheet = new Stylesheet(); $this->setStylesheet($stylesheet); return $this->stylesheet; }
[ "public", "function", "createStylesheet", "(", ")", "{", "if", "(", "$", "this", "->", "stylesheet", ")", "{", "return", "$", "this", "->", "stylesheet", ";", "}", "$", "stylesheet", "=", "new", "Stylesheet", "(", ")", ";", "$", "this", "->", "setStyle...
Create and assign a new Stylesheet if necessary @api @return Stylesheet
[ "Create", "and", "assign", "a", "new", "Stylesheet", "if", "necessary" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L492-L500
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.getScript
public function getScript($createIfEmpty = true) { if (!$this->script && $createIfEmpty) { return $this->createScript(); } return $this->script; }
php
public function getScript($createIfEmpty = true) { if (!$this->script && $createIfEmpty) { return $this->createScript(); } return $this->script; }
[ "public", "function", "getScript", "(", "$", "createIfEmpty", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "script", "&&", "$", "createIfEmpty", ")", "{", "return", "$", "this", "->", "createScript", "(", ")", ";", "}", "return", "$", "t...
Get the Script @api @param bool $createIfEmpty (optional) Create the script if it's not set yet @return Script
[ "Get", "the", "Script" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L509-L515
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.createScript
public function createScript() { if ($this->script) { return $this->script; } $script = new Script(); $this->setScript($script); return $this->script; }
php
public function createScript() { if ($this->script) { return $this->script; } $script = new Script(); $this->setScript($script); return $this->script; }
[ "public", "function", "createScript", "(", ")", "{", "if", "(", "$", "this", "->", "script", ")", "{", "return", "$", "this", "->", "script", ";", "}", "$", "script", "=", "new", "Script", "(", ")", ";", "$", "this", "->", "setScript", "(", "$", ...
Create and assign a new Script if necessary @api @return Script
[ "Create", "and", "assign", "a", "new", "Script", "if", "necessary" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L536-L544
steeffeen/FancyManiaLinks
FML/ManiaLink.php
ManiaLink.render
public function render($echo = false, $domDocument = null) { $isChild = (bool)$domDocument; if (!$isChild) { $domDocument = new \DOMDocument("1.0", "utf-8"); $domDocument->xmlStandalone = true; } $maniaLink = $domDocument->createElement("maniali...
php
public function render($echo = false, $domDocument = null) { $isChild = (bool)$domDocument; if (!$isChild) { $domDocument = new \DOMDocument("1.0", "utf-8"); $domDocument->xmlStandalone = true; } $maniaLink = $domDocument->createElement("maniali...
[ "public", "function", "render", "(", "$", "echo", "=", "false", ",", "$", "domDocument", "=", "null", ")", "{", "$", "isChild", "=", "(", "bool", ")", "$", "domDocument", ";", "if", "(", "!", "$", "isChild", ")", "{", "$", "domDocument", "=", "new"...
Render the ManiaLink @param bool $echo (optional) If the XML text should be echoed and the Content-Type header should be set @param \DOMDocument $domDocument (optional) DOMDocument for which the ManiaLink should be rendered @return \DOMDocument
[ "Render", "the", "ManiaLink" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaLink.php#L553-L626
Double-Opt-in/php-client-api
src/Security/CryptographyEngine.php
CryptographyEngine.encrypt
public function encrypt($text, $email) { $key = $this->hasher->key($email); return $this->crypter->encrypt($text, $key); }
php
public function encrypt($text, $email) { $key = $this->hasher->key($email); return $this->crypter->encrypt($text, $key); }
[ "public", "function", "encrypt", "(", "$", "text", ",", "$", "email", ")", "{", "$", "key", "=", "$", "this", "->", "hasher", "->", "key", "(", "$", "email", ")", ";", "return", "$", "this", "->", "crypter", "->", "encrypt", "(", "$", "text", ","...
encrypts a given string with given hash @param string $text @param string $email @return string
[ "encrypts", "a", "given", "string", "with", "given", "hash" ]
train
https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/CryptographyEngine.php#L50-L55
Double-Opt-in/php-client-api
src/Security/CryptographyEngine.php
CryptographyEngine.decrypt
public function decrypt($text, $email) { $key = $this->hasher->key($email); return $this->crypter->decrypt($text, $key); }
php
public function decrypt($text, $email) { $key = $this->hasher->key($email); return $this->crypter->decrypt($text, $key); }
[ "public", "function", "decrypt", "(", "$", "text", ",", "$", "email", ")", "{", "$", "key", "=", "$", "this", "->", "hasher", "->", "key", "(", "$", "email", ")", ";", "return", "$", "this", "->", "crypter", "->", "decrypt", "(", "$", "text", ","...
decrypts a given encrypted message container e.g.: "slowaes:11 41bc1eacf6ce685c8eb7649da0d080995223165277af8bc068c90f7eb831d5ae 97be775203f003fef3c808e4b588c69b" @param string $text @param string $email @return string @throws Exception
[ "decrypts", "a", "given", "encrypted", "message", "container", "e", ".", "g", ".", ":", "slowaes", ":", "11", "41bc1eacf6ce685c8eb7649da0d080995223165277af8bc068c90f7eb831d5ae", "97be775203f003fef3c808e4b588c69b" ]
train
https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/CryptographyEngine.php#L68-L73
krzysztofmazur/php-object-mapper
src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueReader/AbstractValueReader.php
AbstractValueReader.read
public function read($object) { if ($object === null) { throw new \InvalidArgumentException("Unexpected null value"); } $value = $this->readValue($object); if ($this->next !== null) { $value = $this->next->read($value); } return $value; }
php
public function read($object) { if ($object === null) { throw new \InvalidArgumentException("Unexpected null value"); } $value = $this->readValue($object); if ($this->next !== null) { $value = $this->next->read($value); } return $value; }
[ "public", "function", "read", "(", "$", "object", ")", "{", "if", "(", "$", "object", "===", "null", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Unexpected null value\"", ")", ";", "}", "$", "value", "=", "$", "this", "->", "readV...
{@inheritdoc}
[ "{" ]
train
https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueReader/AbstractValueReader.php#L40-L51
ufocoder/yii2-SyncSocial
src/components/services/Google.php
Google.publishPost
public function publishPost( $message, $url = null ) { throw new Exception( Yii::t( 'SyncSocial', '{service} not support post publish', [ 'service' => $this->service->getName() ] ) ); }
php
public function publishPost( $message, $url = null ) { throw new Exception( Yii::t( 'SyncSocial', '{service} not support post publish', [ 'service' => $this->service->getName() ] ) ); }
[ "public", "function", "publishPost", "(", "$", "message", ",", "$", "url", "=", "null", ")", "{", "throw", "new", "Exception", "(", "Yii", "::", "t", "(", "'SyncSocial'", ",", "'{service} not support post publish'", ",", "[", "'service'", "=>", "$", "this", ...
@param $message @param null $url @return array|void @throws Exception
[ "@param", "$message", "@param", "null", "$url" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Google.php#L38-L43
nyeholt/silverstripe-external-content
thirdparty/Zend/Feed/Abstract.php
Zend_Feed_Abstract._buildEntryCache
protected function _buildEntryCache() { $this->_entries = array(); foreach ($this->_element->childNodes as $child) { if ($child->localName == $this->_entryElementName) { $this->_entries[] = $child; } } }
php
protected function _buildEntryCache() { $this->_entries = array(); foreach ($this->_element->childNodes as $child) { if ($child->localName == $this->_entryElementName) { $this->_entries[] = $child; } } }
[ "protected", "function", "_buildEntryCache", "(", ")", "{", "$", "this", "->", "_entries", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "_element", "->", "childNodes", "as", "$", "child", ")", "{", "if", "(", "$", "child", "->", "l...
Cache the individual feed elements so they don't need to be searched for on every operation. @return void
[ "Cache", "the", "individual", "feed", "elements", "so", "they", "don", "t", "need", "to", "be", "searched", "for", "on", "every", "operation", "." ]
train
https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Abstract.php#L157-L165
ClanCats/Core
src/console/session.php
session.get_manager
public function get_manager( $params ) { if ( array_key_exists( 'm', $params ) ) { $manager = $params['m']; } else { $manager = reset( $params ); } if ( $manager ) { $this->info( 'Using session manager: '.$manager ); } else { $manager = null; $this->info( 'Using default session...
php
public function get_manager( $params ) { if ( array_key_exists( 'm', $params ) ) { $manager = $params['m']; } else { $manager = reset( $params ); } if ( $manager ) { $this->info( 'Using session manager: '.$manager ); } else { $manager = null; $this->info( 'Using default session...
[ "public", "function", "get_manager", "(", "$", "params", ")", "{", "if", "(", "array_key_exists", "(", "'m'", ",", "$", "params", ")", ")", "{", "$", "manager", "=", "$", "params", "[", "'m'", "]", ";", "}", "else", "{", "$", "manager", "=", "reset...
Get a manager instance @param array $params @return Session\Manager
[ "Get", "a", "manager", "instance" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/session.php#L34-L56
ClanCats/Core
src/console/session.php
session.action_gc
public function action_gc( $params ) { $manager = $this->get_manager( $params ); $manager->gc(); $this->success( 'Garbage collection executed successfully' ); }
php
public function action_gc( $params ) { $manager = $this->get_manager( $params ); $manager->gc(); $this->success( 'Garbage collection executed successfully' ); }
[ "public", "function", "action_gc", "(", "$", "params", ")", "{", "$", "manager", "=", "$", "this", "->", "get_manager", "(", "$", "params", ")", ";", "$", "manager", "->", "gc", "(", ")", ";", "$", "this", "->", "success", "(", "'Garbage collection exe...
Gabrage collect old sessions @param array $params
[ "Gabrage", "collect", "old", "sessions" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/session.php#L63-L69
vi-kon/laravel-auth
src/database/migrations/2014_08_27_100003_create_rel_role_permission_table.php
CreateRelRolePermissionTable.up
public function up() { $schema = app()->make('db')->connection()->getSchemaBuilder(); $schema->create(config('vi-kon.auth.table.rel__role__permission'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->unsignedInteger('role_id'); $table->foreign(...
php
public function up() { $schema = app()->make('db')->connection()->getSchemaBuilder(); $schema->create(config('vi-kon.auth.table.rel__role__permission'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->unsignedInteger('role_id'); $table->foreign(...
[ "public", "function", "up", "(", ")", "{", "$", "schema", "=", "app", "(", ")", "->", "make", "(", "'db'", ")", "->", "connection", "(", ")", "->", "getSchemaBuilder", "(", ")", ";", "$", "schema", "->", "create", "(", "config", "(", "'vi-kon.auth.ta...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/database/migrations/2014_08_27_100003_create_rel_role_permission_table.php#L18-L39
slashworks/control-bundle
src/Slashworks/AppBundle/Model/map/RemoteAppTableMap.php
RemoteAppTableMap.initialize
public function initialize() { // attributes $this->setName('remote_app'); $this->setPhpName('RemoteApp'); $this->setClassname('Slashworks\\AppBundle\\Model\\RemoteApp'); $this->setPackage('src.Slashworks.AppBundle.Model'); $this->setUseIdGenerator(true); // c...
php
public function initialize() { // attributes $this->setName('remote_app'); $this->setPhpName('RemoteApp'); $this->setClassname('Slashworks\\AppBundle\\Model\\RemoteApp'); $this->setPackage('src.Slashworks.AppBundle.Model'); $this->setUseIdGenerator(true); // c...
[ "public", "function", "initialize", "(", ")", "{", "// attributes", "$", "this", "->", "setName", "(", "'remote_app'", ")", ";", "$", "this", "->", "setPhpName", "(", "'RemoteApp'", ")", ";", "$", "this", "->", "setClassname", "(", "'Slashworks\\\\AppBundle\\\...
Initialize the table attributes, columns and validators Relations are not initialized by this method since they are lazy loaded @return void @throws PropelException
[ "Initialize", "the", "table", "attributes", "columns", "and", "validators", "Relations", "are", "not", "initialized", "by", "this", "method", "since", "they", "are", "lazy", "loaded" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/map/RemoteAppTableMap.php#L36-L80