_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q252800 | LineBreaksHelper.SetWeekWords | validation | public function SetWeekWords ($weekWords, $lang = '') {
if (!$lang) $lang = $this->lang;
if (is_array($weekWords)) {
$this->weekWords[$lang] = $weekWords;
} else {
$this->weekWords[$lang] = explode(',', (string) $weekWords);
}
return $this;
} | php | {
"resource": ""
} |
q252801 | LineBreaksHelper.SetShortcuts | validation | public function SetShortcuts (array $shortcuts, $lang = '') {
if (!$lang) $lang = $this->lang;
$this->shortcuts[$lang] = $shortcuts;
return $this;
} | php | {
"resource": ""
} |
q252802 | LineBreaksHelper.SetUnits | validation | public function SetUnits ($units) {
if (is_array($units)) {
$this->units = $units;
} else {
$this->units = explode(',', (string) $units);
}
return $this;
} | php | {
"resource": ""
} |
q252803 | LineBreaksHelper.getWeekWordsUnitsAndShortcuts | validation | protected function getWeekWordsUnitsAndShortcuts ($lang) {
if (!isset($this->weekWords[$lang])) {
if (isset(static::$WeekWordsDefault[$lang])) {
$this->weekWords[$lang] = explode(',', static::$WeekWordsDefault[$lang]);
} else {
$this->weekWords[$lang] = [];
}
}
if (!$this->units)
$this->units... | php | {
"resource": ""
} |
q252804 | LineBreaksHelper.LineBreaks | validation | public function LineBreaks ($text, $lang = "") {
$this->text = $text;
$word = "";
$lang = $lang ? $lang : $this->lang;
list($weekWords, $units, $shortcuts) = $this->getWeekWordsUnitsAndShortcuts($lang);
// if there are one or more tab chars in source text, convert them into single space
$this->text = preg_... | php | {
"resource": ""
} |
q252805 | LineBreaksHelper.processWeakWord | validation | protected function processWeakWord ($word) {
$index = 0;
$text = ' ' . $this->text . ' ';
// go through infinite loop and process given week word with html fixed spaces replacement
while (TRUE) {
$index = mb_strpos($text, ' ' . $word . ' ');
if ($index !== FALSE) {
// If there is any week word and bas... | php | {
"resource": ""
} |
q252806 | Concrete5.getApp | validation | private function getApp()
{
if( is_null($this->app) ) {
$this->app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
}
return $this->app;
} | php | {
"resource": ""
} |
q252807 | Bootstrap.register | validation | public function register(string ...$mods) : void
{
$this->kms = array_unique(array_merge($this->kms, $mods));
} | php | {
"resource": ""
} |
q252808 | Di.set | validation | public function set(string $sNameOfDi, callable $cFunction, bool $bShared = false) : Di
{
if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
return $this;
} | php | {
"resource": ""
} |
q252809 | Web2All_Table_ObjectIterator.count | validation | public function count()
{
// start the query if recordSet is not yet initialised
// if the recordSet is initialised it doesn't matter if its used or not
if (is_null($this->recordSet))
{
$this->fetchData();
}
if(is_null($this->recordcount)){
// store the number of records ... | php | {
"resource": ""
} |
q252810 | Attachment.search | validation | public static function search($query, &$results = array()) {
$attachments = static::getInstance();
if (!empty($query)):
$words = explode(' ', $query);
foreach ($words as $word) {
$_results =
$attachments->setListLookUpConditions("attachment_n... | php | {
"resource": ""
} |
q252811 | Attachment.load | validation | final public static function load(&$object, &$params) {
//Relaod the object
$attachments = static::getInstance();
$attachment = & $object;
//if is object $object
if (!is_a($attachment, Entity::class)) {
//Attempt to determine what type of object this is or throw an er... | php | {
"resource": ""
} |
q252812 | BlockEditingListener.onBlockEditing | validation | public function onBlockEditing(BlockEditingEvent $event)
{
$encodedBlock = $event->getFileContent();
$htmlBlock = $this->pageProductionRenderer->renderBlock($encodedBlock);
$this->permalinkManager
->add($event->getFilePath(), $htmlBlock)
->save();
} | php | {
"resource": ""
} |
q252813 | StructureProcessor.process | validation | public function process($structureName, $origin)
{
$def = $this->structures[$structureName];
$data = array_merge(
$def->getEmptyValues(),
$this->source->fetchData($structureName, $origin)
);
$accessor = new PropertyAccess();
foreach ($def->getChildr... | php | {
"resource": ""
} |
q252814 | Response.SendHeaders | validation | public function SendHeaders()
{
// headers have already been sent
if (headers_sent()) {
return $this;
}
header('HTTP/'.$this->Version.' '.$this->StatusCode.' '.$this->StatusText, true, $this->StatusCode);
foreach ($this->Headers->GetCookies() as $cookie) {
... | php | {
"resource": ""
} |
q252815 | FormButtonIcon.openTag | validation | public function openTag($attributesOrElement = null)
{
if (null === $attributesOrElement) {
return '<button>';
}
if (is_array($attributesOrElement)) {
$attributes = $this->createAttributesString($attributesOrElement);
return sprintf('<button %s>', $attri... | php | {
"resource": ""
} |
q252816 | RegistrationController.actionRegister | validation | public function actionRegister()
{
if (!$this->module->enableRegistration) {
throw new NotFoundHttpException;
}
$model = \Yii::createObject(RegistrationForm::className());
$this->performAjaxValidation($model);
if ($model->load(\Yii::$app->request->post()) && $m... | php | {
"resource": ""
} |
q252817 | RegistrationController.actionConnect | validation | public function actionConnect($account_id)
{
$account = $this->finder->findAccountById($account_id);
if ($account === null || $account->getIsConnected()) {
throw new NotFoundHttpException;
}
/** @var User $user */
$user = \Yii::createObject([
'class'... | php | {
"resource": ""
} |
q252818 | RegistrationController.actionConfirm | validation | public function actionConfirm($id, $code)
{
$user = $this->finder->findUserById($id);
if ($user === null || $this->module->enableConfirmation == false) {
throw new NotFoundHttpException;
}
$user->attemptConfirmation($code);
return $this->render('/message', [
... | php | {
"resource": ""
} |
q252819 | RegistrationController.actionResend | validation | public function actionResend()
{
if ($this->module->enableConfirmation == false) {
throw new NotFoundHttpException;
}
$model = \Yii::createObject(ResendForm::className());
$this->performAjaxValidation($model);
if ($model->load(\Yii::$app->request->post()) && $m... | php | {
"resource": ""
} |
q252820 | Logger.config | validation | private function config()
{
$handler = new RotatingFileHandler($this->getFullPath(), 0, MonoLogger::INFO);
$handler->setFormatter($this->getLineFormater());
$this->logger->pushHandler($handler);
$this->logger->pushProcessor(new WebProcessor());
... | php | {
"resource": ""
} |
q252821 | GitSynchronizer.getStatus | validation | public function getStatus()
{
$message = 'Tracking ';
$numRepos = 0;
if (isset($this['repositories']) &&
(1 === ($numRepos = count($this['repositories'])))) {
$message .= '1 repository.';
} else {
$message .= $numRepos . ' repositories.';
... | php | {
"resource": ""
} |
q252822 | RedKiteCms.bootstrap | validation | public function bootstrap($rootDir, $siteName)
{
$this->app["red_kite_cms.root_dir"] = $rootDir;
$this->siteName = $siteName;
$this->checkPermissions($rootDir);
$this->initCmsRequiredServices();
$this->registerProviders();
$this->registerServices();
$this->re... | php | {
"resource": ""
} |
q252823 | BlockPass.getPublicRequireDefinition | validation | private function getPublicRequireDefinition(ContainerBuilder $container, $id, $type)
{
$serviceDefinition = $container->getDefinition($id);
if (!$serviceDefinition->isPublic()) {
throw new InvalidArgumentException(sprintf('The service "%s" must be public as block %s are lazy-loaded.', $... | php | {
"resource": ""
} |
q252824 | Pagamento.exchangeArray | validation | public function exchangeArray($array)
{
return $this->setId(isset($array['id'])?$array['id']:null)
->setAutenticacaoId($array['autenticacao_id'])
->setValor($array['valor'])
->setData(isset($array['data'])?$array['data']:null);
} | php | {
"resource": ""
} |
q252825 | CalcEu.exec | validation | public function exec($calcId)
{
$result = [];
/* collect additional data */
$bonusPercent = Cfg::TEAM_BONUS_EU_PERCENT;
$dwnlCompress = $this->daoBonDwnl->getByCalcId($calcId);
$dwnlCurrent = $this->daoDwnl->get();
/* create maps to access data */
$mapDwnlById... | php | {
"resource": ""
} |
q252826 | SpoolManager.setSpoolDirectory | validation | public function setSpoolDirectory($dir)
{
if (!DirectoryHelper::ensureExists($dir)) {
throw new \Exception(
sprintf('Can not create emails spooling directory "%s"!', $dir)
);
}
$this->spool_dir = $dir;
return $this;
} | php | {
"resource": ""
} |
q252827 | Benchmark.start | validation | public function start($taskName, $repeat = null)
{
$task = new Task();
$task->name($taskName);
if ($repeat) {
$task->repeat($repeat);
}
if (isset($this->_tasks[$taskName])) {
throw new Exception("Task {$taskName} is already defined.");
}
... | php | {
"resource": ""
} |
q252828 | Benchmark.end | validation | public function end($taskName)
{
if (!isset($this->_tasks[$taskName])) {
throw new Exception("Undefined task name: `'{$taskName}`.");
}
$task = $this->_tasks[$taskName];
$task->end();
return $task;
} | php | {
"resource": ""
} |
q252829 | Benchmark.duration | validation | public function duration()
{
$duration = 0;
foreach ($this->_tasks as $task) {
$duration += $task->duration();
}
return $duration;
} | php | {
"resource": ""
} |
q252830 | Benchmark.matrix | validation | public function matrix()
{
if ($this->_matrix) {
return $this->_matrix;
}
$this->_matrix = new Matrix($this->tasks());
$this->_matrix->process();
return $this->_matrix;
} | php | {
"resource": ""
} |
q252831 | Benchmark.title | validation | public static function title($title, $pad = '=')
{
$rest = (int) (78 - mb_strlen($title)) / 2;
$result = "\n\n";
$result .= str_repeat($pad, $rest);
$result .= ' ' . $title . ' ';
$result .= str_repeat($pad, $rest);
$result .= "\n\n";
return $result;
} | php | {
"resource": ""
} |
q252832 | Image.upload | validation | private function upload($path, $payload)
{
return Storage::disk('s3')->put($path, $payload, $this->visibility);
} | php | {
"resource": ""
} |
q252833 | Image.getFullPath | validation | public function getFullPath($file = '')
{
$this->name = ($file) ? $file : $this->name;
return config('odin.assetsUrl') . $this->getPath() . $this->name;
} | php | {
"resource": ""
} |
q252834 | PageService.getAction | validation | public function getAction()
{
$id = $this->getPageId();
if ($id !== null) {
$result = $this->pageList->getPage($id)->getJSON();
} else {
$result = array();
foreach ($this->pageList->getPages() as $pageName) {
$result[] = $this->pageList->ge... | php | {
"resource": ""
} |
q252835 | PageService.postAction | validation | public function postAction()
{
$request = $this->environment->getRequestHelper();
$id = $request->getIdentifierParam('name');
try {
$this->pageList->getPage($id);
} catch (InvalidParameterException $e) {
$page = $this->pageList->addPageFromRequest($id, $reques... | php | {
"resource": ""
} |
q252836 | PageService.getPageId | validation | private function getPageId()
{
if (preg_match('/\/page\/(\w+)$/', $this->name, $matches)) {
$id = $matches[1];
} else {
$id = $this->environment->getRequestHelper()->getIdentifierParam('id', null, true);
}
return $id;
} | php | {
"resource": ""
} |
q252837 | Calc.exec | validation | public function exec($dwnlBonus)
{
$result = [];
$mapById = $this->hlpDwnlTree->mapById($dwnlBonus, EBonDwnl::A_CUST_REF);
$mapTeams = $this->hlpDwnlTree->mapByTeams($dwnlBonus, EBonDwnl::A_CUST_REF, EBonDwnl::A_PARENT_REF);
/** @var \Praxigento\BonusHybrid\Repo\Data\Downline $one */... | php | {
"resource": ""
} |
q252838 | Cache.setCacheType | validation | public static function setCacheType(string $sCacheName)
{
if ($sCacheName === 'file') { self::$_sTypeOfCache = 'file'; }
else if ($sCacheName === 'memcache') { self::$_sTypeOfCache = 'memcache'; }
else if ($sCacheName === 'apc') { self::$_sTypeOfCache = 'apc'; }
else if ($sCacheName === 'redis') { self::$_sTyp... | php | {
"resource": ""
} |
q252839 | Cache._getCacheObject | validation | private static function _getCacheObject()
{
if (self::$_sTypeOfCache === 'file') {
if (!isset(self::$_aCache['file'])) { self::$_aCache['file'] = new CacheFile; }
return self::$_aCache['file'];
}
else if (self::$_sTypeOfCache === 'memcache') {
if (!isset(self::$_aCache['memcache'])) {
... | php | {
"resource": ""
} |
q252840 | AppHelper.run | validation | public function run(): void
{
if (!$this->isAppRootSet()) {
throw new Exception("The application root wasn't defined.");
}
if (!$this->isConfigFileSet()) {
throw new Exception("The main config file wasn't defined.");
}
$configPath = $this->getAppRoot()... | php | {
"resource": ""
} |
q252841 | AppHelper.getConfig | validation | public function getConfig(string $sName = '')
{
if (empty($sName)) {
return $this->configSet;
} elseif (isset($this->configSet[$sName])) {
return $this->configSet[$sName];
} else {
return null;
}
} | php | {
"resource": ""
} |
q252842 | AppHelper.getBaseUrl | validation | private static function getBaseUrl(): ?string
{
$serverName = filter_input(
\INPUT_SERVER,
'SERVER_NAME',
\FILTER_SANITIZE_STRING
);
if (!empty($serverName)) {
$https = filter_input(\INPUT_SERVER, 'HTTPS', \FILTER_SANITIZE_STRING);
... | php | {
"resource": ""
} |
q252843 | AppHelper.getComponentRoot | validation | public function getComponentRoot(string $name): ?string
{
$rootMap = $this->getConfig('componentsRootMap');
return isset($rootMap[$name]) ? $this->getAppRoot().$rootMap[$name] : null;
} | php | {
"resource": ""
} |
q252844 | ThemeAligner.align | validation | public function align(PagesCollectionParser $pagesCollectionParser)
{
$themeSlots = $this->findSlotsInTemplates();
$slots = $this->mergeSlotsByStatus($themeSlots);
if (!array_key_exists("page", $slots)) {
return;
}
$pageSlots = $slots["page"];
unset($slots... | php | {
"resource": ""
} |
q252845 | Listener.notify | validation | public function notify() {
declare(ticks=1);
if (is_array($this->_caller) && !empty($this->_caller)) {
// array
return call_user_func_array($this->_caller, [$this->_interrupt]);
} else if ($this->_caller instanceof Closure) {
// closure
return $this->_caller->call($this, $this->_interrupt);
... | php | {
"resource": ""
} |
q252846 | CRC16.getHashGeneratorByDescription | validation | protected function getHashGeneratorByDescription(OptionsInterface $options, $description)
{
if ($description === 'predis') {
return new Hash\CRC16();
} elseif ($description === 'phpiredis') {
return new Hash\PhpiredisCRC16();
} else {
throw new \InvalidArg... | php | {
"resource": ""
} |
q252847 | ObjectType.getPHPHint | validation | public function getPHPHint($namespaceContext = NULL) {
if (!isset($this->class)) {
return '\stdClass';
}
if (isset($namespaceContext) && trim($this->class->getNamespace(),'\\') === trim($namespaceContext,'\\')) {
return $this->class->getName();
}
return '\\'.$this->class->getFQN();
} | php | {
"resource": ""
} |
q252848 | SettingsController.actionProfile | validation | public function actionProfile()
{
$model = $this->finder->findProfileById(\Yii::$app->user->identity->getId());
$this->performAjaxValidation($model);
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
\Yii::$app->getSession()->setFlash('success', \Yii::t('user',... | php | {
"resource": ""
} |
q252849 | SettingsController.actionConfirm | validation | public function actionConfirm($id, $code)
{
$user = $this->finder->findUserById($id);
if ($user === null || $this->module->emailChangeStrategy == Module::STRATEGY_INSECURE) {
throw new NotFoundHttpException;
}
$user->attemptEmailChange($code);
return $this->red... | php | {
"resource": ""
} |
q252850 | SettingsController.actionDisconnect | validation | public function actionDisconnect($id)
{
$account = $this->finder->findAccountById($id);
if ($account === null) {
throw new NotFoundHttpException;
}
if ($account->user_id != \Yii::$app->user->id) {
throw new ForbiddenHttpException;
}
$account->d... | php | {
"resource": ""
} |
q252851 | SettingsController.connect | validation | public function connect(ClientInterface $client)
{
$attributes = $client->getUserAttributes();
$provider = $client->getId();
$clientId = $attributes['id'];
$account = $this->finder->findAccountByProviderAndClientId($provider, $clientId);
if ($account === null) {
... | php | {
"resource": ""
} |
q252852 | RequestFile.move | validation | public function move($path, $filename = null) {
$newFilename = ($filename != null) ? $filename : $this->filename;
// Valida si la ruta termina con slash
$lastSlash = substr($path, strlen($path), 1);
if ($lastSlash !== '/') {
$path .= '/';
}
// Retorno TRUE... | php | {
"resource": ""
} |
q252853 | ResolveContainerCapableTrait._resolveContainer | validation | protected function _resolveContainer(BaseContainerInterface $container)
{
$parent = null;
while ($container instanceof ContainerAwareInterface) {
$parent = $container->getContainer();
if (!($parent instanceof BaseContainerInterface)) {
break;
}
... | php | {
"resource": ""
} |
q252854 | Staff.create | validation | public function create($account, $nickname)
{
$params = [
'kf_account' => $account,
'nickname' => $nickname,
];
return $this->parseJSON('json', [self::API_CREATE, $params]);
} | php | {
"resource": ""
} |
q252855 | Staff.update | validation | public function update($account, $nickname)
{
$params = [
'kf_account' => $account,
'nickname' => $nickname,
];
return $this->parseJSON('json', [self::API_UPDATE, $params]);
} | php | {
"resource": ""
} |
q252856 | Staff.delete | validation | public function delete($account)
{
// XXX: 微信那帮搞技术的都 TM 是 SB,url上的文本居然不 TM urlencode,
// 这里客服账号因为有 @ 符,而微信不接收urlencode的账号。。
// 简直是日了...
// #222
// PS: 如果你是微信做接口的,奉劝你们,尊重技术,不会别乱搞,笨不是你们的错,你们出来坑人就是大错特错。
$accessTokenField = sprintf('%s=%s', $this->accessToken->getQueryNam... | php | {
"resource": ""
} |
q252857 | Staff.invite | validation | public function invite($account, $wechatId)
{
$params = [
'kf_account' => $account,
'invite_wx' => $wechatId,
];
return $this->parseJSON('json', [self::API_INVITE_BIND, $params]);
} | php | {
"resource": ""
} |
q252858 | Staff.records | validation | public function records($startTime, $endTime, $page = 1, $pageSize = 10)
{
$params = [
'starttime' => is_numeric($startTime) ? $startTime : strtotime($startTime),
'endtime' => is_numeric($endTime) ? $endTime : strtotime($endTime),
'pageindex' => $page... | php | {
"resource": ""
} |
q252859 | Phase2.compressPhase2 | validation | private function compressPhase2($calcIdWriteOff, $calcIdPhase1, $calcIdPhase2, $scheme)
{
$pv = $this->rouGetPv->exec($calcIdWriteOff);
$dwnlPlain = $this->daoBonDwnl->getByCalcId($calcIdWriteOff);
$dwnlPhase1 = $this->daoBonDwnl->getByCalcId($calcIdPhase1);
$ctx = new \Praxigento\Co... | php | {
"resource": ""
} |
q252860 | Core.site | validation | public function site(): \TheCMSThread\Core\Main\Site
{
static $site;
if ($site === null) {
$site = $this->container->get("TheCMSThread\\Core\\Main\\Site");
}
return $site;
} | php | {
"resource": ""
} |
q252861 | Core.auth | validation | public function auth(): \TheCMSThread\Core\Main\Auth
{
static $auth;
if ($auth === null) {
$auth = $this->container->get("TheCMSThread\\Core\\Main\\Auth");
}
$auth->__construct();
return $auth;
} | php | {
"resource": ""
} |
q252862 | Core.view | validation | public function view(): \TheCMSThread\Core\Main\View
{
static $view;
if ($view === null) {
$view = $this->container->get("TheCMSThread\\Core\\Main\\View");
}
$view->__construct($this->auth());
return $view;
} | php | {
"resource": ""
} |
q252863 | Core.api | validation | public function api(string $link = null, string $method = null): \TheCMSThread\Classes\API
{
static $api;
if ($api === null) {
$api = $this->container->get("TheCMSThread\\Core\\API");
}
return $api->set($link, $method);
} | php | {
"resource": ""
} |
q252864 | Session.close | validation | public function close()
{
if($this->id == null) {
throw new InternalException('Session not loaded');
}
if(!$this->cli) {
session_write_close();
}
$this->id = null;
} | php | {
"resource": ""
} |
q252865 | SocialMediaScheduleHandler.getContent | validation | public function getContent(Location $location = null, Operation $operation)
{
if($operation) {
$status = $this->contentService->getSocialMediaScheduleByOperation($operation);
return $status;
}
return null;
} | php | {
"resource": ""
} |
q252866 | SocialMediaScheduleHandler.processContent | validation | public function processContent(Operation $operation, $data)
{
if(is_array($data)) {
// If the status has already been created, we modify its data.
$status = $this->contentService->getSocialMediaScheduleByOperation($operation);
// If data comes from API cal... | php | {
"resource": ""
} |
q252867 | AbstractCliController.isrunning | validation | private function isrunning()
{
$pids = explode(PHP_EOL, `ps -e | awk '{print $1}'`);
if (in_array($this->pid, $pids))
return true;
return false;
} | php | {
"resource": ""
} |
q252868 | AbstractCliController.lock | validation | public function lock()
{
$lock_file = $this->getLockFile();
if (file_exists($lock_file)) {
// Is running?
$this->pid = file_get_contents($lock_file);
if ($this->isrunning()) {
error_log("==".$this->pid."== Already in progress...");
return false;
} else
error_log("==".$this->pid."== Previou... | php | {
"resource": ""
} |
q252869 | AbstractCliController.getLockFile | validation | protected function getLockFile()
{
$request = $this->getRequest();
$params = $request->getParams();
$controller = $params->controller;
$action = $params->action;
$normalizedController = strtolower(stripslashes(str_replace(__NAMESPACE__, '', $controller)));
$fileBaseName = implode('_', array(
basename(... | php | {
"resource": ""
} |
q252870 | PvWriteOff.createOperation | validation | private function createOperation($trans, $dsBegin)
{
$datePerformed = $this->hlpDate->getUtcNowForDb();
$req = new \Praxigento\Accounting\Api\Service\Operation\Create\Request();
$req->setOperationTypeCode(Cfg::CODE_TYPE_OPER_PV_WRITE_OFF);
$req->setDatePerformed($datePerformed);
... | php | {
"resource": ""
} |
q252871 | PvWriteOff.getTransactions | validation | private function getTransactions($turnover, $dsEnd)
{
$dateApplied = $this->hlpPeriod->getTimestampUpTo($dsEnd);
$result = $this->aPrepareTrans->exec($turnover, $dateApplied);
return $result;
} | php | {
"resource": ""
} |
q252872 | PvWriteOff.getTransitions | validation | private function getTransitions($dsBegin, $dsEnd)
{
$assetTypeId = $this->daoTypeAsset->getIdByCode(Cfg::CODE_TYPE_ASSET_PV);
$dateFrom = $this->hlpPeriod->getTimestampFrom($dsBegin);
$dateTo = $this->hlpPeriod->getTimestampNextFrom($dsEnd);
$query = $this->aQGetData->build();
... | php | {
"resource": ""
} |
q252873 | PvWriteOff.groupPvTrans | validation | private function groupPvTrans($transData)
{
$result = [];
foreach ($transData as $one) {
$debitAccId = $one->get(DTrans::A_ACC_ID_DEBIT);
$creditAccId = $one->get(DTrans::A_ACC_ID_CREDIT);
$value = $one->get(DTrans::A_AMOUNT);
if (isset($result[$debitA... | php | {
"resource": ""
} |
q252874 | PvWriteOff.saveLog | validation | private function saveLog($operIdWriteOff, $calcId)
{
/* log PvWriteOff operation itself */
$log = new ELogOper();
$log->setCalcId($calcId);
$log->setOperId($operIdWriteOff);
$this->daoLogOper->create($log);
} | php | {
"resource": ""
} |
q252875 | Relation.bindPage | validation | public function bindPage(array $deviceIdentifier, array $pageIds)
{
$params = [
'device_identifier' => $deviceIdentifier,
'page_ids' => $pageIds,
];
return $this->parseJSON('json', [self::API_DEVICE_BINDPAGE, $params]);
} | php | {
"resource": ""
} |
q252876 | Relation.getPageByDeviceId | validation | public function getPageByDeviceId(array $deviceIdentifier, $raw = false)
{
$params = [
'type' => 1,
'device_identifier' => $deviceIdentifier,
];
$result = $this->parseJSON('json', [self::API_RELATION_SEARCH, $params]);
if ($raw === true) {
return... | php | {
"resource": ""
} |
q252877 | Relation.getDeviceByPageId | validation | public function getDeviceByPageId($pageId, $begin, $count)
{
$params = [
'type' => 2,
'page_id' => intval($pageId),
'begin' => intval($begin),
'count' => intval($count),
];
return $this->parseJSON('json', [self::API_RELATION_SEARCH, $params]);... | php | {
"resource": ""
} |
q252878 | Collector.getTableRegistry | validation | public function getTableRegistry()
{
if (is_null($this->_tableRegistry)) {
$objectTypeClass = Yii::$app->classes['ObjectTypeRegistry'];
$this->_tableRegistry = [];
if ($objectTypeClass::tableExists()) {
$om = $objectTypeClass::find()->all();
... | php | {
"resource": ""
} |
q252879 | Collector.getAuthorities | validation | public function getAuthorities()
{
$authorities = [];
foreach ($this->getAll() as $typeItem) {
if (isset($typeItem->object) && $typeItem->object->getBehavior('Authority') !== null) {
$authorities[$typeItem->object->systemId] = $typeItem->object;
}
}
... | php | {
"resource": ""
} |
q252880 | View.getColumnSettings | validation | public function getColumnSettings()
{
if (is_null($this->_columnSettings)) {
$this->_columnSettings = [];
foreach ($this->columns as $key => $c) {
if (!$c->visible) {
continue;
}
$this->_columnSettings[$key] = ['labe... | php | {
"resource": ""
} |
q252881 | View.getData | validation | public function getData()
{
if (is_null($this->_currentData)) {
$this->_currentDataRaw = $this->dataProvider->getData();
$this->_currentData = [];
$itemNumber = $this->dataProvider->pagination->offset;
$row = 0;
foreach ($this->_currentDataRaw as $... | php | {
"resource": ""
} |
q252882 | View.getColumns | validation | public function getColumns()
{
if (is_null($this->_columns)) {
$this->columns = $this->dataProvider->model->attributeNames();
}
return $this->_columns;
} | php | {
"resource": ""
} |
q252883 | View.getTotalItems | validation | public function getTotalItems()
{
if (is_null($this->_totalItems)) {
$this->_totalItems = $this->dataProvider->totalItemCount;
}
return $this->_totalItems;
} | php | {
"resource": ""
} |
q252884 | View.getFormatter | validation | public function getFormatter()
{
if ($this->_formatter === null) {
$this->_formatter = Yii::$app->format;
}
return $this->_formatter;
} | php | {
"resource": ""
} |
q252885 | Pipeline.getConnection | validation | protected function getConnection()
{
$connection = $this->getClient()->getConnection();
if ($connection instanceof ReplicationInterface) {
$connection->switchToMaster();
}
return $connection;
} | php | {
"resource": ""
} |
q252886 | APIGenerator.addOperationGetter | validation | function addOperationGetter(
$methodName,
OperationDefinition $operation,
OperationGenerator $operationGenerator
) {
$operationName = $this->normalizeMethodName($methodName);
$operationClassName = $this->normalizeClassName($methodName);
$methodGenerator = new MethodGe... | php | {
"resource": ""
} |
q252887 | APIGenerator.generateExecuteDocBlock | validation | private function generateExecuteDocBlock($methodDescription, $returnType) {
$docBlock = new DocBlockGenerator($methodDescription, null);
$tags[] = new GenericTag('return', $returnType);
$docBlock->setTags($tags);
return $docBlock;
} | php | {
"resource": ""
} |
q252888 | APIGenerator.parseAndAddServiceFromFile | validation | function parseAndAddServiceFromFile($serviceFilename) {
$service = require $serviceFilename;
if ($service == false) {
throw new APIBuilderException("Failed to open service file `$serviceFilename`.");
}
if (is_array($service) == false) {
throw new APIBuilderExcept... | php | {
"resource": ""
} |
q252889 | Benri_Auth_Adapter_DbTable.authenticate | validation | public function authenticate()
{
$this->_authenticateSetup();
$dbSelect = $this->_authenticateCreateSelect();
$identity = $this->_authenticateQuerySelect($dbSelect);
$authResult = $this->_authenticateValidateResultSet($identity);
if ($authResult instanceof Zend_Auth_Res... | php | {
"resource": ""
} |
q252890 | Benri_Auth_Adapter_DbTable._authenticateCreateSelect | validation | protected function _authenticateCreateSelect()
{
$dbSelect = clone $this->getDbSelect();
$dbSelect->from($this->_tableName)
->where("{$this->_identityColumn} = ?", $this->_identity)
->limit(1);
return $dbSelect;
} | php | {
"resource": ""
} |
q252891 | Benri_Auth_Adapter_DbTable._authenticateValidateResult | validation | protected function _authenticateValidateResult($resultIdentity)
{
$code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$message = 'Supplied credential is invalid.';
if (Benri_Util_String::verifyPassword($this->_credential, $resultIdentity[$this->_credentialColumn])) {
$code ... | php | {
"resource": ""
} |
q252892 | ProductMapper.getProduct | validation | public function getProduct(array $productData)
{
// check if all mandatory fields are present
foreach ($this->mandatoryFields as $mandatoryField) {
if (!array_key_exists($mandatoryField, $productData)) {
throw new ProductException("The field '$mandatoryField' is missing i... | php | {
"resource": ""
} |
q252893 | Benri_Bootstrap._initRestRoute | validation | protected function _initRestRoute()
{
$front = Zend_Controller_Front::getInstance();
$front->setResponse(new Benri_Controller_Response_Http());
$front->setRequest(new Benri_Controller_Request_Http());
$front->getRouter()->addRoute('benri-app', new Zend_Rest_Route($front));
} | php | {
"resource": ""
} |
q252894 | Benri_Bootstrap._initDbResource | validation | protected function _initDbResource()
{
$registry = $this->getPluginResource('db');
if (!$registry) {
return;
}
//
// options in configs/application
$options = $registry->getOptions();
if (array_key_exists('dsn', $options) && '' !== $options['dsn'... | php | {
"resource": ""
} |
q252895 | Benri_Bootstrap._initMultiDbResources | validation | protected function _initMultiDbResources()
{
$registry = $this->getPluginResource('multidb');
if (!$registry) {
return;
}
//
// options in configs/application
$options = $registry->getOptions();
foreach ($options as &$connection) {
if... | php | {
"resource": ""
} |
q252896 | Benri_Bootstrap._parseDsn | validation | private function _parseDsn($dsn)
{
$dsn = parse_url($dsn);
$cfg = [];
//
// Some drivers (a.k.a. PDO_PGSQL) complains if the port is set
// without a value, even NULL
if (isset($dsn['port'])) {
$cfg['port'] = $dsn['port'];
}
return $cfg +... | php | {
"resource": ""
} |
q252897 | Module.getShortName | validation | public function getShortName()
{
preg_match('/Widget([A-Za-z]+)\\\Module/', get_class($this), $matches);
if (!isset($matches[1])) {
throw new Exception(get_class($this) . " is not set up correctly!");
}
return $matches[1];
} | php | {
"resource": ""
} |
q252898 | RedirectResponse.make | validation | public function make() {
/*
* Se guardan los headers si es que hay en la configuracion
* para luego utilizarlos al construir la redireccion
*/
if (count($this->headers) > 0) {
if (!$this->session->exists('headersInRedirect', 'redirect') || !$this->session->get('hea... | php | {
"resource": ""
} |
q252899 | JavaXmlPropertiesUtils.addEntriesToFile | validation | public static function addEntriesToFile($file, $entries) {
$properties = self::readFromFile($file);
foreach ($entries as $key => $value) {
$properties[$key] = $value;
}
self::saveToFile($file, $properties);
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.