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 |
|---|---|---|---|---|---|---|---|---|---|---|
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent.make | public function make(Table $table, $action, array $ids = [], array $options = [])
{
$count = count($ids);
$options = $this->_getOptions($options, $count);
$redirectUrl = $options['redirect'];
$messages = new JSON($options['messages']);
$event = EventManager::tri... | php | public function make(Table $table, $action, array $ids = [], array $options = [])
{
$count = count($ids);
$options = $this->_getOptions($options, $count);
$redirectUrl = $options['redirect'];
$messages = new JSON($options['messages']);
$event = EventManager::tri... | [
"public",
"function",
"make",
"(",
"Table",
"$",
"table",
",",
"$",
"action",
",",
"array",
"$",
"ids",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"ids",
")",
";",
"$",
"options",... | Make process.
@param Table $table
@param string $action
@param array $ids
@param array $options
@return \Cake\Http\Response|null
@throws \Aura\Intl\Exception | [
"Make",
"process",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L105-L133 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getDefaultMessages | protected function _getDefaultMessages($count)
{
$context = $this->_configRead('context');
$contextPlural = Inflector::pluralize($context);
$countString = sprintf('<strong>%s</strong>', $count);
return [
'delete' => __dn(
'core',
'O... | php | protected function _getDefaultMessages($count)
{
$context = $this->_configRead('context');
$contextPlural = Inflector::pluralize($context);
$countString = sprintf('<strong>%s</strong>', $count);
return [
'delete' => __dn(
'core',
'O... | [
"protected",
"function",
"_getDefaultMessages",
"(",
"$",
"count",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"_configRead",
"(",
"'context'",
")",
";",
"$",
"contextPlural",
"=",
"Inflector",
"::",
"pluralize",
"(",
"$",
"context",
")",
";",
"$",
... | Setup default action messages.
@param int $count
@return array
@throws \Aura\Intl\Exception | [
"Setup",
"default",
"action",
"messages",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L143-L171 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getEventName | protected function _getEventName($action, $event = self::EVENT_NAME_BEFORE)
{
$details = [];
if ($prefix = $this->_request->getParam('prefix')) {
$details[] = ucfirst($prefix);
}
$details = Hash::merge($details, [
'Controller',
$this->_controller-... | php | protected function _getEventName($action, $event = self::EVENT_NAME_BEFORE)
{
$details = [];
if ($prefix = $this->_request->getParam('prefix')) {
$details[] = ucfirst($prefix);
}
$details = Hash::merge($details, [
'Controller',
$this->_controller-... | [
"protected",
"function",
"_getEventName",
"(",
"$",
"action",
",",
"$",
"event",
"=",
"self",
"::",
"EVENT_NAME_BEFORE",
")",
"{",
"$",
"details",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"prefix",
"=",
"$",
"this",
"->",
"_request",
"->",
"getParam",
"(",
... | Get event name by data.
@param string $action
@param string $event
@return string | [
"Get",
"event",
"name",
"by",
"data",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L180-L195 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getIds | protected function _getIds(array $ids, $primaryKey = self::PRIMARY_KEY)
{
$return = [];
foreach ($ids as $id => $value) {
if (is_array($value) && is_int($id) && (int) $value[$primaryKey] === 1) {
$return[$id] = $id;
}
}
return $return;
} | php | protected function _getIds(array $ids, $primaryKey = self::PRIMARY_KEY)
{
$return = [];
foreach ($ids as $id => $value) {
if (is_array($value) && is_int($id) && (int) $value[$primaryKey] === 1) {
$return[$id] = $id;
}
}
return $return;
} | [
"protected",
"function",
"_getIds",
"(",
"array",
"$",
"ids",
",",
"$",
"primaryKey",
"=",
"self",
"::",
"PRIMARY_KEY",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
"=>",
"$",
"value",
")",
"{",
"if",
... | Get ids by request.
@param array $ids
@param string $primaryKey
@return array | [
"Get",
"ids",
"by",
"request",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L204-L214 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getOptions | protected function _getOptions(array $options, $count)
{
$options = Hash::merge($this->_config, $options);
return Hash::merge(['messages' => $this->_getDefaultMessages($count)], $options);
} | php | protected function _getOptions(array $options, $count)
{
$options = Hash::merge($this->_config, $options);
return Hash::merge(['messages' => $this->_getDefaultMessages($count)], $options);
} | [
"protected",
"function",
"_getOptions",
"(",
"array",
"$",
"options",
",",
"$",
"count",
")",
"{",
"$",
"options",
"=",
"Hash",
"::",
"merge",
"(",
"$",
"this",
"->",
"_config",
",",
"$",
"options",
")",
";",
"return",
"Hash",
"::",
"merge",
"(",
"["... | Create and merge actual process options.
@param array $options
@param int|string $count
@return array
@throws \Aura\Intl\Exception | [
"Create",
"and",
"merge",
"actual",
"process",
"options",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L225-L229 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._loadBehavior | protected function _loadBehavior(Table $table)
{
$behaviors = $table->behaviors();
if (!Arr::in('Process', $behaviors->loaded())) {
$behaviors->load('Core.Process');
}
} | php | protected function _loadBehavior(Table $table)
{
$behaviors = $table->behaviors();
if (!Arr::in('Process', $behaviors->loaded())) {
$behaviors->load('Core.Process');
}
} | [
"protected",
"function",
"_loadBehavior",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"behaviors",
"=",
"$",
"table",
"->",
"behaviors",
"(",
")",
";",
"if",
"(",
"!",
"Arr",
"::",
"in",
"(",
"'Process'",
",",
"$",
"behaviors",
"->",
"loaded",
"(",
")... | Load process behavior.
@param Table $table | [
"Load",
"process",
"behavior",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L236-L242 |
CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._process | protected function _process($action, Data $messages, array $redirect, array $ids)
{
$count = count($ids);
$defaultMsg = __dn(
'core',
'One record success processed',
'{0} records processed',
$count,
sprintf('<strong>%s</strong>', $count)
... | php | protected function _process($action, Data $messages, array $redirect, array $ids)
{
$count = count($ids);
$defaultMsg = __dn(
'core',
'One record success processed',
'{0} records processed',
$count,
sprintf('<strong>%s</strong>', $count)
... | [
"protected",
"function",
"_process",
"(",
"$",
"action",
",",
"Data",
"$",
"messages",
",",
"array",
"$",
"redirect",
",",
"array",
"$",
"ids",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"ids",
")",
";",
"$",
"defaultMsg",
"=",
"__dn",
"(",
"'... | Controller process.
@param string $action
@param Data $messages
@param array $redirect
@param array $ids
@return \Cake\Http\Response|null
@throws \Aura\Intl\Exception | [
"Controller",
"process",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L255-L272 |
xtcommerce/shop-appstore-lib | src/XTCommerce/ShopAppstoreLib/Http.php | Http.parseHeaders | public function parseHeaders($src)
{
$headers = array();
$codeMatched = false;
// curl request header
if (!is_array($src)) {
$src = explode("\n",$src);
}
foreach ($src as $i) {
$row = explode(':', $i, 2);
... | php | public function parseHeaders($src)
{
$headers = array();
$codeMatched = false;
// curl request header
if (!is_array($src)) {
$src = explode("\n",$src);
}
foreach ($src as $i) {
$row = explode(':', $i, 2);
... | [
"public",
"function",
"parseHeaders",
"(",
"$",
"src",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"codeMatched",
"=",
"false",
";",
"// curl request header",
"if",
"(",
"!",
"is_array",
"(",
"$",
"src",
")",
")",
"{",
"$",
"src",
"="... | transform headers from $http_response_header
@param array $src
@internal param $headers
@internal param $http_response_header
@return array | [
"transform",
"headers",
"from",
"$http_response_header"
] | train | https://github.com/xtcommerce/shop-appstore-lib/blob/b12637502f74e8d1288cf47817e4c02b7f507c3b/src/XTCommerce/ShopAppstoreLib/Http.php#L279-L312 |
aedart/laravel-helpers | src/Traits/Queue/QueueMonitorTrait.php | QueueMonitorTrait.getQueueMonitor | public function getQueueMonitor(): ?Monitor
{
if (!$this->hasQueueMonitor()) {
$this->setQueueMonitor($this->getDefaultQueueMonitor());
}
return $this->queueMonitor;
} | php | public function getQueueMonitor(): ?Monitor
{
if (!$this->hasQueueMonitor()) {
$this->setQueueMonitor($this->getDefaultQueueMonitor());
}
return $this->queueMonitor;
} | [
"public",
"function",
"getQueueMonitor",
"(",
")",
":",
"?",
"Monitor",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasQueueMonitor",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setQueueMonitor",
"(",
"$",
"this",
"->",
"getDefaultQueueMonitor",
"(",
")",
")",
... | Get queue monitor
If no queue monitor has been set, this method will
set and return a default queue monitor, if any such
value is available
@see getDefaultQueueMonitor()
@return Monitor|null queue monitor or null if none queue monitor has been set | [
"Get",
"queue",
"monitor"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Queue/QueueMonitorTrait.php#L53-L59 |
ClanCats/Core | src/classes/CCArr.php | CCArr.push | public static function push( $item, &$arr, $merge = false )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::push - second argument has to be an array.');
}
if ( $merge && is_array( $item ) )
{
foreach ( $item as $value )
{
$arr[] = $value;
}
return $arr;
}
... | php | public static function push( $item, &$arr, $merge = false )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::push - second argument has to be an array.');
}
if ( $merge && is_array( $item ) )
{
foreach ( $item as $value )
{
$arr[] = $value;
}
return $arr;
}
... | [
"public",
"static",
"function",
"push",
"(",
"$",
"item",
",",
"&",
"$",
"arr",
",",
"$",
"merge",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::pus... | Adds a single item or array of items at the end of the referenced array
If you want to combine multiple arrays recursivly or use key => value pairs, please use CCArr::merge()
Example:
$bar = array( 'bar' );
CCArr::push( 'foo', $bar ); // $bar = array( 'bar', 'foo' )
CCArr::push( array( 'foo', 'baz' ), $bar ); // $bar ... | [
"Adds",
"a",
"single",
"item",
"or",
"array",
"of",
"items",
"at",
"the",
"end",
"of",
"the",
"referenced",
"array",
"If",
"you",
"want",
"to",
"combine",
"multiple",
"arrays",
"recursivly",
"or",
"use",
"key",
"=",
">",
"value",
"pairs",
"please",
"use"... | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L52-L69 |
ClanCats/Core | src/classes/CCArr.php | CCArr.add | public static function add( $key, $item, &$arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::add - second argument has to be an array.');
}
if ( !is_array( static::get( $key, $arr ) ) )
{
return static::set( $key, array( $item ), $arr );
}
return static::set( $key, ... | php | public static function add( $key, $item, &$arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::add - second argument has to be an array.');
}
if ( !is_array( static::get( $key, $arr ) ) )
{
return static::set( $key, array( $item ), $arr );
}
return static::set( $key, ... | [
"public",
"static",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"item",
",",
"&",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::add - second argument ha... | Adds an item to an element in the array
Example:
CCArr::add( 'foo.bar', 'test' );
Results:
array( 'foo' => array( 'bar' => array( 'test' ) ) )
@param string $key
@param mixed $item The item you would like to add to the array
@param array $array
@return array | [
"Adds",
"an",
"item",
"to",
"an",
"element",
"in",
"the",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L85-L98 |
ClanCats/Core | src/classes/CCArr.php | CCArr.pick | public static function pick( $key, $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::pick - second argument has to be an array.');
}
$return = array();
foreach( $arr as $array )
{
$return[] = CCArr::get( $key, $array );
}
return $return;
} | php | public static function pick( $key, $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::pick - second argument has to be an array.');
}
$return = array();
foreach( $arr as $array )
{
$return[] = CCArr::get( $key, $array );
}
return $return;
} | [
"public",
"static",
"function",
"pick",
"(",
"$",
"key",
",",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::pick - second argument has to be an array.'",
")",
... | get a special item from every array
@param mixed $key
@param array[array] $arr
@return array | [
"get",
"a",
"special",
"item",
"from",
"every",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L107-L122 |
ClanCats/Core | src/classes/CCArr.php | CCArr.pick_object | public static function pick_object( $key, $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::pick - second argument has to be an array.');
}
$return = array();
foreach( $arr as $object )
{
$return[] = $object->{$key};
}
return $return;
} | php | public static function pick_object( $key, $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::pick - second argument has to be an array.');
}
$return = array();
foreach( $arr as $object )
{
$return[] = $object->{$key};
}
return $return;
} | [
"public",
"static",
"function",
"pick_object",
"(",
"$",
"key",
",",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::pick - second argument has to be an array.'",
... | get a special item from every array
@param mixed $key
@param array[obj] $arr
@return array | [
"get",
"a",
"special",
"item",
"from",
"every",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L131-L146 |
ClanCats/Core | src/classes/CCArr.php | CCArr.sum | public static function sum( $arr, $key = null )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::sum - first argument has to be an array.');
}
$sum = 0;
if ( is_string( $key ) && CCArr::is_multi( $arr ) )
{
$arr = CCArr::pick( $key, $arr );
}
foreach ( $arr as $item ... | php | public static function sum( $arr, $key = null )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::sum - first argument has to be an array.');
}
$sum = 0;
if ( is_string( $key ) && CCArr::is_multi( $arr ) )
{
$arr = CCArr::pick( $key, $arr );
}
foreach ( $arr as $item ... | [
"public",
"static",
"function",
"sum",
"(",
"$",
"arr",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::sum - first argument has to be an arra... | sum items in an array or use special item in the array
@param array[array] $arr
@param string $key | [
"sum",
"items",
"in",
"an",
"array",
"or",
"use",
"special",
"item",
"in",
"the",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L192-L215 |
ClanCats/Core | src/classes/CCArr.php | CCArr.average | public static function average( $arr, $key = null )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::average - first argunent has to be an array.');
}
if ( is_string( $key ) && CCArr::is_multi( $arr ) )
{
$arr = CCArr::pick( $key, $arr );
}
return ( static::sum( $arr ) /... | php | public static function average( $arr, $key = null )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::average - first argunent has to be an array.');
}
if ( is_string( $key ) && CCArr::is_multi( $arr ) )
{
$arr = CCArr::pick( $key, $arr );
}
return ( static::sum( $arr ) /... | [
"public",
"static",
"function",
"average",
"(",
"$",
"arr",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'CCArr::average - first argunent has to be... | get the average of the items
@param array[array] $arr
@param string $key | [
"get",
"the",
"average",
"of",
"the",
"items"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L223-L236 |
ClanCats/Core | src/classes/CCArr.php | CCArr.object | public static function object( $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException("CCArr::object - only arrays can be passed.");
}
$object = new \stdClass();
if ( !empty( $arr ) )
{
foreach ( $arr as $name => $value)
{
if ( is_array( $value ) )
{
$value = st... | php | public static function object( $arr )
{
if( !is_array( $arr ) )
{
throw new \InvalidArgumentException("CCArr::object - only arrays can be passed.");
}
$object = new \stdClass();
if ( !empty( $arr ) )
{
foreach ( $arr as $name => $value)
{
if ( is_array( $value ) )
{
$value = st... | [
"public",
"static",
"function",
"object",
"(",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"CCArr::object - only arrays can be passed.\"",
")",
";",
"}",
"$",
"obj... | create an object from an array
@param array $array
@return object | [
"create",
"an",
"object",
"from",
"an",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L244-L266 |
ClanCats/Core | src/classes/CCArr.php | CCArr.merge | public static function merge()
{
// get all arguments
$arrs = func_get_args();
$return = array();
foreach ( $arrs as $arr )
{
if ( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::merge - all arguments have to be arrays.');
}
foreach ( $arr as $key => $value )
{
... | php | public static function merge()
{
// get all arguments
$arrs = func_get_args();
$return = array();
foreach ( $arrs as $arr )
{
if ( !is_array( $arr ) )
{
throw new \InvalidArgumentException('CCArr::merge - all arguments have to be arrays.');
}
foreach ( $arr as $key => $value )
{
... | [
"public",
"static",
"function",
"merge",
"(",
")",
"{",
"// get all arguments",
"$",
"arrs",
"=",
"func_get_args",
"(",
")",
";",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"arrs",
"as",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"... | merge arrays recursivly together
@param array $array ...
@return array | [
"merge",
"arrays",
"recursivly",
"together"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L274-L301 |
ClanCats/Core | src/classes/CCArr.php | CCArr.get | public static function get( $key, $arr, $default = null )
{
if ( isset( $arr[$key] ) )
{
return $arr[$key];
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) )
{
case 2:
if ( isset( $arr[$kp[0]][$kp[1]] ) )
{
return $arr[$kp[0]][$kp... | php | public static function get( $key, $arr, $default = null )
{
if ( isset( $arr[$key] ) )
{
return $arr[$key];
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) )
{
case 2:
if ( isset( $arr[$kp[0]][$kp[1]] ) )
{
return $arr[$kp[0]][$kp... | [
"public",
"static",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"arr",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"arr",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"arr",
"[",
"$",
"key",
"]",
";",
... | return an item from an array with dottet dimensions
@param string $key
@param array $arr
@param mixed $default
@return mixed | [
"return",
"an",
"item",
"from",
"an",
"array",
"with",
"dottet",
"dimensions"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L311-L360 |
ClanCats/Core | src/classes/CCArr.php | CCArr.has | public static function has( $key, $arr )
{
if ( isset( $arr[$key] ) )
{
return true;
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) ) {
case 2:
return isset( $arr[$kp[0]][$kp[1]] ); break;
case 3:
return isset( $arr[$kp[0]][$kp[1]][... | php | public static function has( $key, $arr )
{
if ( isset( $arr[$key] ) )
{
return true;
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) ) {
case 2:
return isset( $arr[$kp[0]][$kp[1]] ); break;
case 3:
return isset( $arr[$kp[0]][$kp[1]][... | [
"public",
"static",
"function",
"has",
"(",
"$",
"key",
",",
"$",
"arr",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"arr",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
... | checks if the array has an item with dottet dimensions
@param string $key
@param array $arr
@return bool | [
"checks",
"if",
"the",
"array",
"has",
"an",
"item",
"with",
"dottet",
"dimensions"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L369-L404 |
ClanCats/Core | src/classes/CCArr.php | CCArr.set | public static function set( $key, $value, &$arr )
{
if ( strpos( $key, '.' ) === false )
{
$arr[$key] = $value;
}
else
{
$kp = explode( '.', $key );
switch ( count( $kp ) )
{
case 2:
$arr[$kp[0]][$kp[1]] = $value; break;
case 3:
$arr[$kp[0]][$kp[1]][$kp[2]] = $value; bre... | php | public static function set( $key, $value, &$arr )
{
if ( strpos( $key, '.' ) === false )
{
$arr[$key] = $value;
}
else
{
$kp = explode( '.', $key );
switch ( count( $kp ) )
{
case 2:
$arr[$kp[0]][$kp[1]] = $value; break;
case 3:
$arr[$kp[0]][$kp[1]][$kp[2]] = $value; bre... | [
"public",
"static",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"&",
"$",
"arr",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"$",
"arr",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
... | sets an item from an array with dottet dimensions
@param string $key
@param mixed $value
@param array $arr
@return array | [
"sets",
"an",
"item",
"from",
"an",
"array",
"with",
"dottet",
"dimensions"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L414-L449 |
ClanCats/Core | src/classes/CCArr.php | CCArr.delete | public static function delete( $key, &$arr )
{
if ( isset( $arr[$key] ) )
{
unset( $arr[$key] ); return;
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) ) {
case 2:
unset( $arr[$kp[0]][$kp[1]] ); return; break;
case 3:
unset( $arr[$... | php | public static function delete( $key, &$arr )
{
if ( isset( $arr[$key] ) )
{
unset( $arr[$key] ); return;
}
if ( strpos( $key, '.' ) !== false )
{
$kp = explode( '.', $key );
switch ( count( $kp ) ) {
case 2:
unset( $arr[$kp[0]][$kp[1]] ); return; break;
case 3:
unset( $arr[$... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"key",
",",
"&",
"$",
"arr",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"arr",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"arr",
"[",
"$",
"key",
"]",
")",
";",
"return",
";",
"}... | deletes an item from an array with dottet dimensions
@param string $key
@param array $arr
@return void | [
"deletes",
"an",
"item",
"from",
"an",
"array",
"with",
"dottet",
"dimensions"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCArr.php#L458-L478 |
inpsyde/inpsyde-filter | src/WordPress/RemoveAccents.php | RemoveAccents.filter | public function filter( $value ) {
if ( ! is_string( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not string or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
return remove_accents( $value );
} | php | public function filter( $value ) {
if ( ! is_string( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not string or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
return remove_accents( $value );
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
"||",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"do_action",
"(",
"'inpsyde.filter.error'",
",",
"'The given value is not string or empty.'",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/WordPress/RemoveAccents.php#L17-L26 |
webforge-labs/psc-cms | lib/Psc/Net/RequestMatcher.php | RequestMatcher.qvar | public function qvar($name, $default = NULL) {
$query = (array) $this->request->getQuery();
return array_key_exists($name, $query) ? $query[$name] : $default;
} | php | public function qvar($name, $default = NULL) {
$query = (array) $this->request->getQuery();
return array_key_exists($name, $query) ? $query[$name] : $default;
} | [
"public",
"function",
"qvar",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"NULL",
")",
"{",
"$",
"query",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"request",
"->",
"getQuery",
"(",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"name",
",",
"$... | Gibt die QueryVariable oder NULL zurück | [
"Gibt",
"die",
"QueryVariable",
"oder",
"NULL",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/RequestMatcher.php#L150-L153 |
webforge-labs/psc-cms | lib/Psc/Net/RequestMatcher.php | RequestMatcher.bvar | public function bvar($name, $default = NULL) {
$body = (object) $this->request->getBody();
return isset($body->$name) ? $body->$name : $default;
} | php | public function bvar($name, $default = NULL) {
$body = (object) $this->request->getBody();
return isset($body->$name) ? $body->$name : $default;
} | [
"public",
"function",
"bvar",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"NULL",
")",
"{",
"$",
"body",
"=",
"(",
"object",
")",
"$",
"this",
"->",
"request",
"->",
"getBody",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"body",
"->",
"$",
"name"... | Body Var | [
"Body",
"Var"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/RequestMatcher.php#L158-L161 |
webforge-labs/psc-cms | lib/Psc/Net/RequestMatcher.php | RequestMatcher.matchOrderBy | public function matchOrderBy($orderByValue, Array $mappings, Array $default = array()) {
if (is_string($orderByValue)) {
$orderByValue = array($orderByValue => 'ASC');
}
$orderBy = array();
if (is_array($orderByValue)) {
foreach ($orderByValue as $key => $sort) {
$sort = mb_stripos... | php | public function matchOrderBy($orderByValue, Array $mappings, Array $default = array()) {
if (is_string($orderByValue)) {
$orderByValue = array($orderByValue => 'ASC');
}
$orderBy = array();
if (is_array($orderByValue)) {
foreach ($orderByValue as $key => $sort) {
$sort = mb_stripos... | [
"public",
"function",
"matchOrderBy",
"(",
"$",
"orderByValue",
",",
"Array",
"$",
"mappings",
",",
"Array",
"$",
"default",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"orderByValue",
")",
")",
"{",
"$",
"orderByValue",
"=",
"a... | Matches a value as it is meant to be a order by value
returns an orderby-array if the value can be parsed
returns the $default if the value cannot be parsed
the orderby array is like
array (string $field => string ASC|DESC, string $field2 => string ASC|DESC);
lowercase asc or desc will be converted. Other values wil... | [
"Matches",
"a",
"value",
"as",
"it",
"is",
"meant",
"to",
"be",
"a",
"order",
"by",
"value"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/RequestMatcher.php#L176-L199 |
lode/fem | src/bootstrap.php | bootstrap.set_custom_library | public static function set_custom_library($name, $custom_class) {
if (class_exists('\\alsvanzelf\\fem\\'.$name) == false) {
throw new exception('library does not exist in fem');
}
self::$custom_libraries[$name] = $custom_class;
} | php | public static function set_custom_library($name, $custom_class) {
if (class_exists('\\alsvanzelf\\fem\\'.$name) == false) {
throw new exception('library does not exist in fem');
}
self::$custom_libraries[$name] = $custom_class;
} | [
"public",
"static",
"function",
"set_custom_library",
"(",
"$",
"name",
",",
"$",
"custom_class",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\alsvanzelf\\\\fem\\\\'",
".",
"$",
"name",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"exception",
"(",
"'lib... | set a custom library for usage by other fem libraries
use this when extending a fem library
without this, fem will call the non-extended library in its own calls
@param string $name the name of the fem class, i.e. 'page'
@param string $custom_class the (fully qualified) name of the extending class
@return vo... | [
"set",
"a",
"custom",
"library",
"for",
"usage",
"by",
"other",
"fem",
"libraries",
"use",
"this",
"when",
"extending",
"a",
"fem",
"library",
"without",
"this",
"fem",
"will",
"call",
"the",
"non",
"-",
"extended",
"library",
"in",
"its",
"own",
"calls"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/bootstrap.php#L35-L41 |
lode/fem | src/bootstrap.php | bootstrap.get_library | public static function get_library($name) {
if (class_exists('\\alsvanzelf\\fem\\'.$name) == false) {
throw new exception('library does not exist in fem');
}
if (isset(self::$custom_libraries[$name])) {
return self::$custom_libraries[$name];
}
return '\\alsvanzelf\\fem\\'.$name;
} | php | public static function get_library($name) {
if (class_exists('\\alsvanzelf\\fem\\'.$name) == false) {
throw new exception('library does not exist in fem');
}
if (isset(self::$custom_libraries[$name])) {
return self::$custom_libraries[$name];
}
return '\\alsvanzelf\\fem\\'.$name;
} | [
"public",
"static",
"function",
"get_library",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\alsvanzelf\\\\fem\\\\'",
".",
"$",
"name",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"exception",
"(",
"'library does not exist in fem'",
")",
... | get the class name which should be used for a certain fem library
used internally to determine whether a custom library has been set
returns the fem class name if no custom library is set
@param string $name the name of the fem class, i.e. 'page'
@return string the (fully qualified) name of the class which shou... | [
"get",
"the",
"class",
"name",
"which",
"should",
"be",
"used",
"for",
"a",
"certain",
"fem",
"library",
"used",
"internally",
"to",
"determine",
"whether",
"a",
"custom",
"library",
"has",
"been",
"set",
"returns",
"the",
"fem",
"class",
"name",
"if",
"no... | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/bootstrap.php#L51-L61 |
lode/fem | src/bootstrap.php | bootstrap.environment | private static function environment() {
$environment = getenv('APP_ENV') ?: 'production';
define('alsvanzelf\fem\ENVIRONMENT', $environment);
define('alsvanzelf\fem\ROOT_DIR', realpath(__DIR__.'/../../../../').'/');
define('alsvanzelf\fem\ROOT_DIR_APP', \alsvanzelf\fem\ROOT_DIR.'application/');
define('alsv... | php | private static function environment() {
$environment = getenv('APP_ENV') ?: 'production';
define('alsvanzelf\fem\ENVIRONMENT', $environment);
define('alsvanzelf\fem\ROOT_DIR', realpath(__DIR__.'/../../../../').'/');
define('alsvanzelf\fem\ROOT_DIR_APP', \alsvanzelf\fem\ROOT_DIR.'application/');
define('alsv... | [
"private",
"static",
"function",
"environment",
"(",
")",
"{",
"$",
"environment",
"=",
"getenv",
"(",
"'APP_ENV'",
")",
"?",
":",
"'production'",
";",
"define",
"(",
"'alsvanzelf\\fem\\ENVIRONMENT'",
",",
"$",
"environment",
")",
";",
"define",
"(",
"'alsvanz... | environmental check
defines environment and root dir | [
"environmental",
"check",
"defines",
"environment",
"and",
"root",
"dir"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/bootstrap.php#L67-L79 |
lode/fem | src/bootstrap.php | bootstrap.uncertain | private static function uncertain() {
ini_set('display_startup_errors', 0);
ini_set('display_errors', 0);
error_reporting(0);
if (\alsvanzelf\fem\ENVIRONMENT == 'development') {
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
}
$error_handler = function($level, $me... | php | private static function uncertain() {
ini_set('display_startup_errors', 0);
ini_set('display_errors', 0);
error_reporting(0);
if (\alsvanzelf\fem\ENVIRONMENT == 'development') {
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
}
$error_handler = function($level, $me... | [
"private",
"static",
"function",
"uncertain",
"(",
")",
"{",
"ini_set",
"(",
"'display_startup_errors'",
",",
"0",
")",
";",
"ini_set",
"(",
"'display_errors'",
",",
"0",
")",
";",
"error_reporting",
"(",
"0",
")",
";",
"if",
"(",
"\\",
"alsvanzelf",
"\\",... | error handling
know when to say what depending on environment
and passes errors to exceptions | [
"error",
"handling",
"know",
"when",
"to",
"say",
"what",
"depending",
"on",
"environment",
"and",
"passes",
"errors",
"to",
"exceptions"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/bootstrap.php#L96-L110 |
lode/fem | src/bootstrap.php | bootstrap.secure | private static function secure() {
if (\alsvanzelf\fem\CLI) {
return;
}
header_remove('X-Powered-By');
ini_set('session.use_trans_sid', 0);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
ini_set('session.use_strict_mode', 1); // @note this is only effective from 5.5.2
... | php | private static function secure() {
if (\alsvanzelf\fem\CLI) {
return;
}
header_remove('X-Powered-By');
ini_set('session.use_trans_sid', 0);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
ini_set('session.use_strict_mode', 1); // @note this is only effective from 5.5.2
... | [
"private",
"static",
"function",
"secure",
"(",
")",
"{",
"if",
"(",
"\\",
"alsvanzelf",
"\\",
"fem",
"\\",
"CLI",
")",
"{",
"return",
";",
"}",
"header_remove",
"(",
"'X-Powered-By'",
")",
";",
"ini_set",
"(",
"'session.use_trans_sid'",
",",
"0",
")",
"... | basic security
stops outputting of php header
and help against session fixation | [
"basic",
"security",
"stops",
"outputting",
"of",
"php",
"header",
"and",
"help",
"against",
"session",
"fixation"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/bootstrap.php#L117-L129 |
rayrutjes/domain-foundation | src/Specification/AndSpecification.php | AndSpecification.isSatisfiedBy | public function isSatisfiedBy($object)
{
return $this->left->isSatisfiedBy($object) && $this->right->isSatisfiedBy($object);
} | php | public function isSatisfiedBy($object)
{
return $this->left->isSatisfiedBy($object) && $this->right->isSatisfiedBy($object);
} | [
"public",
"function",
"isSatisfiedBy",
"(",
"$",
"object",
")",
"{",
"return",
"$",
"this",
"->",
"left",
"->",
"isSatisfiedBy",
"(",
"$",
"object",
")",
"&&",
"$",
"this",
"->",
"right",
"->",
"isSatisfiedBy",
"(",
"$",
"object",
")",
";",
"}"
] | @param $object
@return bool | [
"@param",
"$object"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Specification/AndSpecification.php#L32-L35 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.warnInsecureSettings | private function warnInsecureSettings(): void
{
if (!self::$warnInsecureSettings) {
return;
}
if (!ini_get('session.use_cookies')) {
$errorMessage = 'The ini setting session.use_cookies should be set to true.';
throw new InsecureSettingsException($errorMe... | php | private function warnInsecureSettings(): void
{
if (!self::$warnInsecureSettings) {
return;
}
if (!ini_get('session.use_cookies')) {
$errorMessage = 'The ini setting session.use_cookies should be set to true.';
throw new InsecureSettingsException($errorMe... | [
"private",
"function",
"warnInsecureSettings",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"warnInsecureSettings",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"ini_get",
"(",
"'session.use_cookies'",
")",
")",
"{",
"$",
"errorMessage",... | Throws exceptions when insecure INI settings are detected.
@throws InsecureSettingsException
@return void | [
"Throws",
"exceptions",
"when",
"insecure",
"INI",
"settings",
"are",
"detected",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L73-L98 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.handleStrict | private function handleStrict(): void
{
if (!ini_get('session.use_strict_mode') || headers_sent()) {
return;
}
$cookieName = session_name();
if (empty($_COOKIE[$cookieName])) {
return;
}
$sessionId = $_COOKIE[$cookieName];
$identifie... | php | private function handleStrict(): void
{
if (!ini_get('session.use_strict_mode') || headers_sent()) {
return;
}
$cookieName = session_name();
if (empty($_COOKIE[$cookieName])) {
return;
}
$sessionId = $_COOKIE[$cookieName];
$identifie... | [
"private",
"function",
"handleStrict",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"ini_get",
"(",
"'session.use_strict_mode'",
")",
"||",
"headers_sent",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"cookieName",
"=",
"session_name",
"(",
")",
";",
"if"... | Rejects arbitrary session ids.
@SuppressWarnings(PHPMD.Superglobals)
@see http://php.net/manual/en/features.session.security.management.php#features.session.security.management.non-adaptive-session Why this security measure is important.
@return void | [
"Rejects",
"arbitrary",
"session",
"ids",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L108-L129 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.open | public function open($savePath, $sessionName): bool
{
$sessionId = session_id();
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
while (!$this->storageDriver->lock($identifier)) {
usleep(1000);
}
return true;
} | php | public function open($savePath, $sessionName): bool
{
$sessionId = session_id();
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
while (!$this->storageDriver->lock($identifier)) {
usleep(1000);
}
return true;
} | [
"public",
"function",
"open",
"(",
"$",
"savePath",
",",
"$",
"sessionName",
")",
":",
"bool",
"{",
"$",
"sessionId",
"=",
"session_id",
"(",
")",
";",
"$",
"identifier",
"=",
"$",
"this",
"->",
"cryptProvider",
"->",
"makeSessionIdentifier",
"(",
"$",
"... | Opens the session.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param string $savePath The path where the session files will be saved.
@param string $sessionName The name of the session
@return bool | [
"Opens",
"the",
"session",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L140-L151 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.close | public function close(): bool
{
$sessionId = session_id();
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
$this->storageDriver->unlock($identifier);
return true;
} | php | public function close(): bool
{
$sessionId = session_id();
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
$this->storageDriver->unlock($identifier);
return true;
} | [
"public",
"function",
"close",
"(",
")",
":",
"bool",
"{",
"$",
"sessionId",
"=",
"session_id",
"(",
")",
";",
"$",
"identifier",
"=",
"$",
"this",
"->",
"cryptProvider",
"->",
"makeSessionIdentifier",
"(",
"$",
"sessionId",
")",
";",
"$",
"this",
"->",
... | Closes the session
@return bool | [
"Closes",
"the",
"session"
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L158-L167 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.read | public function read($sessionId): string
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
if (!$this->storageDriver->sessionExists($identifier)) {
return '';
}
$content = $this->storageDriver->get($identifier);
if (!$content) {
... | php | public function read($sessionId): string
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
if (!$this->storageDriver->sessionExists($identifier)) {
return '';
}
$content = $this->storageDriver->get($identifier);
if (!$content) {
... | [
"public",
"function",
"read",
"(",
"$",
"sessionId",
")",
":",
"string",
"{",
"$",
"identifier",
"=",
"$",
"this",
"->",
"cryptProvider",
"->",
"makeSessionIdentifier",
"(",
"$",
"sessionId",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"storageDriver",
... | Return the decrypted (but still serialized) data of the session.
@param string $sessionId Id of the session
@return string Decrypted session data (still serialized) | [
"Return",
"the",
"decrypted",
"(",
"but",
"still",
"serialized",
")",
"data",
"of",
"the",
"session",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L175-L189 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.write | public function write($sessionId, $sessionData): bool
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
$content = $this->cryptProvider->encryptSessionData($sessionId, $sessionData);
try {
$this->storageDriver->save($identifier, $content);
ret... | php | public function write($sessionId, $sessionData): bool
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
$content = $this->cryptProvider->encryptSessionData($sessionId, $sessionData);
try {
$this->storageDriver->save($identifier, $content);
ret... | [
"public",
"function",
"write",
"(",
"$",
"sessionId",
",",
"$",
"sessionData",
")",
":",
"bool",
"{",
"$",
"identifier",
"=",
"$",
"this",
"->",
"cryptProvider",
"->",
"makeSessionIdentifier",
"(",
"$",
"sessionId",
")",
";",
"$",
"content",
"=",
"$",
"t... | Encrypts the session data and saves to the storage;
@param string $sessionId Id of the session
@param string $sessionData Unencrypted session data
@return boolean | [
"Encrypts",
"the",
"session",
"data",
"and",
"saves",
"to",
"the",
"storage",
";"
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L198-L210 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.destroy | public function destroy($sessionId): bool
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
try {
$this->storageDriver->destroy($identifier);
return true;
} catch (Exception $e) {
return false;
}
} | php | public function destroy($sessionId): bool
{
$identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);
try {
$this->storageDriver->destroy($identifier);
return true;
} catch (Exception $e) {
return false;
}
} | [
"public",
"function",
"destroy",
"(",
"$",
"sessionId",
")",
":",
"bool",
"{",
"$",
"identifier",
"=",
"$",
"this",
"->",
"cryptProvider",
"->",
"makeSessionIdentifier",
"(",
"$",
"sessionId",
")",
";",
"try",
"{",
"$",
"this",
"->",
"storageDriver",
"->",... | Destroys the session.
@param string $sessionId Id of the session
@return bool | [
"Destroys",
"the",
"session",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L218-L228 |
phpsess/session-handler | src/SessionHandler.php | SessionHandler.gc | public function gc($maxLife): bool
{
try {
$this->storageDriver->clearOld($maxLife * 1000000);
return true;
} catch (Exception $e) {
return false;
}
} | php | public function gc($maxLife): bool
{
try {
$this->storageDriver->clearOld($maxLife * 1000000);
return true;
} catch (Exception $e) {
return false;
}
} | [
"public",
"function",
"gc",
"(",
"$",
"maxLife",
")",
":",
"bool",
"{",
"try",
"{",
"$",
"this",
"->",
"storageDriver",
"->",
"clearOld",
"(",
"$",
"maxLife",
"*",
"1000000",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
... | Removes the expired sessions from the storage.
(GC stands for Garbage Collector)
@SuppressWarnings(PHPMD.ShortMethodName)
@param int $maxLife The maximum time (in seconds) that a session must be kept.
@return bool | [
"Removes",
"the",
"expired",
"sessions",
"from",
"the",
"storage",
"."
] | train | https://github.com/phpsess/session-handler/blob/8b4e60e6a8d2da1c7cba0760523592f8952ef2fa/src/SessionHandler.php#L240-L248 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.ensureConsistency | public function ensureConsistency()
{
if ($this->aUser !== null && $this->user_id !== $this->aUser->getId()) {
$this->aUser = null;
}
if ($this->aCustomer !== null && $this->customer_id !== $this->aCustomer->getId()) {
$this->aCustomer = null;
}
} | php | public function ensureConsistency()
{
if ($this->aUser !== null && $this->user_id !== $this->aUser->getId()) {
$this->aUser = null;
}
if ($this->aCustomer !== null && $this->customer_id !== $this->aCustomer->getId()) {
$this->aCustomer = null;
}
} | [
"public",
"function",
"ensureConsistency",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aUser",
"!==",
"null",
"&&",
"$",
"this",
"->",
"user_id",
"!==",
"$",
"this",
"->",
"aUser",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"this",
"->",
"aUser",
"=... | Checks and repairs the internal consistency of the object.
This method is executed after an already-instantiated object is re-hydrated
from the database. It exists to check any foreign keys to make sure that
the objects related to the current object are correct based on foreign key.
You can override this method in t... | [
"Checks",
"and",
"repairs",
"the",
"internal",
"consistency",
"of",
"the",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L259-L268 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.doInsert | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = UserCustomerRelationPeer::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserCustomerRelat... | php | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = UserCustomerRelationPeer::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserCustomerRelat... | [
"protected",
"function",
"doInsert",
"(",
"PropelPDO",
"$",
"con",
")",
"{",
"$",
"modifiedColumns",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"$",
"this",
"->",
"modifiedColumns",
"[",
"]",
"=",
"UserCustomerRelationPeer",
"::",
"ID",
";... | Insert the row in the database.
@param PropelPDO $con
@throws PropelException
@see doSave() | [
"Insert",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L467-L523 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.doValidate | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | php | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | [
"protected",
"function",
"doValidate",
"(",
"$",
"columns",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInValidation",
")",
"{",
"$",
"this",
"->",
"alreadyInValidation",
"=",
"true",
";",
"$",
"retval",
"=",
"null",
";",
"$",
"fa... | This function performs the validation work for complex object models.
In addition to checking the current object, all related objects will
also be validated. If all pass then <code>true</code> is returned; otherwise
an aggregated array of ValidationFailed objects will be returned.
@param array $columns Array of colu... | [
"This",
"function",
"performs",
"the",
"validation",
"work",
"for",
"complex",
"object",
"models",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L592-L629 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.getByName | public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = UserCustomerRelationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
} | php | public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = UserCustomerRelationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
} | [
"public",
"function",
"getByName",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"pos",
"=",
"UserCustomerRelationPeer",
"::",
"translateFieldName",
"(",
"$",
"name",
",",
"$",
"type",
",",
"BasePeer",
"::",
"TYP... | Retrieves a field from the object by name passed in as a string.
@param string $name name
@param string $type The type of fieldname the $name is of:
one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
Defaults to Bas... | [
"Retrieves",
"a",
"field",
"from",
"the",
"object",
"by",
"name",
"passed",
"in",
"as",
"a",
"string",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L641-L647 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.getByPosition | public function getByPosition($pos)
{
switch ($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getUserId();
break;
case 2:
return $this->getCustomerId();
bre... | php | public function getByPosition($pos)
{
switch ($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getUserId();
break;
case 2:
return $this->getCustomerId();
bre... | [
"public",
"function",
"getByPosition",
"(",
"$",
"pos",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"return",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"break",
";",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getUserId",
... | Retrieves a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@return mixed Value of field at $pos | [
"Retrieves",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L656-L672 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.toArray | public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['UserCustomerRelation'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumped... | php | public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['UserCustomerRelation'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumped... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L689-L716 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.setByName | public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = UserCustomerRelationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$this->setByPosition($pos, $value);
} | php | public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = UserCustomerRelationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$this->setByPosition($pos, $value);
} | [
"public",
"function",
"setByName",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"type",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"pos",
"=",
"UserCustomerRelationPeer",
"::",
"translateFieldName",
"(",
"$",
"name",
",",
"$",
"type",
",",
"... | Sets a field from the object by name passed in as a string.
@param string $name peer name
@param mixed $value field value
@param string $type The type of fieldname the $name is of:
one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, Bas... | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"name",
"passed",
"in",
"as",
"a",
"string",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L729-L734 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.setByPosition | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setUserId($value);
break;
case 2:
$this->setCustomerId($value);
... | php | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setUserId($value);
break;
case 2:
$this->setCustomerId($value);
... | [
"public",
"function",
"setByPosition",
"(",
"$",
"pos",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"$",
"this",
"->",
"setId",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"1",
":",
"$",
"this",
"-... | Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return void | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L744-L757 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.fromArray | public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = UserCustomerRelationPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setUserId($arr[$keys[1]]);
if (array_key_e... | php | public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = UserCustomerRelationPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setUserId($arr[$keys[1]]);
if (array_key_e... | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"UserCustomerRelationPeer",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
"(",
... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L776-L783 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(UserCustomerRelationPeer::DATABASE_NAME);
if ($this->isColumnModified(UserCustomerRelationPeer::ID)) $criteria->add(UserCustomerRelationPeer::ID, $this->id);
if ($this->isColumnModified(UserCustomerRelationPeer::USER_ID)) $criteria-... | php | public function buildCriteria()
{
$criteria = new Criteria(UserCustomerRelationPeer::DATABASE_NAME);
if ($this->isColumnModified(UserCustomerRelationPeer::ID)) $criteria->add(UserCustomerRelationPeer::ID, $this->id);
if ($this->isColumnModified(UserCustomerRelationPeer::USER_ID)) $criteria-... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"UserCustomerRelationPeer",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"UserCustomerRelationPeer",
"::",
"ID",
")",
... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L790-L799 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUserId($this->getUserId());
$copyObj->setCustomerId($this->getCustomerId());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
... | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUserId($this->getUserId());
$copyObj->setCustomerId($this->getCustomerId());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
... | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setUserId",
"(",
"$",
"this",
"->",
"getUserId",
"(",
")",
")",
";",
"$",
"copyObj",
"->",
... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of UserCustomerRelation (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the curre... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L858-L878 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.setCustomer | public function setCustomer(Customer $v = null)
{
if ($v === null) {
$this->setCustomerId(NULL);
} else {
$this->setCustomerId($v->getId());
}
$this->aCustomer = $v;
// Add binding for other direction of this n:n relationship.
// If this obje... | php | public function setCustomer(Customer $v = null)
{
if ($v === null) {
$this->setCustomerId(NULL);
} else {
$this->setCustomerId($v->getId());
}
$this->aCustomer = $v;
// Add binding for other direction of this n:n relationship.
// If this obje... | [
"public",
"function",
"setCustomer",
"(",
"Customer",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setCustomerId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setCustomerId",
"(... | Declares an association between this object and a Customer object.
@param Customer $v
@return UserCustomerRelation The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"Customer",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L979-L997 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php | BaseUserCustomerRelation.getCustomer | public function getCustomer(PropelPDO $con = null, $doQuery = true)
{
if ($this->aCustomer === null && ($this->customer_id !== null) && $doQuery) {
$this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
/* The following can be used additionally to
... | php | public function getCustomer(PropelPDO $con = null, $doQuery = true)
{
if ($this->aCustomer === null && ($this->customer_id !== null) && $doQuery) {
$this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
/* The following can be used additionally to
... | [
"public",
"function",
"getCustomer",
"(",
"PropelPDO",
"$",
"con",
"=",
"null",
",",
"$",
"doQuery",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomer",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"customer_id",
"!==",
"null",
")",
"&&... | Get the associated Customer object
@param PropelPDO $con Optional Connection object.
@param $doQuery Executes a query to get the object if required
@return Customer The associated Customer object.
@throws PropelException | [
"Get",
"the",
"associated",
"Customer",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseUserCustomerRelation.php#L1008-L1022 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withProtocolVersion | public function withProtocolVersion($version)
{
$previousRequest = $this->previousRequest->withProtocolVersion($version);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withProtocolVersion($version)
{
$previousRequest = $this->previousRequest->withProtocolVersion($version);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withProtocolVersion",
"(",
"$",
"version",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withProtocolVersion",
"(",
"$",
"version",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
... | Return an instance with the specified HTTP protocol version.
The version string MUST contain only the HTTP version number (e.g.,
"1.1", "1.0").
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
new protocol version.
@param string $ver... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"HTTP",
"protocol",
"version",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L92-L98 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withHeader | public function withHeader($name, $value)
{
$previousRequest = $this->previousRequest->withHeader($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withHeader($name, $value)
{
$previousRequest = $this->previousRequest->withHeader($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"$",
"request",
"=",
"clone",
"$",
... | Return an instance with the provided value replacing the specified header.
While header names are case-insensitive, the casing of the header will
be preserved by this function, and returned from getHeaders().
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return a... | [
"Return",
"an",
"instance",
"with",
"the",
"provided",
"value",
"replacing",
"the",
"specified",
"header",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L201-L207 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withAddedHeader | public function withAddedHeader($name, $value)
{
$previousRequest = $this->previousRequest->withAddedHeader($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withAddedHeader($name, $value)
{
$previousRequest = $this->previousRequest->withAddedHeader($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withAddedHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withAddedHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"$",
"request",
"=",
"clone... | Return an instance with the specified header appended with the given value.
Existing values for the specified header will be maintained. The new
value(s) will be appended to the existing list. If the header did not
exist previously, it will be added.
This method MUST be implemented in such a way as to retain the
immu... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"header",
"appended",
"with",
"the",
"given",
"value",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L225-L231 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withoutHeader | public function withoutHeader($name)
{
$previousRequest = $this->previousRequest->withoutHeader($name);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withoutHeader($name)
{
$previousRequest = $this->previousRequest->withoutHeader($name);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withoutHeader",
"(",
"$",
"name",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withoutHeader",
"(",
"$",
"name",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"request",
"->",... | Return an instance without the specified header.
Header resolution MUST be done without case-sensitivity.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that removes
the named header.
@param string $name case-insensitive header field name to re... | [
"Return",
"an",
"instance",
"without",
"the",
"specified",
"header",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L245-L251 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withBody | public function withBody(StreamInterface $body)
{
$previousRequest = $this->previousRequest->withBody($body);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withBody(StreamInterface $body)
{
$previousRequest = $this->previousRequest->withBody($body);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withBody",
"(",
"StreamInterface",
"$",
"body",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withBody",
"(",
"$",
"body",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"reques... | Return an instance with the specified message body.
The body MUST be a StreamInterface object.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return a new instance that has the
new body stream.
@param StreamInterface $body body
@throws \InvalidArgumentException w... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"message",
"body",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L276-L282 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withRequestTarget | public function withRequestTarget($requestTarget)
{
$previousRequest = $this->previousRequest->withRequestTarget($requestTarget);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withRequestTarget($requestTarget)
{
$previousRequest = $this->previousRequest->withRequestTarget($requestTarget);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withRequestTarget",
"(",
"$",
"requestTarget",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withRequestTarget",
"(",
"$",
"requestTarget",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
... | Return an instance with the specific request-target.
If the request needs a non-origin-form request-target — e.g., for
specifying an absolute-form, authority-form, or asterisk-form —
this method may be used to create an instance with the specified
request-target, verbatim.
This method MUST be implemented in such a wa... | [
"Return",
"an",
"instance",
"with",
"the",
"specific",
"request",
"-",
"target",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L322-L328 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withMethod | public function withMethod($method)
{
$previousRequest = $this->previousRequest->withMethod($method);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withMethod($method)
{
$previousRequest = $this->previousRequest->withMethod($method);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withMethod",
"(",
"$",
"method",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withMethod",
"(",
"$",
"method",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"request",
"->",
... | Return an instance with the provided HTTP method.
While HTTP method names are typically all uppercase characters, HTTP
method names are case-sensitive and thus implementations SHOULD NOT
modify the given string.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST retur... | [
"Return",
"an",
"instance",
"with",
"the",
"provided",
"HTTP",
"method",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L355-L361 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withUri | public function withUri(UriInterface $uri, $preserveHost = false)
{
$previousRequest = $this->previousRequest->withUri($uri, $preserveHost);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withUri(UriInterface $uri, $preserveHost = false)
{
$previousRequest = $this->previousRequest->withUri($uri, $preserveHost);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withUri",
"(",
"UriInterface",
"$",
"uri",
",",
"$",
"preserveHost",
"=",
"false",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withUri",
"(",
"$",
"uri",
",",
"$",
"preserveHost",
")",
";",
"... | Returns an instance with the provided URI.
This method MUST update the Host header of the returned request by
default if the URI contains a host component. If the URI does not
contain a host component, any pre-existing Host header MUST be carried
over to the returned request.
You can opt-in to preserving the original... | [
"Returns",
"an",
"instance",
"with",
"the",
"provided",
"URI",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L407-L413 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withCookieParams | public function withCookieParams(array $cookies)
{
$previousRequest = $this->previousRequest->withCookieParams($cookies);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withCookieParams(array $cookies)
{
$previousRequest = $this->previousRequest->withCookieParams($cookies);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withCookieParams",
"(",
"array",
"$",
"cookies",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withCookieParams",
"(",
"$",
"cookies",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$... | Return an instance with the specified cookies.
The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST
be compatible with the structure of $_COOKIE. Typically, this data will
be injected at instantiation.
This method MUST NOT update the related Cookie header of the request
instance, nor related value... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"cookies",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L461-L467 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withQueryParams | public function withQueryParams(array $query)
{
$previousRequest = $this->previousRequest->withQueryParams($query);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withQueryParams(array $query)
{
$previousRequest = $this->previousRequest->withQueryParams($query);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withQueryParams",
"(",
"array",
"$",
"query",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withQueryParams",
"(",
"$",
"query",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"... | Return an instance with the specified query string arguments.
These values SHOULD remain immutable over the course of the incoming
request. They MAY be injected during instantiation, such as from PHP's
$_GET superglobal, or MAY be derived from some other value such as the
URI. In cases where the arguments are parsed f... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"query",
"string",
"arguments",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L508-L514 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withUploadedFiles | public function withUploadedFiles(array $uploadedFiles)
{
$previousRequest = $this->previousRequest->withUploadedFiles($uploadedFiles);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withUploadedFiles(array $uploadedFiles)
{
$previousRequest = $this->previousRequest->withUploadedFiles($uploadedFiles);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withUploadedFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withUploadedFiles",
"(",
"$",
"uploadedFiles",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this... | Create a new instance with the specified uploaded files.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
updated body parameters.
@param array $uploadedFiles an array tree of UploadedFileInterface instances
@throws \InvalidArgumentEx... | [
"Create",
"a",
"new",
"instance",
"with",
"the",
"specified",
"uploaded",
"files",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L544-L550 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withParsedBody | public function withParsedBody($data)
{
$previousRequest = $this->previousRequest->withParsedBody($data);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withParsedBody($data)
{
$previousRequest = $this->previousRequest->withParsedBody($data);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withParsedBody",
"(",
"$",
"data",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withParsedBody",
"(",
"$",
"data",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"request",
"->... | Return an instance with the specified body parameters.
These MAY be injected during instantiation.
If the request Content-Type is either application/x-www-form-urlencoded
or multipart/form-data, and the request method is POST, use this method
ONLY to inject the contents of $_POST.
The data IS NOT REQUIRED to come fr... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"body",
"parameters",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L600-L606 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withAttribute | public function withAttribute($name, $value)
{
$previousRequest = $this->previousRequest->withAttribute($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withAttribute($name, $value)
{
$previousRequest = $this->previousRequest->withAttribute($name, $value);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withAttribute",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withAttribute",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"$",
"request",
"=",
"clone",
... | Return an instance with the specified derived request attribute.
This method allows setting a single derived request attribute as
described in getAttributes().
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
updated attribute.
@see ... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"derived",
"request",
"attribute",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L659-L665 |
ixocreate/application | src/Http/Request/AbstractRequestWrapper.php | AbstractRequestWrapper.withoutAttribute | public function withoutAttribute($name)
{
$previousRequest = $this->previousRequest->withoutAttribute($name);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | php | public function withoutAttribute($name)
{
$previousRequest = $this->previousRequest->withoutAttribute($name);
$request = clone $this;
$request->previousRequest = $previousRequest;
return $request;
} | [
"public",
"function",
"withoutAttribute",
"(",
"$",
"name",
")",
"{",
"$",
"previousRequest",
"=",
"$",
"this",
"->",
"previousRequest",
"->",
"withoutAttribute",
"(",
"$",
"name",
")",
";",
"$",
"request",
"=",
"clone",
"$",
"this",
";",
"$",
"request",
... | Return an instance that removes the specified derived request attribute.
This method allows removing a single derived request attribute as
described in getAttributes().
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that removes
the attribute.
... | [
"Return",
"an",
"instance",
"that",
"removes",
"the",
"specified",
"derived",
"request",
"attribute",
"."
] | train | https://github.com/ixocreate/application/blob/6b0ef355ecf96af63d0dd5b901b4c9a5a69daf05/src/Http/Request/AbstractRequestWrapper.php#L681-L687 |
yuncms/framework | src/user/models/RegistrationForm.php | RegistrationForm.register | public function register()
{
if (!$this->validate()) {
return false;
}
/** @var User $user */
$user = new User();
$user->setScenario(User::SCENARIO_EMAIL_REGISTER);
$this->loadAttributes($user);
if (!$user->register()) {
return false;
... | php | public function register()
{
if (!$this->validate()) {
return false;
}
/** @var User $user */
$user = new User();
$user->setScenario(User::SCENARIO_EMAIL_REGISTER);
$this->loadAttributes($user);
if (!$user->register()) {
return false;
... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"/** @var User $user */",
"$",
"user",
"=",
"new",
"User",
"(",
")",
";",
"$",
"user",
"->",
"setScenario... | Registers a new user account. If registration was successful it will set flash message.
@return boolean | [
"Registers",
"a",
"new",
"user",
"account",
".",
"If",
"registration",
"was",
"successful",
"it",
"will",
"set",
"flash",
"message",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/models/RegistrationForm.php#L106-L121 |
matks/MarkdownBlogBundle | DependencyInjection/MarkdownBlogExtension.php | MarkdownBlogExtension.injectBundleConfigurationParametersIntoContainer | private function injectBundleConfigurationParametersIntoContainer(
ContainerBuilder $container,
array $bundleConfiguration)
{
$parametersToInject = [
'posts_directory',
];
foreach ($parametersToInject as $parameter) {
if (false === array_key_exists($p... | php | private function injectBundleConfigurationParametersIntoContainer(
ContainerBuilder $container,
array $bundleConfiguration)
{
$parametersToInject = [
'posts_directory',
];
foreach ($parametersToInject as $parameter) {
if (false === array_key_exists($p... | [
"private",
"function",
"injectBundleConfigurationParametersIntoContainer",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"bundleConfiguration",
")",
"{",
"$",
"parametersToInject",
"=",
"[",
"'posts_directory'",
",",
"]",
";",
"foreach",
"(",
"$",
"par... | @param ContainerBuilder $container
@param array $bundleConfiguration
@throws \RuntimeException | [
"@param",
"ContainerBuilder",
"$container",
"@param",
"array",
"$bundleConfiguration"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/DependencyInjection/MarkdownBlogExtension.php#L32-L49 |
xinix-technology/norm | src/Norm/Connection/PDOConnection.php | PDOConnection.query | public function query($collection, array $criteria = null)
{
$collection = $this->factory($collection);
if (!empty($this->options['autocreate'])) {
$this->dialect->prepareCollection($collection, $criteria);
}
return new PDOCursor($collection, $criteria);
} | php | public function query($collection, array $criteria = null)
{
$collection = $this->factory($collection);
if (!empty($this->options['autocreate'])) {
$this->dialect->prepareCollection($collection, $criteria);
}
return new PDOCursor($collection, $criteria);
} | [
"public",
"function",
"query",
"(",
"$",
"collection",
",",
"array",
"$",
"criteria",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"factory",
"(",
"$",
"collection",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"o... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/PDOConnection.php#L132-L141 |
xinix-technology/norm | src/Norm/Connection/PDOConnection.php | PDOConnection.remove | public function remove($collection, $criteria = null)
{
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
$collection = static::factory($collection);
}
$this->ddl($collection... | php | public function remove($collection, $criteria = null)
{
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
$collection = static::factory($collection);
}
$this->ddl($collection... | [
"public",
"function",
"remove",
"(",
"$",
"collection",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"collection",
"instanceof",
"Collection",
")",
"{",
"$",
"collectionName",
"=",
"$",
"collection",
"->",
"getName",
"(",
")",
";",
"}",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/PDOConnection.php#L146-L173 |
xinix-technology/norm | src/Norm/Connection/PDOConnection.php | PDOConnection.execute | protected function execute($sql, array $data = array())
{
$statement = $this->raw->prepare($sql);
return $statement->execute($data);
} | php | protected function execute($sql, array $data = array())
{
$statement = $this->raw->prepare($sql);
return $statement->execute($data);
} | [
"protected",
"function",
"execute",
"(",
"$",
"sql",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"raw",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"return",
"$",
"statement",
"->",
"execut... | Execute an sql
@param string $sql
@param array $data
@return bool | [
"Execute",
"an",
"sql"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/PDOConnection.php#L209-L214 |
xinix-technology/norm | src/Norm/Connection/PDOConnection.php | PDOConnection.marshall | public function marshall($object)
{
if (is_array($object)) {
$result = array();
foreach ($object as $key => $value) {
if ($key[0] === '$') {
if ($key === '$id' || $key === '$type') {
continue;
}
... | php | public function marshall($object)
{
if (is_array($object)) {
$result = array();
foreach ($object as $key => $value) {
if ($key[0] === '$') {
if ($key === '$id' || $key === '$type') {
continue;
}
... | [
"public",
"function",
"marshall",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"object",
")",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"object",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/PDOConnection.php#L219-L246 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Process/PcntlSignals.php | PcntlSignals.create | public static function create($install = true)
{
$instance = new PcntlSignals();
if ($install) {
$instance->install(self::getDefaultInstalledSignals());
}
return $instance;
} | php | public static function create($install = true)
{
$instance = new PcntlSignals();
if ($install) {
$instance->install(self::getDefaultInstalledSignals());
}
return $instance;
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"install",
"=",
"true",
")",
"{",
"$",
"instance",
"=",
"new",
"PcntlSignals",
"(",
")",
";",
"if",
"(",
"$",
"install",
")",
"{",
"$",
"instance",
"->",
"install",
"(",
"self",
"::",
"getDefaultInsta... | Factory method, can install default signals.
@param bool $install When true installs signals.
@return PcntlSignals | [
"Factory",
"method",
"can",
"install",
"default",
"signals",
"."
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Process/PcntlSignals.php#L32-L39 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Process/PcntlSignals.php | PcntlSignals.install | public function install(array $signals)
{
if (self::isSupported()) {
$callback = [$this, 'dispatchSignal'];
foreach ($signals as $signal) {
\pcntl_signal($signal, $callback);
}
};
} | php | public function install(array $signals)
{
if (self::isSupported()) {
$callback = [$this, 'dispatchSignal'];
foreach ($signals as $signal) {
\pcntl_signal($signal, $callback);
}
};
} | [
"public",
"function",
"install",
"(",
"array",
"$",
"signals",
")",
"{",
"if",
"(",
"self",
"::",
"isSupported",
"(",
")",
")",
"{",
"$",
"callback",
"=",
"[",
"$",
"this",
",",
"'dispatchSignal'",
"]",
";",
"foreach",
"(",
"$",
"signals",
"as",
"$",... | Installs selected signal
@param array $signals | [
"Installs",
"selected",
"signal"
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Process/PcntlSignals.php#L50-L58 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Process/PcntlSignals.php | PcntlSignals.handle | public function handle($signal, $handler, $namespace = self::DEFAULT_NAMESPACE)
{
if (empty($this->handlers[$signal])) {
$this->handlers[$signal] = [];
}
if (empty($this->handlers[$signal][$namespace])) {
$this->handlers[$signal][$namespace] = [];
}
... | php | public function handle($signal, $handler, $namespace = self::DEFAULT_NAMESPACE)
{
if (empty($this->handlers[$signal])) {
$this->handlers[$signal] = [];
}
if (empty($this->handlers[$signal][$namespace])) {
$this->handlers[$signal][$namespace] = [];
}
... | [
"public",
"function",
"handle",
"(",
"$",
"signal",
",",
"$",
"handler",
",",
"$",
"namespace",
"=",
"self",
"::",
"DEFAULT_NAMESPACE",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"signal",
"]",
")",
")",
"{",
"$",
"... | Registers handler for signal in selected namespace.
@param int $signal Signal id (\SIG* constants)
@param callable $handler Handler callback
@param string $namespace
@return $this | [
"Registers",
"handler",
"for",
"signal",
"in",
"selected",
"namespace",
"."
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Process/PcntlSignals.php#L67-L80 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Process/PcntlSignals.php | PcntlSignals.dispatchSignal | public function dispatchSignal($signal)
{
if (isset($this->handlers[$signal])) {
foreach ($this->handlers[$signal] as $namespaceHandlers) {
foreach ($namespaceHandlers as $handler) {
$handler();
}
}
}
return $this;
... | php | public function dispatchSignal($signal)
{
if (isset($this->handlers[$signal])) {
foreach ($this->handlers[$signal] as $namespaceHandlers) {
foreach ($namespaceHandlers as $handler) {
$handler();
}
}
}
return $this;
... | [
"public",
"function",
"dispatchSignal",
"(",
"$",
"signal",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"signal",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"signal",
"]",
"as",
"$",... | Dispatch signal on registered handlers.
@param int $signal
@return $this | [
"Dispatch",
"signal",
"on",
"registered",
"handlers",
"."
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Process/PcntlSignals.php#L87-L98 |
SachaMorard/phalcon-console | Library/Phalcon/Commands/Builtin/Info.php | Info.run | public function run(array $parameters)
{
$info = new SystemInfo();
printf("%s:\n", Color::head('Environment:'));
foreach ($info->getEnvironment() as $k => $v) {
printf(" %s: %s\n", $k, $v);
}
printf("%s:\n", Color::head('Versions:'));
foreach ($info->ge... | php | public function run(array $parameters)
{
$info = new SystemInfo();
printf("%s:\n", Color::head('Environment:'));
foreach ($info->getEnvironment() as $k => $v) {
printf(" %s: %s\n", $k, $v);
}
printf("%s:\n", Color::head('Versions:'));
foreach ($info->ge... | [
"public",
"function",
"run",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"info",
"=",
"new",
"SystemInfo",
"(",
")",
";",
"printf",
"(",
"\"%s:\\n\"",
",",
"Color",
"::",
"head",
"(",
"'Environment:'",
")",
")",
";",
"foreach",
"(",
"$",
"info",
... | {@inheritdoc}
@param array $parameters
@return mixed | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Builtin/Info.php#L53-L70 |
SachaMorard/phalcon-console-migration | Library/Phalcon/Migrations/MigrationScript.php | MigrationScript.batchInsert | public function batchInsert(\Phalcon\Db\Adapter $connection, $tableName, $fields)
{
$migrationData = $this->migrationsDir . '/' . $this->version . '/' . $tableName . '.dat';
if (file_exists($migrationData)) {
$connection->begin();
$batchHandler = fopen($migrationData, 'r');
... | php | public function batchInsert(\Phalcon\Db\Adapter $connection, $tableName, $fields)
{
$migrationData = $this->migrationsDir . '/' . $this->version . '/' . $tableName . '.dat';
if (file_exists($migrationData)) {
$connection->begin();
$batchHandler = fopen($migrationData, 'r');
... | [
"public",
"function",
"batchInsert",
"(",
"\\",
"Phalcon",
"\\",
"Db",
"\\",
"Adapter",
"$",
"connection",
",",
"$",
"tableName",
",",
"$",
"fields",
")",
"{",
"$",
"migrationData",
"=",
"$",
"this",
"->",
"migrationsDir",
".",
"'/'",
".",
"$",
"this",
... | Inserts data from a data migration file in a table
@param string $tableName
@param string $fields | [
"Inserts",
"data",
"from",
"a",
"data",
"migration",
"file",
"in",
"a",
"table"
] | train | https://github.com/SachaMorard/phalcon-console-migration/blob/6b79ecb04f3790844eae04d33e3489a98f4f1214/Library/Phalcon/Migrations/MigrationScript.php#L103-L116 |
shiftio/safestream-php-sdk | src/Watermark/WatermarkClient.php | WatermarkClient.create | public function create($videoKey, $watermarkConfiguration, $timeout = 90000) {
$this->validateVideoKey($videoKey);
$this->validateWatermarkConfiguration($watermarkConfiguration);
$this->validateTimeout($timeout);
$config = is_array($watermarkConfiguration) ? $watermarkConfiguration : ar... | php | public function create($videoKey, $watermarkConfiguration, $timeout = 90000) {
$this->validateVideoKey($videoKey);
$this->validateWatermarkConfiguration($watermarkConfiguration);
$this->validateTimeout($timeout);
$config = is_array($watermarkConfiguration) ? $watermarkConfiguration : ar... | [
"public",
"function",
"create",
"(",
"$",
"videoKey",
",",
"$",
"watermarkConfiguration",
",",
"$",
"timeout",
"=",
"90000",
")",
"{",
"$",
"this",
"->",
"validateVideoKey",
"(",
"$",
"videoKey",
")",
";",
"$",
"this",
"->",
"validateWatermarkConfiguration",
... | Watermarks a video
@param $videoKey
The unique key for the video to watermark. The key is a property on the video
defined at ingest time. @see http://docs.safestream.com/docs/video
@param $watermarkConfiguration
A single configuration object OR an array of configuration object
@see WatermarkConfiguration
@param int $t... | [
"Watermarks",
"a",
"video"
] | train | https://github.com/shiftio/safestream-php-sdk/blob/1957cd5574725b24da1bbff9059aa30a9ca123c2/src/Watermark/WatermarkClient.php#L88-L97 |
shiftio/safestream-php-sdk | src/Watermark/WatermarkClient.php | WatermarkClient.createFromTemplate | public function createFromTemplate($videoKey, $templateId, $templateMapping, $timeout = 90000) {
$payload = array("key" => $videoKey, "settingsTemplateMapping" => array( "id" => $templateId, "mappings" => $templateMapping ));
return $this->createAPI($payload, $timeout);
} | php | public function createFromTemplate($videoKey, $templateId, $templateMapping, $timeout = 90000) {
$payload = array("key" => $videoKey, "settingsTemplateMapping" => array( "id" => $templateId, "mappings" => $templateMapping ));
return $this->createAPI($payload, $timeout);
} | [
"public",
"function",
"createFromTemplate",
"(",
"$",
"videoKey",
",",
"$",
"templateId",
",",
"$",
"templateMapping",
",",
"$",
"timeout",
"=",
"90000",
")",
"{",
"$",
"payload",
"=",
"array",
"(",
"\"key\"",
"=>",
"$",
"videoKey",
",",
"\"settingsTemplateM... | Watermarks a video from an existing watermark template.
For more on watermark templates @see Watermark\Template\Template
@param $videoKey
The unique key for the video to watermark. The key is a property on the video
defined at ingest time. @see http://docs.safestream.com/docs/video
@param $templateId
@param $templateM... | [
"Watermarks",
"a",
"video",
"from",
"an",
"existing",
"watermark",
"template",
".",
"For",
"more",
"on",
"watermark",
"templates",
"@see",
"Watermark",
"\\",
"Template",
"\\",
"Template"
] | train | https://github.com/shiftio/safestream-php-sdk/blob/1957cd5574725b24da1bbff9059aa30a9ca123c2/src/Watermark/WatermarkClient.php#L115-L118 |
webforge-labs/psc-cms | lib/Psc/PHPExcel/Exporter.php | Exporter.createSheet | protected function createSheet($name) {
$name = \Psc\PHPExcel\Helper::sanitizeSheetTitle($name);
$this->excel->addSheet(new PHPExcel_Worksheet($this->excel, $name));
$this->excel->setActiveSheetIndexByName($name);
$this->sheet = $this->excel->getActiveSheet();
$this->setRow(1);
} | php | protected function createSheet($name) {
$name = \Psc\PHPExcel\Helper::sanitizeSheetTitle($name);
$this->excel->addSheet(new PHPExcel_Worksheet($this->excel, $name));
$this->excel->setActiveSheetIndexByName($name);
$this->sheet = $this->excel->getActiveSheet();
$this->setRow(1);
} | [
"protected",
"function",
"createSheet",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"\\",
"Psc",
"\\",
"PHPExcel",
"\\",
"Helper",
"::",
"sanitizeSheetTitle",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"excel",
"->",
"addSheet",
"(",
"new",
"PHPE... | Setzt this->sheet auf das gerade erstellte Sheet
und die Row auf Zeile 1 | [
"Setzt",
"this",
"-",
">",
"sheet",
"auf",
"das",
"gerade",
"erstellte",
"Sheet",
"und",
"die",
"Row",
"auf",
"Zeile",
"1"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PHPExcel/Exporter.php#L79-L86 |
webforge-labs/psc-cms | lib/Psc/PHPExcel/Exporter.php | Exporter.styleColumn | public function styleColumn($char, Array $style) {
$this->sheet->getStyle($char.'1:'.$char.max(2,$this->row->getRowIndex()))
->applyFromArray($style);
} | php | public function styleColumn($char, Array $style) {
$this->sheet->getStyle($char.'1:'.$char.max(2,$this->row->getRowIndex()))
->applyFromArray($style);
} | [
"public",
"function",
"styleColumn",
"(",
"$",
"char",
",",
"Array",
"$",
"style",
")",
"{",
"$",
"this",
"->",
"sheet",
"->",
"getStyle",
"(",
"$",
"char",
".",
"'1:'",
".",
"$",
"char",
".",
"max",
"(",
"2",
",",
"$",
"this",
"->",
"row",
"->",... | Sollte erst nach create() ausgeführt werden | [
"Sollte",
"erst",
"nach",
"create",
"()",
"ausgeführt",
"werden"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PHPExcel/Exporter.php#L167-L170 |
uzulla/mock_slim_client | lib/Uzulla/MockSlimClient.php | MockSlimClient.req_dom | public function req_dom($path = '/', $method = 'GET', $input='',$option = [])
{
$html = $this->req($path, $method, $input, $option);
$dom = new \PHPHtmlParser\Dom;
$dom->load($html);
return $dom;
} | php | public function req_dom($path = '/', $method = 'GET', $input='',$option = [])
{
$html = $this->req($path, $method, $input, $option);
$dom = new \PHPHtmlParser\Dom;
$dom->load($html);
return $dom;
} | [
"public",
"function",
"req_dom",
"(",
"$",
"path",
"=",
"'/'",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"input",
"=",
"''",
",",
"$",
"option",
"=",
"[",
"]",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"req",
"(",
"$",
"path",
",",
"$"... | get PHPHtmlParser\Dom instance by req() response. | [
"get",
"PHPHtmlParser",
"\\",
"Dom",
"instance",
"by",
"req",
"()",
"response",
"."
] | train | https://github.com/uzulla/mock_slim_client/blob/1485c2417aa45f010f0143b842e710adf8fdc769/lib/Uzulla/MockSlimClient.php#L24-L31 |
uzulla/mock_slim_client | lib/Uzulla/MockSlimClient.php | MockSlimClient.req | public function req($path = '/', $method = 'GET', $input='',$option = [])
{
// $app->post() が $_POSTにfallbackするので対応
$_POST_OLD = [];
if ($method==='POST') {
$_POST_OLD = $_POST;
parse_str($input, $_POST);
}
// create slim mock with settings.
\... | php | public function req($path = '/', $method = 'GET', $input='',$option = [])
{
// $app->post() が $_POSTにfallbackするので対応
$_POST_OLD = [];
if ($method==='POST') {
$_POST_OLD = $_POST;
parse_str($input, $_POST);
}
// create slim mock with settings.
\... | [
"public",
"function",
"req",
"(",
"$",
"path",
"=",
"'/'",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"input",
"=",
"''",
",",
"$",
"option",
"=",
"[",
"]",
")",
"{",
"// $app->post() が $_POSTにfallbackするので対応",
"$",
"_POST_OLD",
"=",
"[",
"]",
";",
"... | make vitrual http request. return html(of raw body). | [
"make",
"vitrual",
"http",
"request",
".",
"return",
"html",
"(",
"of",
"raw",
"body",
")",
"."
] | train | https://github.com/uzulla/mock_slim_client/blob/1485c2417aa45f010f0143b842e710adf8fdc769/lib/Uzulla/MockSlimClient.php#L34-L80 |
iamapen/dbunit-ExcelFriendlyDataSet | src/lib/Iamapen/ExcelFriendlyDataSet/Database/DataSet/ExcelCsvDataSet.php | ExcelCsvDataSet.addTable | public function addTable($tableName, $csvFile)
{
if (!is_file($csvFile)) {
throw new \InvalidArgumentException("Could not find csv file: {$csvFile}");
}
if (!is_readable($csvFile)) {
throw new \InvalidArgumentException("Could not read csv file: {$csvFile}");
... | php | public function addTable($tableName, $csvFile)
{
if (!is_file($csvFile)) {
throw new \InvalidArgumentException("Could not find csv file: {$csvFile}");
}
if (!is_readable($csvFile)) {
throw new \InvalidArgumentException("Could not read csv file: {$csvFile}");
... | [
"public",
"function",
"addTable",
"(",
"$",
"tableName",
",",
"$",
"csvFile",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"csvFile",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Could not find csv file: {$csvFile}\"",
")",
";",
... | Adds a table to the dataset
The table will be given the passed name. $csvFile should be a path to
a valid csv file (based on the arguments passed to the constructor.)
@param string $tableName
@param string $csvFile | [
"Adds",
"a",
"table",
"to",
"the",
"dataset"
] | train | https://github.com/iamapen/dbunit-ExcelFriendlyDataSet/blob/036103cb2a2a75608f0a00448301cd3f4a5c4e19/src/lib/Iamapen/ExcelFriendlyDataSet/Database/DataSet/ExcelCsvDataSet.php#L44-L78 |
2amigos/yiifoundation | widgets/Clearing.php | Clearing.init | public function init()
{
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.clearing.js' : 'foundation.min.js'
);
Html::addCssClass($this->htmlOptions, Enum::CLEARING_THUMBS);
ArrayHelper::addValue('data-clearing', 'data-clearing', $this->htmlOptions);
... | php | public function init()
{
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.clearing.js' : 'foundation.min.js'
);
Html::addCssClass($this->htmlOptions, Enum::CLEARING_THUMBS);
ArrayHelper::addValue('data-clearing', 'data-clearing', $this->htmlOptions);
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"assets",
"=",
"array",
"(",
"'js'",
"=>",
"YII_DEBUG",
"?",
"'foundation/foundation.clearing.js'",
":",
"'foundation.min.js'",
")",
";",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",
"ht... | Initializes the widget | [
"Initializes",
"the",
"widget"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Clearing.php#L45-L53 |
2amigos/yiifoundation | widgets/Clearing.php | Clearing.renderClearing | public function renderClearing()
{
if (empty($this->items)) {
return true;
}
$list = array();
foreach ($this->items as $item) {
$list[] = $this->renderItem($item);
}
return \CHtml::tag('ul', $this->htmlOptions, implode("\n", $list));
} | php | public function renderClearing()
{
if (empty($this->items)) {
return true;
}
$list = array();
foreach ($this->items as $item) {
$list[] = $this->renderItem($item);
}
return \CHtml::tag('ul', $this->htmlOptions, implode("\n", $list));
} | [
"public",
"function",
"renderClearing",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"items",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$"... | Renders the clearing widget
@return bool|string the resulting element | [
"Renders",
"the",
"clearing",
"widget"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Clearing.php#L67-L77 |
2amigos/yiifoundation | widgets/Clearing.php | Clearing.renderItem | public function renderItem($item)
{
$options = ArrayHelper::getValue($item, 'options', array());
if (isset($item['featured'])) {
Html::addCssClass($this->htmlOptions, Enum::ClEARING_FEATURE);
Html::addCssClass($options, Enum::CLEARING_FEATURE_IMG);
}
$imgOptio... | php | public function renderItem($item)
{
$options = ArrayHelper::getValue($item, 'options', array());
if (isset($item['featured'])) {
Html::addCssClass($this->htmlOptions, Enum::ClEARING_FEATURE);
Html::addCssClass($options, Enum::CLEARING_FEATURE_IMG);
}
$imgOptio... | [
"public",
"function",
"renderItem",
"(",
"$",
"item",
")",
"{",
"$",
"options",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"item",
",",
"'options'",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"'featured'",
"]",
... | Renders a clearing (lightbox) item
@param array $item
@return string the resulting LI tag item | [
"Renders",
"a",
"clearing",
"(",
"lightbox",
")",
"item"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Clearing.php#L84-L99 |
kevintweber/phpunit-markup-validators | src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php | AssertHTML5.isValidMarkup | public static function isValidMarkup($html,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $html is a string.
if (empty($html) || !is_string($html)) {
throw \PHPUnit_Util_InvalidArgume... | php | public static function isValidMarkup($html,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $html is a string.
if (empty($html) || !is_string($html)) {
throw \PHPUnit_Util_InvalidArgume... | [
"public",
"static",
"function",
"isValidMarkup",
"(",
"$",
"html",
",",
"$",
"message",
"=",
"''",
",",
"ConnectorInterface",
"$",
"connector",
"=",
"null",
")",
"{",
"// Check that $html is a string.",
"if",
"(",
"empty",
"(",
"$",
"html",
")",
"||",
"!",
... | Asserts that the HTML5 string is valid.
@param string $html The markup to be validated.
@param string $message Test message.
@param ConnectorInterface $connector Connector to HTML5 validation service. | [
"Asserts",
"that",
"the",
"HTML5",
"string",
"is",
"valid",
"."
] | train | https://github.com/kevintweber/phpunit-markup-validators/blob/bee48f48c7c1c9e811d1a4bedeca8f413d049cb3/src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php#L27-L48 |
kevintweber/phpunit-markup-validators | src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php | AssertHTML5.isValidFile | public static function isValidFile($path,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $path is exists.
if (!file_exists($path)) {
throw new \PHPUnit_Framework_Exception(
... | php | public static function isValidFile($path,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $path is exists.
if (!file_exists($path)) {
throw new \PHPUnit_Framework_Exception(
... | [
"public",
"static",
"function",
"isValidFile",
"(",
"$",
"path",
",",
"$",
"message",
"=",
"''",
",",
"ConnectorInterface",
"$",
"connector",
"=",
"null",
")",
"{",
"// Check that $path is exists.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
... | Asserts that the HTML5 file is valid.
@param string $path The file path to be validated.
@param string $message Test message.
@param ConnectorInterface $connector Connector to HTML5 validation service. | [
"Asserts",
"that",
"the",
"HTML5",
"file",
"is",
"valid",
"."
] | train | https://github.com/kevintweber/phpunit-markup-validators/blob/bee48f48c7c1c9e811d1a4bedeca8f413d049cb3/src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php#L57-L88 |
kevintweber/phpunit-markup-validators | src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php | AssertHTML5.isValidURL | public static function isValidURL($url,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $url is a string.
if (empty($url) || !is_string($url)) {
throw \PHPUnit_Util_InvalidArgumentHelper::fac... | php | public static function isValidURL($url,
$message = '',
ConnectorInterface $connector = null)
{
// Check that $url is a string.
if (empty($url) || !is_string($url)) {
throw \PHPUnit_Util_InvalidArgumentHelper::fac... | [
"public",
"static",
"function",
"isValidURL",
"(",
"$",
"url",
",",
"$",
"message",
"=",
"''",
",",
"ConnectorInterface",
"$",
"connector",
"=",
"null",
")",
"{",
"// Check that $url is a string.",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
"||",
"!",
"is_s... | Asserts that the HTML5 url is valid.
@param string $url The external url to be validated.
@param string $message Test message.
@param ConnectorInterface $connector Connector to HTML5 validation service. | [
"Asserts",
"that",
"the",
"HTML5",
"url",
"is",
"valid",
"."
] | train | https://github.com/kevintweber/phpunit-markup-validators/blob/bee48f48c7c1c9e811d1a4bedeca8f413d049cb3/src/Kevintweber/PhpunitMarkupValidators/Assert/AssertHTML5.php#L97-L123 |
krzysztofmazur/ntp-client | src/Impl/CompositeNtpClient.php | CompositeNtpClient.getUnixTime | public function getUnixTime(): int
{
foreach ($this->clients as $client) {
try {
return $client->getUnixTime();
} catch (ConnectionException $e) {
//do nothing
}
}
throw new UnableToConnectException("Unable connect to any s... | php | public function getUnixTime(): int
{
foreach ($this->clients as $client) {
try {
return $client->getUnixTime();
} catch (ConnectionException $e) {
//do nothing
}
}
throw new UnableToConnectException("Unable connect to any s... | [
"public",
"function",
"getUnixTime",
"(",
")",
":",
"int",
"{",
"foreach",
"(",
"$",
"this",
"->",
"clients",
"as",
"$",
"client",
")",
"{",
"try",
"{",
"return",
"$",
"client",
"->",
"getUnixTime",
"(",
")",
";",
"}",
"catch",
"(",
"ConnectionExceptio... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/ntp-client/blob/3e15ce8ee26d6e2e57a8bdbdf67273762e3fbfd2/src/Impl/CompositeNtpClient.php#L46-L57 |
krzysztofmazur/ntp-client | src/Impl/CompositeNtpClient.php | CompositeNtpClient.getTime | public function getTime(\DateTimeZone $timezone = null): \DateTime
{
return DateTimeConverter::createFromUnixTimestamp($this->getUnixTime(), $timezone);
} | php | public function getTime(\DateTimeZone $timezone = null): \DateTime
{
return DateTimeConverter::createFromUnixTimestamp($this->getUnixTime(), $timezone);
} | [
"public",
"function",
"getTime",
"(",
"\\",
"DateTimeZone",
"$",
"timezone",
"=",
"null",
")",
":",
"\\",
"DateTime",
"{",
"return",
"DateTimeConverter",
"::",
"createFromUnixTimestamp",
"(",
"$",
"this",
"->",
"getUnixTime",
"(",
")",
",",
"$",
"timezone",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/ntp-client/blob/3e15ce8ee26d6e2e57a8bdbdf67273762e3fbfd2/src/Impl/CompositeNtpClient.php#L62-L65 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof RemoteAppQuery) {
return $criteria;
}
$query = new RemoteAppQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof RemoteAppQuery) {
return $criteria;
}
$query = new RemoteAppQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"RemoteAppQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"n... | Returns a new RemoteAppQuery object.
@param string $modelAlias The alias of a model in the query
@param RemoteAppQuery|Criteria $criteria Optional Criteria to build the query from
@return RemoteAppQuery | [
"Returns",
"a",
"new",
"RemoteAppQuery",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L173-L185 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.findPkComplex | protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter... | php | protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter... | [
"protected",
"function",
"findPkComplex",
"(",
"$",
"key",
",",
"$",
"con",
")",
"{",
"// As the query uses a PK condition, no limit(1) is necessary.",
"$",
"criteria",
"=",
"$",
"this",
"->",
"isKeepQuery",
"(",
")",
"?",
"clone",
"$",
"this",
":",
"$",
"this",... | Find object by primary key.
@param mixed $key Primary key to use for the query
@param PropelPDO $con A connection object
@return RemoteApp|RemoteApp[]|mixed the result, formatted by the current formatter | [
"Find",
"object",
"by",
"primary",
"key",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L277-L286 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.findPks | public function findPks($keys, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filt... | php | public function findPks($keys, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filt... | [
"public",
"function",
"findPks",
"(",
"$",
"keys",
",",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Prop... | Find objects by primary key
<code>
$objs = $c->findPks(array(12, 56, 832), $con);
</code>
@param array $keys Primary keys to use for the query
@param PropelPDO $con an optional connection object
@return PropelObjectCollection|RemoteApp[]|mixed the list of results, formatted by the current formatter | [
"Find",
"objects",
"by",
"primary",
"key",
"<code",
">",
"$objs",
"=",
"$c",
"-",
">",
"findPks",
"(",
"array",
"(",
"12",
"56",
"832",
")",
"$con",
")",
";",
"<",
"/",
"code",
">",
"@param",
"array",
"$keys",
"Primary",
"keys",
"to",
"use",
"for",... | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L298-L310 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiUrl | public function filterByApiUrl($apiUrl = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiUrl)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiUrl)) {
$apiUrl = str_replace('*', '%', $apiUrl);
... | php | public function filterByApiUrl($apiUrl = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiUrl)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiUrl)) {
$apiUrl = str_replace('*', '%', $apiUrl);
... | [
"public",
"function",
"filterByApiUrl",
"(",
"$",
"apiUrl",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiUrl",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the api_url column
Example usage:
<code>
$query->filterByApiUrl('fooValue'); // WHERE api_url = 'fooValue'
$query->filterByApiUrl('%fooValue%'); // WHERE api_url LIKE '%fooValue%'
</code>
@param string $apiUrl The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"api_url",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L482-L494 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthHttpUser | public function filterByApiAuthHttpUser($apiAuthHttpUser = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthHttpUser)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthHttpUser)) {
$apiAuthHttpUser = st... | php | public function filterByApiAuthHttpUser($apiAuthHttpUser = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthHttpUser)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthHttpUser)) {
$apiAuthHttpUser = st... | [
"public",
"function",
"filterByApiAuthHttpUser",
"(",
"$",
"apiAuthHttpUser",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthHttpUser",
")",
")",
... | Filter the query on the api_auth_http_user column
Example usage:
<code>
$query->filterByApiAuthHttpUser('fooValue'); // WHERE api_auth_http_user = 'fooValue'
$query->filterByApiAuthHttpUser('%fooValue%'); // WHERE api_auth_http_user LIKE '%fooValue%'
</code>
@param string $apiAuthHttpUser The value to use as fi... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_http_user",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L511-L523 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthHttpPassword | public function filterByApiAuthHttpPassword($apiAuthHttpPassword = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthHttpPassword)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthHttpPassword)) {
$apiA... | php | public function filterByApiAuthHttpPassword($apiAuthHttpPassword = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthHttpPassword)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthHttpPassword)) {
$apiA... | [
"public",
"function",
"filterByApiAuthHttpPassword",
"(",
"$",
"apiAuthHttpPassword",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthHttpPassword",
"... | Filter the query on the api_auth_http_password column
Example usage:
<code>
$query->filterByApiAuthHttpPassword('fooValue'); // WHERE api_auth_http_password = 'fooValue'
$query->filterByApiAuthHttpPassword('%fooValue%'); // WHERE api_auth_http_password LIKE '%fooValue%'
</code>
@param string $apiAuthHttpPasswor... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_http_password",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L540-L552 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthType | public function filterByApiAuthType($apiAuthType = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthType)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthType)) {
$apiAuthType = str_replace('*', '%', ... | php | public function filterByApiAuthType($apiAuthType = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthType)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthType)) {
$apiAuthType = str_replace('*', '%', ... | [
"public",
"function",
"filterByApiAuthType",
"(",
"$",
"apiAuthType",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthType",
")",
")",
"{",
"$",... | Filter the query on the api_auth_type column
Example usage:
<code>
$query->filterByApiAuthType('fooValue'); // WHERE api_auth_type = 'fooValue'
$query->filterByApiAuthType('%fooValue%'); // WHERE api_auth_type LIKE '%fooValue%'
</code>
@param string $apiAuthType The value to use as filter.
Accepts wildcards (* ... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_type",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L569-L581 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.