_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q11600 | GroupVersionHydrator.hydrateEntity | train | private function hydrateEntity(EntityInterface $entity, $group, $version)
{
$entity->setEntityGroup($group);
$entity->setAPIVersion($version);
// hydrate all the sub-fields recursively using JMS to extract them and identify their type
$metadata = $this->metadataFactory->getMetadataF... | php | {
"resource": ""
} |
q11601 | APIRequests.request | train | public static function request(
$arg_endpoint,
$arg_method,
array $arg_data = array(),
array $arg_headers = array()
) {
$return = array();
$headers = array(
'Accept: application/json',
'DUE-API-KEY: '.Due::getApiKey(),
'DUE-PLATFORM... | php | {
"resource": ""
} |
q11602 | APIRequests.headersToArray | train | public static function headersToArray($header_text)
{
$headers = array();
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
if(!empty($line) && strpos($line, ':') !== false)... | php | {
"resource": ""
} |
q11603 | Application.loadFactory | train | protected function loadFactory(?array $params=[])
{
if (\is_array($params) && !empty($params['class']) && \class_exists($params['class'])) {
$factory = new $params['class']($params['options'] ?? []);
$this->getLogger()->debug('Factory created',[
'factory'=>$factory
]);
return $fac... | php | {
"resource": ""
} |
q11604 | Application.setCookie | train | public function setCookie(string $name, string $value=null, int $expire=0, string $path='', string $domain='', bool $secure=false, bool $httpOnly=false)
{
if ( \array_key_exists($name,$this->cookies) && \is_null($value) ) {
# Remove the Cookie
$this->cookies = \array_diff_key($this->cookies,[$name=>''... | php | {
"resource": ""
} |
q11605 | Application.sendResponse | train | public function sendResponse()
{
# Set HTTP Response Code
\http_response_code($this->getResponse()->getStatusCode());
# Set All HTTP headers from Response Object
foreach ($this->getResponse()->getHeaders() as $header => $value) {
if (\is_array($value)) {
$values = \implode(';',$value);
... | php | {
"resource": ""
} |
q11606 | TaxModifier.updateTotal | train | public function updateTotal(&$total) {
$rate = (float)self::config()->get('tax_rate') / 100;
$tax = $total * $rate;
$this->setPriceModification($tax);
if (!(bool)self::config()->get('inclusive')) {
$total += $tax;
}
} | php | {
"resource": ""
} |
q11607 | TaxModifier.getTableTitle | train | public function getTableTitle()
{
$rate = _t(
'TaxModifier.TABLE_TITLE',
'{rate}% BTW',
null,
array(
'rate' => (float)self::config()->get('tax_rate')
)
);
if ((bool)self::config()->get('inclusive')) {
$i... | php | {
"resource": ""
} |
q11608 | TaxModifier.findOrMake | train | public static function findOrMake(Reservation $reservation)
{
if (!$modifier = $reservation->PriceModifiers()->find('ClassName', self::class)) {
$modifier = self::create();
$modifier->write();
}
return $modifier;
} | php | {
"resource": ""
} |
q11609 | MapTableMap.doDelete | train | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(MapTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = ... | php | {
"resource": ""
} |
q11610 | FileSystem.getUserData | train | public function getUserData() : FilesystemInterface
{
if ($this->connectionType == self::CONNECTION_TYPE_LOCAL) {
return $this->getLocalAdapter();
} else {
return $this->remoteAdapter;
}
} | php | {
"resource": ""
} |
q11611 | FileSystem.getLocalAdapter | train | protected function getLocalAdapter() : FilesystemInterface
{
if (is_null($this->localAdapter)) {
$dir = $this->factory->getConnection()->getMapsDirectory();
$this->localAdapter = new \League\Flysystem\Filesystem(new Local($dir.'/../'));
}
return $this->localAdapter;
... | php | {
"resource": ""
} |
q11612 | PluginManager.isPluginCompatible | train | protected function isPluginCompatible(PluginDescription $plugin, $enabledPlugins, $title, $mode, $script, Map $map)
{
// first check for other plugins.
foreach ($plugin->getParents() as $parentPluginId) {
if (!isset($enabledPlugins[$parentPluginId])) {
// A parent plugin... | php | {
"resource": ""
} |
q11613 | PluginManager.enablePlugin | train | protected function enablePlugin(PluginDescription $plugin, $title, $mode, $script, Map $map)
{
$notify = false;
$plugin->setIsEnabled(true);
$pluginService = $this->container->get($plugin->getPluginId());
if (!isset($this->enabledPlugins[$plugin->getPluginId()])) {
$noti... | php | {
"resource": ""
} |
q11614 | InstallHelperService.getDomain | train | public function getDomain()
{
$uri = $this->getServiceLocator()->get('Application')->getMvcEvent()->getRequest()->getUri();
return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
} | php | {
"resource": ""
} |
q11615 | InstallHelperService.checkMysqlConnection | train | public function checkMysqlConnection($host, $db, $user, $pass)
{
$results = array();
$isConnected = 0;
$isDatabaseExists = 0;
$isDatabaseCollationNameValid = 0;
$isPassCorrect = 1;
if($this->i... | php | {
"resource": ""
} |
q11616 | InstallHelperService.setDbAdapter | train | public function setDbAdapter($config)
{
if(is_array($config)) {
$this->odbAdapter = new DbAdapter(array_merge(array(
'driver' => 'Pdo_Mysql',
'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
)
... | php | {
"resource": ""
} |
q11617 | InstallHelperService.executeRawQuery | train | public function executeRawQuery($query)
{
$resultSet = null;
if($this->odbAdapter) {
if(!empty($query)) {
$resultSet = $this->getDbAdapter()->query($query, DbAdapter::QUERY_MODE_EXECUTE);
}
}
return $resultSet;
} | php | {
"resource": ""
} |
q11618 | InstallHelperService.isDbTableExists | train | public function isDbTableExists($tableName)
{
$status = false;
$resultSet = array();
$query = $this->executeRawQuery("SHOW TABLES LIKE '".trim($tableName)."';");
if($resultSet)
$resultSet = $query->toArray();
if(!empty($resultSet)) {
$status = true... | php | {
"resource": ""
} |
q11619 | InstallHelperService.importSql | train | public function importSql($path, $files = array('setup_structure.sql'))
{
$status = false;
$fImport = null;
if(file_exists($path)) {
foreach($files as $file) {
if(file_exists($path.$file)) {
$fImport = file_get_contents($path.$file);
... | php | {
"resource": ""
} |
q11620 | InstallHelperService.getSqlFileTables | train | public function getSqlFileTables($path)
{
$tables = array();
if(file_exists($path)) {
$file = fopen($path, 'r');
$textToFind = 'CREATE TABLE IF NOT EXISTS ';
$found = array();
$tables = array();
while(!feof($file)) {
$outpu... | php | {
"resource": ""
} |
q11621 | InstallHelperService.checkEnvironmentVariables | train | public function checkEnvironmentVariables()
{
$settingsValues = array();
$iniSettings = array(
'memory_limit', 'max_execution_time', 'upload_max_filesize'
);
foreach($iniSettings as $setting) {
$settingsValues[$setting] = ini_get($setting);
}
... | php | {
"resource": ""
} |
q11622 | InstallHelperService.filePermission | train | public function filePermission($path, $mode = self::CHMOD_775)
{
$results = array();
$success = 0;
if(file_exists($path)) {
if(!is_writable($path))
chmod($path, $mode);
if(!is_readable($path))
chmod($path, $mode);
if(is_re... | php | {
"resource": ""
} |
q11623 | InstallHelperService.replaceFile | train | public function replaceFile($old, $new, array $content)
{
$oldFileContent = file_get_contents($old);
file_put_contents($new, vsprintf($oldFileContent, $content));
unlink($old);
} | php | {
"resource": ""
} |
q11624 | MimeTypeFileExtensionGuesser.guess | train | public static function guess(string $guess): ?string
{
if (! \is_file($guess)) {
throw new FileNotFoundException($guess);
}
if (! \is_readable($guess)) {
throw new AccessDeniedException($guess);
}
return parent::guess(\pathinfo($guess, \PATHINFO_EXTE... | php | {
"resource": ""
} |
q11625 | ConfigManager.registerConfig | train | public function registerConfig(ConfigInterface $config, $id)
{
$this->configurationDefinitions[spl_object_hash($config)] = $config;
$this->configurationIds[spl_object_hash($config)] = $id;
$this->configTree->set($config->getPath(), $config);
$config->setConfigManager($this);
} | php | {
"resource": ""
} |
q11626 | ModelSearch.run | train | public function run(&$query, $model, $request)
{
$this->query = $query;
$this->getAttributes($model);
$this->parseRequest($request);
return $this->query();
} | php | {
"resource": ""
} |
q11627 | ModelSearch.query | train | private function query()
{
foreach ($this->search_models as $model_name => $filters) {
// Apply search against the original model.
if ($model_name === 'self') {
self::applySearch($this->query, $filters);
continue;
}
// Apply se... | php | {
"resource": ""
} |
q11628 | ModelSearch.getAttributes | train | public function getAttributes($model)
{
$this->model = $model;
$this->attributes = self::buildRelationshipAttributes($this->model);
$this->attributes = $this->attributes + self::buildAttributes($this->model);
return $this->attributes;
} | php | {
"resource": ""
} |
q11629 | ModelSearch.buildRelationshipAttributes | train | private function buildRelationshipAttributes($model)
{
$result = [];
foreach ($model->getSearchRelationships() as $method) {
if (!method_exists($model, $method)) {
continue;
}
$relation = self::getRelation($model->$method());
$this->r... | php | {
"resource": ""
} |
q11630 | ModelSearch.buildAttributes | train | public static function buildAttributes($model)
{
$result = [];
self::buildCastedAttributes($model, $result);
self::buildSearchAttributes($model, $result);
return $result;
} | php | {
"resource": ""
} |
q11631 | ModelSearch.buildCastedAttributes | train | private static function buildCastedAttributes($model, &$result, $method = null)
{
$model_name = 'self';
$name_append = '';
if (!is_null($method)) {
$model_name = $method;
$name_append = $method.'.';
}
// ModelSchema implementation gives us better dat... | php | {
"resource": ""
} |
q11632 | ModelSearch.validateAttributes | train | private static function validateAttributes($model, $name, &$attributes)
{
// Should be an array.
if (!is_array($attributes)) {
$attributes = [$attributes];
}
// Is empty, use the name of the table + name.
if (empty($attributes)) {
$attributes = [sprin... | php | {
"resource": ""
} |
q11633 | ModelSearch.parseRequest | train | private function parseRequest($request)
{
if (empty($request)) {
return;
}
$this->request = $request;
// Models used in this request.
$models_used = [];
// Review each request.
foreach ($this->request as $name => $filters) {
// This ... | php | {
"resource": ""
} |
q11634 | ModelSearch.validateFilters | train | private static function validateFilters($filters, $settings)
{
if (!is_array($filters)) {
$filters = [$filters];
}
// Each fitler.
foreach ($filters as $index => &$filter) {
// Check this item.
$filter = self::validateFilterItem($filter, $setting... | php | {
"resource": ""
} |
q11635 | ModelSearch.validateFilterItem | train | private static function validateFilterItem($filter, $settings)
{
// Convert string to filter array.
if (!is_array($filter)) {
$filter = ['', $filter];
}
// Convert string to filter array.
if (Arr::get($settings, 'filter') !== 'boolean' && count($filter) == 1) {
... | php | {
"resource": ""
} |
q11636 | ModelSearch.applyWildAll | train | private static function applyWildAll(&$operator, &$value)
{
$positive = !(stripos($operator, '!') !== false || stripos($operator, 'NOT') !== false);
$operator = $positive ? '*=*' : '*!=*';
$value_array = str_split(str_replace(' ', '', $value));
$value = implode('%', $value_array);
... | php | {
"resource": ""
} |
q11637 | ModelSearch.parseInlineOperator | train | public static function parseInlineOperator($text)
{
$operator_name = 'contains';
$operator = Arr::get($text, 0, '');
$value = Arr::get($text, 1, false);
self::checkInlineOperator($operator, $value);
if (!empty($operator)) {
$operator_name = Arr::get(self::getOpe... | php | {
"resource": ""
} |
q11638 | ModelSearch.checkInlineOperator | train | private static function checkInlineOperator(&$operator, &$value, $settings = [])
{
if (is_array($value)) {
return;
}
// Boolean does not provide inline operations.
if (Arr::get($settings, 'filter') === 'boolean') {
return;
}
$value_array = ex... | php | {
"resource": ""
} |
q11639 | ModelSearch.filterByUuid | train | public static function filterByUuid($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
$value_one = Arr::get($filter, 'value_one');
$value_two = Arr::get($filter, 'value_two');
$set... | php | {
"resource": ""
} |
q11640 | ModelSearch.filterByString | train | public static function filterByString($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
$value_one = Arr::get($filter, 'value_one');
$value_two = Arr::get($filter, 'value_two');
$s... | php | {
"resource": ""
} |
q11641 | ModelSearch.filterByScope | train | public static function filterByScope($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$source = Arr::get($filter, 'settings.source');
$arguments = Arr::get($filter, 'arguments');
$value_one = Arr::get($filter, 'value_one');
... | php | {
"resource": ""
} |
q11642 | ModelSearch.modelJoin | train | public function modelJoin($relationships, $operator = '=', $type = 'left', $where = false)
{
if (!is_array($relationships)) {
$relationships = [$relationships];
}
if (empty($this->query->columns)) {
$this->query->selectRaw('DISTINCT '.$this->model->getTable().'.*');
... | php | {
"resource": ""
} |
q11643 | ModelSearch.applySearch | train | private static function applySearch(&$query, $search)
{
foreach ($search as $name => $filters) {
foreach ($filters as $filter) {
self::applySearchFilter($query, $filter);
}
}
} | php | {
"resource": ""
} |
q11644 | ModelSearch.applySearchFilter | train | private static function applySearchFilter(&$query, $filter)
{
$filter_type = Arr::get($filter, 'settings.filter');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
$attributes = Arr::get($filter, 'settings.attributes');
$positive = Arr::get(... | php | {
"resource": ""
} |
q11645 | ModelSearch.getOperator | train | public static function getOperator($type, $operator)
{
$operators = self::getOperators($type);
return Arr::get($operators, $operator, []);
} | php | {
"resource": ""
} |
q11646 | ModelSearch.getOperators | train | public static function getOperators($type)
{
if (!in_array($type, self::getTypes())) {
return [];
}
$source = snake_case($type).'_operators';
return self::$$source;
} | php | {
"resource": ""
} |
q11647 | ModelSearch.getListFromString | train | private static function getListFromString($value)
{
if (is_string($value_array = $value)) {
$value = str_replace([',', ' '], ';', $value);
$value_array = explode(';', $value);
}
if (is_array($value_array)) {
return array_filter(array_map('trim', $value_ar... | php | {
"resource": ""
} |
q11648 | Smarty_Internal_Template.compileTemplateSource | train | public function compileTemplateSource()
{
if (!$this->source->recompiled) {
$this->properties['file_dependency'] = array();
if ($this->source->components) {
// for the extends resource the compiler will fill it
// uses real resource for file dependency... | php | {
"resource": ""
} |
q11649 | Smarty_Internal_Template.getSubTemplate | train | public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope)
{
// already in template cache?
if ($this->smarty->allow_ambiguous_resources) {
$_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compil... | php | {
"resource": ""
} |
q11650 | ServerRequestFactory.createServerRequestFromArray | train | public function createServerRequestFromArray(?array $server)
{
global $app;
# Copied from Guzzles ::fromGlobals(), but we need to support the $server array as
# paramter, so we use that instead of the $_SERVER array guzzle uses by default
$method = isset($server['REQUEST_METHOD']) ? $server['REQUEST... | php | {
"resource": ""
} |
q11651 | Kohana_PayPal.payment | train | public static function payment($amount, $localTrxID = null) {
$impl = new PayPal();
$registration = $impl->registerTransaction($amount, $impl->storeLocalTrx($localTrxID));
Session::instance()->set(self::SESSION_TOKEN, $registration->id);
foreach ($registration->links as $link) {
if ($link->rel == 'appr... | php | {
"resource": ""
} |
q11652 | Kohana_PayPal.registerTransaction | train | public function registerTransaction($amount, $localTrxID) {
$token = $this->authenticate();
// paypal like the amount as string, to prevent floating point errors
if (!is_string($amount))
$amount = sprintf("%0.2f", $amount);
$a = (object)[
"amount" => (object)[
"total" => $amount,
"currency" ... | php | {
"resource": ""
} |
q11653 | Kohana_PayPal.storeLocalTrx | train | private function storeLocalTrx($localTrxID) {
if (is_null($localTrxID))
return $localTrxID;
$trxco = sha1(time() . "" . serialize($localTrxID));
$this->cache->set($trxco, $localTrxID, self::MAX_SESSION_LENGTH);
return $trxco;
} | php | {
"resource": ""
} |
q11654 | Kohana_PayPal.retrieveLocalTrx | train | private function retrieveLocalTrx($localTrxHash) {
if (is_null($localTrxHash))
return $localTrxHash;
$trxid = $this->cache->get($localTrxHash, false);
if ($trxid === false)
throw new Exception("Failed to retrieve local data for " . $localTrxHash);
return $trxid;
} | php | {
"resource": ""
} |
q11655 | Kohana_PayPal.extractSales | train | private function extractSales($transactions) {
$out = [];
foreach ($transactions as $trx) {
foreach ($trx->related_resources as $src) {
if (isset($src->sale)) {
$out[] = $src->sale;
}
}
}
return $out;
} | php | {
"resource": ""
} |
q11656 | Kohana_PayPal.getRefundURL | train | private function getRefundURL($paymentDetails) {
if (!is_object($paymentDetails))
throw new Exception("Invalid payment details in getRefundURL");
if (!is_array($paymentDetails->transactions))
throw new Exception("Invalid transaction list in getRefundURL");
foreach ($paymentDetails->transactions as $transact... | php | {
"resource": ""
} |
q11657 | Kohana_PayPal.genRequest | train | protected function genRequest($address, $data = [], $token = null, $get = false) {
// compose request URL
if (strstr($address, 'https://'))
$url = $address;
else
$url = $this->endpoint . '/v1/' . $address;
$method = (is_null($data) || $get) ? 'GET' : 'POST';
self::debug("PayPal Auth: " . $token-... | php | {
"resource": ""
} |
q11658 | Kohana_PayPal.call | train | protected function call(Request $request) {
$response = $request->execute();
if (!$response->isSuccess()) {
self::debug("Error in PayPal call", $response);
throw new PayPal_Exception_InvalidResponse("Error " . $response->status() . " in PayPal call (". $response->body() .")");
}
$res = json_decode($res... | php | {
"resource": ""
} |
q11659 | ImageExtension.getBase64 | train | public function getBase64()
{
if ($this->owner->exists()) {
$file = $this->owner->getFullPath();
$mime = mime_content_type($file);
$fileContent = file_get_contents($file);
return "data://$mime;base64," . base64_encode($fileContent);
}
... | php | {
"resource": ""
} |
q11660 | Template_Part.set_var | train | public function set_var( $key, $value ) {
if ( null === $this->wp_query->get( $key, null ) ) {
$this->vars[ $key ] = $value;
$this->wp_query->set( $key, $value );
}
} | php | {
"resource": ""
} |
q11661 | Template_Part.render | train | public function render() {
$html = '';
ob_start();
if ( $this->_is_root_template() ) {
$this->_root_get_template_part();
} else {
get_template_part( $this->slug, $this->name );
}
$html = ob_get_clean();
// @codingStandardsIgnoreStart
echo apply_filters( 'inc2734_view_controller_template_part_ren... | php | {
"resource": ""
} |
q11662 | Template_Part._is_root_template | train | protected function _is_root_template() {
$hierarchy = [];
/**
* @deprecated
*/
$root = apply_filters(
'inc2734_view_controller_template_part_root',
'',
$this->slug,
$this->name,
$this->vars
);
if ( $root ) {
$hierarchy[] = $root;
}
$hierarchy = apply_filters(
'inc2734_view_co... | php | {
"resource": ""
} |
q11663 | Template_Part._is_root | train | protected function _is_root( $root ) {
$this->root = $root;
$is_root = (bool) $this->_root_locate_template();
if ( ! $is_root ) {
$this->root = '';
}
return $is_root;
} | php | {
"resource": ""
} |
q11664 | Template_Part._get_root_template_part_slugs | train | protected function _get_root_template_part_slugs() {
if ( ! $this->root ) {
return [];
}
if ( $this->name ) {
$templates[] = trailingslashit( $this->root ) . $this->slug . '-' . $this->name . '.php';
}
$templates[] = trailingslashit( $this->root ) . $this->slug . '.php';
return $templates;
} | php | {
"resource": ""
} |
q11665 | DataCollection.getData | train | public function getData($page)
{
$this->loadData();
$start = ($page - 1) * $this->pageSize;
return array_slice($this->filteredData, $start, $this->pageSize);
} | php | {
"resource": ""
} |
q11666 | DataCollection.getLastPageNumber | train | public function getLastPageNumber()
{
$this->loadData();
$count = count($this->filteredData);
return ceil($count / $this->pageSize);
} | php | {
"resource": ""
} |
q11667 | DataCollection.setFiltersAndSort | train | public function setFiltersAndSort($filters, $sortField = null, $sortOrder = "ASC")
{
$this->reset();
$this->filters = $filters;
if ($sortField && $sortOrder) {
$this->sort = [$sortField, $sortOrder];
}
return $this;
} | php | {
"resource": ""
} |
q11668 | DataCollection.setDataByIndex | train | public function setDataByIndex($line, $data)
{
$this->data[$line] = $data;
$this->filteredData = null;
} | php | {
"resource": ""
} |
q11669 | DataCollection.reset | train | public function reset()
{
$this->filteredData = null;
$this->filters = [];
$this->sort = null;
return $this;
} | php | {
"resource": ""
} |
q11670 | DataCollection.loadData | train | protected function loadData()
{
if (is_null($this->filteredData)) {
$this->filteredData = $this->filterHelper->filterData(
$this->data,
$this->filters,
FilterInterface::FILTER_LOGIC_OR
);
if (!is_null($this->sort)) {
... | php | {
"resource": ""
} |
q11671 | DataProviderManager.isProviderCompatible | train | public function isProviderCompatible($provider, $title, $mode, $script, Map $map)
{
return !is_null($this->getCompatibleProviderId($provider, $title, $mode, $script, $map));
} | php | {
"resource": ""
} |
q11672 | DataProviderManager.registerPlugin | train | public function registerPlugin($provider, $pluginId, $title, $mode, $script, Map $map)
{
$providerId = $this->getCompatibleProviderId($provider, $title, $mode, $script, $map);
if (empty($providerId)) {
return;
}
/** @var AbstractDataProvider $providerService */
... | php | {
"resource": ""
} |
q11673 | DataProviderManager.deletePlugin | train | public function deletePlugin($provider, $pluginId)
{
foreach ($this->providersByCompatibility[$provider] as $titleProviders) {
foreach ($titleProviders as $modeProviders) {
foreach ($modeProviders as $providerId) {
$providerService = $this->container->get($pro... | php | {
"resource": ""
} |
q11674 | DataProviderManager.dispatch | train | public function dispatch($eventName, $params)
{
if (isset($this->enabledProviderListeners[$eventName])) {
foreach ($this->enabledProviderListeners[$eventName] as $callback) {
call_user_func_array($callback, $params);
}
}
} | php | {
"resource": ""
} |
q11675 | Service.makeBoletoAsHTML | train | public function makeBoletoAsHTML($codigoBanco, $boleto)
{
$boleto = new Boleto($boleto);
$factory = new BoletoFactory($this->config);
return $factory->makeBoletoAsHTML($codigoBanco, $boleto->toArray());
} | php | {
"resource": ""
} |
q11676 | CountryIpv4.ipv4For | train | protected function ipv4For($country)
{
$country = self::toUpper($country);
if (!isset(self::$ipv4Ranges[$country])) {
return '';
}
return static::randomElement(self::$ipv4Ranges[$country]) . mt_rand(1, 254);
} | php | {
"resource": ""
} |
q11677 | Smarty_CacheResource_Memcache.delete | train | protected function delete(array $keys)
{
foreach ($keys as $k) {
$k = sha1($k);
$this->memcache->delete($k);
}
return true;
} | php | {
"resource": ""
} |
q11678 | Module.initSession | train | public function initSession()
{
$sessionManager = new SessionManager();
$sessionManager->start();
Container::setDefaultManager($sessionManager);
$container = new Container('melisinstaller');
} | php | {
"resource": ""
} |
q11679 | FormField.getEditable | train | public function getEditable($is_create = true)
{
return
(
$this->getParent()->getEditable() ||
$this->getParent()->getRequired()
) &&
! $this->getField()->getCalculated() &&
! $this->getField()->getAutoNumber() &&
(
... | php | {
"resource": ""
} |
q11680 | LayoutScrollable.forceContainerSize | train | public function forceContainerSize($x, $y)
{
$this->force = true;
$this->_X = $x;
$this->_Y = $y;
} | php | {
"resource": ""
} |
q11681 | CheckoutSteps.nextStep | train | public static function nextStep($step)
{
$steps = self::getSteps();
$key = self::getStepIndex($step) + 1;
if (key_exists($key, $steps)) {
return $steps[$key];
} else {
return null;
}
} | php | {
"resource": ""
} |
q11682 | CheckoutSteps.get | train | public static function get(CheckoutStepController $controller)
{
$list = new ArrayList();
$steps = self::getSteps();
foreach ($steps as $step) {
$data = new ViewableData();
$data->Link = $controller->Link($step);
$data->Title = _t("CheckoutSteps.$step", uc... | php | {
"resource": ""
} |
q11683 | CheckoutSteps.inPast | train | private static function inPast($step, CheckoutStepController $controller)
{
$currentStep = $controller->getURLParams()['Action'];
return self::getStepIndex($step) < self::getStepIndex($currentStep);
} | php | {
"resource": ""
} |
q11684 | CheckoutSteps.inFuture | train | private static function inFuture($step, CheckoutStepController $controller)
{
$currentStep = $controller->getURLParams()['Action'];
return self::getStepIndex($step) > self::getStepIndex($currentStep);
} | php | {
"resource": ""
} |
q11685 | CheckoutSteps.current | train | private static function current($step, CheckoutStepController $controller)
{
$currentStep = $controller->getURLParams()['Action'];
return self::getStepIndex($step) === self::getStepIndex($currentStep);
} | php | {
"resource": ""
} |
q11686 | ScriptMapDataProvider.dispatchMapEvent | train | protected function dispatchMapEvent($eventName, $params)
{
$map = $this->mapStorage->getMap($params['map']['uid']);
$this->dispatch(
$eventName,
[
$params['count'],
isset($params['time']) ? $params['time'] : time(),
isset($para... | php | {
"resource": ""
} |
q11687 | MapratingTableMap.doDelete | train | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(MapratingTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$crite... | php | {
"resource": ""
} |
q11688 | UserProfile.formUserInfo | train | protected function formUserInfo()
{
$form = new XmlFormCollection($this->_context, $this->_url, $this->_myWords->Value("UPDATETITLE"));
$this->_paragraph->addXmlnukeObject($form);
$hidden = new XmlInputHidden("action", "update");
$form->addXmlnukeObject($hidden);
$labelField = new XmlInputLabelField(... | php | {
"resource": ""
} |
q11689 | UserProfile.formPasswordInfo | train | protected function formPasswordInfo()
{
$form = new XmlFormCollection($this->_context, $this->_url, $this->_myWords->Value("CHANGEPASSTITLE"));
$this->_paragraph->addXmlnukeObject($form);
$hidden = new XmlInputHidden("action", "changepassword");
$form->addXmlnukeObject($hidden);
$textbox = new XmlInput... | php | {
"resource": ""
} |
q11690 | UserProfile.formRolesInfo | train | protected function formRolesInfo()
{
$form = new XmlFormCollection($this->_context, $this->_url, $this->_myWords->Value("OTHERTITLE"));
$this->_paragraph->addXmlnukeObject($form);
$easyList = new XmlEasyList(EasyListType::SELECTLIST , "", $this->_myWords->Value("OTHERROLE"), $this->_users->returnUserProperty(... | php | {
"resource": ""
} |
q11691 | ReservationController.ReservationForm | train | public function ReservationForm()
{
$reservationForm = new ReservationForm($this, 'ReservationForm', ReservationSession::get());
$reservationForm->setNextStep(CheckoutSteps::nextStep($this->step));
return $reservationForm;
} | php | {
"resource": ""
} |
q11692 | UUID.generate | train | public static function generate(): string
{
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
\mt_rand( 0, 0xffff ), \mt_rand( 0, 0xffff ),
// 16 bits for "time_mid"
\mt_rand( 0, 0xffff ),
// 16 bits for "time_hi_and_version",
// fo... | php | {
"resource": ""
} |
q11693 | Tokenizer.setInput | train | public function setInput($input)
{
$this->input = $input;
$this->pos = 0;
$this->line = 0;
$this->linePos = 0;
$this->tokenType = TokenType::BOF;
$this->tokenValue = null;
$this->length = strlen($this->input);
} | php | {
"resource": ""
} |
q11694 | Tokenizer.nextChar | train | private function nextChar()
{
if( ! $this->isEOF())
{
$this->linePos ++;
return $this->input[$this->pos++];
}
return null;
} | php | {
"resource": ""
} |
q11695 | Environments.init | train | public static function init()
{
$instance = self::getInstance();
$instance->_environments = $instance->_loadEnvironment($instance->_envPath . DS . 'config.php');
if (!isset($instance->_environments['local'])) {
$instance->_environments['local'] = [];
}
$instance... | php | {
"resource": ""
} |
q11696 | Environments._loadEnvironment | train | protected function _loadEnvironment($envFilePath)
{
if (file_exists($envFilePath)) {
include $envFilePath;
// $configure has to be defined in the included environment file.
if (isset($configure) && is_array($configure) && !empty($configure)) {
$config = H... | php | {
"resource": ""
} |
q11697 | Environments._getEnvironment | train | protected function _getEnvironment()
{
$environment = self::$forceEnvironment;
// Check if the environment has been manually set (forced).
if ($environment !== null) {
if (!isset($this->_environments[$environment])) {
throw new Exception('Environment configuratio... | php | {
"resource": ""
} |
q11698 | Environments._getRealAppPath | train | protected function _getRealAppPath()
{
$path = realpath(APP);
if (substr($path, -1, 1) !== DS) {
$path .= DS;
}
return $path;
} | php | {
"resource": ""
} |
q11699 | CryptBehavior.initialize | train | public function initialize(array $config)
{
$config += $this->_defaultConfig;
$this->config('fields', $this->_resolveFields($config['fields']));
$this->config('strategy', $this->_resolveStrategy($config['strategy']));
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.