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
yuncms/framework
src/helpers/StringHelper.php
StringHelper.UUID
public static function UUID(): string { // $data = Yii::$app->security->generateRandomKey(16); // assert(strlen($data) == 16); // $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 // $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 // return vsp...
php
public static function UUID(): string { // $data = Yii::$app->security->generateRandomKey(16); // assert(strlen($data) == 16); // $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 // $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 // return vsp...
[ "public", "static", "function", "UUID", "(", ")", ":", "string", "{", "// $data = Yii::$app->security->generateRandomKey(16);", "// assert(strlen($data) == 16);", "// $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100", "// $data[8] = chr(ord($dat...
Generates a valid v4 UUID string. See [http://stackoverflow.com/a/2040279/684] @return string The UUID. @throws \Exception
[ "Generates", "a", "valid", "v4", "UUID", "string", ".", "See", "[", "http", ":", "//", "stackoverflow", ".", "com", "/", "a", "/", "2040279", "/", "684", "]" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/StringHelper.php#L914-L940
yuncms/framework
src/helpers/StringHelper.php
StringHelper.asciiCharMap
public static function asciiCharMap(): array { if (self::$_asciiCharMap !== null) { return self::$_asciiCharMap; } // Get the map from Stringy. self::$_asciiCharMap = (new Stringy(''))->getAsciiCharMap(); return self::$_asciiCharMap; }
php
public static function asciiCharMap(): array { if (self::$_asciiCharMap !== null) { return self::$_asciiCharMap; } // Get the map from Stringy. self::$_asciiCharMap = (new Stringy(''))->getAsciiCharMap(); return self::$_asciiCharMap; }
[ "public", "static", "function", "asciiCharMap", "(", ")", ":", "array", "{", "if", "(", "self", "::", "$", "_asciiCharMap", "!==", "null", ")", "{", "return", "self", "::", "$", "_asciiCharMap", ";", "}", "// Get the map from Stringy.", "self", "::", "$", ...
Returns ASCII character mappings, merging in any custom defined mappings from the 'customAsciiCharMappings' config setting. @return array The fully merged ASCII character mappings.
[ "Returns", "ASCII", "character", "mappings", "merging", "in", "any", "custom", "defined", "mappings", "from", "the", "customAsciiCharMappings", "config", "setting", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/StringHelper.php#L948-L958
yuncms/framework
src/helpers/StringHelper.php
StringHelper.convertToUtf8
public static function convertToUtf8(string $string): string { // If it's already a UTF8 string, just clean and return it if (static::isUtf8($string)) { return HtmlPurifier::cleanUtf8($string); } // Otherwise set HTMLPurifier to the actual string encoding $config...
php
public static function convertToUtf8(string $string): string { // If it's already a UTF8 string, just clean and return it if (static::isUtf8($string)) { return HtmlPurifier::cleanUtf8($string); } // Otherwise set HTMLPurifier to the actual string encoding $config...
[ "public", "static", "function", "convertToUtf8", "(", "string", "$", "string", ")", ":", "string", "{", "// If it's already a UTF8 string, just clean and return it", "if", "(", "static", "::", "isUtf8", "(", "$", "string", ")", ")", "{", "return", "HtmlPurifier", ...
Attempts to convert a string to UTF-8 and clean any non-valid UTF-8 characters. @param string $string @return string
[ "Attempts", "to", "convert", "a", "string", "to", "UTF", "-", "8", "and", "clean", "any", "non", "-", "valid", "UTF", "-", "8", "characters", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/StringHelper.php#L978-L1001
yuncms/framework
src/helpers/StringHelper.php
StringHelper.encodeMb4
public static function encodeMb4(string $string): string { // Does this string have any 4+ byte Unicode chars? if (max(array_map('ord', str_split($string))) >= 240) { $string = preg_replace_callback('/./u', function (array $match) { if (strlen($match[0]) >= 4) { ...
php
public static function encodeMb4(string $string): string { // Does this string have any 4+ byte Unicode chars? if (max(array_map('ord', str_split($string))) >= 240) { $string = preg_replace_callback('/./u', function (array $match) { if (strlen($match[0]) >= 4) { ...
[ "public", "static", "function", "encodeMb4", "(", "string", "$", "string", ")", ":", "string", "{", "// Does this string have any 4+ byte Unicode chars?", "if", "(", "max", "(", "array_map", "(", "'ord'", ",", "str_split", "(", "$", "string", ")", ")", ")", ">...
HTML-encodes any 4-byte UTF-8 characters. @param string $string The string @return string The string with converted 4-byte UTF-8 characters @see http://stackoverflow.com/a/16496730/1688568
[ "HTML", "-", "encodes", "any", "4", "-", "byte", "UTF", "-", "8", "characters", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/StringHelper.php#L1032-L1052
yuncms/framework
src/helpers/StringHelper.php
StringHelper._prepStringForCasing
private static function _prepStringForCasing(string $string, bool $lower = true, bool $removePunctuation = true): array { if ($lower) { // Make it lowercase $string = static::toLowerCase($string); } if ($removePunctuation) { $string = str_replace(['.', '_'...
php
private static function _prepStringForCasing(string $string, bool $lower = true, bool $removePunctuation = true): array { if ($lower) { // Make it lowercase $string = static::toLowerCase($string); } if ($removePunctuation) { $string = str_replace(['.', '_'...
[ "private", "static", "function", "_prepStringForCasing", "(", "string", "$", "string", ",", "bool", "$", "lower", "=", "true", ",", "bool", "$", "removePunctuation", "=", "true", ")", ":", "array", "{", "if", "(", "$", "lower", ")", "{", "// Make it lowerc...
Prepares a string for casing routines. @param string $string The string @param bool $lower @param bool $removePunctuation Whether punctuation marks should be removed (default is true) @return string[] The prepped words in the string @see toKebabCase() @see toCamelCase() @see toPascalCase() @see toSnakeCase()
[ "Prepares", "a", "string", "for", "casing", "routines", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/StringHelper.php#L1068-L1081
askupasoftware/amarkal
Extensions/WordPress/Admin/AdminPage.php
AdminPage.add_page
public function add_page( $config ) { foreach( $this->required_params() as $param ) { if( !isset( $config[$param] ) ) { throw new \RuntimeException( 'Missing required parameter "'.$param.'" for submenu' ); } } $this->config['submenu...
php
public function add_page( $config ) { foreach( $this->required_params() as $param ) { if( !isset( $config[$param] ) ) { throw new \RuntimeException( 'Missing required parameter "'.$param.'" for submenu' ); } } $this->config['submenu...
[ "public", "function", "add_page", "(", "$", "config", ")", "{", "foreach", "(", "$", "this", "->", "required_params", "(", ")", "as", "$", "param", ")", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "$", "param", "]", ")", ")", "{", "thr...
Add a page to this menu. If there is only one page set for this menu, no submenu will be created. If there is more than one page set for this menu, a submenu will automatically be created with all the pages of this menu. Possible options are: title: (Required) Submenu title AND submenu page title tag. capabilit...
[ "Add", "a", "page", "to", "this", "menu", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Admin/AdminPage.php#L64-L74
askupasoftware/amarkal
Extensions/WordPress/Admin/AdminPage.php
AdminPage.set_config
private function set_config( $config ) { if( !isset( $config['title'] ) ) { throw new \RuntimeException( 'Missing required parameter "title" for menu' ); } if( !isset( $config['slug'] ) || '' == $config['slug'] ) { $config['slug'] = \Amarkal\C...
php
private function set_config( $config ) { if( !isset( $config['title'] ) ) { throw new \RuntimeException( 'Missing required parameter "title" for menu' ); } if( !isset( $config['slug'] ) || '' == $config['slug'] ) { $config['slug'] = \Amarkal\C...
[ "private", "function", "set_config", "(", "$", "config", ")", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "'title'", "]", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Missing required parameter \"title\" for menu'", ")", ";", "}...
Set the configuration for this menu page. Validates that all the required parameters have been provided. Auto generates a slug if none was provided. @param mixed[] $config The configuraion. @throws \RuntimeException If one of the required options was not provided.
[ "Set", "the", "configuration", "for", "this", "menu", "page", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Admin/AdminPage.php#L124-L136
askupasoftware/amarkal
Extensions/WordPress/Admin/AdminPage.php
AdminPage.add_menu_page
public function add_menu_page() { extract( $this->config ); $icon .= '' != $class ? '" class="'.$class : ''; $icon .= array() != $style ? '" style="'.$this->array_to_css($style) : ''; $page = $this->config['submenu-pages'][0]; \add_menu_page( $title, ...
php
public function add_menu_page() { extract( $this->config ); $icon .= '' != $class ? '" class="'.$class : ''; $icon .= array() != $style ? '" style="'.$this->array_to_css($style) : ''; $page = $this->config['submenu-pages'][0]; \add_menu_page( $title, ...
[ "public", "function", "add_menu_page", "(", ")", "{", "extract", "(", "$", "this", "->", "config", ")", ";", "$", "icon", ".=", "''", "!=", "$", "class", "?", "'\" class=\"'", ".", "$", "class", ":", "''", ";", "$", "icon", ".=", "array", "(", ")",...
Add this page, and all it's submenus, to the admin sidebar. Internally used when the admin_menu action is called. This function is called by AdminPage::register().
[ "Add", "this", "page", "and", "all", "it", "s", "submenus", "to", "the", "admin", "sidebar", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Admin/AdminPage.php#L144-L165
askupasoftware/amarkal
Extensions/WordPress/Admin/AdminPage.php
AdminPage.array_to_css
private function array_to_css( array $rules ) { $css = ''; foreach( $rules as $rule => $value ) { $css .= $rule.':'.$value.';'; } return $css; }
php
private function array_to_css( array $rules ) { $css = ''; foreach( $rules as $rule => $value ) { $css .= $rule.':'.$value.';'; } return $css; }
[ "private", "function", "array_to_css", "(", "array", "$", "rules", ")", "{", "$", "css", "=", "''", ";", "foreach", "(", "$", "rules", "as", "$", "rule", "=>", "$", "value", ")", "{", "$", "css", ".=", "$", "rule", ".", "':'", ".", "$", "value", ...
Array to CSS. Converts an array of rule => value into proper CSS formatted rules. @param string[] $rules The CSS rules. @return string The CSS formatted string.
[ "Array", "to", "CSS", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Admin/AdminPage.php#L199-L207
milkyway-multimedia/ss-mwm-formfields
src/RecordMapField.php
RecordMapField.available_map_fields
public static function available_map_fields($class) { if (!in_array($class, self::config()->allowed_classes) || !\ClassInfo::exists($class)) return false; $available = \Config::inst()->get($class, 'public_fields') ? \Config::inst()->get($class, 'public_fields') : array_keys(singleton($class)->summaryFields());...
php
public static function available_map_fields($class) { if (!in_array($class, self::config()->allowed_classes) || !\ClassInfo::exists($class)) return false; $available = \Config::inst()->get($class, 'public_fields') ? \Config::inst()->get($class, 'public_fields') : array_keys(singleton($class)->summaryFields());...
[ "public", "static", "function", "available_map_fields", "(", "$", "class", ")", "{", "if", "(", "!", "in_array", "(", "$", "class", ",", "self", "::", "config", "(", ")", "->", "allowed_classes", ")", "||", "!", "\\", "ClassInfo", "::", "exists", "(", ...
Return an array of fields that can be mapped to a class name Looks for public_fields set via config, otherwise defaults to summary_fields @param string $class @return array|bool
[ "Return", "an", "array", "of", "fields", "that", "can", "be", "mapped", "to", "a", "class", "name", "Looks", "for", "public_fields", "set", "via", "config", "otherwise", "defaults", "to", "summary_fields" ]
train
https://github.com/milkyway-multimedia/ss-mwm-formfields/blob/b98d84d494c92d6881dcea50c9c8334e5f487e1d/src/RecordMapField.php#L66-L76
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.init
private static function init() { ob_start(); set_time_limit(0); ini_set('memory_limit', '256M'); ini_set('upload_max_filesize', '128M'); ini_set('post_max_size', '256M'); ini_set('max_input_time', '7200'); ini_set('max_execution_time', '0'); ini_set('expect.timeout', '7200'); ini_set('default_socket_...
php
private static function init() { ob_start(); set_time_limit(0); ini_set('memory_limit', '256M'); ini_set('upload_max_filesize', '128M'); ini_set('post_max_size', '256M'); ini_set('max_input_time', '7200'); ini_set('max_execution_time', '0'); ini_set('expect.timeout', '7200'); ini_set('default_socket_...
[ "private", "static", "function", "init", "(", ")", "{", "ob_start", "(", ")", ";", "set_time_limit", "(", "0", ")", ";", "ini_set", "(", "'memory_limit'", ",", "'256M'", ")", ";", "ini_set", "(", "'upload_max_filesize'", ",", "'128M'", ")", ";", "ini_set",...
function will attempt to alocate more resources to run the sync
[ "function", "will", "attempt", "to", "alocate", "more", "resources", "to", "run", "the", "sync" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L42-L54
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.initData
public static function initData($syncid, $action) { if ($syncid) { //clear sync in progress catch in case we manually stopped the sync so that the sync will continue self::changeStatus($syncid, 0); } $syncdata = new Registry(); $syncdata->set('completed', false); $syncdata->set('sync_errors', 0); $...
php
public static function initData($syncid, $action) { if ($syncid) { //clear sync in progress catch in case we manually stopped the sync so that the sync will continue self::changeStatus($syncid, 0); } $syncdata = new Registry(); $syncdata->set('completed', false); $syncdata->set('sync_errors', 0); $...
[ "public", "static", "function", "initData", "(", "$", "syncid", ",", "$", "action", ")", "{", "if", "(", "$", "syncid", ")", "{", "//clear sync in progress catch in case we manually stopped the sync so that the sync will continue", "self", "::", "changeStatus", "(", "$"...
Count log data @param string $syncid the usersync id @param string $action @return Registry
[ "Count", "log", "data" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L64-L83
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.initiate
public static function initiate($syncdata, $slaves) { $syncid = $syncdata->get('syncid'); $action = $syncdata->get('action'); if (!self::getStatus($syncid)) { //sync has not started, lets get going :) $master = Framework::getMaster(); if (!$master) { throw new RuntimeException(Text::_('SYNC_NOMAMAST...
php
public static function initiate($syncdata, $slaves) { $syncid = $syncdata->get('syncid'); $action = $syncdata->get('action'); if (!self::getStatus($syncid)) { //sync has not started, lets get going :) $master = Framework::getMaster(); if (!$master) { throw new RuntimeException(Text::_('SYNC_NOMAMAST...
[ "public", "static", "function", "initiate", "(", "$", "syncdata", ",", "$", "slaves", ")", "{", "$", "syncid", "=", "$", "syncdata", "->", "get", "(", "'syncid'", ")", ";", "$", "action", "=", "$", "syncdata", "->", "get", "(", "'action'", ")", ";", ...
@param Registry $syncdata @param array $slaves @return Registry @throws \RuntimeException
[ "@param", "Registry", "$syncdata", "@param", "array", "$slaves" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L92-L148
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.getLogData
public static function getLogData($syncid, $type = 'all', $limitstart = null, $limit = null, $sort = 'id', $dir = 'ASC') { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('*') ->from('#__jfusion_sync_details') ->where('syncid = ' . $db->quote($syncid)); if (!empty($sort)) { $query->o...
php
public static function getLogData($syncid, $type = 'all', $limitstart = null, $limit = null, $sort = 'id', $dir = 'ASC') { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('*') ->from('#__jfusion_sync_details') ->where('syncid = ' . $db->quote($syncid)); if (!empty($sort)) { $query->o...
[ "public", "static", "function", "getLogData", "(", "$", "syncid", ",", "$", "type", "=", "'all'", ",", "$", "limitstart", "=", "null", ",", "$", "limit", "=", "null", ",", "$", "sort", "=", "'id'", ",", "$", "dir", "=", "'ASC'", ")", "{", "$", "d...
Retrieve log data @param string $syncid the usersync id @param string $type @param int $limitstart @param int $limit @param string $sort @param string $dir @return stdClass[] nothing
[ "Retrieve", "log", "data" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L162-L183
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.countLogData
public static function countLogData($syncid, $type = 'all') { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from('#__jfusion_sync_details') ->where('syncid = ' . $db->quote($syncid)); if ($type != 'all') { $query->where('action = ' . $db->quote($type)); } $db->set...
php
public static function countLogData($syncid, $type = 'all') { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from('#__jfusion_sync_details') ->where('syncid = ' . $db->quote($syncid)); if ($type != 'all') { $query->where('action = ' . $db->quote($type)); } $db->set...
[ "public", "static", "function", "countLogData", "(", "$", "syncid", ",", "$", "type", "=", "'all'", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", "true", ")", "->", "select"...
Count log data @param string $syncid the usersync id @param string $type @return int count results
[ "Count", "log", "data" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L193-L207
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.saveData
public static function saveData(Registry $syncdata) { $db = Factory::getDBO(); $data = new stdClass; $data->syncdata = $syncdata->toString(); $data->syncid = $syncdata->get('syncid'); $data->time_start = time(); $data->action = $syncdata->get('action'); $db->insertObject('#__jfusion_sync', $data); }
php
public static function saveData(Registry $syncdata) { $db = Factory::getDBO(); $data = new stdClass; $data->syncdata = $syncdata->toString(); $data->syncid = $syncdata->get('syncid'); $data->time_start = time(); $data->action = $syncdata->get('action'); $db->insertObject('#__jfusion_sync', $data); }
[ "public", "static", "function", "saveData", "(", "Registry", "$", "syncdata", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "data", "=", "new", "stdClass", ";", "$", "data", "->", "syncdata", "=", "$", "syncdata", "->", "to...
Save sync data @param Registry &$syncdata the actual syncdata @return string nothing
[ "Save", "sync", "data" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L216-L226
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.updateData
public static function updateData(Registry $syncdata) { //find out if the syncid already exists $db = Factory::getDBO(); $query = $db->getQuery(true) ->update('#__jfusion_sync') ->set('syncdata = ' . $db->quote($syncdata->toString())) ->where('syncid = ' . $db->quote($syncdata->get('syncid'))); $db-...
php
public static function updateData(Registry $syncdata) { //find out if the syncid already exists $db = Factory::getDBO(); $query = $db->getQuery(true) ->update('#__jfusion_sync') ->set('syncdata = ' . $db->quote($syncdata->toString())) ->where('syncid = ' . $db->quote($syncdata->get('syncid'))); $db-...
[ "public", "static", "function", "updateData", "(", "Registry", "$", "syncdata", ")", "{", "//find out if the syncid already exists", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", "true", ")", ...
Update syncdata @param Registry &$syncdata the actual syncdata
[ "Update", "syncdata" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L233-L245
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.getData
public static function getData($syncid) { if ($syncid) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('syncdata') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); $data = $db->loadResult(); if ($data) { return new Registry...
php
public static function getData($syncid) { if ($syncid) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('syncdata') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); $data = $db->loadResult(); if ($data) { return new Registry...
[ "public", "static", "function", "getData", "(", "$", "syncid", ")", "{", "if", "(", "$", "syncid", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", "true", ")", "->", "select...
Get syncdata @param string $syncid the usersync id @return Registry|null
[ "Get", "syncdata" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L254-L271
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.resolveError
public static function resolveError($syncid, $syncError, $limitstart, $limit) { $synclog = static::getLogData($syncid, 'error', $limitstart, $limit); foreach ($syncError as $id => $error) { try { if (isset($error['action']) && isset($synclog[$id]) && $error['action']) { $data = json_decode($synclog[$id...
php
public static function resolveError($syncid, $syncError, $limitstart, $limit) { $synclog = static::getLogData($syncid, 'error', $limitstart, $limit); foreach ($syncError as $id => $error) { try { if (isset($error['action']) && isset($synclog[$id]) && $error['action']) { $data = json_decode($synclog[$id...
[ "public", "static", "function", "resolveError", "(", "$", "syncid", ",", "$", "syncError", ",", "$", "limitstart", ",", "$", "limit", ")", "{", "$", "synclog", "=", "static", "::", "getLogData", "(", "$", "syncid", ",", "'error'", ",", "$", "limitstart",...
Fix sync errors @param string $syncid the usersync id @param array $syncError the actual syncError data @param $limitstart @param $limit @return string nothing
[ "Fix", "sync", "errors" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L284-L380
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.markResolved
public static function markResolved($id) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->update('#__jfusion_sync_details') ->set('action = ' . $db->quote('resolved')) ->where('id = ' . $db->quote($id)); $db->setQuery($query); $db->execute(); }
php
public static function markResolved($id) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->update('#__jfusion_sync_details') ->set('action = ' . $db->quote('resolved')) ->where('id = ' . $db->quote($id)); $db->setQuery($query); $db->execute(); }
[ "public", "static", "function", "markResolved", "(", "$", "id", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", "true", ")", "->", "update", "(", "'#__jfusion_sync_details'", ")",...
Marks an error in sync details as resolved to prevent it from constantly showing up in the resolve error view @param $id
[ "Marks", "an", "error", "in", "sync", "details", "as", "resolved", "to", "prevent", "it", "from", "constantly", "showing", "up", "in", "the", "resolve", "error", "view" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L386-L396
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.execute
public static function execute(&$syncdata) { self::init(); try { $action = $syncdata->get('action'); $completed = $syncdata->get('completed'); if (empty($completed)) { $master = $syncdata->get('master'); $syncid = $syncdata->get('syncid'); $userbatch = $syncdata->get('userbatch', 500); //...
php
public static function execute(&$syncdata) { self::init(); try { $action = $syncdata->get('action'); $completed = $syncdata->get('completed'); if (empty($completed)) { $master = $syncdata->get('master'); $syncid = $syncdata->get('syncid'); $userbatch = $syncdata->get('userbatch', 500); //...
[ "public", "static", "function", "execute", "(", "&", "$", "syncdata", ")", "{", "self", "::", "init", "(", ")", ";", "try", "{", "$", "action", "=", "$", "syncdata", "->", "get", "(", "'action'", ")", ";", "$", "completed", "=", "$", "syncdata", "-...
Save log data @param Registry &$syncdata the actual syncdata @return string nothing
[ "Save", "log", "data" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L405-L625
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.getStatus
public static function getStatus($syncid) { if (!empty($syncid)) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('active') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); return (int)$db->loadResult(); } return 0; }
php
public static function getStatus($syncid) { if (!empty($syncid)) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('active') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); return (int)$db->loadResult(); } return 0; }
[ "public", "static", "function", "getStatus", "(", "$", "syncid", ")", "{", "if", "(", "!", "empty", "(", "$", "syncid", ")", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", ...
@static @param string $syncid @return int|mixed
[ "@static", "@param", "string", "$syncid" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L650-L663
jfusion/org.jfusion.framework
src/User/Sync.php
Sync.exsists
public static function exsists($syncid) { if (!empty($syncid)) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('syncid') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); if ($db->loadResult()) { return true; } } return ...
php
public static function exsists($syncid) { if (!empty($syncid)) { $db = Factory::getDBO(); $query = $db->getQuery(true) ->select('syncid') ->from('#__jfusion_sync') ->where('syncid = ' . $db->quote($syncid)); $db->setQuery($query); if ($db->loadResult()) { return true; } } return ...
[ "public", "static", "function", "exsists", "(", "$", "syncid", ")", "{", "if", "(", "!", "empty", "(", "$", "syncid", ")", ")", "{", "$", "db", "=", "Factory", "::", "getDBO", "(", ")", ";", "$", "query", "=", "$", "db", "->", "getQuery", "(", ...
@static @param string $syncid @return boolean
[ "@static", "@param", "string", "$syncid" ]
train
https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Sync.php#L671-L687
fubhy/graphql-php
src/Utility/TypeInfo.php
TypeInfo.typeFromAST
public static function typeFromAST(Schema $schema, $inputType) { if ($inputType instanceof ListType) { $innerType = self::typeFromAST($schema, $inputType->get('type')); return $innerType ? new ListModifier($innerType) : NULL; } if ($inputType instanceof NonNullType) ...
php
public static function typeFromAST(Schema $schema, $inputType) { if ($inputType instanceof ListType) { $innerType = self::typeFromAST($schema, $inputType->get('type')); return $innerType ? new ListModifier($innerType) : NULL; } if ($inputType instanceof NonNullType) ...
[ "public", "static", "function", "typeFromAST", "(", "Schema", "$", "schema", ",", "$", "inputType", ")", "{", "if", "(", "$", "inputType", "instanceof", "ListType", ")", "{", "$", "innerType", "=", "self", "::", "typeFromAST", "(", "$", "schema", ",", "$...
@param Schema $schema @param $inputType @return ListModifier|NonNullModifier|\Fubhy\GraphQL\Type\Definition\Types\TypeInterface|null
[ "@param", "Schema", "$schema", "@param", "$inputType" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Utility/TypeInfo.php#L59-L76
fubhy/graphql-php
src/Utility/TypeInfo.php
TypeInfo.getFieldDefinition
protected static function getFieldDefinition(Schema $schema, Type $parentType, Field $fieldAST) { $name = $fieldAST->get('name')->get('value'); $schemaMeta = Introspection::schemaMetaFieldDefinition(); if ($name === $schemaMeta->getName() && $schema->getQueryType() === $parentType) { ...
php
protected static function getFieldDefinition(Schema $schema, Type $parentType, Field $fieldAST) { $name = $fieldAST->get('name')->get('value'); $schemaMeta = Introspection::schemaMetaFieldDefinition(); if ($name === $schemaMeta->getName() && $schema->getQueryType() === $parentType) { ...
[ "protected", "static", "function", "getFieldDefinition", "(", "Schema", "$", "schema", ",", "Type", "$", "parentType", ",", "Field", "$", "fieldAST", ")", "{", "$", "name", "=", "$", "fieldAST", "->", "get", "(", "'name'", ")", "->", "get", "(", "'value'...
Not exactly the same as the executor's definition of getFieldDef, in this statically evaluated environment we do not always have an Object type, and need to handle Interface and Union types. @param Schema $schema @param Type $parentType @param Field $fieldAST @return FieldDefinition
[ "Not", "exactly", "the", "same", "as", "the", "executor", "s", "definition", "of", "getFieldDef", "in", "this", "statically", "evaluated", "environment", "we", "do", "not", "always", "have", "an", "Object", "type", "and", "need", "to", "handle", "Interface", ...
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Utility/TypeInfo.php#L89-L113
nooku/nooku-installer
src/Nooku/Composer/Installer/NookuFramework.php
NookuFramework.install
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { if (!$this->_isValidName($package->getPrettyName())) { throw new \InvalidArgumentException( 'Invalid package name `'.$package->getPrettyName().'`. '. 'The `nooku-frame...
php
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { if (!$this->_isValidName($package->getPrettyName())) { throw new \InvalidArgumentException( 'Invalid package name `'.$package->getPrettyName().'`. '. 'The `nooku-frame...
[ "public", "function", "install", "(", "InstalledRepositoryInterface", "$", "repo", ",", "PackageInterface", "$", "package", ")", "{", "if", "(", "!", "$", "this", "->", "_isValidName", "(", "$", "package", "->", "getPrettyName", "(", ")", ")", ")", "{", "t...
{@inheritDoc}
[ "{" ]
train
https://github.com/nooku/nooku-installer/blob/2aa82ed08983bccd51905426cfff4980ba960d89/src/Nooku/Composer/Installer/NookuFramework.php#L26-L42
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.factorySyncService
protected function factorySyncService( $serviceName ) { $syncClass = '\\ufocoder\\SyncSocial\\components\\services\\' . ucfirst( $serviceName ); if ( ! class_exists( $syncClass ) ) { throw new Exception( Yii::t( 'SyncSocial', 'SyncSocial Extension not support "{serviceName}" service', [ ...
php
protected function factorySyncService( $serviceName ) { $syncClass = '\\ufocoder\\SyncSocial\\components\\services\\' . ucfirst( $serviceName ); if ( ! class_exists( $syncClass ) ) { throw new Exception( Yii::t( 'SyncSocial', 'SyncSocial Extension not support "{serviceName}" service', [ ...
[ "protected", "function", "factorySyncService", "(", "$", "serviceName", ")", "{", "$", "syncClass", "=", "'\\\\ufocoder\\\\SyncSocial\\\\components\\\\services\\\\'", ".", "ucfirst", "(", "$", "serviceName", ")", ";", "if", "(", "!", "class_exists", "(", "$", "syncC...
Create service synchronizer wrapper class @param $serviceName @return \yii\authclient\BaseOAuth @throws Exception
[ "Create", "service", "synchronizer", "wrapper", "class" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L143-L157
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.getService
public function getService( $serviceName ) { if ( empty( $this->services[ $serviceName ] ) ) { $this->services[ $serviceName ] = $this->factorySyncService( $serviceName ); } if ( ! $this->services[ $serviceName ] instanceof SyncService ) { throw new Exception( Yii::t( '...
php
public function getService( $serviceName ) { if ( empty( $this->services[ $serviceName ] ) ) { $this->services[ $serviceName ] = $this->factorySyncService( $serviceName ); } if ( ! $this->services[ $serviceName ] instanceof SyncService ) { throw new Exception( Yii::t( '...
[ "public", "function", "getService", "(", "$", "serviceName", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "services", "[", "$", "serviceName", "]", ")", ")", "{", "$", "this", "->", "services", "[", "$", "serviceName", "]", "=", "$", "this",...
@param $serviceName @return SyncService @throws Exception
[ "@param", "$serviceName" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L165-L176
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.disconnect
public function disconnect( $serviceName = null ) { $service = $this->getService( $serviceName ); $service->disconnect(); return ! $service->isConnected(); }
php
public function disconnect( $serviceName = null ) { $service = $this->getService( $serviceName ); $service->disconnect(); return ! $service->isConnected(); }
[ "public", "function", "disconnect", "(", "$", "serviceName", "=", "null", ")", "{", "$", "service", "=", "$", "this", "->", "getService", "(", "$", "serviceName", ")", ";", "$", "service", "->", "disconnect", "(", ")", ";", "return", "!", "$", "service...
@param null $serviceName @return bool
[ "@param", "null", "$serviceName" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L222-L227
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.createModel
protected function createModel( array $data ) { /** * @var $model \yii\db\ActiveRecord */ $model = new $this->modelClass; $model->scenario = $this->modelScenario; $model->{$this->modelAttribute} = $data['content']; $model...
php
protected function createModel( array $data ) { /** * @var $model \yii\db\ActiveRecord */ $model = new $this->modelClass; $model->scenario = $this->modelScenario; $model->{$this->modelAttribute} = $data['content']; $model...
[ "protected", "function", "createModel", "(", "array", "$", "data", ")", "{", "/**\n * @var $model \\yii\\db\\ActiveRecord\n */", "$", "model", "=", "new", "$", "this", "->", "modelClass", ";", "$", "model", "->", "scenario", "=", "$", "this", "->",...
@param array $data @return ActiveRecord @throws Exception
[ "@param", "array", "$data" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L235-L250
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.isExistsSyncModelByData
protected function isExistsSyncModelByData( SyncService $service, array $data ) { return SyncModel::find()->where( [ 'service_name' => $service->getName(), 'service_id_author' => $data['service_id_author'], 'service_id_post' => $data['service_id_post'] ] )->ex...
php
protected function isExistsSyncModelByData( SyncService $service, array $data ) { return SyncModel::find()->where( [ 'service_name' => $service->getName(), 'service_id_author' => $data['service_id_author'], 'service_id_post' => $data['service_id_post'] ] )->ex...
[ "protected", "function", "isExistsSyncModelByData", "(", "SyncService", "$", "service", ",", "array", "$", "data", ")", "{", "return", "SyncModel", "::", "find", "(", ")", "->", "where", "(", "[", "'service_name'", "=>", "$", "service", "->", "getName", "(",...
@param SyncService $service @param array $data @return bool
[ "@param", "SyncService", "$service", "@param", "array", "$data" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L268-L275
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.isExistsSyncModelByActiveRecord
protected function isExistsSyncModelByActiveRecord( SyncService $service, ActiveRecord $model ) { return SyncModel::find()->where( [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName() ] )->exists(); }
php
protected function isExistsSyncModelByActiveRecord( SyncService $service, ActiveRecord $model ) { return SyncModel::find()->where( [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName() ] )->exists(); }
[ "protected", "function", "isExistsSyncModelByActiveRecord", "(", "SyncService", "$", "service", ",", "ActiveRecord", "$", "model", ")", "{", "return", "SyncModel", "::", "find", "(", ")", "->", "where", "(", "[", "'model_id'", "=>", "$", "model", "->", "getPri...
@param SyncService $service @param ActiveRecord $model @return bool
[ "@param", "SyncService", "$service", "@param", "ActiveRecord", "$model" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L283-L289
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.getSyncModel
protected function getSyncModel( SyncService $service, ActiveRecord $syncActiveRecord ) { return $this->finSyncModel( [ 'service_name' => $service->getName(), 'service_id_post' => $syncActiveRecord->getPrimaryKey() ] ); }
php
protected function getSyncModel( SyncService $service, ActiveRecord $syncActiveRecord ) { return $this->finSyncModel( [ 'service_name' => $service->getName(), 'service_id_post' => $syncActiveRecord->getPrimaryKey() ] ); }
[ "protected", "function", "getSyncModel", "(", "SyncService", "$", "service", ",", "ActiveRecord", "$", "syncActiveRecord", ")", "{", "return", "$", "this", "->", "finSyncModel", "(", "[", "'service_name'", "=>", "$", "service", "->", "getName", "(", ")", ",", ...
@param SyncService $service @param ActiveRecord $syncActiveRecord @return array|null|SyncModel
[ "@param", "SyncService", "$service", "@param", "ActiveRecord", "$syncActiveRecord" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L306-L312
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.getSyncActiveRecord
protected function getSyncActiveRecord( SyncService $service, ActiveRecord $model ) { return $this->finSyncModel( [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName() ] ); }
php
protected function getSyncActiveRecord( SyncService $service, ActiveRecord $model ) { return $this->finSyncModel( [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName() ] ); }
[ "protected", "function", "getSyncActiveRecord", "(", "SyncService", "$", "service", ",", "ActiveRecord", "$", "model", ")", "{", "return", "$", "this", "->", "finSyncModel", "(", "[", "'model_id'", "=>", "$", "model", "->", "getPrimaryKey", "(", ")", ",", "'...
@param SyncService $service @param ActiveRecord $model @return array|null|SyncModel
[ "@param", "SyncService", "$service", "@param", "ActiveRecord", "$model" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L320-L326
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.createSyncModel
protected function createSyncModel( SyncService $service, ActiveRecord $model, array $data = array() ) { $syncModel = new SyncModel(); $syncModel->attributes = [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName(), '...
php
protected function createSyncModel( SyncService $service, ActiveRecord $model, array $data = array() ) { $syncModel = new SyncModel(); $syncModel->attributes = [ 'model_id' => $model->getPrimaryKey(), 'service_name' => $service->getName(), '...
[ "protected", "function", "createSyncModel", "(", "SyncService", "$", "service", ",", "ActiveRecord", "$", "model", ",", "array", "$", "data", "=", "array", "(", ")", ")", "{", "$", "syncModel", "=", "new", "SyncModel", "(", ")", ";", "$", "syncModel", "-...
@param SyncService $service @param ActiveRecord $model @param array $data @return bool @throws Exception
[ "@param", "SyncService", "$service", "@param", "ActiveRecord", "$model", "@param", "array", "$data" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L336-L354
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.deleteSyncModel
public function deleteSyncModel( $serviceName, ActiveRecord $model, $flagSync = false ) { $service = $this->getService( $serviceName ); $syncActiveRecord = $this->getSyncActiveRecord( $service, $model ); if ( ! $syncActiveRecord instanceof SyncModel ) { return false; ...
php
public function deleteSyncModel( $serviceName, ActiveRecord $model, $flagSync = false ) { $service = $this->getService( $serviceName ); $syncActiveRecord = $this->getSyncActiveRecord( $service, $model ); if ( ! $syncActiveRecord instanceof SyncModel ) { return false; ...
[ "public", "function", "deleteSyncModel", "(", "$", "serviceName", ",", "ActiveRecord", "$", "model", ",", "$", "flagSync", "=", "false", ")", "{", "$", "service", "=", "$", "this", "->", "getService", "(", "$", "serviceName", ")", ";", "$", "syncActiveReco...
@param $serviceName @param ActiveRecord $model @param bool $flagSync @return bool
[ "@param", "$serviceName", "@param", "ActiveRecord", "$model", "@param", "bool", "$flagSync" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L363-L388
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.syncService
public function syncService( $serviceName = null ) { $flag = false; $count = 0; $service = $this->getService( $serviceName ); $postData = $service->getPosts(); if ( $postData !== null ) { $flag = true; foreach ( $postData as $data ) { ...
php
public function syncService( $serviceName = null ) { $flag = false; $count = 0; $service = $this->getService( $serviceName ); $postData = $service->getPosts(); if ( $postData !== null ) { $flag = true; foreach ( $postData as $data ) { ...
[ "public", "function", "syncService", "(", "$", "serviceName", "=", "null", ")", "{", "$", "flag", "=", "false", ";", "$", "count", "=", "0", ";", "$", "service", "=", "$", "this", "->", "getService", "(", "$", "serviceName", ")", ";", "$", "postData"...
@param null $serviceName @return bool @throws Exception @throws InvalidConfigException
[ "@param", "null", "$serviceName" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L397-L422
ufocoder/yii2-SyncSocial
src/components/Synchronizer.php
Synchronizer.syncActiveRecord
public function syncActiveRecord( $serviceName = null, ActiveRecord $model ) { $service = $this->getService( $serviceName ); if ( $service->isConnected() && ! $this->isExistsSyncModelByActiveRecord( $service, $model ) ) { $message = $model->{$this->modelAttribute}; $function ...
php
public function syncActiveRecord( $serviceName = null, ActiveRecord $model ) { $service = $this->getService( $serviceName ); if ( $service->isConnected() && ! $this->isExistsSyncModelByActiveRecord( $service, $model ) ) { $message = $model->{$this->modelAttribute}; $function ...
[ "public", "function", "syncActiveRecord", "(", "$", "serviceName", "=", "null", ",", "ActiveRecord", "$", "model", ")", "{", "$", "service", "=", "$", "this", "->", "getService", "(", "$", "serviceName", ")", ";", "if", "(", "$", "service", "->", "isConn...
Post message with URL to Social Network @param null $serviceName @param \yii\db\ActiveRecord $model @return bool
[ "Post", "message", "with", "URL", "to", "Social", "Network" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/Synchronizer.php#L432-L453
webforge-labs/psc-cms
lib/Psc/Code/Event/Manager.php
Manager.dispatch
public function dispatch(Event $event) { foreach ($this->getSubscribers($event) as $subscriber) { $subscriber->trigger($event); } return $this; }
php
public function dispatch(Event $event) { foreach ($this->getSubscribers($event) as $subscriber) { $subscriber->trigger($event); } return $this; }
[ "public", "function", "dispatch", "(", "Event", "$", "event", ")", "{", "foreach", "(", "$", "this", "->", "getSubscribers", "(", "$", "event", ")", "as", "$", "subscriber", ")", "{", "$", "subscriber", "->", "trigger", "(", "$", "event", ")", ";", "...
Dispatched ein Event @chainable
[ "Dispatched", "ein", "Event" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Event/Manager.php#L13-L20
webforge-labs/psc-cms
lib/Psc/Code/Event/Manager.php
Manager.dispatchEvent
public function dispatchEvent($eventName, $eventData = NULL, $target = NULL) { $event = new Event($eventName,$target); $event->setData($eventData); $this->dispatch($event); return $event; }
php
public function dispatchEvent($eventName, $eventData = NULL, $target = NULL) { $event = new Event($eventName,$target); $event->setData($eventData); $this->dispatch($event); return $event; }
[ "public", "function", "dispatchEvent", "(", "$", "eventName", ",", "$", "eventData", "=", "NULL", ",", "$", "target", "=", "NULL", ")", "{", "$", "event", "=", "new", "Event", "(", "$", "eventName", ",", "$", "target", ")", ";", "$", "event", "->", ...
Dispatched ein (nicht erstelltes) Event $manager->dispatchEvent('Psc.SourceFileChanged', array('file'=>'D:\www\psc-cms\Umsetzung\base\src\PSC.php'), $this); ist dasselbe wie $event = new Event('Psc.SourceFileChanged',$this); $manager->dispatch($event); anders als dispatch() gibt dies das erstellte Event zurück (dies...
[ "Dispatched", "ein", "(", "nicht", "erstelltes", ")", "Event" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Event/Manager.php#L34-L40
webforge-labs/psc-cms
lib/Psc/Code/Event/Manager.php
Manager.bind
public function bind(Subscriber $subscriber, $eventIdentifier) { if ($eventIdentifier instanceof Event) { $eventIdentifier = $eventIdentifier->getIdentifier(); } if (!isset($this->subscribers[$eventIdentifier])) $this->subscribers[$eventIdentifier] = array(); $this->subscribers[$...
php
public function bind(Subscriber $subscriber, $eventIdentifier) { if ($eventIdentifier instanceof Event) { $eventIdentifier = $eventIdentifier->getIdentifier(); } if (!isset($this->subscribers[$eventIdentifier])) $this->subscribers[$eventIdentifier] = array(); $this->subscribers[$...
[ "public", "function", "bind", "(", "Subscriber", "$", "subscriber", ",", "$", "eventIdentifier", ")", "{", "if", "(", "$", "eventIdentifier", "instanceof", "Event", ")", "{", "$", "eventIdentifier", "=", "$", "eventIdentifier", "->", "getIdentifier", "(", ")",...
Bindet den Subscriber an einen Event(Typ) Wenn das Event dann dispatched wird, wird der subscriber mit trigger() benachrichtigt @param $eventIdentifier kann NULL sein für alle Event-Typen
[ "Bindet", "den", "Subscriber", "an", "einen", "Event", "(", "Typ", ")" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Event/Manager.php#L48-L59
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.create
public static function create( $name = null, $conf = null ) { if ( is_null( $name ) ) { $name = static::$_default; } if ( !is_null( $conf ) && is_array( $conf ) ) { return static::$_instances[$name] = new static( $name, $conf ); } if ( !isset( static::$_instances[$name] ) ) { static::$_ins...
php
public static function create( $name = null, $conf = null ) { if ( is_null( $name ) ) { $name = static::$_default; } if ( !is_null( $conf ) && is_array( $conf ) ) { return static::$_instances[$name] = new static( $name, $conf ); } if ( !isset( static::$_instances[$name] ) ) { static::$_ins...
[ "public", "static", "function", "create", "(", "$", "name", "=", "null", ",", "$", "conf", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "name", ")", ")", "{", "$", "name", "=", "static", "::", "$", "_default", ";", "}", "if", "(", "!"...
Get an auth instance or create one @param string $name @param array $conf You can pass optionally a configuration directly. This will overwrite. @return Auth_Handler
[ "Get", "an", "auth", "instance", "or", "create", "one" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L38-L56
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.kill_restore
public function kill_restore() { CCCookie::delete( $this->config->get( 'restore.id_cookie' ) ); CCCookie::delete( $this->config->get( 'restore.token_cookie' ) ); }
php
public function kill_restore() { CCCookie::delete( $this->config->get( 'restore.id_cookie' ) ); CCCookie::delete( $this->config->get( 'restore.token_cookie' ) ); }
[ "public", "function", "kill_restore", "(", ")", "{", "CCCookie", "::", "delete", "(", "$", "this", "->", "config", "->", "get", "(", "'restore.id_cookie'", ")", ")", ";", "CCCookie", "::", "delete", "(", "$", "this", "->", "config", "->", "get", "(", "...
Kill the restore keys @return void
[ "Kill", "the", "restore", "keys" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L266-L270
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.restore_key
public function restore_key( $user ) { return \CCStr::hash( $user->password.'@'.$user->{$this->config->user_key}.'%'.\CCIn::client()->agent ); }
php
public function restore_key( $user ) { return \CCStr::hash( $user->password.'@'.$user->{$this->config->user_key}.'%'.\CCIn::client()->agent ); }
[ "public", "function", "restore_key", "(", "$", "user", ")", "{", "return", "\\", "CCStr", "::", "hash", "(", "$", "user", "->", "password", ".", "'@'", ".", "$", "user", "->", "{", "$", "this", "->", "config", "->", "user_key", "}", ".", "'%'", "."...
generate the current restore key @param User $user @return string
[ "generate", "the", "current", "restore", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L298-L301
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.login
public function login() { return $this->select_logins() ->where( 'restore_id', $this->user->{$this->config->user_key} ) ->where( 'restore_token', $this->restore_key( $this->user ) ) ->limit( 1 ) ->run(); }
php
public function login() { return $this->select_logins() ->where( 'restore_id', $this->user->{$this->config->user_key} ) ->where( 'restore_token', $this->restore_key( $this->user ) ) ->limit( 1 ) ->run(); }
[ "public", "function", "login", "(", ")", "{", "return", "$", "this", "->", "select_logins", "(", ")", "->", "where", "(", "'restore_id'", ",", "$", "this", "->", "user", "->", "{", "$", "this", "->", "config", "->", "user_key", "}", ")", "->", "where...
Get the current login of the user @return stdObject|null
[ "Get", "the", "current", "login", "of", "the", "user" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L322-L329
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.validate
public function validate( $identifier, $password ) { $user = null; $user_model = $this->config->user_model; foreach( $this->config->identifiers as $property ) { if ( $user = $user_model::find( $property, $identifier ) ) { break; } } // when could not find a user matching the identifiers ...
php
public function validate( $identifier, $password ) { $user = null; $user_model = $this->config->user_model; foreach( $this->config->identifiers as $property ) { if ( $user = $user_model::find( $property, $identifier ) ) { break; } } // when could not find a user matching the identifiers ...
[ "public", "function", "validate", "(", "$", "identifier", ",", "$", "password", ")", "{", "$", "user", "=", "null", ";", "$", "user_model", "=", "$", "this", "->", "config", "->", "user_model", ";", "foreach", "(", "$", "this", "->", "config", "->", ...
Validate an identifier with the password In other words is the login correct? @param string $identifier @param string $password @return mixed false on failure, user object on success
[ "Validate", "an", "identifier", "with", "the", "password", "In", "other", "words", "is", "the", "login", "correct?" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L339-L374
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.sign_in
public function sign_in( \Auth\User $user, $keep_login = true ) { // set the session key so the session knows we are logged in $this->session->set( $this->config->session_key, $user->{$this->config->user_key} ); // update the current user object $this->user = $user; // update the last login timestamp $t...
php
public function sign_in( \Auth\User $user, $keep_login = true ) { // set the session key so the session knows we are logged in $this->session->set( $this->config->session_key, $user->{$this->config->user_key} ); // update the current user object $this->user = $user; // update the last login timestamp $t...
[ "public", "function", "sign_in", "(", "\\", "Auth", "\\", "User", "$", "user", ",", "$", "keep_login", "=", "true", ")", "{", "// set the session key so the session knows we are logged in", "$", "this", "->", "session", "->", "set", "(", "$", "this", "->", "co...
Sign the user and optinal also set the resore keys @param Auth\User $user @param bool $keep_login @return bool
[ "Sign", "the", "user", "and", "optinal", "also", "set", "the", "resore", "keys" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L383-L449
ClanCats/Core
src/bundles/Auth/Handler.php
Handler.sign_out
public function sign_out() { if ( !$this->authenticated ) { return false; } // remove the restore login \DB::delete( $this->config->get( 'logins.table' ) ) ->where( 'restore_token', $this->restore_key( $this->user ) ) ->run(); // logout the user $this->session->delete( $this->config->session_...
php
public function sign_out() { if ( !$this->authenticated ) { return false; } // remove the restore login \DB::delete( $this->config->get( 'logins.table' ) ) ->where( 'restore_token', $this->restore_key( $this->user ) ) ->run(); // logout the user $this->session->delete( $this->config->session_...
[ "public", "function", "sign_out", "(", ")", "{", "if", "(", "!", "$", "this", "->", "authenticated", ")", "{", "return", "false", ";", "}", "// remove the restore login", "\\", "DB", "::", "delete", "(", "$", "this", "->", "config", "->", "get", "(", "...
Sign a user out @param id $user_id @param string $name @return false
[ "Sign", "a", "user", "out" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Auth/Handler.php#L458-L483
ripaclub/zf2-sphinxsearch-tool
src/Source/Writer/XML2.php
XML2.beginOutput
public function beginOutput() { $this->startDocument('1.0', 'UTF-8'); $this->startElement('sphinx:docset'); $this->startElement('sphinx:schema'); // Add fields to the schema foreach ($this->fields as $fields) { $this->startElement('sphinx:field'); fore...
php
public function beginOutput() { $this->startDocument('1.0', 'UTF-8'); $this->startElement('sphinx:docset'); $this->startElement('sphinx:schema'); // Add fields to the schema foreach ($this->fields as $fields) { $this->startElement('sphinx:field'); fore...
[ "public", "function", "beginOutput", "(", ")", "{", "$", "this", "->", "startDocument", "(", "'1.0'", ",", "'UTF-8'", ")", ";", "$", "this", "->", "startElement", "(", "'sphinx:docset'", ")", ";", "$", "this", "->", "startElement", "(", "'sphinx:schema'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Source/Writer/XML2.php#L65-L91
ripaclub/zf2-sphinxsearch-tool
src/Source/Writer/XML2.php
XML2.addDocument
public function addDocument(array $doc) { $this->startElement('sphinx:document'); if (!isset($doc['id'])) { throw new NotValidDocumentException('Document array must have an element with "id" key'); } $this->writeAttribute('id', $doc['id']); foreach ($doc as $key =...
php
public function addDocument(array $doc) { $this->startElement('sphinx:document'); if (!isset($doc['id'])) { throw new NotValidDocumentException('Document array must have an element with "id" key'); } $this->writeAttribute('id', $doc['id']); foreach ($doc as $key =...
[ "public", "function", "addDocument", "(", "array", "$", "doc", ")", "{", "$", "this", "->", "startElement", "(", "'sphinx:document'", ")", ";", "if", "(", "!", "isset", "(", "$", "doc", "[", "'id'", "]", ")", ")", "{", "throw", "new", "NotValidDocument...
{@inheritdoc}
[ "{" ]
train
https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Source/Writer/XML2.php#L96-L116
2amigos/yiifoundation
widgets/Reveal.php
Reveal.init
public function init() { $this->assets = array( 'js' => YII_DEBUG ? 'foundation/foundation.reveal.js' : 'foundation.min.js' ); Html::addCssClass($this->htmlOptions, Enum::DIALOG); $this->setId(ArrayHelper::removeValue($this->htmlOptions, 'id', $this->getId())); $...
php
public function init() { $this->assets = array( 'js' => YII_DEBUG ? 'foundation/foundation.reveal.js' : 'foundation.min.js' ); Html::addCssClass($this->htmlOptions, Enum::DIALOG); $this->setId(ArrayHelper::removeValue($this->htmlOptions, 'id', $this->getId())); $...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "assets", "=", "array", "(", "'js'", "=>", "YII_DEBUG", "?", "'foundation/foundation.reveal.js'", ":", "'foundation.min.js'", ")", ";", "Html", "::", "addCssClass", "(", "$", "this", "->", "html...
Initializes the widget
[ "Initializes", "the", "widget" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Reveal.php#L110-L126
2amigos/yiifoundation
widgets/Reveal.php
Reveal.renderToggleButton
public function renderToggleButton() { if ($this->toggleButton !== null) { $tag = ArrayHelper::removeValue($this->toggleButton, 'tag', 'button'); $label = ArrayHelper::removeValue($this->toggleButton, 'label', 'Show'); if ($tag === 'button' && !isset($this->toggleButton...
php
public function renderToggleButton() { if ($this->toggleButton !== null) { $tag = ArrayHelper::removeValue($this->toggleButton, 'tag', 'button'); $label = ArrayHelper::removeValue($this->toggleButton, 'label', 'Show'); if ($tag === 'button' && !isset($this->toggleButton...
[ "public", "function", "renderToggleButton", "(", ")", "{", "if", "(", "$", "this", "->", "toggleButton", "!==", "null", ")", "{", "$", "tag", "=", "ArrayHelper", "::", "removeValue", "(", "$", "this", "->", "toggleButton", ",", "'tag'", ",", "'button'", ...
Renders the toggle button @return null|string the rendering result
[ "Renders", "the", "toggle", "button" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Reveal.php#L150-L163
2amigos/yiifoundation
widgets/Reveal.php
Reveal.renderCloseButton
protected function renderCloseButton() { if ($this->closeButton !== null) { $tag = ArrayHelper::removeValue($this->closeButton, 'tag', 'a'); $label = ArrayHelper::removeValue($this->closeButton, 'label', '×'); if ($tag === 'button' && !isset($this->closeButton['ty...
php
protected function renderCloseButton() { if ($this->closeButton !== null) { $tag = ArrayHelper::removeValue($this->closeButton, 'tag', 'a'); $label = ArrayHelper::removeValue($this->closeButton, 'label', '×'); if ($tag === 'button' && !isset($this->closeButton['ty...
[ "protected", "function", "renderCloseButton", "(", ")", "{", "if", "(", "$", "this", "->", "closeButton", "!==", "null", ")", "{", "$", "tag", "=", "ArrayHelper", "::", "removeValue", "(", "$", "this", "->", "closeButton", ",", "'tag'", ",", "'a'", ")", ...
Renders the close button. @return string the rendering result
[ "Renders", "the", "close", "button", "." ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Reveal.php#L169-L182
phpmob/changmin
src/PhpMob/WidgetBundle/Twig/AbstractWidgetExtension.php
AbstractWidgetExtension.resolveOptions
private function resolveOptions(array $options = []) { $resolver = new OptionsResolver(); $this->configure($resolver); return $resolver->resolve($options); }
php
private function resolveOptions(array $options = []) { $resolver = new OptionsResolver(); $this->configure($resolver); return $resolver->resolve($options); }
[ "private", "function", "resolveOptions", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "resolver", "=", "new", "OptionsResolver", "(", ")", ";", "$", "this", "->", "configure", "(", "$", "resolver", ")", ";", "return", "$", "resolver", "-...
@param array $options @return array
[ "@param", "array", "$options" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/WidgetBundle/Twig/AbstractWidgetExtension.php#L86-L92
phpmob/changmin
src/PhpMob/WidgetBundle/Twig/AbstractWidgetExtension.php
AbstractWidgetExtension.render
final public function render(\Twig_Environment $env, array $userOptions = []) { $data = []; $options = $this->getOptions($userOptions); if ('away' === $options['visibility']) { $data = $this->getData($options); } if (empty($options['render_url'])) { ...
php
final public function render(\Twig_Environment $env, array $userOptions = []) { $data = []; $options = $this->getOptions($userOptions); if ('away' === $options['visibility']) { $data = $this->getData($options); } if (empty($options['render_url'])) { ...
[ "final", "public", "function", "render", "(", "\\", "Twig_Environment", "$", "env", ",", "array", "$", "userOptions", "=", "[", "]", ")", "{", "$", "data", "=", "[", "]", ";", "$", "options", "=", "$", "this", "->", "getOptions", "(", "$", "userOptio...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/WidgetBundle/Twig/AbstractWidgetExtension.php#L140-L174
phpmob/changmin
src/PhpMob/Sylius/Grid/FieldType/BadgeFieldType.php
BadgeFieldType.render
public function render(Field $field, $data, array $options) { if ('.' !== $field->getPath()) { $data = $this->dataExtractor->get($field, $data); } $field->setOptions($options); return $this->twig->render($options['template'], ['data' => $data, 'options' => $options]); ...
php
public function render(Field $field, $data, array $options) { if ('.' !== $field->getPath()) { $data = $this->dataExtractor->get($field, $data); } $field->setOptions($options); return $this->twig->render($options['template'], ['data' => $data, 'options' => $options]); ...
[ "public", "function", "render", "(", "Field", "$", "field", ",", "$", "data", ",", "array", "$", "options", ")", "{", "if", "(", "'.'", "!==", "$", "field", "->", "getPath", "(", ")", ")", "{", "$", "data", "=", "$", "this", "->", "dataExtractor", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/Sylius/Grid/FieldType/BadgeFieldType.php#L56-L65
phpmob/changmin
src/PhpMob/Sylius/Grid/FieldType/BadgeFieldType.php
BadgeFieldType.configureOptions
public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefault('template', $this->defaultTemplate); $resolver->setAllowedTypes('template', 'string'); $resolver->setDefined('vars'); $resolver->setAllowedTypes('vars', 'array'); $resolver->setDefault...
php
public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefault('template', $this->defaultTemplate); $resolver->setAllowedTypes('template', 'string'); $resolver->setDefined('vars'); $resolver->setAllowedTypes('vars', 'array'); $resolver->setDefault...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", ":", "void", "{", "$", "resolver", "->", "setDefault", "(", "'template'", ",", "$", "this", "->", "defaultTemplate", ")", ";", "$", "resolver", "->", "setAllowedTypes", "("...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/Sylius/Grid/FieldType/BadgeFieldType.php#L70-L87
fubhy/graphql-php
src/Language/Token.php
Token.typeToString
public static function typeToString($type) { switch ($type) { case self::EOF_TYPE: return 'EOF'; case self::BANG_TYPE: return '!'; case self::DOLLAR_TYPE: return '$'; case self::PAREN_L_TYPE: retu...
php
public static function typeToString($type) { switch ($type) { case self::EOF_TYPE: return 'EOF'; case self::BANG_TYPE: return '!'; case self::DOLLAR_TYPE: return '$'; case self::PAREN_L_TYPE: retu...
[ "public", "static", "function", "typeToString", "(", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "EOF_TYPE", ":", "return", "'EOF'", ";", "case", "self", "::", "BANG_TYPE", ":", "return", "'!'", ";", "case", "self...
Returns the constant representation (internal) of a given type. @param int $type The type as an integer @return string The string representation
[ "Returns", "the", "constant", "representation", "(", "internal", ")", "of", "a", "given", "type", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Token.php#L154-L198
webforge-labs/psc-cms
lib/Psc/JS/JooseSnippet.php
JooseSnippet.expr
public static function expr($jsCode) { $dsl = new \Psc\Code\AST\DSL(); return $dsl->expression($jsCode); }
php
public static function expr($jsCode) { $dsl = new \Psc\Code\AST\DSL(); return $dsl->expression($jsCode); }
[ "public", "static", "function", "expr", "(", "$", "jsCode", ")", "{", "$", "dsl", "=", "new", "\\", "Psc", "\\", "Code", "\\", "AST", "\\", "DSL", "(", ")", ";", "return", "$", "dsl", "->", "expression", "(", "$", "jsCode", ")", ";", "}" ]
Kleiner Helfer für das Erzeugen einer Expression JooseSnippet::expr("$('#psc-ui-tabs')")
[ "Kleiner", "Helfer", "für", "das", "Erzeugen", "einer", "Expression" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/JooseSnippet.php#L52-L55
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.init
public function init() { parent::init(); $this->datetimeFormat = (empty(Yii::$app->params['site']->datetimeFormat)) ? $this->datetimeFormat : Yii::$app->params['site']->datetimeFormat; $this->timezone = (empty(Yii::$app->params['site']->timezone)) ? $this->timezone : Yii::$app->params['site...
php
public function init() { parent::init(); $this->datetimeFormat = (empty(Yii::$app->params['site']->datetimeFormat)) ? $this->datetimeFormat : Yii::$app->params['site']->datetimeFormat; $this->timezone = (empty(Yii::$app->params['site']->timezone)) ? $this->timezone : Yii::$app->params['site...
[ "public", "function", "init", "(", ")", "{", "parent", "::", "init", "(", ")", ";", "$", "this", "->", "datetimeFormat", "=", "(", "empty", "(", "Yii", "::", "$", "app", "->", "params", "[", "'site'", "]", "->", "datetimeFormat", ")", ")", "?", "$"...
Set default timezone and datetime format for model
[ "Set", "default", "timezone", "and", "datetime", "format", "for", "model" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L24-L30
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.getDisplayDateTime
public function getDisplayDateTime($input, $format = null, $timezone = null) { return \enpii\enpiiCms\helpers\DateTimeHelper::fromDbFormat($input, ($format === null ? $this->datetimeFormat : $format), ($timezone === null ? $this->timezone : $timezone)); }
php
public function getDisplayDateTime($input, $format = null, $timezone = null) { return \enpii\enpiiCms\helpers\DateTimeHelper::fromDbFormat($input, ($format === null ? $this->datetimeFormat : $format), ($timezone === null ? $this->timezone : $timezone)); }
[ "public", "function", "getDisplayDateTime", "(", "$", "input", ",", "$", "format", "=", "null", ",", "$", "timezone", "=", "null", ")", "{", "return", "\\", "enpii", "\\", "enpiiCms", "\\", "helpers", "\\", "DateTimeHelper", "::", "fromDbFormat", "(", "$",...
Display datetime from the result retrieve from database (stored by GMT datetime @param $input @param null $format @param null $timezone @return bool|string
[ "Display", "datetime", "from", "the", "result", "retrieve", "from", "database", "(", "stored", "by", "GMT", "datetime" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L54-L59
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.getCreatedAt
public function getCreatedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->created_at, $format, $timezone); }
php
public function getCreatedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->created_at, $format, $timezone); }
[ "public", "function", "getCreatedAt", "(", "$", "format", "=", "null", ",", "$", "timezone", "=", "null", ")", "{", "return", "$", "this", "->", "getDisplayDateTime", "(", "$", "this", "->", "created_at", ",", "$", "format", ",", "$", "timezone", ")", ...
Display create_at datetime @param null $format @param null $timezone @return bool|string
[ "Display", "create_at", "datetime" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L67-L70
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.getUpdatedAt
public function getUpdatedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->updated_at, $format, $timezone); }
php
public function getUpdatedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->updated_at, $format, $timezone); }
[ "public", "function", "getUpdatedAt", "(", "$", "format", "=", "null", ",", "$", "timezone", "=", "null", ")", "{", "return", "$", "this", "->", "getDisplayDateTime", "(", "$", "this", "->", "updated_at", ",", "$", "format", ",", "$", "timezone", ")", ...
Display updated_at datetime @param null $format @param null $timezone @return bool|string
[ "Display", "updated_at", "datetime" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L78-L81
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.getPublishedAt
public function getPublishedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->published_at, $format, $timezone); }
php
public function getPublishedAt($format = null, $timezone = null) { return $this->getDisplayDateTime($this->published_at, $format, $timezone); }
[ "public", "function", "getPublishedAt", "(", "$", "format", "=", "null", ",", "$", "timezone", "=", "null", ")", "{", "return", "$", "this", "->", "getDisplayDateTime", "(", "$", "this", "->", "published_at", ",", "$", "format", ",", "$", "timezone", ")"...
Display published_at datetime @param null $format @param null $timezone @return bool|string
[ "Display", "published_at", "datetime" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L89-L92
npbtrac/yii2-enpii-cms
libs/override/db/NpActiveRecord.php
NpActiveRecord.getUploadTmpPath
public function getUploadTmpPath() { $path = Yii::getAlias('@root' . '/' . Yii::$app->params['uploads']['folderName'] . '/' . 'tmp'); if (!file_exists($path)) { FileHelper::createDirectory($path, 0777); } return $path; }
php
public function getUploadTmpPath() { $path = Yii::getAlias('@root' . '/' . Yii::$app->params['uploads']['folderName'] . '/' . 'tmp'); if (!file_exists($path)) { FileHelper::createDirectory($path, 0777); } return $path; }
[ "public", "function", "getUploadTmpPath", "(", ")", "{", "$", "path", "=", "Yii", "::", "getAlias", "(", "'@root'", ".", "'/'", ".", "Yii", "::", "$", "app", "->", "params", "[", "'uploads'", "]", "[", "'folderName'", "]", ".", "'/'", ".", "'tmp'", "...
Temporary upload path @return bool|string
[ "Temporary", "upload", "path" ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/db/NpActiveRecord.php#L98-L105
atkrad/data-tables
src/Column/ActionBuilder.php
ActionBuilder.addAction
public function addAction($slug, $name, $url, $options = []) { $this->actions[$slug] = ['name' => $name, 'url' => $url, 'options' => $options]; return $this; }
php
public function addAction($slug, $name, $url, $options = []) { $this->actions[$slug] = ['name' => $name, 'url' => $url, 'options' => $options]; return $this; }
[ "public", "function", "addAction", "(", "$", "slug", ",", "$", "name", ",", "$", "url", ",", "$", "options", "=", "[", "]", ")", "{", "$", "this", "->", "actions", "[", "$", "slug", "]", "=", "[", "'name'", "=>", "$", "name", ",", "'url'", "=>"...
Add Action @param string $slug Action slug @param string $name Action name @param string $url Action url @param array $options Action options @return ActionBuilder
[ "Add", "Action" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/ActionBuilder.php#L40-L45
atkrad/data-tables
src/Column/ActionBuilder.php
ActionBuilder.removeAction
public function removeAction($slug) { if (array_key_exists($slug, $this->actions)) { unset($this->actions[$slug]); return true; } else { return false; } }
php
public function removeAction($slug) { if (array_key_exists($slug, $this->actions)) { unset($this->actions[$slug]); return true; } else { return false; } }
[ "public", "function", "removeAction", "(", "$", "slug", ")", "{", "if", "(", "array_key_exists", "(", "$", "slug", ",", "$", "this", "->", "actions", ")", ")", "{", "unset", "(", "$", "this", "->", "actions", "[", "$", "slug", "]", ")", ";", "retur...
Remove action @param string $slug Action slug @return bool
[ "Remove", "action" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/ActionBuilder.php#L54-L63
atkrad/data-tables
src/Column/ActionBuilder.php
ActionBuilder.render
public function render($template) { $actions = $this->getActions(); $this->flushActions(); return $this->table->getRender()->getTwig()->render($template, ['actions' => $actions]); }
php
public function render($template) { $actions = $this->getActions(); $this->flushActions(); return $this->table->getRender()->getTwig()->render($template, ['actions' => $actions]); }
[ "public", "function", "render", "(", "$", "template", ")", "{", "$", "actions", "=", "$", "this", "->", "getActions", "(", ")", ";", "$", "this", "->", "flushActions", "(", ")", ";", "return", "$", "this", "->", "table", "->", "getRender", "(", ")", ...
Actions render @param string $template Action template name @return string
[ "Actions", "render" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/ActionBuilder.php#L90-L96
ruvents/ruwork-upload-bundle
Form/TypeGuesser/DoctrineUploadTypeGuesser.php
DoctrineUploadTypeGuesser.guessType
public function guessType($class, $property) { if (!$result = $this->getMetadata($class)) { return null; } /** @var ClassMetadata $metadata */ $metadata = $result[0]; if (!$metadata->hasAssociation($property) || $metadata->isCollectionValuedAssociation($property...
php
public function guessType($class, $property) { if (!$result = $this->getMetadata($class)) { return null; } /** @var ClassMetadata $metadata */ $metadata = $result[0]; if (!$metadata->hasAssociation($property) || $metadata->isCollectionValuedAssociation($property...
[ "public", "function", "guessType", "(", "$", "class", ",", "$", "property", ")", "{", "if", "(", "!", "$", "result", "=", "$", "this", "->", "getMetadata", "(", "$", "class", ")", ")", "{", "return", "null", ";", "}", "/** @var ClassMetadata $metadata */...
{@inheritdoc}
[ "{" ]
train
https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Form/TypeGuesser/DoctrineUploadTypeGuesser.php#L29-L55
steeffeen/FancyManiaLinks
FML/Script/Features/Toggle.php
Toggle.setTogglingControl
public function setTogglingControl(Control $control) { $control->checkId(); if ($control instanceof Scriptable) { $control->setScriptEvents(true); } $this->togglingControl = $control; return $this; }
php
public function setTogglingControl(Control $control) { $control->checkId(); if ($control instanceof Scriptable) { $control->setScriptEvents(true); } $this->togglingControl = $control; return $this; }
[ "public", "function", "setTogglingControl", "(", "Control", "$", "control", ")", "{", "$", "control", "->", "checkId", "(", ")", ";", "if", "(", "$", "control", "instanceof", "Scriptable", ")", "{", "$", "control", "->", "setScriptEvents", "(", "true", ")"...
Set the toggling Control @api @param Control $control Toggling Control @return static
[ "Set", "the", "toggling", "Control" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Toggle.php#L98-L106
steeffeen/FancyManiaLinks
FML/Script/Features/Toggle.php
Toggle.setOnlyShow
public function setOnlyShow($onlyShow) { $this->onlyShow = (bool)$onlyShow; if ($this->onlyShow) { $this->onlyHide = null; } return $this; }
php
public function setOnlyShow($onlyShow) { $this->onlyShow = (bool)$onlyShow; if ($this->onlyShow) { $this->onlyHide = null; } return $this; }
[ "public", "function", "setOnlyShow", "(", "$", "onlyShow", ")", "{", "$", "this", "->", "onlyShow", "=", "(", "bool", ")", "$", "onlyShow", ";", "if", "(", "$", "this", "->", "onlyShow", ")", "{", "$", "this", "->", "onlyHide", "=", "null", ";", "}...
Set Show Only @api @param bool $onlyShow If it should only show the Control but not toggle @return static
[ "Set", "Show", "Only" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Toggle.php#L175-L182
steeffeen/FancyManiaLinks
FML/Script/Features/Toggle.php
Toggle.setOnlyHide
public function setOnlyHide($onlyHide) { $this->onlyHide = (bool)$onlyHide; if ($this->onlyHide) { $this->onlyShow = null; } return $this; }
php
public function setOnlyHide($onlyHide) { $this->onlyHide = (bool)$onlyHide; if ($this->onlyHide) { $this->onlyShow = null; } return $this; }
[ "public", "function", "setOnlyHide", "(", "$", "onlyHide", ")", "{", "$", "this", "->", "onlyHide", "=", "(", "bool", ")", "$", "onlyHide", ";", "if", "(", "$", "this", "->", "onlyHide", ")", "{", "$", "this", "->", "onlyShow", "=", "null", ";", "}...
Set Hide Only @api @param bool $onlyHide If it should only hide the Control but not toggle @return static
[ "Set", "Hide", "Only" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Toggle.php#L202-L209
steeffeen/FancyManiaLinks
FML/Script/Features/Toggle.php
Toggle.getScriptText
protected function getScriptText() { $togglingControlId = Builder::escapeText($this->togglingControl->getId()); $toggledControlId = Builder::escapeText($this->toggledControl->getId()); $visibility = "!ToggleControl.Visible"; if ($this->onlyShow) { $visibility = "T...
php
protected function getScriptText() { $togglingControlId = Builder::escapeText($this->togglingControl->getId()); $toggledControlId = Builder::escapeText($this->toggledControl->getId()); $visibility = "!ToggleControl.Visible"; if ($this->onlyShow) { $visibility = "T...
[ "protected", "function", "getScriptText", "(", ")", "{", "$", "togglingControlId", "=", "Builder", "::", "escapeText", "(", "$", "this", "->", "togglingControl", "->", "getId", "(", ")", ")", ";", "$", "toggledControlId", "=", "Builder", "::", "escapeText", ...
Get the script text @return string
[ "Get", "the", "script", "text" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Toggle.php#L225-L240
liugene/framework
src/Collection.php
Collection.each
public function each(callable $callback) { foreach ($this->items as $key => $item) { $result = $callback($item, $key); if (false === $result) { break; } if (!is_object($item)) { $this->items[$key] = $result; } ...
php
public function each(callable $callback) { foreach ($this->items as $key => $item) { $result = $callback($item, $key); if (false === $result) { break; } if (!is_object($item)) { $this->items[$key] = $result; } ...
[ "public", "function", "each", "(", "callable", "$", "callback", ")", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "key", "=>", "$", "item", ")", "{", "$", "result", "=", "$", "callback", "(", "$", "item", ",", "$", "key", ")", ";",...
给数据中的每个元素执行回调 @access public @param callable $callback 回调函数 @return $this
[ "给数据中的每个元素执行回调" ]
train
https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Collection.php#L224-L239
liugene/framework
src/Collection.php
Collection.column
public function column($columnKey, $indexKey = null) { if (function_exists('array_column')) { return array_column($this->items, $columnKey, $indexKey); } $result = []; foreach ($this->items as $row) { $key = $value = null; $keySet = $valueSe...
php
public function column($columnKey, $indexKey = null) { if (function_exists('array_column')) { return array_column($this->items, $columnKey, $indexKey); } $result = []; foreach ($this->items as $row) { $key = $value = null; $keySet = $valueSe...
[ "public", "function", "column", "(", "$", "columnKey", ",", "$", "indexKey", "=", "null", ")", "{", "if", "(", "function_exists", "(", "'array_column'", ")", ")", "{", "return", "array_column", "(", "$", "this", "->", "items", ",", "$", "columnKey", ",",...
返回数据中指定的一列 @access public @param mixed $columnKey 键名 @param null $indexKey 作为索引值的列 @return array
[ "返回数据中指定的一列" ]
train
https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Collection.php#L259-L293
webforge-labs/psc-cms
lib/Psc/Net/HTTP/RequestHandler.php
RequestHandler.findService
public function findService(ServiceRequest $serviceRequest) { $this->log('Find Services..'); foreach ($this->services as $service) { $this->log('Service: '.Code::getClass($service).'::isResponsibleFor'); if ($service->isResponsibleFor($serviceRequest)) { $this->log('ok: Service übernimmt den...
php
public function findService(ServiceRequest $serviceRequest) { $this->log('Find Services..'); foreach ($this->services as $service) { $this->log('Service: '.Code::getClass($service).'::isResponsibleFor'); if ($service->isResponsibleFor($serviceRequest)) { $this->log('ok: Service übernimmt den...
[ "public", "function", "findService", "(", "ServiceRequest", "$", "serviceRequest", ")", "{", "$", "this", "->", "log", "(", "'Find Services..'", ")", ";", "foreach", "(", "$", "this", "->", "services", "as", "$", "service", ")", "{", "$", "this", "->", "...
Sucht den ersten der Services, der den Request bearbeiten will @throws NoServiceFoundException
[ "Sucht", "den", "ersten", "der", "Services", "der", "den", "Request", "bearbeiten", "will" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/HTTP/RequestHandler.php#L216-L232
webforge-labs/psc-cms
lib/Psc/Net/HTTP/RequestHandler.php
RequestHandler.addService
public function addService(Service $service) { if (!in_array($service, $this->services, TRUE)) { $this->services[] = $service; if ($service instanceof \Psc\System\LoggerObject && $service->getLogger() instanceof \Psc\System\DispatchingLogger) { $this->getLogger()->listenTo($service->getLo...
php
public function addService(Service $service) { if (!in_array($service, $this->services, TRUE)) { $this->services[] = $service; if ($service instanceof \Psc\System\LoggerObject && $service->getLogger() instanceof \Psc\System\DispatchingLogger) { $this->getLogger()->listenTo($service->getLo...
[ "public", "function", "addService", "(", "Service", "$", "service", ")", "{", "if", "(", "!", "in_array", "(", "$", "service", ",", "$", "this", "->", "services", ",", "TRUE", ")", ")", "{", "$", "this", "->", "services", "[", "]", "=", "$", "servi...
Fügt einen Service hinzu spätere Services werden immer auch später nach isResponsibleFor()- gefragt (bis jetzt)
[ "Fügt", "einen", "Service", "hinzu" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/HTTP/RequestHandler.php#L262-L271
webforge-labs/psc-cms
lib/Psc/Net/HTTP/RequestHandler.php
RequestHandler.dumpRequest
protected function dumpRequest(Request $request) { $body = $request->getBody(); $dump = "Body of request is:\n"; if (is_object($body) || is_array($body)) { $dump .= json_encode($body); } elseif(is_string($body)) { $dump .= sprintf('"%s"',$body); } return $dump; }
php
protected function dumpRequest(Request $request) { $body = $request->getBody(); $dump = "Body of request is:\n"; if (is_object($body) || is_array($body)) { $dump .= json_encode($body); } elseif(is_string($body)) { $dump .= sprintf('"%s"',$body); } return $dump; }
[ "protected", "function", "dumpRequest", "(", "Request", "$", "request", ")", "{", "$", "body", "=", "$", "request", "->", "getBody", "(", ")", ";", "$", "dump", "=", "\"Body of request is:\\n\"", ";", "if", "(", "is_object", "(", "$", "body", ")", "||", ...
returns a importable string representation of the request @return string
[ "returns", "a", "importable", "string", "representation", "of", "the", "request" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/HTTP/RequestHandler.php#L317-L329
webforge-labs/psc-cms
lib/Psc/Net/HTTP/RequestHandler.php
RequestHandler.setServices
public function setServices(Array $services) { $this->services = array(); foreach ($services as $service) { $this->addService($service); } return $this; }
php
public function setServices(Array $services) { $this->services = array(); foreach ($services as $service) { $this->addService($service); } return $this; }
[ "public", "function", "setServices", "(", "Array", "$", "services", ")", "{", "$", "this", "->", "services", "=", "array", "(", ")", ";", "foreach", "(", "$", "services", "as", "$", "service", ")", "{", "$", "this", "->", "addService", "(", "$", "ser...
Überschreibt alle Services
[ "Überschreibt", "alle", "Services" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Net/HTTP/RequestHandler.php#L369-L375
CakeCMS/Core
src/View/Widget/MaterializeCss/FileWidget.php
FileWidget.render
public function render(array $data, ContextInterface $context) { $data += [ 'name' => '', 'templateVars' => [], 'escape' => true ]; unset($data['val']); $title = (Arr::key('title', $data)) ? $data['title'] : $data['name']; ...
php
public function render(array $data, ContextInterface $context) { $data += [ 'name' => '', 'templateVars' => [], 'escape' => true ]; unset($data['val']); $title = (Arr::key('title', $data)) ? $data['title'] : $data['name']; ...
[ "public", "function", "render", "(", "array", "$", "data", ",", "ContextInterface", "$", "context", ")", "{", "$", "data", "+=", "[", "'name'", "=>", "''", ",", "'templateVars'", "=>", "[", "]", ",", "'escape'", "=>", "true", "]", ";", "unset", "(", ...
Render a file upload form widget. Data supports the following keys: - `name` - Set the input name. - `escape` - Set to false to disable HTML escaping. All other keys will be converted into HTML attributes. Unlike other input objects the `val` property will be specifically ignored. @param array $data The data to b...
[ "Render", "a", "file", "upload", "form", "widget", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Widget/MaterializeCss/FileWidget.php#L47-L65
VincentChalnot/SidusEAVFilterBundle
Pager/Adapter/EAVAdapter.php
EAVAdapter.create
public static function create(DataLoaderInterface $dataLoader, QueryBuilder $qb, $depth = 2) { return new self( $dataLoader, new DoctrineORMAdapter($qb, false, $depth) ); }
php
public static function create(DataLoaderInterface $dataLoader, QueryBuilder $qb, $depth = 2) { return new self( $dataLoader, new DoctrineORMAdapter($qb, false, $depth) ); }
[ "public", "static", "function", "create", "(", "DataLoaderInterface", "$", "dataLoader", ",", "QueryBuilder", "$", "qb", ",", "$", "depth", "=", "2", ")", "{", "return", "new", "self", "(", "$", "dataLoader", ",", "new", "DoctrineORMAdapter", "(", "$", "qb...
Automatically creates an adapter with the Sidus/FilterBundle's DoctrineORMAdapter @param DataLoaderInterface $dataLoader @param QueryBuilder $qb @param int $depth @return EAVAdapter
[ "Automatically", "creates", "an", "adapter", "with", "the", "Sidus", "/", "FilterBundle", "s", "DoctrineORMAdapter" ]
train
https://github.com/VincentChalnot/SidusEAVFilterBundle/blob/25a9e0495fae30cb96ecded56c50cf7fe70c9032/Pager/Adapter/EAVAdapter.php#L35-L41
VincentChalnot/SidusEAVFilterBundle
Pager/Adapter/EAVAdapter.php
EAVAdapter.getSlice
public function getSlice($offset, $length) { $iterator = $this->baseAdapter->getSlice($offset, $length); $this->dataLoader->load($iterator, $this->depth); return $iterator; }
php
public function getSlice($offset, $length) { $iterator = $this->baseAdapter->getSlice($offset, $length); $this->dataLoader->load($iterator, $this->depth); return $iterator; }
[ "public", "function", "getSlice", "(", "$", "offset", ",", "$", "length", ")", "{", "$", "iterator", "=", "$", "this", "->", "baseAdapter", "->", "getSlice", "(", "$", "offset", ",", "$", "length", ")", ";", "$", "this", "->", "dataLoader", "->", "lo...
{@inheritdoc}
[ "{" ]
train
https://github.com/VincentChalnot/SidusEAVFilterBundle/blob/25a9e0495fae30cb96ecded56c50cf7fe70c9032/Pager/Adapter/EAVAdapter.php#L61-L67
slashworks/control-bundle
src/Slashworks/BackendBundle/Form/Type/InstallType.php
InstallType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add("controlUrl", "text", array( 'required' => true, 'data' => $this->_getSiteURL(), ...
php
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add("controlUrl", "text", array( 'required' => true, 'data' => $this->_getSiteURL(), ...
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "builder", "->", "add", "(", "\"controlUrl\"", ",", "\"text\"", ",", "array", "(", "'required'", "=>", "true", ",", "'data'", "=>", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Form/Type/InstallType.php#L43-L157
drsdre/yii2-xmlsoccer
models/Team.php
Team.getMatches
public function getMatches() { $matches = ArrayHelper::merge($this->homeMatches, $this->awayMatches); ArrayHelper::multisort($matches, 'date', SORT_ASC); return $matches; }
php
public function getMatches() { $matches = ArrayHelper::merge($this->homeMatches, $this->awayMatches); ArrayHelper::multisort($matches, 'date', SORT_ASC); return $matches; }
[ "public", "function", "getMatches", "(", ")", "{", "$", "matches", "=", "ArrayHelper", "::", "merge", "(", "$", "this", "->", "homeMatches", ",", "$", "this", "->", "awayMatches", ")", ";", "ArrayHelper", "::", "multisort", "(", "$", "matches", ",", "'da...
Get all matches @return array
[ "Get", "all", "matches" ]
train
https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/models/Team.php#L96-L101
anime-db/app-bundle
src/Controller/NoticeController.php
NoticeController.showAction
public function showAction(Request $request) { $em = $this->getDoctrine()->getManager(); /* @var $rep NoticeRepository */ $rep = $em->getRepository('AnimeDbAppBundle:Notice'); $notice = $rep->getFirstShow(); // caching /* @var $response JsonResponse */ $respo...
php
public function showAction(Request $request) { $em = $this->getDoctrine()->getManager(); /* @var $rep NoticeRepository */ $rep = $em->getRepository('AnimeDbAppBundle:Notice'); $notice = $rep->getFirstShow(); // caching /* @var $response JsonResponse */ $respo...
[ "public", "function", "showAction", "(", "Request", "$", "request", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManager", "(", ")", ";", "/* @var $rep NoticeRepository */", "$", "rep", "=", "$", "em", "->", "getRepositor...
Show last notice. @param Request $request @return JsonResponse
[ "Show", "last", "notice", "." ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/NoticeController.php#L25-L59
anime-db/app-bundle
src/Controller/NoticeController.php
NoticeController.closeAction
public function closeAction(Notice $notice) { // mark as closed $notice->setStatus(Notice::STATUS_CLOSED); $em = $this->getDoctrine()->getManager(); $em->persist($notice); $em->flush(); return new JsonResponse([]); }
php
public function closeAction(Notice $notice) { // mark as closed $notice->setStatus(Notice::STATUS_CLOSED); $em = $this->getDoctrine()->getManager(); $em->persist($notice); $em->flush(); return new JsonResponse([]); }
[ "public", "function", "closeAction", "(", "Notice", "$", "notice", ")", "{", "// mark as closed", "$", "notice", "->", "setStatus", "(", "Notice", "::", "STATUS_CLOSED", ")", ";", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManage...
@param Notice $notice @return JsonResponse
[ "@param", "Notice", "$notice" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/NoticeController.php#L66-L75
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/ManyToMany.php
ManyToMany.setDefaultOptions
protected function setDefaultOptions(array $options=[]) { $tables = [ 'model' => $this->model->getTable(), 'toModel' => $this->toModel->getTable() ]; asort($tables, SORT_REGULAR); $pivotTable = implode('_', array_map([Str::class, 'singular'], $tables)); ...
php
protected function setDefaultOptions(array $options=[]) { $tables = [ 'model' => $this->model->getTable(), 'toModel' => $this->toModel->getTable() ]; asort($tables, SORT_REGULAR); $pivotTable = implode('_', array_map([Str::class, 'singular'], $tables)); ...
[ "protected", "function", "setDefaultOptions", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "tables", "=", "[", "'model'", "=>", "$", "this", "->", "model", "->", "getTable", "(", ")", ",", "'toModel'", "=>", "$", "this", "->", "toModel",...
set default options @param array $options @return void
[ "set", "default", "options" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/ManyToMany.php#L15-L31
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/ManyToMany.php
ManyToMany.stylingText
protected function stylingText() { $modelTable = $this->model->getTable(); $toModelTable = $this->toModel->getTable(); $pivotTable = $this->defaultOptions['pivot_table']; $foreignKey = $this->defaultOptions['foreign_key']; $relatedKey = $this->defaultOptions['related_key']; ...
php
protected function stylingText() { $modelTable = $this->model->getTable(); $toModelTable = $this->toModel->getTable(); $pivotTable = $this->defaultOptions['pivot_table']; $foreignKey = $this->defaultOptions['foreign_key']; $relatedKey = $this->defaultOptions['related_key']; ...
[ "protected", "function", "stylingText", "(", ")", "{", "$", "modelTable", "=", "$", "this", "->", "model", "->", "getTable", "(", ")", ";", "$", "toModelTable", "=", "$", "this", "->", "toModel", "->", "getTable", "(", ")", ";", "$", "pivotTable", "=",...
styling text @return void
[ "styling", "text" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/ManyToMany.php#L38-L56
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/ManyToMany.php
ManyToMany.setConnectedRelationOptions
protected function setConnectedRelationOptions() { $pivotTable = $this->defaultOptions['pivot_table']; $foreignKey = $this->defaultOptions['foreign_key']; $relatedKey = $this->defaultOptions['related_key']; if (! $this->db->isTableExists($pivotTable)) { $question = "Can'...
php
protected function setConnectedRelationOptions() { $pivotTable = $this->defaultOptions['pivot_table']; $foreignKey = $this->defaultOptions['foreign_key']; $relatedKey = $this->defaultOptions['related_key']; if (! $this->db->isTableExists($pivotTable)) { $question = "Can'...
[ "protected", "function", "setConnectedRelationOptions", "(", ")", "{", "$", "pivotTable", "=", "$", "this", "->", "defaultOptions", "[", "'pivot_table'", "]", ";", "$", "foreignKey", "=", "$", "this", "->", "defaultOptions", "[", "'foreign_key'", "]", ";", "$"...
get connected db relation options @return void
[ "get", "connected", "db", "relation", "options" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/ManyToMany.php#L63-L86
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/ManyToMany.php
ManyToMany.askToUseCustomeOptions
protected function askToUseCustomeOptions() { $question = "The {$this->text['pivot_text']} in the database will be?"; $this->options['pivot_table'] = $this->command->ask($question, $this->defaultOptions['pivot_table']); $this->text['pivot_table'] = "[".$this->command->paintString($this->opti...
php
protected function askToUseCustomeOptions() { $question = "The {$this->text['pivot_text']} in the database will be?"; $this->options['pivot_table'] = $this->command->ask($question, $this->defaultOptions['pivot_table']); $this->text['pivot_table'] = "[".$this->command->paintString($this->opti...
[ "protected", "function", "askToUseCustomeOptions", "(", ")", "{", "$", "question", "=", "\"The {$this->text['pivot_text']} in the database will be?\"", ";", "$", "this", "->", "options", "[", "'pivot_table'", "]", "=", "$", "this", "->", "command", "->", "ask", "(",...
ask to use custome options @return void
[ "ask", "to", "use", "custome", "options" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/ManyToMany.php#L107-L118
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/ManyToMany.php
ManyToMany.buildRelations
public function buildRelations() { $this->command->buildMethod($this->model, 'belongsToMany', $this->toModel, $this->options); $foreignKey = $this->options['foreign_key']; $relatedKey = $this->options['related_key']; $this->options['foreign_key'] = $relatedKey; $this->option...
php
public function buildRelations() { $this->command->buildMethod($this->model, 'belongsToMany', $this->toModel, $this->options); $foreignKey = $this->options['foreign_key']; $relatedKey = $this->options['related_key']; $this->options['foreign_key'] = $relatedKey; $this->option...
[ "public", "function", "buildRelations", "(", ")", "{", "$", "this", "->", "command", "->", "buildMethod", "(", "$", "this", "->", "model", ",", "'belongsToMany'", ",", "$", "this", "->", "toModel", ",", "$", "this", "->", "options", ")", ";", "$", "for...
build relations between models @return void
[ "build", "relations", "between", "models" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/ManyToMany.php#L125-L136
anime-db/app-bundle
src/Repository/Notice.php
Notice.getList
public function getList($limit, $offset = 0) { return $this->getEntityManager()->createQuery(' SELECT n FROM AnimeDbAppBundle:Notice n ORDER BY n.date_created DESC ') ->setFirstResult($offset) ...
php
public function getList($limit, $offset = 0) { return $this->getEntityManager()->createQuery(' SELECT n FROM AnimeDbAppBundle:Notice n ORDER BY n.date_created DESC ') ->setFirstResult($offset) ...
[ "public", "function", "getList", "(", "$", "limit", ",", "$", "offset", "=", "0", ")", "{", "return", "$", "this", "->", "getEntityManager", "(", ")", "->", "createQuery", "(", "'\n SELECT\n n\n FROM\n AnimeDbAppBundle...
@param int $limit @param int $offset @return NoticeEntity[]
[ "@param", "int", "$limit", "@param", "int", "$offset" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Repository/Notice.php#L51-L64
anime-db/app-bundle
src/Repository/Notice.php
Notice.getFilteredQuery
public function getFilteredQuery($status, $type) { $query = $this->createQueryBuilder('n'); if (is_int($status) && in_array($status, NoticeEntity::getStatuses())) { $query ->where('n.status = :status') ->setParameter('status', $status); } ...
php
public function getFilteredQuery($status, $type) { $query = $this->createQueryBuilder('n'); if (is_int($status) && in_array($status, NoticeEntity::getStatuses())) { $query ->where('n.status = :status') ->setParameter('status', $status); } ...
[ "public", "function", "getFilteredQuery", "(", "$", "status", ",", "$", "type", ")", "{", "$", "query", "=", "$", "this", "->", "createQueryBuilder", "(", "'n'", ")", ";", "if", "(", "is_int", "(", "$", "status", ")", "&&", "in_array", "(", "$", "sta...
@param int $status @param string $type @return QueryBuilder
[ "@param", "int", "$status", "@param", "string", "$type" ]
train
https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Repository/Notice.php#L174-L191
krzysztofmazur/php-object-mapper
src/KrzysztofMazur/ObjectMapper/Mapping/Field/FieldsMatchmaker.php
FieldsMatchmaker.match
public function match($sourceClass, $targetClass) { $fields = []; $targetClassProperties = Reflection::getPropertyNames($targetClass); $sourceClassProperties = Reflection::getPropertyNames($sourceClass); $this->matchProperties($fields, $targetClassProperties, $sourceClassProperties);...
php
public function match($sourceClass, $targetClass) { $fields = []; $targetClassProperties = Reflection::getPropertyNames($targetClass); $sourceClassProperties = Reflection::getPropertyNames($sourceClass); $this->matchProperties($fields, $targetClassProperties, $sourceClassProperties);...
[ "public", "function", "match", "(", "$", "sourceClass", ",", "$", "targetClass", ")", "{", "$", "fields", "=", "[", "]", ";", "$", "targetClassProperties", "=", "Reflection", "::", "getPropertyNames", "(", "$", "targetClass", ")", ";", "$", "sourceClassPrope...
{@inheritdoc}
[ "{" ]
train
https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/Mapping/Field/FieldsMatchmaker.php#L37-L46
dreamfactorysoftware/df-file
src/Components/SFTPFileSystem.php
SFTPFileSystem.getFolder
public function getFolder($container, $path, $include_files = true, $include_folders = true, $full_tree = false) { if ($this->folderExists($container, $path)) { $path = rtrim($path, '/'); $contents = $this->adapter->listContents($path, $full_tree); foreach ($contents as $...
php
public function getFolder($container, $path, $include_files = true, $include_folders = true, $full_tree = false) { if ($this->folderExists($container, $path)) { $path = rtrim($path, '/'); $contents = $this->adapter->listContents($path, $full_tree); foreach ($contents as $...
[ "public", "function", "getFolder", "(", "$", "container", ",", "$", "path", ",", "$", "include_files", "=", "true", ",", "$", "include_folders", "=", "true", ",", "$", "full_tree", "=", "false", ")", "{", "if", "(", "$", "this", "->", "folderExists", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SFTPFileSystem.php#L20-L38
dreamfactorysoftware/df-file
src/Components/SFTPFileSystem.php
SFTPFileSystem.normalizeFolderInfo
protected function normalizeFolderInfo(array & $folder, $localizer) { if(empty(array_get($folder, 'type')) && !empty(array_get($folder, 'path'))){ $folder['type'] = 'dir'; } parent::normalizeFolderInfo($folder, $localizer); $folder['last_modified'] = gmdate('D, d M Y H:i:...
php
protected function normalizeFolderInfo(array & $folder, $localizer) { if(empty(array_get($folder, 'type')) && !empty(array_get($folder, 'path'))){ $folder['type'] = 'dir'; } parent::normalizeFolderInfo($folder, $localizer); $folder['last_modified'] = gmdate('D, d M Y H:i:...
[ "protected", "function", "normalizeFolderInfo", "(", "array", "&", "$", "folder", ",", "$", "localizer", ")", "{", "if", "(", "empty", "(", "array_get", "(", "$", "folder", ",", "'type'", ")", ")", "&&", "!", "empty", "(", "array_get", "(", "$", "folde...
@param array $folder @param string $localizer @throws \DreamFactory\Core\Exceptions\InternalServerErrorException
[ "@param", "array", "$folder", "@param", "string", "$localizer" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SFTPFileSystem.php#L46-L54
webforge-labs/psc-cms
lib/Psc/Graph/BFSVertice.php
BFSVertice.getParents
public function getParents($withSelf = TRUE) { $node = $this; $parents = array(); while ($node->getParent() != NULL) { $parents[] = $node->getParent(); $node = $node->getParent(); } if ($withSelf) array_unshift($parents,$this); return $parents; }
php
public function getParents($withSelf = TRUE) { $node = $this; $parents = array(); while ($node->getParent() != NULL) { $parents[] = $node->getParent(); $node = $node->getParent(); } if ($withSelf) array_unshift($parents,$this); return $parents; }
[ "public", "function", "getParents", "(", "$", "withSelf", "=", "TRUE", ")", "{", "$", "node", "=", "$", "this", ";", "$", "parents", "=", "array", "(", ")", ";", "while", "(", "$", "node", "->", "getParent", "(", ")", "!=", "NULL", ")", "{", "$",...
Gibt die Eltern des Knoten zurücks Dabei werden auch die Eltern der Eltern des Knotens zurückgegeben (diese stehe im Array weiter hinten) Die Node selbst ist nicht im Array enthalten wenn $withSelf FALSE ist
[ "Gibt", "die", "Eltern", "des", "Knoten", "zurücks" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/BFSVertice.php#L43-L52
php-rise/rise
src/Request/Upload/File.php
File.moveTo
public function moveTo($destination) { if (!$this->isValid()) { return null; } $path = $this->generateFinalPath($destination); $moved = move_uploaded_file($this->tmpName, $path); if (!$moved) { return null; } return $path; }
php
public function moveTo($destination) { if (!$this->isValid()) { return null; } $path = $this->generateFinalPath($destination); $moved = move_uploaded_file($this->tmpName, $path); if (!$moved) { return null; } return $path; }
[ "public", "function", "moveTo", "(", "$", "destination", ")", "{", "if", "(", "!", "$", "this", "->", "isValid", "(", ")", ")", "{", "return", "null", ";", "}", "$", "path", "=", "$", "this", "->", "generateFinalPath", "(", "$", "destination", ")", ...
Move file. @param string $destination @return string|null Path of the moved file.
[ "Move", "file", "." ]
train
https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Request/Upload/File.php#L132-L145
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.make
public static function make($attributes = []) { $jobset = new static(); // make jobset model $model = $jobset->makeModel($attributes); // update local model $jobset->setModel($model); // make job models and init job instances $jobset->makeJobs(); // s...
php
public static function make($attributes = []) { $jobset = new static(); // make jobset model $model = $jobset->makeModel($attributes); // update local model $jobset->setModel($model); // make job models and init job instances $jobset->makeJobs(); // s...
[ "public", "static", "function", "make", "(", "$", "attributes", "=", "[", "]", ")", "{", "$", "jobset", "=", "new", "static", "(", ")", ";", "// make jobset model", "$", "model", "=", "$", "jobset", "->", "makeModel", "(", "$", "attributes", ")", ";", ...
Make new jobset @param array $attributes @return BaseJobset
[ "Make", "new", "jobset" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L37-L53
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.get
public static function get($id) { $jobset = new static(); // find jobset model $model = $jobset->findModel($id); // update local model $jobset->setModel($model); // Init job instances $jobset->initJobs(); return $jobset; }
php
public static function get($id) { $jobset = new static(); // find jobset model $model = $jobset->findModel($id); // update local model $jobset->setModel($model); // Init job instances $jobset->initJobs(); return $jobset; }
[ "public", "static", "function", "get", "(", "$", "id", ")", "{", "$", "jobset", "=", "new", "static", "(", ")", ";", "// find jobset model", "$", "model", "=", "$", "jobset", "->", "findModel", "(", "$", "id", ")", ";", "// update local model", "$", "j...
Get an existed jobset @param $id @return static
[ "Get", "an", "existed", "jobset" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L61-L73