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 |
|---|---|---|---|---|---|---|---|---|---|---|
tttptd/laravel-responder | src/ResourceFactory.php | ResourceFactory.makeFromPaginator | protected function makeFromPaginator(Paginator $paginator):ResourceInterface
{
$resource = static::makeFromCollection($paginator->getCollection());
if ($resource instanceof CollectionResource) {
$queryParams = array_diff_key(app('request')->all(), array_flip(['page']));
$pag... | php | protected function makeFromPaginator(Paginator $paginator):ResourceInterface
{
$resource = static::makeFromCollection($paginator->getCollection());
if ($resource instanceof CollectionResource) {
$queryParams = array_diff_key(app('request')->all(), array_flip(['page']));
$pag... | [
"protected",
"function",
"makeFromPaginator",
"(",
"Paginator",
"$",
"paginator",
")",
":",
"ResourceInterface",
"{",
"$",
"resource",
"=",
"static",
"::",
"makeFromCollection",
"(",
"$",
"paginator",
"->",
"getCollection",
"(",
")",
")",
";",
"if",
"(",
"$",
... | Make resource from an Eloquent paginator.
@param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
@return \League\Fractal\Resource\ResourceInterface | [
"Make",
"resource",
"from",
"an",
"Eloquent",
"paginator",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/ResourceFactory.php#L130-L142 |
OKTOTV/OktolabMediaBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('oktolab_media');
$rootNode
->children()
->arrayNode('origin')
->addDefaultsIfNotSet()
->children()
... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('oktolab_media');
$rootNode
->children()
->arrayNode('origin')
->addDefaultsIfNotSet()
->children()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'oktolab_media'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/DependencyInjection/Configuration.php#L18-L102 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Adapter/FileTransfer.php | FileTransfer.download | public function download($ftkey, $size, $passthru = FALSE)
{
$this->init($ftkey);
if($passthru)
{
return $this->passthru($size);
}
$buff = new Str("");
$size = intval($size);
$pack = 4096;
Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);... | php | public function download($ftkey, $size, $passthru = FALSE)
{
$this->init($ftkey);
if($passthru)
{
return $this->passthru($size);
}
$buff = new Str("");
$size = intval($size);
$pack = 4096;
Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);... | [
"public",
"function",
"download",
"(",
"$",
"ftkey",
",",
"$",
"size",
",",
"$",
"passthru",
"=",
"FALSE",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"ftkey",
")",
";",
"if",
"(",
"$",
"passthru",
")",
"{",
"return",
"$",
"this",
"->",
"passt... | Returns the content of a downloaded file as a Str object.
@param string $ftkey
@param integer $size
@param boolean $passthru
@throws Exception
@return Str | [
"Returns",
"the",
"content",
"of",
"a",
"downloaded",
"file",
"as",
"a",
"Str",
"object",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Adapter/FileTransfer.php#L142-L179 |
surebert/surebert-framework | src/sb/Cache/Memcache.php | Memcache.store | public function store($key, $data, $lifetime = 0, $compress = 0)
{
$key = $this->namespace . $key;
$store = $this->memcache->set($key, $data, $compress, $lifetime);
if ($store && $key != $this->namespace . $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
}
... | php | public function store($key, $data, $lifetime = 0, $compress = 0)
{
$key = $this->namespace . $key;
$store = $this->memcache->set($key, $data, $compress, $lifetime);
if ($store && $key != $this->namespace . $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
}
... | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$",
"lifetime",
"=",
"0",
",",
"$",
"compress",
"=",
"0",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"namespace",
".",
"$",
"key",
";",
"$",
"store",
"=",
"$",
"this",
... | Store the cache data in memcache
(non-PHPdoc)
@see trunk/private/framework/sb/sb_Cache#store() | [
"Store",
"the",
"cache",
"data",
"in",
"memcache",
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Memcache.php#L63-L74 |
surebert/surebert-framework | src/sb/Cache/Memcache.php | Memcache.delete | public function delete($key)
{
$deleted = false;
$catalog = \array_keys($this->getKeys());
foreach ($catalog as $k) {
if (substr($k, 0, strlen($key)) == $key) {
$delete = $this->memcache->delete($this->namespace . $key);
if ($delete) {
... | php | public function delete($key)
{
$deleted = false;
$catalog = \array_keys($this->getKeys());
foreach ($catalog as $k) {
if (substr($k, 0, strlen($key)) == $key) {
$delete = $this->memcache->delete($this->namespace . $key);
if ($delete) {
... | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"deleted",
"=",
"false",
";",
"$",
"catalog",
"=",
"\\",
"array_keys",
"(",
"$",
"this",
"->",
"getKeys",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"catalog",
"as",
"$",
"k",
")",
"{"... | Deletes cache data
(non-PHPdoc)
@see trunk/private/framework/sb/sb_Cache#delete() | [
"Deletes",
"cache",
"data",
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Memcache.php#L93-L112 |
ekuiter/feature-php | FeaturePhp/ProductLine/Settings.php | Settings.processDirectoryEntry | private function processDirectoryEntry($artifactDirectory, $entry) {
$entity = fphp\Helper\Path::join($artifactDirectory, $entry);
// directory containing artifact file
if (is_dir($entity) && !fphp\Helper\Path::isDot($entry) && in_array($this->get("artifactFile"), scandir($entity))) {
... | php | private function processDirectoryEntry($artifactDirectory, $entry) {
$entity = fphp\Helper\Path::join($artifactDirectory, $entry);
// directory containing artifact file
if (is_dir($entity) && !fphp\Helper\Path::isDot($entry) && in_array($this->get("artifactFile"), scandir($entity))) {
... | [
"private",
"function",
"processDirectoryEntry",
"(",
"$",
"artifactDirectory",
",",
"$",
"entry",
")",
"{",
"$",
"entity",
"=",
"fphp",
"\\",
"Helper",
"\\",
"Path",
"::",
"join",
"(",
"$",
"artifactDirectory",
",",
"$",
"entry",
")",
";",
"// directory cont... | recursively search the artifact directory, allowing the user to group features | [
"recursively",
"search",
"the",
"artifact",
"directory",
"allowing",
"the",
"user",
"to",
"group",
"features"
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Settings.php#L99-L125 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Concerns/HasEvents.php | HasEvents.observe | public static function observe($class)
{
$className = is_string($class) ? $class : get_class($class);
// When registering a model observer, we will spin through the possible events
// and determine if this observer has that method. If it does, we will hook
// it into the model's eve... | php | public static function observe($class)
{
$className = is_string($class) ? $class : get_class($class);
// When registering a model observer, we will spin through the possible events
// and determine if this observer has that method. If it does, we will hook
// it into the model's eve... | [
"public",
"static",
"function",
"observe",
"(",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"is_string",
"(",
"$",
"class",
")",
"?",
"$",
"class",
":",
"get_class",
"(",
"$",
"class",
")",
";",
"// When registering a model observer, we will spin through the ... | Register an observer with the Model.
@param object|string $class
@return void | [
"Register",
"an",
"observer",
"with",
"the",
"Model",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Concerns/HasEvents.php#L37-L49 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Concerns/HasEvents.php | HasEvents.fireModelEvent | protected function fireModelEvent($event, $halt = true)
{
if (!isset(static::$dispatcher)) {
return true;
}
// First, we will get the proper method to call on the event dispatcher, and then we
// will attempt to fire a custom, object based event for the given event. If t... | php | protected function fireModelEvent($event, $halt = true)
{
if (!isset(static::$dispatcher)) {
return true;
}
// First, we will get the proper method to call on the event dispatcher, and then we
// will attempt to fire a custom, object based event for the given event. If t... | [
"protected",
"function",
"fireModelEvent",
"(",
"$",
"event",
",",
"$",
"halt",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"dispatcher",
")",
")",
"{",
"return",
"true",
";",
"}",
"// First, we will get the proper method to cal... | Fire the given event for the model.
@param string $event
@param bool $halt
@return mixed | [
"Fire",
"the",
"given",
"event",
"for",
"the",
"model",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Concerns/HasEvents.php#L74-L91 |
nabab/bbn | src/bbn/mvc/controller.php | controller.say_local_path | public function say_local_path()
{
if ( ($pp = $this->get_prepath()) && (strpos($this->path, $pp) === 0) ){
return substr($this->path, \strlen($pp));
}
return $this->path;
} | php | public function say_local_path()
{
if ( ($pp = $this->get_prepath()) && (strpos($this->path, $pp) === 0) ){
return substr($this->path, \strlen($pp));
}
return $this->path;
} | [
"public",
"function",
"say_local_path",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"pp",
"=",
"$",
"this",
"->",
"get_prepath",
"(",
")",
")",
"&&",
"(",
"strpos",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"pp",
")",
"===",
"0",
")",
")",
"{",
"return... | Returns the current controller's path.
@return string | [
"Returns",
"the",
"current",
"controller",
"s",
"path",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L228-L234 |
nabab/bbn | src/bbn/mvc/controller.php | controller.say_local_route | public function say_local_route()
{
if ( ($pp = $this->get_prepath()) && (strpos($this->request, $pp) === 0) ){
return substr($this->request, \strlen($pp));
}
return $this->request;
} | php | public function say_local_route()
{
if ( ($pp = $this->get_prepath()) && (strpos($this->request, $pp) === 0) ){
return substr($this->request, \strlen($pp));
}
return $this->request;
} | [
"public",
"function",
"say_local_route",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"pp",
"=",
"$",
"this",
"->",
"get_prepath",
"(",
")",
")",
"&&",
"(",
"strpos",
"(",
"$",
"this",
"->",
"request",
",",
"$",
"pp",
")",
"===",
"0",
")",
")",
"{",
"re... | Returns the current controller's path.
@return string | [
"Returns",
"the",
"current",
"controller",
"s",
"path",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L251-L257 |
nabab/bbn | src/bbn/mvc/controller.php | controller.say_dir | public function say_dir()
{
if ( $this->path ){
$p = dirname($this->path);
if ( $p === '.' ){
return '';
}
if (
($prepath = $this->get_prepath()) &&
(strpos($p, $prepath) === 0)
){
return substr($p, \strlen($prepath));
}
return $p;
}
return false;
} | php | public function say_dir()
{
if ( $this->path ){
$p = dirname($this->path);
if ( $p === '.' ){
return '';
}
if (
($prepath = $this->get_prepath()) &&
(strpos($p, $prepath) === 0)
){
return substr($p, \strlen($prepath));
}
return $p;
}
return false;
} | [
"public",
"function",
"say_dir",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"path",
")",
"{",
"$",
"p",
"=",
"dirname",
"(",
"$",
"this",
"->",
"path",
")",
";",
"if",
"(",
"$",
"p",
"===",
"'.'",
")",
"{",
"return",
"''",
";",
"}",
"if",
... | Returns the current controller's file's name.
@return string | [
"Returns",
"the",
"current",
"controller",
"s",
"file",
"s",
"name",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L264-L280 |
nabab/bbn | src/bbn/mvc/controller.php | controller.render | public function render($view, $model=''){
if ( empty($model) && $this->has_data() ){
$model = $this->data;
}
if ( \is_string($view) ){
return \is_array($model) ? bbn\tpl::render($view, $model) : $view;
}
die(bbn\x::hdump("Problem with the template", $view, $this->path, $this->mode));
} | php | public function render($view, $model=''){
if ( empty($model) && $this->has_data() ){
$model = $this->data;
}
if ( \is_string($view) ){
return \is_array($model) ? bbn\tpl::render($view, $model) : $view;
}
die(bbn\x::hdump("Problem with the template", $view, $this->path, $this->mode));
} | [
"public",
"function",
"render",
"(",
"$",
"view",
",",
"$",
"model",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"model",
")",
"&&",
"$",
"this",
"->",
"has_data",
"(",
")",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"data",
";",
... | This directly renders content with arbitrary values using the existing Mustache engine.
@param string $view The view to be rendered
@param array $model The data model to fill the view with
@return void | [
"This",
"directly",
"renders",
"content",
"with",
"arbitrary",
"values",
"using",
"the",
"existing",
"Mustache",
"engine",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L296-L304 |
nabab/bbn | src/bbn/mvc/controller.php | controller.reroute | public function reroute($path='', $post = false, $arguments = false)
{
if ( !\in_array($path, $this->reroutes) && ($this->path !== $path) ){
$this->reroutes[] = $path;
$this->mvc->reroute($path, $post, $arguments);
$this->is_rerouted = 1;
}
} | php | public function reroute($path='', $post = false, $arguments = false)
{
if ( !\in_array($path, $this->reroutes) && ($this->path !== $path) ){
$this->reroutes[] = $path;
$this->mvc->reroute($path, $post, $arguments);
$this->is_rerouted = 1;
}
} | [
"public",
"function",
"reroute",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"post",
"=",
"false",
",",
"$",
"arguments",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"path",
",",
"$",
"this",
"->",
"reroutes",
")",
"&&",
"(",
... | This will reroute a controller to another one seemlessly. Chainable
@param string $path The request path <em>(e.g books/466565 or xml/books/48465)</em>
@return void | [
"This",
"will",
"reroute",
"a",
"controller",
"to",
"another",
"one",
"seemlessly",
".",
"Chainable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L322-L329 |
nabab/bbn | src/bbn/mvc/controller.php | controller.incl | public function incl($file_name){
if ( $this->exists() ){
$d = dirname($this->file).'/';
if ( substr($file_name, -4) !== '.php' ){
$file_name .= '.php';
}
if ( (strpos($file_name, '..') === false) && file_exists($d.$file_name) ){
$bbn_path = $d.$file_name;
$ctrl =& $this;
unset($d, $file_n... | php | public function incl($file_name){
if ( $this->exists() ){
$d = dirname($this->file).'/';
if ( substr($file_name, -4) !== '.php' ){
$file_name .= '.php';
}
if ( (strpos($file_name, '..') === false) && file_exists($d.$file_name) ){
$bbn_path = $d.$file_name;
$ctrl =& $this;
unset($d, $file_n... | [
"public",
"function",
"incl",
"(",
"$",
"file_name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"d",
"=",
"dirname",
"(",
"$",
"this",
"->",
"file",
")",
".",
"'/'",
";",
"if",
"(",
"substr",
"(",
"$",
"file_name... | This will include a file from within the controller's path. Chainable
@param string $file_name If .php is ommited it will be added
@return $this | [
"This",
"will",
"include",
"a",
"file",
"from",
"within",
"the",
"controller",
"s",
"path",
".",
"Chainable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L337-L351 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_script | public function add_script($script){
if ( \is_object($this->obj) ){
if ( !isset($this->obj->script) ){
$this->obj->script = '';
}
$this->obj->script .= $script;
}
return $this;
} | php | public function add_script($script){
if ( \is_object($this->obj) ){
if ( !isset($this->obj->script) ){
$this->obj->script = '';
}
$this->obj->script .= $script;
}
return $this;
} | [
"public",
"function",
"add_script",
"(",
"$",
"script",
")",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"this",
"->",
"obj",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"obj",
"->",
"script",
")",
")",
"{",
"$",
"this",
"-... | This will add the given string to the script property, and create it if needed. Chainable
@param string $script The javascript chain to add
@return $this | [
"This",
"will",
"add",
"the",
"given",
"string",
"to",
"the",
"script",
"property",
"and",
"create",
"it",
"if",
"needed",
".",
"Chainable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L359-L367 |
nabab/bbn | src/bbn/mvc/controller.php | controller.control | private function control(){
if ( $this->file && !isset($this->is_controlled) ){
$ok = 1;
if ( $this->plugin ){
$this->register_plugin_classes($this->plugin_path());
}
ob_start();
foreach ( $this->checkers as $appui_checker_file ){
// If a checker file returns false, the controller ... | php | private function control(){
if ( $this->file && !isset($this->is_controlled) ){
$ok = 1;
if ( $this->plugin ){
$this->register_plugin_classes($this->plugin_path());
}
ob_start();
foreach ( $this->checkers as $appui_checker_file ){
// If a checker file returns false, the controller ... | [
"private",
"function",
"control",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"is_controlled",
")",
")",
"{",
"$",
"ok",
"=",
"1",
";",
"if",
"(",
"$",
"this",
"->",
"plugin",
")",
"{",
"$",
... | This will enclose the controller's inclusion
It can be publicly launched through check()
@return boolean | [
"This",
"will",
"enclose",
"the",
"controller",
"s",
"inclusion",
"It",
"can",
"be",
"publicly",
"launched",
"through",
"check",
"()"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L392-L431 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_js | public function get_js($path='', array $data=null, $encapsulated = true){
if ( \is_array($path) ){
$data = $path;
$path = '';
}
if ( $r = $this->get_view($path, 'js', $data) ){
return '<script>'.
( $encapsulated ? '(function($){' : '' ).
( empty($data) ? '' : 'var data = '.... | php | public function get_js($path='', array $data=null, $encapsulated = true){
if ( \is_array($path) ){
$data = $path;
$path = '';
}
if ( $r = $this->get_view($path, 'js', $data) ){
return '<script>'.
( $encapsulated ? '(function($){' : '' ).
( empty($data) ? '' : 'var data = '.... | [
"public",
"function",
"get_js",
"(",
"$",
"path",
"=",
"''",
",",
"array",
"$",
"data",
"=",
"null",
",",
"$",
"encapsulated",
"=",
"true",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"data",
"=",
"$",
"path",
"... | This will get a javascript view encapsulated in an anonymous function for embedding in HTML.
@param string $path
@return string|false | [
"This",
"will",
"get",
"a",
"javascript",
"view",
"encapsulated",
"in",
"an",
"anonymous",
"function",
"for",
"embedding",
"in",
"HTML",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L460-L474 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_js_group | public function get_js_group($files='', array $data=null, $encapsulated = true){
if ( $js = $this->get_view_group($files, $data, 'js') ){
return '<script>'.
( $encapsulated ? '(function($){' : '' ).
( empty($data) ? '' : 'var data = '.\bbn\x::js_object($data).';' ).
$js.
( $encapsulate... | php | public function get_js_group($files='', array $data=null, $encapsulated = true){
if ( $js = $this->get_view_group($files, $data, 'js') ){
return '<script>'.
( $encapsulated ? '(function($){' : '' ).
( empty($data) ? '' : 'var data = '.\bbn\x::js_object($data).';' ).
$js.
( $encapsulate... | [
"public",
"function",
"get_js_group",
"(",
"$",
"files",
"=",
"''",
",",
"array",
"$",
"data",
"=",
"null",
",",
"$",
"encapsulated",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"js",
"=",
"$",
"this",
"->",
"get_view_group",
"(",
"$",
"files",
",",
"$"... | This will get a javascript view encapsulated in an anonymous function for embedding in HTML.
@param array|string $files
@param array $data
@param boolean $encapsulated
@return string|false | [
"This",
"will",
"get",
"a",
"javascript",
"view",
"encapsulated",
"in",
"an",
"anonymous",
"function",
"for",
"embedding",
"in",
"HTML",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L484-L494 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_view_group | public function get_view_group($files='', array $data=null, $mode = 'html'){
if ( !\is_array($files) ){
if ( !($tmp = $this->mvc->fetch_dir($files, $mode)) ){
$this->error("Impossible to get files from directory $files");
return false;
}
$files = $tmp;
}
if ( \is_array($fil... | php | public function get_view_group($files='', array $data=null, $mode = 'html'){
if ( !\is_array($files) ){
if ( !($tmp = $this->mvc->fetch_dir($files, $mode)) ){
$this->error("Impossible to get files from directory $files");
return false;
}
$files = $tmp;
}
if ( \is_array($fil... | [
"public",
"function",
"get_view_group",
"(",
"$",
"files",
"=",
"''",
",",
"array",
"$",
"data",
"=",
"null",
",",
"$",
"mode",
"=",
"'html'",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"files",
")",
")",
"{",
"if",
"(",
"!",
"(",
"$... | This will get a javascript view encapsulated in an anonymous function for embedding in HTML.
@param array|string $files
@param array $data
@param string $mode
@return string|false | [
"This",
"will",
"get",
"a",
"javascript",
"view",
"encapsulated",
"in",
"an",
"anonymous",
"function",
"for",
"embedding",
"in",
"HTML",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L504-L522 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_css | public function get_css($path=''){
if ( $r = $this->get_view($path, 'css') ){
return \CssMin::minify($r);
}
return false;
} | php | public function get_css($path=''){
if ( $r = $this->get_view($path, 'css') ){
return \CssMin::minify($r);
}
return false;
} | [
"public",
"function",
"get_css",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"r",
"=",
"$",
"this",
"->",
"get_view",
"(",
"$",
"path",
",",
"'css'",
")",
")",
"{",
"return",
"\\",
"CssMin",
"::",
"minify",
"(",
"$",
"r",
")",
";",
... | This will get a CSS view encapsulated in a scoped style tag.
@param string $path
@return string|false | [
"This",
"will",
"get",
"a",
"CSS",
"view",
"encapsulated",
"in",
"a",
"scoped",
"style",
"tag",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L530-L535 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_less | public function get_less($path=''){
if ( $r = $this->get_view($path, 'css', false) ){
return \CssMin::minify($r);
}
} | php | public function get_less($path=''){
if ( $r = $this->get_view($path, 'css', false) ){
return \CssMin::minify($r);
}
} | [
"public",
"function",
"get_less",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"r",
"=",
"$",
"this",
"->",
"get_view",
"(",
"$",
"path",
",",
"'css'",
",",
"false",
")",
")",
"{",
"return",
"\\",
"CssMin",
"::",
"minify",
"(",
"$",
"... | This will get and compile a LESS view encapsulated in a scoped style tag.
@param string $path
@return string|false | [
"This",
"will",
"get",
"and",
"compile",
"a",
"LESS",
"view",
"encapsulated",
"in",
"a",
"scoped",
"style",
"tag",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L543-L547 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_css | public function add_css($path=''){
if ( $css = $this->get_css($path) ){
if ( !isset($this->obj->css) ){
$this->obj->css = '';
}
$this->obj->css .= $css;
}
return $this;
} | php | public function add_css($path=''){
if ( $css = $this->get_css($path) ){
if ( !isset($this->obj->css) ){
$this->obj->css = '';
}
$this->obj->css .= $css;
}
return $this;
} | [
"public",
"function",
"add_css",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"css",
"=",
"$",
"this",
"->",
"get_css",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"obj",
"->",
"css",
")",
")",
... | This will get a CSS view encapsulated in a scoped style tag.
@param string $path
@return string|false | [
"This",
"will",
"get",
"a",
"CSS",
"view",
"encapsulated",
"in",
"a",
"scoped",
"style",
"tag",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L555-L563 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_less | public function add_less($path=''){
if ( $css = $this->get_less($path) ){
if ( !isset($this->obj->css) ){
$this->obj->css = '';
}
$this->obj->css .= $css;
}
return $this;
} | php | public function add_less($path=''){
if ( $css = $this->get_less($path) ){
if ( !isset($this->obj->css) ){
$this->obj->css = '';
}
$this->obj->css .= $css;
}
return $this;
} | [
"public",
"function",
"add_less",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"css",
"=",
"$",
"this",
"->",
"get_less",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"obj",
"->",
"css",
")",
")"... | This will get and compile a LESS view encapsulated in a scoped style tag.
@param string $path
@return string|false | [
"This",
"will",
"get",
"and",
"compile",
"a",
"LESS",
"view",
"encapsulated",
"in",
"a",
"scoped",
"style",
"tag",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L571-L579 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_js | public function add_js(){
$args = \func_get_args();
$has_path = false;
foreach ( $args as $i => $a ){
if ( $new_data = $this->retrieve_var($a) ){
$this->js_data($new_data);
}
else if ( \is_string($a) ){
$has_path = 1;
}
else if ( \is_array($a) ){
$this->... | php | public function add_js(){
$args = \func_get_args();
$has_path = false;
foreach ( $args as $i => $a ){
if ( $new_data = $this->retrieve_var($a) ){
$this->js_data($new_data);
}
else if ( \is_string($a) ){
$has_path = 1;
}
else if ( \is_array($a) ){
$this->... | [
"public",
"function",
"add_js",
"(",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"$",
"has_path",
"=",
"false",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"i",
"=>",
"$",
"a",
")",
"{",
"if",
"(",
"$",
"new_data",
"=",
"... | This will add a javascript view to $this->obj->script
Chainable
@param string $path
@param string $mode
@return string|false | [
"This",
"will",
"add",
"a",
"javascript",
"view",
"to",
"$this",
"-",
">",
"obj",
"-",
">",
"script",
"Chainable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L589-L611 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_js_group | public function add_js_group($files = '', array $data = []){
if ( $js = $this->get_view_group($files, $data, 'js') ){
$this->js_data($data)->add_script($js);
}
return $this;
} | php | public function add_js_group($files = '', array $data = []){
if ( $js = $this->get_view_group($files, $data, 'js') ){
$this->js_data($data)->add_script($js);
}
return $this;
} | [
"public",
"function",
"add_js_group",
"(",
"$",
"files",
"=",
"''",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"js",
"=",
"$",
"this",
"->",
"get_view_group",
"(",
"$",
"files",
",",
"$",
"data",
",",
"'js'",
")",
")",
... | This will add a javascript view to $this->obj->script
Chainable
@param string $path
@param string $mode
@return string|false | [
"This",
"will",
"add",
"a",
"javascript",
"view",
"to",
"$this",
"-",
">",
"obj",
"-",
">",
"script",
"Chainable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L621-L626 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_view | public function get_view()
{
$args = $this->get_arguments(\func_get_args());
/*if ( !isset($args['mode']) ){
$v = $this->mvc->get_view($args['path'], 'html', $args['data']);
if ( !$v ){
$v = $this->mvc->get_view($args['path'], 'php', $args['data']);
}
}
else{
$v = $this->mvc->... | php | public function get_view()
{
$args = $this->get_arguments(\func_get_args());
/*if ( !isset($args['mode']) ){
$v = $this->mvc->get_view($args['path'], 'html', $args['data']);
if ( !$v ){
$v = $this->mvc->get_view($args['path'], 'php', $args['data']);
}
}
else{
$v = $this->mvc->... | [
"public",
"function",
"get_view",
"(",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"get_arguments",
"(",
"\\",
"func_get_args",
"(",
")",
")",
";",
"/*if ( !isset($args['mode']) ){\n $v = $this->mvc->get_view($args['path'], 'html', $args['data']);\n if ( !$v ){\n... | This will get a view.
@param string $path
@param string $mode
@return string|false | [
"This",
"will",
"get",
"a",
"view",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L723-L745 |
nabab/bbn | src/bbn/mvc/controller.php | controller.retrieve_var | private function retrieve_var($var){
if ( \is_string($var) && (strpos($var, '$') === 0) && isset($this->data[substr($var, 1)]) ){
return $this->data[substr($var, 1)];
}
return false;
} | php | private function retrieve_var($var){
if ( \is_string($var) && (strpos($var, '$') === 0) && isset($this->data[substr($var, 1)]) ){
return $this->data[substr($var, 1)];
}
return false;
} | [
"private",
"function",
"retrieve_var",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"var",
")",
"&&",
"(",
"strpos",
"(",
"$",
"var",
",",
"'$'",
")",
"===",
"0",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"s... | /*
public function get_php(){
$args = $this->get_arguments(\func_get_args());
$v = $this->mvc->get_view($args['path'], 'php', $args['data']);
if ( !$v && $args['die'] ){
die("Impossible to find the PHP view $args[path]");
}
return $v;
}
public function get_html(){
$args = $this->get_arguments(\func_get_args());
$v = $... | [
"/",
"*",
"public",
"function",
"get_php",
"()",
"{",
"$args",
"=",
"$this",
"-",
">",
"get_arguments",
"(",
"\\",
"func_get_args",
"()",
")",
";",
"$v",
"=",
"$this",
"-",
">",
"mvc",
"-",
">",
"get_view",
"(",
"$args",
"[",
"path",
"]",
"php",
"$... | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L781-L786 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_content | public function get_content($file_name){
if ( $this->check_path($file_name) &&
\defined('BBN_DATA_PATH') &&
is_file(BBN_DATA_PATH.$file_name)
){
return file_get_contents(BBN_DATA_PATH.$file_name);
}
return false;
} | php | public function get_content($file_name){
if ( $this->check_path($file_name) &&
\defined('BBN_DATA_PATH') &&
is_file(BBN_DATA_PATH.$file_name)
){
return file_get_contents(BBN_DATA_PATH.$file_name);
}
return false;
} | [
"public",
"function",
"get_content",
"(",
"$",
"file_name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check_path",
"(",
"$",
"file_name",
")",
"&&",
"\\",
"defined",
"(",
"'BBN_DATA_PATH'",
")",
"&&",
"is_file",
"(",
"BBN_DATA_PATH",
".",
"$",
"file_name",
... | This will get a the content of a file located within the data path
@param string $file_name
@return string|false | [
"This",
"will",
"get",
"a",
"the",
"content",
"of",
"a",
"file",
"located",
"within",
"the",
"data",
"path"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L840-L848 |
nabab/bbn | src/bbn/mvc/controller.php | controller.get_model | public function get_model(){
$args = \func_get_args();
$die = false;
foreach ( $args as $a ){
if ( \is_string($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
else if ( \is_bool($a) ){
$die = $a;
}
}
if ( empty($path) ){
... | php | public function get_model(){
$args = \func_get_args();
$die = false;
foreach ( $args as $a ){
if ( \is_string($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
else if ( \is_bool($a) ){
$die = $a;
}
}
if ( empty($path) ){
... | [
"public",
"function",
"get_model",
"(",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"$",
"die",
"=",
"false",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"a",
")",
")... | This will get the model. There is no order for the arguments.
@params string path to the model
@params array data to send to the model
@return array|false A data model | [
"This",
"will",
"get",
"the",
"model",
".",
"There",
"is",
"no",
"order",
"for",
"the",
"arguments",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L893-L930 |
nabab/bbn | src/bbn/mvc/controller.php | controller.delete_cached_model | public function delete_cached_model(){
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) && \strlen($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
}
if ( !isset($path) ){
$path = $this->path;
}
else if ( strpos($p... | php | public function delete_cached_model(){
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) && \strlen($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
}
if ( !isset($path) ){
$path = $this->path;
}
else if ( strpos($p... | [
"public",
"function",
"delete_cached_model",
"(",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"a",
")",
"&&",
"\\",
"strlen",
"(",
... | This will delete the cached model. There is no order for the arguments.
@params string path to the model
@params array data to send to the model | [
"This",
"will",
"delete",
"the",
"cached",
"model",
".",
"There",
"is",
"no",
"order",
"for",
"the",
"arguments",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L984-L1005 |
nabab/bbn | src/bbn/mvc/controller.php | controller.set_cached_model | public function set_cached_model(){
$args = \func_get_args();
$die = 1;
foreach ( $args as $a ){
if ( \is_string($a) && \strlen($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
else if ( \is_int($a) ){
$ttl = $a;
}
else if ( \is_bool($a) ){
$die =... | php | public function set_cached_model(){
$args = \func_get_args();
$die = 1;
foreach ( $args as $a ){
if ( \is_string($a) && \strlen($a) ){
$path = $a;
}
else if ( \is_array($a) ){
$data = $a;
}
else if ( \is_int($a) ){
$ttl = $a;
}
else if ( \is_bool($a) ){
$die =... | [
"public",
"function",
"set_cached_model",
"(",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"$",
"die",
"=",
"1",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"a",
")",
... | This will get the model. There is no order for the arguments.
@params string path to the model
@params array data to send to the model
@return $this | [
"This",
"will",
"get",
"the",
"model",
".",
"There",
"is",
"no",
"order",
"for",
"the",
"arguments",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L1014-L1045 |
nabab/bbn | src/bbn/mvc/controller.php | controller.has_data | public function has_data($data=null)
{
if ( \is_null($data) ){
$data = $this->data;
}
return ( \is_array($data) && (\count($data) > 0) ) ? 1 : false;
} | php | public function has_data($data=null)
{
if ( \is_null($data) ){
$data = $this->data;
}
return ( \is_array($data) && (\count($data) > 0) ) ? 1 : false;
} | [
"public",
"function",
"has_data",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"}",
"return",
"(",
"\\",
"is_array",
"(",
"$",
"data",
")... | Checks if data exists
@return bool | [
"Checks",
"if",
"data",
"exists"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L1086-L1092 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add | public function add($path, $data=[], $internal = false)
{
if ( substr($path, 0, 2) === './' ){
$path = $this->say_dir().substr($path, 1);
}
if ( $route = $this->mvc->get_route($path, $internal ? 'private' : 'public') ){
$o = new controller($this->mvc, $route, $data);
$o->process();
... | php | public function add($path, $data=[], $internal = false)
{
if ( substr($path, 0, 2) === './' ){
$path = $this->say_dir().substr($path, 1);
}
if ( $route = $this->mvc->get_route($path, $internal ? 'private' : 'public') ){
$o = new controller($this->mvc, $route, $data);
$o->process();
... | [
"public",
"function",
"add",
"(",
"$",
"path",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"internal",
"=",
"false",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"2",
")",
"===",
"'./'",
")",
"{",
"$",
"path",
"=",
"$",
"t... | Merges the existing data if there is with this one. Chainable.
@return void | [
"Merges",
"the",
"existing",
"data",
"if",
"there",
"is",
"with",
"this",
"one",
".",
"Chainable",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L1179-L1190 |
nabab/bbn | src/bbn/mvc/controller.php | controller.add_to_obj | public function add_to_obj(string $path, $data=[], $internal = false)
{
if ( substr($path, 0, 2) === './' ){
$path = $this->say_dir().substr($path, 1);
}
if ( $route = $this->mvc->get_route($path, $internal ? 'private' : 'public') ){
$o = new controller($this->mvc, $route, $data);
$o->pr... | php | public function add_to_obj(string $path, $data=[], $internal = false)
{
if ( substr($path, 0, 2) === './' ){
$path = $this->say_dir().substr($path, 1);
}
if ( $route = $this->mvc->get_route($path, $internal ? 'private' : 'public') ){
$o = new controller($this->mvc, $route, $data);
$o->pr... | [
"public",
"function",
"add_to_obj",
"(",
"string",
"$",
"path",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"internal",
"=",
"false",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"2",
")",
"===",
"'./'",
")",
"{",
"$",
"path",... | Merges the existing data if there is with this one. Chainable.
@return void | [
"Merges",
"the",
"existing",
"data",
"if",
"there",
"is",
"with",
"this",
"one",
".",
"Chainable",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/controller.php#L1197-L1209 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/UrlDomain.php | UrlDomain.urlGetDomainRouteAndDefaultDomainParams | protected function urlGetDomainRouteAndDefaultDomainParams (array & $params, $moduleParamDefined, $currentDomainRouteMatched) {
$targetModule = NULL;
$targetDomainRoute = NULL;
$domainParamsDefault = [];
if ($moduleParamDefined) {
$moduleParamName = static::URL_PARAM_MODULE;
$targetModule = $params[$modul... | php | protected function urlGetDomainRouteAndDefaultDomainParams (array & $params, $moduleParamDefined, $currentDomainRouteMatched) {
$targetModule = NULL;
$targetDomainRoute = NULL;
$domainParamsDefault = [];
if ($moduleParamDefined) {
$moduleParamName = static::URL_PARAM_MODULE;
$targetModule = $params[$modul... | [
"protected",
"function",
"urlGetDomainRouteAndDefaultDomainParams",
"(",
"array",
"&",
"$",
"params",
",",
"$",
"moduleParamDefined",
",",
"$",
"currentDomainRouteMatched",
")",
"{",
"$",
"targetModule",
"=",
"NULL",
";",
"$",
"targetDomainRoute",
"=",
"NULL",
";",
... | Get target module, target module domain route (for possibly defined)
target `module` record in `Url()` method `$params` array) and get module
domain route default params with default values, necessary to complete
domain part. Those default params could be requested domain params or
module domain route default reverse p... | [
"Get",
"target",
"module",
"target",
"module",
"domain",
"route",
"(",
"for",
"possibly",
"defined",
")",
"target",
"module",
"record",
"in",
"Url",
"()",
"method",
"$params",
"array",
")",
"and",
"get",
"module",
"domain",
"route",
"default",
"params",
"wit... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/UrlDomain.php#L30-L56 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/UrlDomain.php | UrlDomain.urlGetDomainUrlAndClasifyParamsAndDomainParams | protected function urlGetDomainUrlAndClasifyParamsAndDomainParams (array & $params, array & $domainParamsDefault, & $targetDomainRoute) {
// remove domain module params and complete URL address base part by module domain
$domainParams = array_intersect_key($params, $domainParamsDefault);
$params = array_diff_key(... | php | protected function urlGetDomainUrlAndClasifyParamsAndDomainParams (array & $params, array & $domainParamsDefault, & $targetDomainRoute) {
// remove domain module params and complete URL address base part by module domain
$domainParams = array_intersect_key($params, $domainParamsDefault);
$params = array_diff_key(... | [
"protected",
"function",
"urlGetDomainUrlAndClasifyParamsAndDomainParams",
"(",
"array",
"&",
"$",
"params",
",",
"array",
"&",
"$",
"domainParamsDefault",
",",
"&",
"$",
"targetDomainRoute",
")",
"{",
"// remove domain module params and complete URL address base part by module... | Complete domain URL part by given module domain route and classify params
necessary to complete URL by module route reverse string and unset those
params from params array reference. Params array will be changed.
Return URL base part by module domain route.
@param array $params
@param array $domainParamsDefault
@param ... | [
"Complete",
"domain",
"URL",
"part",
"by",
"given",
"module",
"domain",
"route",
"and",
"classify",
"params",
"necessary",
"to",
"complete",
"URL",
"by",
"module",
"route",
"reverse",
"string",
"and",
"unset",
"those",
"params",
"from",
"params",
"array",
"ref... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/UrlDomain.php#L68-L77 |
zhouyl/mellivora | Mellivora/Database/Console/Migrations/ResetCommand.php | ResetCommand.fire | public function fire()
{
if (!$this->confirmToProceed()) {
return;
}
$migrator = $this->container['migrator'];
$migrator->setConnection($this->option('database'));
// First, we'll make sure that the migration table actually exists before we
// start try... | php | public function fire()
{
if (!$this->confirmToProceed()) {
return;
}
$migrator = $this->container['migrator'];
$migrator->setConnection($this->option('database'));
// First, we'll make sure that the migration table actually exists before we
// start try... | [
"public",
"function",
"fire",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"confirmToProceed",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"migrator",
"=",
"$",
"this",
"->",
"container",
"[",
"'migrator'",
"]",
";",
"$",
"migrator",
"->",
"s... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Console/Migrations/ResetCommand.php#L31-L59 |
php-lug/lug | src/Component/Grid/Column/Type/BooleanType.php | BooleanType.render | public function render($data, array $options)
{
$boolean = $this->getValue($data, $options);
if ($boolean === null) {
return;
}
if (!is_bool($boolean)) {
throw new InvalidTypeException(sprintf(
'The "%s" %s column type expects a boolean value... | php | public function render($data, array $options)
{
$boolean = $this->getValue($data, $options);
if ($boolean === null) {
return;
}
if (!is_bool($boolean)) {
throw new InvalidTypeException(sprintf(
'The "%s" %s column type expects a boolean value... | [
"public",
"function",
"render",
"(",
"$",
"data",
",",
"array",
"$",
"options",
")",
"{",
"$",
"boolean",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"data",
",",
"$",
"options",
")",
";",
"if",
"(",
"$",
"boolean",
"===",
"null",
")",
"{",
"re... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/BooleanType.php#L43-L61 |
php-lug/lug | src/Component/Grid/Column/Type/BooleanType.php | BooleanType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefault('template', $this->template);
} | php | public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefault('template', $this->template);
} | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"parent",
"::",
"configureOptions",
"(",
"$",
"resolver",
")",
";",
"$",
"resolver",
"->",
"setDefault",
"(",
"'template'",
",",
"$",
"this",
"->",
"template",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/BooleanType.php#L66-L71 |
zhouyl/mellivora | Mellivora/Database/Migrations/MigrationCreator.php | MigrationCreator.getStub | protected function getStub($table, $create)
{
if (is_null($table)) {
return file_get_contents($this->stubPath() . '/blank.stub');
}
// We also have stubs for creating new tables and modifying existing tables
// to save the developer some typing when they are creating a n... | php | protected function getStub($table, $create)
{
if (is_null($table)) {
return file_get_contents($this->stubPath() . '/blank.stub');
}
// We also have stubs for creating new tables and modifying existing tables
// to save the developer some typing when they are creating a n... | [
"protected",
"function",
"getStub",
"(",
"$",
"table",
",",
"$",
"create",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"table",
")",
")",
"{",
"return",
"file_get_contents",
"(",
"$",
"this",
"->",
"stubPath",
"(",
")",
".",
"'/blank.stub'",
")",
";",
... | Get the migration stub file.
@param string $table
@param bool $create
@return string | [
"Get",
"the",
"migration",
"stub",
"file",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Migrations/MigrationCreator.php#L76-L89 |
honzapospi/rest-server | src/RouteList.php | RouteList.get | public function get(string $path, string $className) {
$this->add(new Route($path, Route::GET, $className));
} | php | public function get(string $path, string $className) {
$this->add(new Route($path, Route::GET, $className));
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"className",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"Route",
"::",
"GET",
",",
"$",
"className",
")",
")",
";",
"}"
] | *********************************************** SHORTERS ****************************************************** | [
"***********************************************",
"SHORTERS",
"******************************************************"
] | train | https://github.com/honzapospi/rest-server/blob/8c56d62ef64c90dd1c594be4a229606fe5e8caec/src/RouteList.php#L48-L50 |
LeaseCloud/leasecloud-php-sdk | src/ApiRequestor.php | ApiRequestor.request | public function request($method, $url, $params = null, $headers = [])
{
$headers = array_merge(self::defaultHeaders(), $headers);
$absUrl = $this->apiBase . $url;
return $this->httpClient()->request($method, $absUrl, $params, $headers);
} | php | public function request($method, $url, $params = null, $headers = [])
{
$headers = array_merge(self::defaultHeaders(), $headers);
$absUrl = $this->apiBase . $url;
return $this->httpClient()->request($method, $absUrl, $params, $headers);
} | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
"=",
"null",
",",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"headers",
"=",
"array_merge",
"(",
"self",
"::",
"defaultHeaders",
"(",
")",
",",
"$",
"heade... | Make an API request
@param string $method
@param string $url
@param array|null $params
@param array|null $headers
@return array An array whose first element is an API response and second
element is the API key used to make the request. | [
"Make",
"an",
"API",
"request"
] | train | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiRequestor.php#L61-L66 |
LeaseCloud/leasecloud-php-sdk | src/ApiRequestor.php | ApiRequestor.httpClient | private function httpClient()
{
if (!self::$httpClient) {
self::$httpClient = HttpClient\CurlClient::instance();
}
return self::$httpClient;
} | php | private function httpClient()
{
if (!self::$httpClient) {
self::$httpClient = HttpClient\CurlClient::instance();
}
return self::$httpClient;
} | [
"private",
"function",
"httpClient",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"httpClient",
")",
"{",
"self",
"::",
"$",
"httpClient",
"=",
"HttpClient",
"\\",
"CurlClient",
"::",
"instance",
"(",
")",
";",
"}",
"return",
"self",
"::",
"$",
... | If needed create, and return a http client
@return HttpClient\CurlClient | [
"If",
"needed",
"create",
"and",
"return",
"a",
"http",
"client"
] | train | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiRequestor.php#L84-L90 |
engineor/flysystem-runabove | src/Runabove.php | Runabove.getCredentials | public function getCredentials()
{
$secret = $this->getSecret();
if (!isset($secret['username']) || !isset($secret['password'])) {
throw new CredentialError('Unrecognized credential secret');
}
return parent::getCredentials();
} | php | public function getCredentials()
{
$secret = $this->getSecret();
if (!isset($secret['username']) || !isset($secret['password'])) {
throw new CredentialError('Unrecognized credential secret');
}
return parent::getCredentials();
} | [
"public",
"function",
"getCredentials",
"(",
")",
"{",
"$",
"secret",
"=",
"$",
"this",
"->",
"getSecret",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"secret",
"[",
"'username'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"secret",
"[",
"'passw... | Check whether required secret keys are set and return Runabove API credentials
{@inheritDoc} | [
"Check",
"whether",
"required",
"secret",
"keys",
"are",
"set",
"and",
"return",
"Runabove",
"API",
"credentials",
"{"
] | train | https://github.com/engineor/flysystem-runabove/blob/d8c22dbf25c3bf2b62187f9da07efb48888d44de/src/Runabove.php#L50-L59 |
ezsystems/ezcomments-ls-extension | classes/ezcomaddcommenttool.php | ezcomAddCommentTool.isVariableRequired | public function isVariableRequired( $field )
{
switch ( $field )
{
case 'email':
$user = eZUser::currentUser();
if( !$user->isAnonymous() )
{
return false;
}
return true;
case ... | php | public function isVariableRequired( $field )
{
switch ( $field )
{
case 'email':
$user = eZUser::currentUser();
if( !$user->isAnonymous() )
{
return false;
}
return true;
case ... | [
"public",
"function",
"isVariableRequired",
"(",
"$",
"field",
")",
"{",
"switch",
"(",
"$",
"field",
")",
"{",
"case",
"'email'",
":",
"$",
"user",
"=",
"eZUser",
"::",
"currentUser",
"(",
")",
";",
"if",
"(",
"!",
"$",
"user",
"->",
"isAnonymous",
... | isVariableRequire in adding comment.
When adding comment, for logined user the email is not required
@see extension/ezcomments/classes/ezcomFormTool#isVariableRequired($field) | [
"isVariableRequire",
"in",
"adding",
"comment",
".",
"When",
"adding",
"comment",
"for",
"logined",
"user",
"the",
"email",
"is",
"not",
"required"
] | train | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomaddcommenttool.php#L24-L46 |
ezsystems/ezcomments-ls-extension | classes/ezcomaddcommenttool.php | ezcomAddCommentTool.validateField | protected function validateField( $field, $value )
{
switch ( $field )
{
case 'website':
return ezcomUtility::validateURLString( $value );
case 'email':
// just validate anonymous's input email
$user = eZUser::currentUser();
... | php | protected function validateField( $field, $value )
{
switch ( $field )
{
case 'website':
return ezcomUtility::validateURLString( $value );
case 'email':
// just validate anonymous's input email
$user = eZUser::currentUser();
... | [
"protected",
"function",
"validateField",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"field",
")",
"{",
"case",
"'website'",
":",
"return",
"ezcomUtility",
"::",
"validateURLString",
"(",
"$",
"value",
")",
";",
"case",
"'email'",
... | Implement the validatation in adding comment
@see extension/ezcomments/classes/ezcomFormTool#validateField($field) | [
"Implement",
"the",
"validatation",
"in",
"adding",
"comment"
] | train | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomaddcommenttool.php#L52-L95 |
ezsystems/ezcomments-ls-extension | classes/ezcomaddcommenttool.php | ezcomAddCommentTool.setFieldValue | protected function setFieldValue( $field, $fieldPostName )
{
$user = eZUser::currentUser();
switch ( $field )
{
case 'email':
if( !$user->isAnonymous() )
{
$this->fieldValues[$field] = $user->attribute( 'email' );
... | php | protected function setFieldValue( $field, $fieldPostName )
{
$user = eZUser::currentUser();
switch ( $field )
{
case 'email':
if( !$user->isAnonymous() )
{
$this->fieldValues[$field] = $user->attribute( 'email' );
... | [
"protected",
"function",
"setFieldValue",
"(",
"$",
"field",
",",
"$",
"fieldPostName",
")",
"{",
"$",
"user",
"=",
"eZUser",
"::",
"currentUser",
"(",
")",
";",
"switch",
"(",
"$",
"field",
")",
"{",
"case",
"'email'",
":",
"if",
"(",
"!",
"$",
"use... | Implement the setFieldValue in adding comment
@see extension/ezcomments/classes/ezcomFormTool#setFieldValue($fieldPostName) | [
"Implement",
"the",
"setFieldValue",
"in",
"adding",
"comment"
] | train | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomaddcommenttool.php#L101-L129 |
digipolisgent/robo-digipolis-package-drupal8 | src/Utility/ThemeFinder.php | ThemeFinder.getThemePaths | protected function getThemePaths($themes)
{
$dirsFromConfig = array_filter(
[
$this->getConfig()->get('digipolis.root.project', false),
$this->getConfig()->get('digipolis.root.web', false),
]
);
$dirs = empty($this->dirs)
? ... | php | protected function getThemePaths($themes)
{
$dirsFromConfig = array_filter(
[
$this->getConfig()->get('digipolis.root.project', false),
$this->getConfig()->get('digipolis.root.web', false),
]
);
$dirs = empty($this->dirs)
? ... | [
"protected",
"function",
"getThemePaths",
"(",
"$",
"themes",
")",
"{",
"$",
"dirsFromConfig",
"=",
"array_filter",
"(",
"[",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"get",
"(",
"'digipolis.root.project'",
",",
"false",
")",
",",
"$",
"this",
"->",... | Get the theme paths.
@param array $themes
An array of theme names.
@return array
The theme paths keyed by theme name. | [
"Get",
"the",
"theme",
"paths",
"."
] | train | https://github.com/digipolisgent/robo-digipolis-package-drupal8/blob/dc03ae0f68d56a027291e9574ff7aa433c27690a/src/Utility/ThemeFinder.php#L17-L52 |
sgmendez/json | src/Json.php | Json.encode | public function encode($data, $options = 0, $depth = 512)
{
$dataValid = $this->validateType('not_resource', $data);
$optionsValid = $this->validateType('int', $options, '$options');
$depthValid = $this->validateType('int', $depth, '$depth');
$jsonData = $this->encodeCheckVersion($d... | php | public function encode($data, $options = 0, $depth = 512)
{
$dataValid = $this->validateType('not_resource', $data);
$optionsValid = $this->validateType('int', $options, '$options');
$depthValid = $this->validateType('int', $depth, '$depth');
$jsonData = $this->encodeCheckVersion($d... | [
"public",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"options",
"=",
"0",
",",
"$",
"depth",
"=",
"512",
")",
"{",
"$",
"dataValid",
"=",
"$",
"this",
"->",
"validateType",
"(",
"'not_resource'",
",",
"$",
"data",
")",
";",
"$",
"optionsValid"... | Returns the JSON representation of a value
@param mixed $data Valid all type except a resource
@param integer $options Acepted values: JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP,
JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT,
JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT, JSON_UNESCAPED_UNICODE
@param integer $depth... | [
"Returns",
"the",
"JSON",
"representation",
"of",
"a",
"value"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L41-L51 |
sgmendez/json | src/Json.php | Json.decodeFile | public function decodeFile($file, $assoc = true, $depth = 512, $options = 0)
{
set_error_handler(
create_function(
'$severity, $message, $file, $line', 'throw new ErrorException($message, $severity, $severity, $file, $line);'
)
);
... | php | public function decodeFile($file, $assoc = true, $depth = 512, $options = 0)
{
set_error_handler(
create_function(
'$severity, $message, $file, $line', 'throw new ErrorException($message, $severity, $severity, $file, $line);'
)
);
... | [
"public",
"function",
"decodeFile",
"(",
"$",
"file",
",",
"$",
"assoc",
"=",
"true",
",",
"$",
"depth",
"=",
"512",
",",
"$",
"options",
"=",
"0",
")",
"{",
"set_error_handler",
"(",
"create_function",
"(",
"'$severity, $message, $file, $line'",
",",
"'thro... | Decode JSON data encoded in file
@param string $file
@param boolean $assoc
@param integer $depth
@param integer $options
@return mixed
@throws RuntimeException | [
"Decode",
"JSON",
"data",
"encoded",
"in",
"file"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L86-L111 |
sgmendez/json | src/Json.php | Json.checkJsonError | protected function checkJsonError()
{
if(!function_exists('json_last_error'))
{
throw new BadFunctionCallException('json_last_error() function not exits');
}
$jsonError = json_last_error();
if($jsonError !== JSON_ERROR_NONE)
{
$this->j... | php | protected function checkJsonError()
{
if(!function_exists('json_last_error'))
{
throw new BadFunctionCallException('json_last_error() function not exits');
}
$jsonError = json_last_error();
if($jsonError !== JSON_ERROR_NONE)
{
$this->j... | [
"protected",
"function",
"checkJsonError",
"(",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'json_last_error'",
")",
")",
"{",
"throw",
"new",
"BadFunctionCallException",
"(",
"'json_last_error() function not exits'",
")",
";",
"}",
"$",
"jsonError",
"=",
"... | Check exists error for last execution json funtion
@return boolean
@throws BadFunctionCallException | [
"Check",
"exists",
"error",
"for",
"last",
"execution",
"json",
"funtion"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L157-L171 |
sgmendez/json | src/Json.php | Json.jsonErrorException | protected function jsonErrorException($code)
{
$this->defineCodesErrorJson();
switch($code)
{
case JSON_ERROR_DEPTH:
throw new LengthException('The maximum stack depth has been exceeded');
break;
case JSON_ERROR_STATE_MISMATCH:... | php | protected function jsonErrorException($code)
{
$this->defineCodesErrorJson();
switch($code)
{
case JSON_ERROR_DEPTH:
throw new LengthException('The maximum stack depth has been exceeded');
break;
case JSON_ERROR_STATE_MISMATCH:... | [
"protected",
"function",
"jsonErrorException",
"(",
"$",
"code",
")",
"{",
"$",
"this",
"->",
"defineCodesErrorJson",
"(",
")",
";",
"switch",
"(",
"$",
"code",
")",
"{",
"case",
"JSON_ERROR_DEPTH",
":",
"throw",
"new",
"LengthException",
"(",
"'The maximum st... | Generate exception when $code is a json defined error
@param integer $code
@throws LengthException
@throws UnexpectedValueException
@throws RuntimeException | [
"Generate",
"exception",
"when",
"$code",
"is",
"a",
"json",
"defined",
"error"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L181-L215 |
sgmendez/json | src/Json.php | Json.validateType | private function validateType($type, $value, $name = '')
{
$valueType = gettype($value);
$codeException = $this->checkType($type, $value);
if(1 === $codeException)
{
throw new InvalidArgumentException(sprintf('%s argument only accepts %s. Input type was:... | php | private function validateType($type, $value, $name = '')
{
$valueType = gettype($value);
$codeException = $this->checkType($type, $value);
if(1 === $codeException)
{
throw new InvalidArgumentException(sprintf('%s argument only accepts %s. Input type was:... | [
"private",
"function",
"validateType",
"(",
"$",
"type",
",",
"$",
"value",
",",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"valueType",
"=",
"gettype",
"(",
"$",
"value",
")",
";",
"$",
"codeException",
"=",
"$",
"this",
"->",
"checkType",
"(",
"$",
"... | Validate type of $value
@param string $type Type of de value expect
@param mixec $value
@param string $name Name of the variable $value
@return mixed
@throws InvalidArgumentException
@throws RuntimeException | [
"Validate",
"type",
"of",
"$value"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L248-L270 |
sgmendez/json | src/Json.php | Json.checkType | private function checkType($type, $value)
{
switch($type)
{
case 'bool':
case 'boolean':
$codeException = (!is_bool($value)) ? 1 : 0;
break;
case 'int':
case 'integer':
$codeException = (!is_int($... | php | private function checkType($type, $value)
{
switch($type)
{
case 'bool':
case 'boolean':
$codeException = (!is_bool($value)) ? 1 : 0;
break;
case 'int':
case 'integer':
$codeException = (!is_int($... | [
"private",
"function",
"checkType",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'bool'",
":",
"case",
"'boolean'",
":",
"$",
"codeException",
"=",
"(",
"!",
"is_bool",
"(",
"$",
"value",
")",
")",
"... | Check type of $value
@param string $type Type expect for $value
@param mixed $value Value of the variable to check
@return int Code for exception | [
"Check",
"type",
"of",
"$value"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L279-L303 |
sgmendez/json | src/Json.php | Json.decodeCheckVersion | private function decodeCheckVersion($dataValid, $assocValid, $depthValid, $optionsValid)
{
//In 5.4 add options param
if(version_compare(PHP_VERSION, '5.4.0') >= 0)
{
return json_decode($dataValid, $assocValid, $depthValid, $optionsValid);
}
return json_decode($d... | php | private function decodeCheckVersion($dataValid, $assocValid, $depthValid, $optionsValid)
{
//In 5.4 add options param
if(version_compare(PHP_VERSION, '5.4.0') >= 0)
{
return json_decode($dataValid, $assocValid, $depthValid, $optionsValid);
}
return json_decode($d... | [
"private",
"function",
"decodeCheckVersion",
"(",
"$",
"dataValid",
",",
"$",
"assocValid",
",",
"$",
"depthValid",
",",
"$",
"optionsValid",
")",
"{",
"//In 5.4 add options param",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.4.0'",
")",
">=",
"0"... | Options param add 5.4
@param $dataValid
@param $assocValid
@param $depthValid
@param $optionsValid
@return mixed | [
"Options",
"param",
"add",
"5",
".",
"4"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L314-L323 |
sgmendez/json | src/Json.php | Json.encodeCheckVersion | private function encodeCheckVersion($dataValid, $optionsValid, $depthValid)
{
//In 5.4 add depth param
if(version_compare(PHP_VERSION, '5.4.0') >= 0)
{
return json_encode($dataValid, $optionsValid, $depthValid);
}
return json_encode($dataValid, $optionsValid);
... | php | private function encodeCheckVersion($dataValid, $optionsValid, $depthValid)
{
//In 5.4 add depth param
if(version_compare(PHP_VERSION, '5.4.0') >= 0)
{
return json_encode($dataValid, $optionsValid, $depthValid);
}
return json_encode($dataValid, $optionsValid);
... | [
"private",
"function",
"encodeCheckVersion",
"(",
"$",
"dataValid",
",",
"$",
"optionsValid",
",",
"$",
"depthValid",
")",
"{",
"//In 5.4 add depth param",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.4.0'",
")",
">=",
"0",
")",
"{",
"return",
"j... | Depth param add 5.4
@param $dataValid
@param $optionsValid
@param $depthValid
@return string | [
"Depth",
"param",
"add",
"5",
".",
"4"
] | train | https://github.com/sgmendez/json/blob/5b63f3328fe4235cdbf3cebe0aadab6fefcc6aba/src/Json.php#L333-L342 |
inhere/php-librarys | src/Traits/EventTrait.php | EventTrait.off | public function off($event)
{
if ($this->hasEvent($event)) {
$handler = $this->eventHandlers[$event];
unset($this->events[$event], $this->eventHandlers[$event]);
return $handler;
}
return null;
} | php | public function off($event)
{
if ($this->hasEvent($event)) {
$handler = $this->eventHandlers[$event];
unset($this->events[$event], $this->eventHandlers[$event]);
return $handler;
}
return null;
} | [
"public",
"function",
"off",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasEvent",
"(",
"$",
"event",
")",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"eventHandlers",
"[",
"$",
"event",
"]",
";",
"unset",
"(",
"$",
"this",... | remove event and it's handlers
@param string $event
@return mixed | [
"remove",
"event",
"and",
"it",
"s",
"handlers"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/EventTrait.php#L97-L108 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.boot | public function boot()
{
if (!$this->app->routesAreCached()) {
require __DIR__.'/routes.php';
}
$this->app->make('designpond\newsletter\Http\Controllers\Frontend\NewsletterController');
$this->app->make('designpond\newsletter\Http\Controllers\Frontend\InscriptionControll... | php | public function boot()
{
if (!$this->app->routesAreCached()) {
require __DIR__.'/routes.php';
}
$this->app->make('designpond\newsletter\Http\Controllers\Frontend\NewsletterController');
$this->app->make('designpond\newsletter\Http\Controllers\Frontend\InscriptionControll... | [
"public",
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"->",
"routesAreCached",
"(",
")",
")",
"{",
"require",
"__DIR__",
".",
"'/routes.php'",
";",
"}",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'designpond\\newslet... | Perform post-registration booting of services.
@return void | [
"Perform",
"post",
"-",
"registration",
"booting",
"of",
"services",
"."
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L14-L77 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.register | public function register()
{
$this->mergeConfigFrom(
__DIR__.'/config/newsletter.php', 'newsletter'
);
// Custom Facade for CampagneWorker
$this->app['newsworker'] = $this->app->share(function ()
{
return $this->app->make('\designpond\newsletter\Newsl... | php | public function register()
{
$this->mergeConfigFrom(
__DIR__.'/config/newsletter.php', 'newsletter'
);
// Custom Facade for CampagneWorker
$this->app['newsworker'] = $this->app->share(function ()
{
return $this->app->make('\designpond\newsletter\Newsl... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"mergeConfigFrom",
"(",
"__DIR__",
".",
"'/config/newsletter.php'",
",",
"'newsletter'",
")",
";",
"// Custom Facade for CampagneWorker",
"$",
"this",
"->",
"app",
"[",
"'newsworker'",
"]",
"=",
... | Register any package services.
@return void | [
"Register",
"any",
"package",
"services",
"."
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L84-L111 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerMailjetService | protected function registerMailjetService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\MailjetInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\MailjetWorker(
new \designpond\newsletter\Newsletter\Service\Mailjet(
... | php | protected function registerMailjetService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\MailjetInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\MailjetWorker(
new \designpond\newsletter\Newsletter\Service\Mailjet(
... | [
"protected",
"function",
"registerMailjetService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Worker\\MailjetInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsletter",
... | Newsletter Content service | [
"Newsletter",
"Content",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L116-L126 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerMailjetNewService | protected function registerMailjetNewService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\MailjetServiceInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\MailjetService(
new \Mailjet\Client(config('newsletter.mailjet.api'),config('n... | php | protected function registerMailjetNewService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\MailjetServiceInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\MailjetService(
new \Mailjet\Client(config('newsletter.mailjet.api'),config('n... | [
"protected",
"function",
"registerMailjetNewService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Worker\\MailjetServiceInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsl... | Newsletter Content service | [
"Newsletter",
"Content",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L131-L140 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerNewsletterService | protected function registerNewsletterService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter );
});
} | php | protected function registerNewsletterService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter );
});
} | [
"protected",
"function",
"registerNewsletterService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsletter"... | Newsletter Content service | [
"Newsletter",
"Content",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L145-L151 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerContentService | protected function registerContentService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterContentInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterContentEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_contents );
... | php | protected function registerContentService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterContentInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterContentEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_contents );
... | [
"protected",
"function",
"registerContentService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterContentInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newslet... | Newsletter service | [
"Newsletter",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L156-L162 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerTypesService | protected function registerTypesService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterTypesInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterTypesEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_types );
})... | php | protected function registerTypesService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterTypesInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterTypesEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_types );
})... | [
"protected",
"function",
"registerTypesService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterTypesInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsletter"... | Newsletter Types service | [
"Newsletter",
"Types",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L167-L173 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerCampagneService | protected function registerCampagneService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterCampagneInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterCampagneEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_campagnes ... | php | protected function registerCampagneService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterCampagneInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterCampagneEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_campagnes ... | [
"protected",
"function",
"registerCampagneService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterCampagneInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsl... | Newsletter Types service | [
"Newsletter",
"Types",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L179-L185 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerCampagneWorkerService | protected function registerCampagneWorkerService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\CampagneInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\CampagneWorker(
\App::make('designpond\newsletter\Newsletter\Repo\NewsletterCont... | php | protected function registerCampagneWorkerService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\CampagneInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\CampagneWorker(
\App::make('designpond\newsletter\Newsletter\Repo\NewsletterCont... | [
"protected",
"function",
"registerCampagneWorkerService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Worker\\CampagneInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newslet... | Newsletter Campagne worker | [
"Newsletter",
"Campagne",
"worker"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L190-L201 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerInscriptionService | protected function registerInscriptionService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterUserInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterUserEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_users );
... | php | protected function registerInscriptionService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterUserInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterUserEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_users );
... | [
"protected",
"function",
"registerInscriptionService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterUserInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsle... | Newsletter user abo service | [
"Newsletter",
"user",
"abo",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L207-L213 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerSubscribeService | protected function registerSubscribeService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionEloquent(
new \designpond\newsletter\Newsletter\Entit... | php | protected function registerSubscribeService(){
$this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionEloquent(
new \designpond\newsletter\Newsletter\Entit... | [
"protected",
"function",
"registerSubscribeService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterSubscriptionInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"... | Newsletter user abo service | [
"Newsletter",
"user",
"abo",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L218-L226 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerImportService | protected function registerImportService(){
$this->app->singleton('designpond\newsletter\Newsletter\Worker\ImportWorkerInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\ImportWorker(
\App::make('designpond\newsletter\Newsletter\Worker\MailjetServic... | php | protected function registerImportService(){
$this->app->singleton('designpond\newsletter\Newsletter\Worker\ImportWorkerInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\ImportWorker(
\App::make('designpond\newsletter\Newsletter\Worker\MailjetServic... | [
"protected",
"function",
"registerImportService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'designpond\\newsletter\\Newsletter\\Worker\\ImportWorkerInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsle... | Newsletter Import worker | [
"Newsletter",
"Import",
"worker"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L231-L245 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerListService | protected function registerListService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterListInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterListEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_lists() );
... | php | protected function registerListService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterListInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterListEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_lists() );
... | [
"protected",
"function",
"registerListService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterListInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newslett... | Newsletter list | [
"Newsletter",
"list"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L261-L267 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerEmailService | protected function registerEmailService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterEmailInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterEmailEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_emails() );
... | php | protected function registerEmailService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterEmailInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterEmailEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_emails() );
... | [
"protected",
"function",
"registerEmailService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterEmailInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
"newsle... | Newsletter Email | [
"Newsletter",
"Email"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L272-L278 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerClipboardService | protected function registerClipboardService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterClipboardInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterClipboardEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_cl... | php | protected function registerClipboardService(){
$this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterClipboardInterface', function()
{
return new \designpond\newsletter\Newsletter\Repo\NewsletterClipboardEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_cl... | [
"protected",
"function",
"registerClipboardService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'designpond\\newsletter\\Newsletter\\Repo\\NewsletterClipboardInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",
... | Newsletter clipboard | [
"Newsletter",
"clipboard"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L283-L289 |
DesignPond/newsletter | src/newsletterServiceProvider.php | newsletterServiceProvider.registerSubscribeWorkerService | protected function registerSubscribeWorkerService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\SubscriptionWorkerInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\SubscriptionWorker(
\App::make('designpond\newsletter\Newsletter\Repo... | php | protected function registerSubscribeWorkerService(){
$this->app->bind('designpond\newsletter\Newsletter\Worker\SubscriptionWorkerInterface', function()
{
return new \designpond\newsletter\Newsletter\Worker\SubscriptionWorker(
\App::make('designpond\newsletter\Newsletter\Repo... | [
"protected",
"function",
"registerSubscribeWorkerService",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'designpond\\newsletter\\Newsletter\\Worker\\SubscriptionWorkerInterface'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"\\",
"designpond",
"\\",... | Newsletter subscriber service | [
"Newsletter",
"subscriber",
"service"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/newsletterServiceProvider.php#L294-L304 |
php-lug/lug | src/Bundle/GridBundle/Batch/Batcher.php | Batcher.batch | public function batch(GridInterface $grid, FormInterface $form)
{
if ($form->isValid()) {
$this->batcher->batch(
$grid,
$form->get('type')->getData(),
$form->get('value')->getData()
);
}
} | php | public function batch(GridInterface $grid, FormInterface $form)
{
if ($form->isValid()) {
$this->batcher->batch(
$grid,
$form->get('type')->getData(),
$form->get('value')->getData()
);
}
} | [
"public",
"function",
"batch",
"(",
"GridInterface",
"$",
"grid",
",",
"FormInterface",
"$",
"form",
")",
"{",
"if",
"(",
"$",
"form",
"->",
"isValid",
"(",
")",
")",
"{",
"$",
"this",
"->",
"batcher",
"->",
"batch",
"(",
"$",
"grid",
",",
"$",
"fo... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Batch/Batcher.php#L39-L48 |
oroinc/OroLayoutComponent | Templating/Helper/LayoutHelper.php | LayoutHelper.parentBlockWidget | public function parentBlockWidget(BlockView $view, array $variables = [])
{
return $this->renderer->searchAndRenderBlock($view, 'widget', $variables, true);
} | php | public function parentBlockWidget(BlockView $view, array $variables = [])
{
return $this->renderer->searchAndRenderBlock($view, 'widget', $variables, true);
} | [
"public",
"function",
"parentBlockWidget",
"(",
"BlockView",
"$",
"view",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"searchAndRenderBlock",
"(",
"$",
"view",
",",
"'widget'",
",",
"$",
"variable... | Renders the parent block widget defined in other resources on all levels of block prefix hierarchy
@param BlockView $view
@param array $variables
@return string | [
"Renders",
"the",
"parent",
"block",
"widget",
"defined",
"in",
"other",
"resources",
"on",
"all",
"levels",
"of",
"block",
"prefix",
"hierarchy"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Templating/Helper/LayoutHelper.php#L98-L101 |
simbiosis-group/yii2-helper | widgets/ModalButton.php | ModalButton.run | public function run()
{
$options = array_merge([
'value' => $this->url,
'data-modal-id' => $this->modalId,
], $this->options);
ModalButtonAsset::register(Yii::$app->controller->getView());
Html::addCssClass($options, ['class' => 'show-modal-button']);... | php | public function run()
{
$options = array_merge([
'value' => $this->url,
'data-modal-id' => $this->modalId,
], $this->options);
ModalButtonAsset::register(Yii::$app->controller->getView());
Html::addCssClass($options, ['class' => 'show-modal-button']);... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'value'",
"=>",
"$",
"this",
"->",
"url",
",",
"'data-modal-id'",
"=>",
"$",
"this",
"->",
"modalId",
",",
"]",
",",
"$",
"this",
"->",
"options",
")",
";",
... | Renders the widget. | [
"Renders",
"the",
"widget",
"."
] | train | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/widgets/ModalButton.php#L51-L68 |
dstuecken/notify | src/Handler/NotifySendHandler.php | NotifySendHandler.handle | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof TitleAwareInterface)
{
$command = $this->shellCommand . ' ' . escapeshellarg($notification->message()) . ' ' . escapeshellarg($notification->title());
}
else
{
... | php | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof TitleAwareInterface)
{
$command = $this->shellCommand . ' ' . escapeshellarg($notification->message()) . ' ' . escapeshellarg($notification->title());
}
else
{
... | [
"public",
"function",
"handle",
"(",
"NotificationInterface",
"$",
"notification",
",",
"$",
"level",
")",
"{",
"if",
"(",
"$",
"notification",
"instanceof",
"TitleAwareInterface",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"shellCommand",
".",
"' '",
... | Handle a notification
@return bool | [
"Handle",
"a",
"notification"
] | train | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/Handler/NotifySendHandler.php#L48-L81 |
kenphp/ken | src/Log/LogFormatter.php | LogFormatter.formatLog | public function formatLog(array $logMessage) {
extract($logMessage);
$level = strtoupper($level);
$message = $this->applyContext($message, $context);
$timestamp = date($this->dateTimeFormat, $timestamp);
$exception = $this->getExceptionTrace($context);
$log = str_replac... | php | public function formatLog(array $logMessage) {
extract($logMessage);
$level = strtoupper($level);
$message = $this->applyContext($message, $context);
$timestamp = date($this->dateTimeFormat, $timestamp);
$exception = $this->getExceptionTrace($context);
$log = str_replac... | [
"public",
"function",
"formatLog",
"(",
"array",
"$",
"logMessage",
")",
"{",
"extract",
"(",
"$",
"logMessage",
")",
";",
"$",
"level",
"=",
"strtoupper",
"(",
"$",
"level",
")",
";",
"$",
"message",
"=",
"$",
"this",
"->",
"applyContext",
"(",
"$",
... | Format log message
@param array $logMessage An array with key `timestamp`, 'level', 'message', and 'context'
@return string | [
"Format",
"log",
"message"
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Log/LogFormatter.php#L64-L78 |
kenphp/ken | src/Log/LogFormatter.php | LogFormatter.applyContext | protected function applyContext($message, array $context = array())
{
foreach ($context as $key => $value) {
$key = trim($key, "{}");
if ($key != 'exception') {
$message = $this->replaceContext($message, $key, $value);
}
}
return $message;... | php | protected function applyContext($message, array $context = array())
{
foreach ($context as $key => $value) {
$key = trim($key, "{}");
if ($key != 'exception') {
$message = $this->replaceContext($message, $key, $value);
}
}
return $message;... | [
"protected",
"function",
"applyContext",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"context",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"trim",
"(",
"$",
"key",
... | Apply context into log message.
@param string $message
@param array $context [optional]
@return string | [
"Apply",
"context",
"into",
"log",
"message",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Log/LogFormatter.php#L88-L98 |
kenphp/ken | src/Log/LogFormatter.php | LogFormatter.replaceContext | protected function replaceContext($message, string $key, $context)
{
$strContext = '';
if (is_object($context)) {
if (method_exists($context, '__toString')) {
$strContext = call_user_func([$context, '__toString']);
} else {
$strContext = var_ex... | php | protected function replaceContext($message, string $key, $context)
{
$strContext = '';
if (is_object($context)) {
if (method_exists($context, '__toString')) {
$strContext = call_user_func([$context, '__toString']);
} else {
$strContext = var_ex... | [
"protected",
"function",
"replaceContext",
"(",
"$",
"message",
",",
"string",
"$",
"key",
",",
"$",
"context",
")",
"{",
"$",
"strContext",
"=",
"''",
";",
"if",
"(",
"is_object",
"(",
"$",
"context",
")",
")",
"{",
"if",
"(",
"method_exists",
"(",
... | Replace context pattern in the message with related context.
@param string $message Log message
@param string $key Context pattern to be replaced
@param mixed $context Related context to replace $key
@return string $message with pattern '{$key}' replaced by $context | [
"Replace",
"context",
"pattern",
"in",
"the",
"message",
"with",
"related",
"context",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Log/LogFormatter.php#L109-L123 |
kenphp/ken | src/Log/LogFormatter.php | LogFormatter.getExceptionTrace | protected function getExceptionTrace(array $context)
{
if (array_key_exists('exception', $context)) {
if ($context['exception'] instanceof \Exception) {
$strException = $context['exception']->getTraceAsString();
return $strException;
}
}
... | php | protected function getExceptionTrace(array $context)
{
if (array_key_exists('exception', $context)) {
if ($context['exception'] instanceof \Exception) {
$strException = $context['exception']->getTraceAsString();
return $strException;
}
}
... | [
"protected",
"function",
"getExceptionTrace",
"(",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'exception'",
",",
"$",
"context",
")",
")",
"{",
"if",
"(",
"$",
"context",
"[",
"'exception'",
"]",
"instanceof",
"\\",
"Exception",
... | Get Exception trace if found in the context.
@param array $context | [
"Get",
"Exception",
"trace",
"if",
"found",
"in",
"the",
"context",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Log/LogFormatter.php#L130-L141 |
InfiniteSoftware/ISEcommpayPayum | Action/ConvertPaymentAction.php | ConvertPaymentAction.execute | public function execute($request)
{
RequestNotSupportedException::assertSupports($this, $request);
/** @var PaymentInterface $payment */
$payment = $request->getSource();
/** @var OrderInterface $order */
$params = [
'payment_id' => $payment->getNumber(),
... | php | public function execute($request)
{
RequestNotSupportedException::assertSupports($this, $request);
/** @var PaymentInterface $payment */
$payment = $request->getSource();
/** @var OrderInterface $order */
$params = [
'payment_id' => $payment->getNumber(),
... | [
"public",
"function",
"execute",
"(",
"$",
"request",
")",
"{",
"RequestNotSupportedException",
"::",
"assertSupports",
"(",
"$",
"this",
",",
"$",
"request",
")",
";",
"/** @var PaymentInterface $payment */",
"$",
"payment",
"=",
"$",
"request",
"->",
"getSource"... | {@inheritDoc}
@param Convert $request | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/InfiniteSoftware/ISEcommpayPayum/blob/44a073e3d885d9007aa54d6ff13aea93a9e52e7c/Action/ConvertPaymentAction.php#L34-L50 |
scherersoftware/cake-monitor | src/Lib/MonitorHandler.php | MonitorHandler._validateConfig | protected function _validateConfig()
{
foreach ($this->_config as $key => $value) {
if (!isset($value)) {
throw new \Exception('Incomplete configuration: ' . $key, 1);
}
}
} | php | protected function _validateConfig()
{
foreach ($this->_config as $key => $value) {
if (!isset($value)) {
throw new \Exception('Incomplete configuration: ' . $key, 1);
}
}
} | [
"protected",
"function",
"_validateConfig",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_config",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"... | Validates Config
@throws \Exception if configuration is incomplete
@return void | [
"Validates",
"Config"
] | train | https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Lib/MonitorHandler.php#L61-L68 |
scherersoftware/cake-monitor | src/Lib/MonitorHandler.php | MonitorHandler.handleChecks | public function handleChecks()
{
$errors = [];
foreach ($this->_config['checks'] as $name => $check) {
if (empty($check)) {
continue;
}
$result = $check['callback']();
if ($result !== true) {
$errors[] = $name . ': <br>' ... | php | public function handleChecks()
{
$errors = [];
foreach ($this->_config['checks'] as $name => $check) {
if (empty($check)) {
continue;
}
$result = $check['callback']();
if ($result !== true) {
$errors[] = $name . ': <br>' ... | [
"public",
"function",
"handleChecks",
"(",
")",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_config",
"[",
"'checks'",
"]",
"as",
"$",
"name",
"=>",
"$",
"check",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"check",
")... | Handle all defined checks
@return void | [
"Handle",
"all",
"defined",
"checks"
] | train | https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Lib/MonitorHandler.php#L88-L112 |
PayBreak/foundation | src/AbstractEntity.php | AbstractEntity.make | public static function make(array $components)
{
$entity = new static();
foreach ($components as $k => $v) {
if ($entity->isPropertyAllowed($k)) {
$entity->{'set' . NameHelper::snakeToCamel($k)}($v);
}
}
return $entity;
} | php | public static function make(array $components)
{
$entity = new static();
foreach ($components as $k => $v) {
if ($entity->isPropertyAllowed($k)) {
$entity->{'set' . NameHelper::snakeToCamel($k)}($v);
}
}
return $entity;
} | [
"public",
"static",
"function",
"make",
"(",
"array",
"$",
"components",
")",
"{",
"$",
"entity",
"=",
"new",
"static",
"(",
")",
";",
"foreach",
"(",
"$",
"components",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"entity",
"->",
"i... | Make Entity
@author WN
@param array $components
@return static | [
"Make",
"Entity"
] | train | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/AbstractEntity.php#L51-L62 |
ShaoZeMing/laravel-merchant | src/Controllers/PermissionController.php | PermissionController.create | public function create()
{
return Merchant::content(function (Content $content) {
$content->header(trans('merchant.permissions'));
$content->description(trans('merchant.create'));
$content->body($this->form());
});
} | php | public function create()
{
return Merchant::content(function (Content $content) {
$content->header(trans('merchant.permissions'));
$content->description(trans('merchant.create'));
$content->body($this->form());
});
} | [
"public",
"function",
"create",
"(",
")",
"{",
"return",
"Merchant",
"::",
"content",
"(",
"function",
"(",
"Content",
"$",
"content",
")",
"{",
"$",
"content",
"->",
"header",
"(",
"trans",
"(",
"'merchant.permissions'",
")",
")",
";",
"$",
"content",
"... | Create interface.
@return Content | [
"Create",
"interface",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Controllers/PermissionController.php#L52-L59 |
windwork/wf-db | lib/Finder.php | Finder.fetchAll | public function fetchAll($offset = 0, $rows = 0)
{
$opts = $this->options;
if ($offset || $rows) {
$offset = (int)$offset;
$rows = (int)$rows;
if ($rows) {
$opts['limit'] = "{$offset},{$rows}";
} else {
$opts['li... | php | public function fetchAll($offset = 0, $rows = 0)
{
$opts = $this->options;
if ($offset || $rows) {
$offset = (int)$offset;
$rows = (int)$rows;
if ($rows) {
$opts['limit'] = "{$offset},{$rows}";
} else {
$opts['li... | [
"public",
"function",
"fetchAll",
"(",
"$",
"offset",
"=",
"0",
",",
"$",
"rows",
"=",
"0",
")",
"{",
"$",
"opts",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"$",
"offset",
"||",
"$",
"rows",
")",
"{",
"$",
"offset",
"=",
"(",
"int",
... | 获取符合条件的所有记录
@param int $offset = 0 开始查询记录下标,最小为0
@param int $rows = 0 返回记录数,为0则忽略offset和rows都使用默认值
@return array | [
"获取符合条件的所有记录"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L74-L91 |
windwork/wf-db | lib/Finder.php | Finder.fetchRow | public function fetchRow()
{
$opts = $this->options;
$opts['limit'] = 1;
$sql = QueryBuilder::optionsToSql($opts);
$row = $this->getDb()->getRow($sql);
return $row;
} | php | public function fetchRow()
{
$opts = $this->options;
$opts['limit'] = 1;
$sql = QueryBuilder::optionsToSql($opts);
$row = $this->getDb()->getRow($sql);
return $row;
} | [
"public",
"function",
"fetchRow",
"(",
")",
"{",
"$",
"opts",
"=",
"$",
"this",
"->",
"options",
";",
"$",
"opts",
"[",
"'limit'",
"]",
"=",
"1",
";",
"$",
"sql",
"=",
"QueryBuilder",
"::",
"optionsToSql",
"(",
"$",
"opts",
")",
";",
"$",
"row",
... | 获取一行记录,返回关联数组格式
@return array | [
"获取一行记录,返回关联数组格式"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L98-L107 |
windwork/wf-db | lib/Finder.php | Finder.fetchColumn | public function fetchColumn($field = '')
{
$opts = $this->options;
if ($field) {
$opts['field'] = $field;
}
$sql = QueryBuilder::optionsToSql($opts);
$colValue = $this->getDb()->getColumn($sql);
return $colValue;
} | php | public function fetchColumn($field = '')
{
$opts = $this->options;
if ($field) {
$opts['field'] = $field;
}
$sql = QueryBuilder::optionsToSql($opts);
$colValue = $this->getDb()->getColumn($sql);
return $colValue;
} | [
"public",
"function",
"fetchColumn",
"(",
"$",
"field",
"=",
"''",
")",
"{",
"$",
"opts",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"$",
"field",
")",
"{",
"$",
"opts",
"[",
"'field'",
"]",
"=",
"$",
"field",
";",
"}",
"$",
"sql",
"=",... | 获取字段值
@param string $field = ''
@return string | [
"获取字段值"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L114-L126 |
windwork/wf-db | lib/Finder.php | Finder.fetchCount | public function fetchCount($field = '')
{
$opts = $this->options;
if ($field) {
$opts['field'] = $field;
} else {
$opts['field'] = '*';
}
$sql = \wf\db\QueryBuilder::optionsToCountSql($opts);
$num = $this->getDb()->getColumn($... | php | public function fetchCount($field = '')
{
$opts = $this->options;
if ($field) {
$opts['field'] = $field;
} else {
$opts['field'] = '*';
}
$sql = \wf\db\QueryBuilder::optionsToCountSql($opts);
$num = $this->getDb()->getColumn($... | [
"public",
"function",
"fetchCount",
"(",
"$",
"field",
"=",
"''",
")",
"{",
"$",
"opts",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"$",
"field",
")",
"{",
"$",
"opts",
"[",
"'field'",
"]",
"=",
"$",
"field",
";",
"}",
"else",
"{",
"$",... | 获取记录数
@param string $field = ''
@return int | [
"获取记录数"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L133-L148 |
windwork/wf-db | lib/Finder.php | Finder.join | public function join($table, $onFieldA, $onFieldB, $joinType = 'LEFT')
{
$joinType = strtoupper(trim($joinType));
if (!in_array($joinType, ['LEFT', 'RIGHT', 'INNER', 'CROSS'])) {
throw new \Exception('$joinType 不正确,只允许是LEFT|RIGHT|INNER|CROSS');
}
$this->options['... | php | public function join($table, $onFieldA, $onFieldB, $joinType = 'LEFT')
{
$joinType = strtoupper(trim($joinType));
if (!in_array($joinType, ['LEFT', 'RIGHT', 'INNER', 'CROSS'])) {
throw new \Exception('$joinType 不正确,只允许是LEFT|RIGHT|INNER|CROSS');
}
$this->options['... | [
"public",
"function",
"join",
"(",
"$",
"table",
",",
"$",
"onFieldA",
",",
"$",
"onFieldB",
",",
"$",
"joinType",
"=",
"'LEFT'",
")",
"{",
"$",
"joinType",
"=",
"strtoupper",
"(",
"trim",
"(",
"$",
"joinType",
")",
")",
";",
"if",
"(",
"!",
"in_ar... | 连接表,
如:RIGHT JOIN myTable tb ON tb.a = xx.filed1
则参数为->join('myTable tb', 'tb.a', 'xx.filed1', 'RIGHT')
@param string $table 连接的表
@param string $onFieldA ON 等号前面的字段名
@param string $onFieldB ON 等号后面的字段名
@param string $joinType = 'LEFT' join类型,LEFT|RIGHT|INNER|CROSS
@return \wf\db\Finder | [
"连接表,",
"如:RIGHT",
"JOIN",
"myTable",
"tb",
"ON",
"tb",
".",
"a",
"=",
"xx",
".",
"filed1",
"则参数为",
"-",
">",
"join",
"(",
"myTable",
"tb",
"tb",
".",
"a",
"xx",
".",
"filed1",
"RIGHT",
")"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L215-L224 |
windwork/wf-db | lib/Finder.php | Finder.where | public function where($field, $value, $operator = '=', $type = 'string')
{
$this->options['where'][] = [$field, $value, $operator, $type];
return $this;
} | php | public function where($field, $value, $operator = '=', $type = 'string')
{
$this->options['where'][] = [$field, $value, $operator, $type];
return $this;
} | [
"public",
"function",
"where",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'where'",
"]",
"[",
"]",
"=",
"[",
"$",
"field",
",",
"$",
"... | WHERE查询条件
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 运算符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,int:整形,flo... | [
"WHERE查询条件"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L272-L277 |
windwork/wf-db | lib/Finder.php | Finder.andWhere | public function andWhere($field, $value, $operator = '=', $type = 'string')
{
$this->where($field, $value, $operator, $type);
return $this;
} | php | public function andWhere($field, $value, $operator = '=', $type = 'string')
{
$this->where($field, $value, $operator, $type);
return $this;
} | [
"public",
"function",
"andWhere",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"where",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
",",
"$... | WHERE查询条件(AND)
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 运算符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,int:... | [
"WHERE查询条件(AND)"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L291-L296 |
windwork/wf-db | lib/Finder.php | Finder.orWhere | public function orWhere($field, $value, $operator = '=', $type = 'string')
{
if (!empty($this->options['where'])) {
$this->options['where'] = [
'OR',
$this->options['where'],
[$field, $value, $operator, $type],
];
} else { ... | php | public function orWhere($field, $value, $operator = '=', $type = 'string')
{
if (!empty($this->options['where'])) {
$this->options['where'] = [
'OR',
$this->options['where'],
[$field, $value, $operator, $type],
];
} else { ... | [
"public",
"function",
"orWhere",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"'where'",
"]",
")",
")",
"{",
... | WHERE查询条件(OR)
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 运算符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,int:整... | [
"WHERE查询条件(OR)"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L310-L323 |
windwork/wf-db | lib/Finder.php | Finder.having | public function having($field, $value, $operator = '=', $type = 'string')
{
$this->options['having'][] = [$field, $value, $operator, $type];
return $this;
} | php | public function having($field, $value, $operator = '=', $type = 'string')
{
$this->options['having'][] = [$field, $value, $operator, $type];
return $this;
} | [
"public",
"function",
"having",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'having'",
"]",
"[",
"]",
"=",
"[",
"$",
"field",
",",
"$",
... | HAVING条件,格式同where
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 操作符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,i... | [
"HAVING条件,格式同where"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L402-L407 |
windwork/wf-db | lib/Finder.php | Finder.andHaving | public function andHaving($field, $value, $operator = '=', $type = 'string')
{
$this->having($field, $value, $operator, $type);
return $this;
} | php | public function andHaving($field, $value, $operator = '=', $type = 'string')
{
$this->having($field, $value, $operator, $type);
return $this;
} | [
"public",
"function",
"andHaving",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"having",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
",",
... | HAVING查询条件(AND)
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 运算符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,int... | [
"HAVING查询条件(AND)"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L421-L426 |
windwork/wf-db | lib/Finder.php | Finder.orHaving | public function orHaving($field, $value, $operator = '=', $type = 'string')
{
if (!empty($this->options['having'])) {
$this->options['having'] = [
'OR',
$this->options['having'],
[$field, $value, $operator, $type],
];
} else { ... | php | public function orHaving($field, $value, $operator = '=', $type = 'string')
{
if (!empty($this->options['having'])) {
$this->options['having'] = [
'OR',
$this->options['having'],
[$field, $value, $operator, $type],
];
} else { ... | [
"public",
"function",
"orHaving",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"'having'",
"]",
")",
")",
"{"... | HAVING查询条件(OR)
如需要复杂SQL查询,请使用 wfDb()->getAll($sql, $args)/wfDb()->getRow($sql, $args)/wfDb()->getColumn($sql, $args)
@param string $field 字段名
@param mixed $value 字段值
@param string $operator = '=' 运算符,可选=,+,-,|,&,^,like,in,notin,>,<,<>,>=,<=,!=等
@param string $type = 'string' 字段值的类型,默认是string,string:字符串,field:字段,int:... | [
"HAVING查询条件(OR)"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L439-L452 |
windwork/wf-db | lib/Finder.php | Finder.limit | public function limit($offset, $rows = 0)
{
$offset = (int)($offset > 0 ? $offset : 0);
$rows = (int)($rows > 0 ? $rows : 0);
$this->options['limit'] = "{$offset}, {$rows}";
return $this;
} | php | public function limit($offset, $rows = 0)
{
$offset = (int)($offset > 0 ? $offset : 0);
$rows = (int)($rows > 0 ? $rows : 0);
$this->options['limit'] = "{$offset}, {$rows}";
return $this;
} | [
"public",
"function",
"limit",
"(",
"$",
"offset",
",",
"$",
"rows",
"=",
"0",
")",
"{",
"$",
"offset",
"=",
"(",
"int",
")",
"(",
"$",
"offset",
">",
"0",
"?",
"$",
"offset",
":",
"0",
")",
";",
"$",
"rows",
"=",
"(",
"int",
")",
"(",
"$",... | SQL分页查询
@param number $offset
@param number $rows
@return \wf\db\Finder | [
"SQL分页查询"
] | train | https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/Finder.php#L461-L469 |
j-d/draggy | src/Draggy/Autocode/Templates/PHP/Symfony2/Doctrine2/Entity4.php | Entity4.getCascadeOwnerPart | public function getCascadeOwnerPart(PHPAttribute $attribute)
{
$cascadeAttributes = [];
if (in_array($attribute->getCascadePersist(), ['both', 'owner'])) {
$cascadeAttributes[] = '"persist"';
}
if (in_array($attribute->getCascadeRemove(), ['both', 'owner'])) {
... | php | public function getCascadeOwnerPart(PHPAttribute $attribute)
{
$cascadeAttributes = [];
if (in_array($attribute->getCascadePersist(), ['both', 'owner'])) {
$cascadeAttributes[] = '"persist"';
}
if (in_array($attribute->getCascadeRemove(), ['both', 'owner'])) {
... | [
"public",
"function",
"getCascadeOwnerPart",
"(",
"PHPAttribute",
"$",
"attribute",
")",
"{",
"$",
"cascadeAttributes",
"=",
"[",
"]",
";",
"if",
"(",
"in_array",
"(",
"$",
"attribute",
"->",
"getCascadePersist",
"(",
")",
",",
"[",
"'both'",
",",
"'owner'",... | <user-additions part="otherMethods"> | [
"<user",
"-",
"additions",
"part",
"=",
"otherMethods",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/PHP/Symfony2/Doctrine2/Entity4.php#L43-L60 |
j-d/draggy | src/Draggy/Autocode/Templates/PHP/Symfony2/Doctrine2/Entity4.php | Entity4.getSetterCodeDocumentationParameterLines | public function getSetterCodeDocumentationParameterLines(PHPAttribute $attribute)
{
$lines = parent::getSetterCodeDocumentationParameterLines($attribute);
if (null !== $attribute->getForeign()) {
$lines[] = '@param bool $_reverseCall';
}
return $lines;
} | php | public function getSetterCodeDocumentationParameterLines(PHPAttribute $attribute)
{
$lines = parent::getSetterCodeDocumentationParameterLines($attribute);
if (null !== $attribute->getForeign()) {
$lines[] = '@param bool $_reverseCall';
}
return $lines;
} | [
"public",
"function",
"getSetterCodeDocumentationParameterLines",
"(",
"PHPAttribute",
"$",
"attribute",
")",
"{",
"$",
"lines",
"=",
"parent",
"::",
"getSetterCodeDocumentationParameterLines",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"attribu... | <editor-fold desc="Setters"> | [
"<editor",
"-",
"fold",
"desc",
"=",
"Setters",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/PHP/Symfony2/Doctrine2/Entity4.php#L217-L226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.