_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q3300
ClientFactory.clearSessionTokens
train
public function clearSessionTokens() { $this->session->remove(self::SESSION_TOKEN_KEY); $this->session->remove(self::SESSION_TOKEN_SECRET_KEY); }
php
{ "resource": "" }
q3301
ClientFactory.hasSessionTokens
train
public function hasSessionTokens() { return ($this->session->has(self::SESSION_TOKEN_KEY) && $this->session->has(self::SESSION_TOKEN_SECRET_KEY)); }
php
{ "resource": "" }
q3302
Tweet.createTweet
train
private function createTweet(array $tweet, User $user) { $this->fields = [ 'id' => $this->getValue('id', $tweet), 'text' => $this->getValue('text', $tweet), 'source' => $this->getValue('source', $tweet), 'url' => $this-...
php
{ "resource": "" }
q3303
Tweet.listHashTags
train
private function listHashTags(array $tweet) { $list = []; if (array_key_exists('entities', $tweet) and array_key_exists('hashtags', $tweet['entities'])) { $hashTags = $tweet['entities']['hashtags']; foreach ($hashTags as $hashTag) { if (a...
php
{ "resource": "" }
q3304
Tx_Oelib_HeaderProxyFactory.getHeaderProxy
train
public function getHeaderProxy() { if ($this->isTestMode) { $className = \Tx_Oelib_HeaderCollector::class; } else { $className = \Tx_Oelib_RealHeaderProxy::class; } if (!is_object($this->headerProxy) || (get_class($this->headerProxy) !== $className)) { ...
php
{ "resource": "" }
q3305
DbConfig.read
train
public function read($key) { $query = $this->_table->find('kv'); if ($key !== '*') { $query->where([ $this->_table->aliasField('namespace') . ' IS' => $key ]); } return $query ->cache(function ($q) { return md5(ser...
php
{ "resource": "" }
q3306
ImageSizes.addImageSizes
train
private function addImageSizes() { $data = $this->getData(); foreach ($data as $slug => $props) { add_image_size($slug, $props['width'], $props['height'], $props['crop']); } }
php
{ "resource": "" }
q3307
ImageSizes.addSizesToDropDownList
train
public function addSizesToDropDownList($sizes) { $new = array(); $data = $this->getData(); foreach ($data as $slug => $props) { // If no 4th option, stop the loop. if ( !isset($props['media']) || false == $props['media']) { continu...
php
{ "resource": "" }
q3308
Tx_Oelib_Geocoding_Calculator.calculateDistanceInKilometers
train
public function calculateDistanceInKilometers( \Tx_Oelib_Interface_Geo $object1, \Tx_Oelib_Interface_Geo $object2 ) { if ($object1->hasGeoError()) { throw new \InvalidArgumentException('$object1 has a geo error.'); } if ($object2->hasGeoError()) { thro...
php
{ "resource": "" }
q3309
Tx_Oelib_Geocoding_Calculator.filterByDistance
train
public function filterByDistance(\Tx_Oelib_List $unfilteredObjects, \Tx_Oelib_Interface_Geo $center, $distance) { $objectsWithinDistance = new \Tx_Oelib_List(); /** @var \Tx_Oelib_Interface_Geo|\Tx_Oelib_Model $object */ foreach ($unfilteredObjects as $object) { if ($this->calcu...
php
{ "resource": "" }
q3310
CrudCommand.addRoutes
train
protected function addRoutes() { return ["Route::delete('" . $this->routeName . "/arr-delete', '" . $this->controller . "@arrDelete')->name('" . $this->myAddrName . ".arrDelete');\nRoute::resource('" . $this->routeName . "', '" . $this->controller . "');"]; }
php
{ "resource": "" }
q3311
CrudCommand.processJSONFields
train
protected function processJSONFields($file) { $json = File::get($file); $fields = json_decode($json); $fieldsString = ''; foreach ($fields->fields as $field) { if ($field->type === 'select' || $field->type === 'enum') { $fieldsString .= $field->name . '#'...
php
{ "resource": "" }
q3312
SitewideContentReport.columns
train
public function columns($itemType = 'Pages') { $columns = [ 'Title' => [ 'title' => _t(__CLASS__ . '.Name', 'Name'), 'link' => true, ], 'Created' => [ 'title' => _t(__CLASS__ . '.Created', 'Date created'), 'f...
php
{ "resource": "" }
q3313
SitewideContentReport.getPrintExportColumns
train
public function getPrintExportColumns($gridField, $itemType, $exportColumns) { // Swap RelativeLink for AbsoluteLink for export $exportColumns['AbsoluteLink'] = _t(__CLASS__ . '.Link', 'Link'); unset($exportColumns['RelativeLink']); $this->extend('updatePrintExportColumns', $gridFie...
php
{ "resource": "" }
q3314
RegExp.checkUnicodeSupport
train
public function checkUnicodeSupport() { if (null === self::$unicodeEnabled) { self::$unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false; } return self::$unicodeEnabled; }
php
{ "resource": "" }
q3315
Tx_Oelib_ViewHelpers_GoogleMapsViewHelper.generateJavaScript
train
protected function generateJavaScript($mapId, array $mapPoints, $initializeFunctionName) { // Note: If there are several map points with coordinates and the map // is fit to the map points, the Google Maps API still requires a center // point. In that case, any point will do (e.g., the first...
php
{ "resource": "" }
q3316
SiteView.scopeOlderThanOrBetween
train
public function scopeOlderThanOrBetween(Builder $query, $until = null, $from = null) { if (is_null($until)) { $until = Carbon::now(); } $query->where('created_at', '<', $until); if ( ! is_null($from)) { $query->where('created_at', '>=', $from...
php
{ "resource": "" }
q3317
LanguageLa.convertGrammar
train
function convertGrammar( $word, $case ) { global $wgGrammarForms; if ( isset( $wgGrammarForms['la'][$case][$word] ) ) { return $wgGrammarForms['la'][$case][$word]; } switch ( $case ) { case 'genitive': // only a few declensions, and even for those mostly the singular only $in = array( '/u[ms]$/', ...
php
{ "resource": "" }
q3318
Dialog.getLibrary
train
public function getLibrary($sName) { try { $library = $this->di[$sName]; } catch(\Exception $e) { $library = null; } return $library; }
php
{ "resource": "" }
q3319
Dialog.getModalLibrary
train
protected function getModalLibrary() { // Get the current modal library if(($this->sModalLibrary) && ($library = $this->getLibrary($this->sModalLibrary)) && ($library instanceof Modal)) { return $library; } // Get the default modal library if((...
php
{ "resource": "" }
q3320
Dialog.getAlertLibrary
train
protected function getAlertLibrary($bReturnDefault = false) { // Get the current alert library if(($this->sAlertLibrary) && ($library = $this->getLibrary($this->sAlertLibrary)) && ($library instanceof Alert)) { return $library; } // Get the configured ...
php
{ "resource": "" }
q3321
Dialog.getConfirmLibrary
train
protected function getConfirmLibrary($bReturnDefault = false) { // Get the current confirm library if(($this->sConfirmLibrary) && ($library = $this->getLibrary($this->sConfirmLibrary)) && ($library instanceof Confirm)) { return $library; } // Get the c...
php
{ "resource": "" }
q3322
Dialog.getLibrariesInUse
train
protected function getLibrariesInUse() { $aNames = $this->getOption('dialogs.libraries', array()); if(!is_array($aNames)) { $aNames = array(); } $libraries = array(); foreach($aNames as $sName) { if(($library = $this->getLibrary($sName)...
php
{ "resource": "" }
q3323
Dialog.getJs
train
public function getJs() { if(!$this->includeAssets()) { return ''; } $libraries = $this->getLibrariesInUse(); $code = ''; foreach($libraries as $library) { $code .= "\n" . $library->getJs() . "\n"; } return $code; }
php
{ "resource": "" }
q3324
Dialog.getCss
train
public function getCss() { if(!$this->includeAssets()) { return ''; } $libraries = $this->getLibrariesInUse(); $code = ''; foreach($libraries as $library) { $code .= $library->getCss() . "\n"; } return $code; }
php
{ "resource": "" }
q3325
Dialog.success
train
public function success($message, $title = null) { return $this->getAlertLibrary(true)->success((string)$message, (string)$title); }
php
{ "resource": "" }
q3326
Dialog.info
train
public function info($message, $title = null) { return $this->getAlertLibrary(true)->info((string)$message, (string)$title); }
php
{ "resource": "" }
q3327
Dialog.warning
train
public function warning($message, $title = null) { return $this->getAlertLibrary(true)->warning((string)$message, (string)$title); }
php
{ "resource": "" }
q3328
Dialog.error
train
public function error($message, $title = null) { return $this->getAlertLibrary(true)->error((string)$message, (string)$title); }
php
{ "resource": "" }
q3329
CNabuIContactProspectStatusTypeLanguageBase.setIcontactProspectStatusTypeId
train
public function setIcontactProspectStatusTypeId(int $nb_icontact_prospect_status_type_id) : CNabuDataObject { if ($nb_icontact_prospect_status_type_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$n...
php
{ "resource": "" }
q3330
CNabuIContactProspectStatusTypeLanguageBase.setLanguageId
train
public function setLanguageId(int $nb_language_id) : CNabuDataObject { if ($nb_language_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_language_id") ); } $this->setV...
php
{ "resource": "" }
q3331
CallbackService.getAll
train
public function getAll(array $queryParams = []) { $response = $this->api->callbacks()->getAll($queryParams); return new CallbacksResponse($response); }
php
{ "resource": "" }
q3332
CallbackService.getById
train
public function getById($callbackId, array $queryParams = []) { $response = $this->api->callbacks()->getById($callbackId, $queryParams); return new CallbackResponse($response); }
php
{ "resource": "" }
q3333
CallbackService.create
train
public function create(CallbackBuilder $input, array $queryParams = []) { $response = $this->api->callbacks()->create($input->toArray(), $queryParams); return new CallbackResponse($response); }
php
{ "resource": "" }
q3334
CallbackService.update
train
public function update($callbackId, CallbackBuilder $input, array $queryParams = []) { $response = $this->api->callbacks()->update($callbackId, $input->toArray(), $queryParams); return new CallbackResponse($response); }
php
{ "resource": "" }
q3335
CallbackService.deleteAll
train
public function deleteAll(array $queryParams = []) { $response = $this->api->callbacks()->deleteAll($queryParams); return new BaseResponse($response); }
php
{ "resource": "" }
q3336
CallbackService.deleteById
train
public function deleteById($callbackId, array $queryParams = []) { $response = $this->api->callbacks()->deleteById($callbackId, $queryParams); return new BaseResponse($response); }
php
{ "resource": "" }
q3337
ValueObject.equals
train
public function equals(ValueObjectContract $valueObject) { foreach (get_object_vars($this) as $name => $value) { if ($this->{$name} !== $valueObject->{$name}) { return false; } } return true; }
php
{ "resource": "" }
q3338
SettingService.get
train
public function get($appId, $profileId, array $queryParams) { $response = $this->api->applications()->profiles()->settings()->get($appId, $profileId, $queryParams); return new SettingResponse($response); }
php
{ "resource": "" }
q3339
SettingService.update
train
public function update($appId, $profileId, SettingBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->settings()->update($appId, $profileId, $input->toArray(), $queryParams); return new SettingResponse($response); }
php
{ "resource": "" }
q3340
LanguageMap.withEntry
train
public function withEntry(string $languageTag, string $value): self { $languageMap = clone $this; $languageMap->map[$languageTag] = $value; return $languageMap; }
php
{ "resource": "" }
q3341
ActivityService.getAll
train
public function getAll(array $queryParams = []) { $response = $this->api->activities()->getAll($queryParams); return new ActivitiesResponse($response); }
php
{ "resource": "" }
q3342
ActivityService.getById
train
public function getById($activityId, array $queryParams = []) { $response = $this->api->activities()->getById($activityId, $queryParams); return new ActivityResponse($response); }
php
{ "resource": "" }
q3343
RegistersExceptionHandlers.handleShutdown
train
protected function handleShutdown() { if (! \is_null($error = \error_get_last()) && $this->isFatalError($error['type'])) { $this->handleUncaughtException(new FatalErrorException( $error['message'], $error['type'], 0, $error['file'], $error['line'] )); } }
php
{ "resource": "" }
q3344
RegistersExceptionHandlers.isFatalError
train
protected function isFatalError($type) { $errorCodes = [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE]; if (\defined('FATAL_ERROR')) { $errorCodes[] = FATAL_ERROR; } return \in_array($type, $errorCodes); }
php
{ "resource": "" }
q3345
Compiler.addDbup
train
protected function addDbup(\Phar $phar) { $content = file_get_contents(__DIR__ . '/../../../dbup'); $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content); $phar->addFromString('dbup', $content); }
php
{ "resource": "" }
q3346
CNabuSiteTargetSectionLanguageBase.setSiteTargetSectionId
train
public function setSiteTargetSectionId(int $nb_site_target_section_id) : CNabuDataObject { if ($nb_site_target_section_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_target_section_id") ...
php
{ "resource": "" }
q3347
CNabuProjectBase.refresh
train
public function refresh(bool $force = false, bool $cascade = false) : bool { return parent::refresh($force, $cascade) && $this->appendTranslatedRefresh($force); }
php
{ "resource": "" }
q3348
CNabuProjectBase.getAllProjects
train
public static function getAllProjects(CNabuCustomer $nb_customer) { $nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id'); if (is_numeric($nb_customer_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_p...
php
{ "resource": "" }
q3349
CNabuProjectBase.setCustomerId
train
public function setCustomerId(int $nb_customer_id) : CNabuDataObject { if ($nb_customer_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_customer_id") ); } $this->setV...
php
{ "resource": "" }
q3350
ModificationHydrator.hydrateCollection
train
public static function hydrateCollection(array $modifications) { $hydrated = []; foreach ($modifications as $modification) { $hydrated[] = self::hydrate($modification); } return $hydrated; }
php
{ "resource": "" }
q3351
ModificationHydrator.hydrate
train
public static function hydrate(stdClass $modification) { $hydrated = new ModificationEntity(); if (isset($modification->id)) { $hydrated->setId($modification->id); } if (isset($modification->virtual_line)) { $hydrated->setVirtualLine($modification->virtual_l...
php
{ "resource": "" }
q3352
Controller.getMiddlewareForMethod
train
public function getMiddlewareForMethod($method) { $middleware = []; foreach ($this->middleware as $name => $options) { if (isset($options['only']) && ! \in_array($method, (array) $options['only'])) { continue; } if (isset($options['except']) && \...
php
{ "resource": "" }
q3353
TeamHydrator.hydrateCollection
train
public static function hydrateCollection(array $teams) { $hydrated = []; foreach ($teams as $team) { $hydrated[] = self::hydrate($team); } return $hydrated; }
php
{ "resource": "" }
q3354
TeamHydrator.hydrate
train
public static function hydrate(stdClass $team) { $hydrated = new TeamEntity(); if (isset($team->id)) { $hydrated->setId($team->id); } if (isset($team->name)) { $hydrated->setName($team->name); } if (isset($team->organization)) { ...
php
{ "resource": "" }
q3355
CNabuCommerceProductLanguageBase.setCommerceProductId
train
public function setCommerceProductId(int $nb_commerce_product_id) : CNabuDataObject { if ($nb_commerce_product_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_commerce_product_id") )...
php
{ "resource": "" }
q3356
CNabuIContactProspectStatusTypeBase.getLanguages
train
public function getLanguages($force = false) { if (!CNabuEngine::getEngine()->isOperationModeStandalone() && ($this->languages_list->getSize() === 0 || $force) ) { $this->languages_list = CNabuIContactProspectStatusTypeLanguage::getLanguagesForTranslatedObject($this); ...
php
{ "resource": "" }
q3357
CNabuIContactProspectStatusTypeBase.getTranslations
train
public function getTranslations($force = false) { if (!CNabuEngine::getEngine()->isOperationModeStandalone() && ($this->translations_list->getSize() === 0 || $force) ) { $this->translations_list = CNabuIContactProspectStatusTypeLanguage::getTranslationsForTranslatedObject($th...
php
{ "resource": "" }
q3358
CNabuCustomer.refresh
train
public function refresh(bool $force = false, bool $cascade = false) : bool { if (($retval = parent::refresh($force, $cascade))===true && $cascade) { $this->getMediotecas($force); $this->getSites($force); $this->getCommerces($force); $this->getCatalogs($force);...
php
{ "resource": "" }
q3359
CNabuCustomer.getMediotecas
train
public function getMediotecas($force = false) { if ($this->nb_medioteca_list->isEmpty() || $force) { $this->nb_medioteca_list->clear(); $this->nb_medioteca_list->merge(CNabuMedioteca::getAllMediotecas($this)); } return $this->nb_medioteca_list->getItems(); }
php
{ "resource": "" }
q3360
CNabuCustomer.getMedioteca
train
public function getMedioteca($nb_medioteca) { $retval = false; if (is_object($nb_medioteca) && !($nb_medioteca instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_medioteca', get_c...
php
{ "resource": "" }
q3361
CNabuCustomer.getMediotecaByKey
train
public function getMediotecaByKey(string $key) { if (strlen($key) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$key', print_r($key, true)) ); } return $this->nb_medioteca_list->getItem...
php
{ "resource": "" }
q3362
CNabuCustomer.getSite
train
public function getSite($nb_site) { $retval = false; if (is_object($nb_site) && !($nb_site instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_site', get_class($nb_site)) ...
php
{ "resource": "" }
q3363
CNabuCustomer.getSiteByKey
train
public function getSiteByKey(string $key) { $retval = false; if (strlen($key) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$key', print_r($key, true)) ); } $nb_site = $this->n...
php
{ "resource": "" }
q3364
CNabuCustomer.getSiteByAlias
train
public function getSiteByAlias(string $alias) { $retval = false; if (!is_string($alias) || strlen($alias) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$alias', print_r($alias, true)) ); ...
php
{ "resource": "" }
q3365
CNabuCustomer.getSites
train
public function getSites($force = false) { if ($force) { $this->nb_site_list->clear(); $this->nb_site_list->merge(CNabuSite::getAllSites($this)); } return $this->nb_site_list->getItems(); }
php
{ "resource": "" }
q3366
CNabuCustomer.getCommerces
train
public function getCommerces($force = false) { if ($this->nb_commerce_list->isEmpty() || $force) { $this->nb_commerce_list->clear(); $this->nb_commerce_list->merge(CNabuCommerce::getAllCommerces($this)); } return $this->nb_commerce_list->getItems(); }
php
{ "resource": "" }
q3367
CNabuCustomer.getCommerce
train
public function getCommerce($nb_commerce) { $retval = false; if (is_object($nb_commerce) && !($nb_commerce instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_commerce', get_class(...
php
{ "resource": "" }
q3368
CNabuCustomer.getCatalog
train
public function getCatalog($nb_catalog) { $retval = false; if (is_object($nb_catalog) && !($nb_catalog instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_catalog', get_class($nb_c...
php
{ "resource": "" }
q3369
CNabuCustomer.getCatalogByKey
train
public function getCatalogByKey($key) { if (!is_string($key) || strlen($key) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$key', print_r($key, true)) ); } return $this->nb_catalog_list...
php
{ "resource": "" }
q3370
CNabuCustomer.getCatalogBySlug
train
public function getCatalogBySlug($slug, $nb_language = null) { if (!is_string($slug) || strlen($slug) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$slug', print_r($slug, true)) ); } $n...
php
{ "resource": "" }
q3371
CNabuCustomer.getCatalogs
train
public function getCatalogs($force = false) { if ($this->nb_catalog_list->isEmpty() || $force) { $this->nb_catalog_list->clear(); $this->nb_catalog_list->merge(CNabuCatalog::getAllCatalogs($this)); } return $this->nb_catalog_list->getItems(); }
php
{ "resource": "" }
q3372
CNabuCustomer.getMessagings
train
public function getMessagings($force = false) { if ($this->nb_messaging_list->isEmpty() || $force) { $this->nb_messaging_list->clear(); $this->nb_messaging_list->merge(CNabuMessaging::getAllMessagings($this)); } return $this->nb_messaging_list->getItems(); }
php
{ "resource": "" }
q3373
CNabuCustomer.getMessaging
train
public function getMessaging($nb_messaging) { $retval = false; if (is_object($nb_messaging) && !($nb_messaging instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_messaging', get_c...
php
{ "resource": "" }
q3374
CNabuCustomer.getProjects
train
public function getProjects($force = false) { if ($this->nb_project_list === null) { $this->nb_project_list = new CNabuProjectList($this); } if ($force) { $this->nb_role_list->clear(); $this->nb_project_list->merge(CNabuProject::getAllProjects($this)); ...
php
{ "resource": "" }
q3375
CNabuCustomer.getProject
train
public function getProject($nb_project) { $retval = false; if (is_object($nb_project) && !($nb_project instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_project', get_class($nb_p...
php
{ "resource": "" }
q3376
CNabuCustomer.getUser
train
public function getUser($nb_user) { $retval = null; $nb_user_id = nb_getMixedValue($nb_user, NABU_USER_FIELD_ID); if (is_numeric($nb_user_id)) { $nb_new_user = new CNabuUser($nb_user_id); if ($nb_new_user->isFetched() && $nb_new_user->validateCustomer($this)) { ...
php
{ "resource": "" }
q3377
CNabuCustomer.getUserByLogin
train
public function getUserByLogin(string $login) { $retval = null; if (strlen($login) > 0) { $nb_user = CNabuUser::findByLogin($this, $login); if ($nb_user instanceof CNabuUser && $nb_user->validateCustomer($this)) { $nb_user->setCustomer($this); ...
php
{ "resource": "" }
q3378
CNabuCustomer.getUserByEMail
train
public function getUserByEMail(string $email) { $retval = null; if (strlen($email) > 0) { $nb_user = CNabuUser::findByEMail($this, $email); if ($nb_user instanceof CNabuUser && $nb_user->validateCustomer($this)) { $nb_user->setCustomer($this); ...
php
{ "resource": "" }
q3379
CNabuCustomer.getRoles
train
public function getRoles(bool $force = false) { if ($this->nb_role_list->isEmpty() || $force) { $this->nb_role_list->clear(); $this->nb_role_list->merge(CNabuRole::getAllRoles($this)); } return $this->nb_role_list; }
php
{ "resource": "" }
q3380
CNabuCustomer.getRole
train
public function getRole($nb_role) { $retval = false; if (is_object($nb_role) && !($nb_role instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_role', get_class($nb_role)) ...
php
{ "resource": "" }
q3381
CNabuCustomer.getRoleByKey
train
public function getRoleByKey(string $key) { if (strlen($key) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$key', print_r($key, true)) ); } return $this->nb_role_list->getItem($key, CNa...
php
{ "resource": "" }
q3382
CNabuCustomer.getIContacts
train
public function getIContacts($force = false) { if ($this->nb_icontact_list->isEmpty() || $force) { $this->nb_icontact_list->clear(); $this->nb_icontact_list->merge(CNabuIContact::getAlliContacts($this)); } return $this->nb_icontact_list->getItems(); }
php
{ "resource": "" }
q3383
CNabuCustomer.getIContact
train
public function getIContact($nb_icontact) { $retval = false; if (is_object($nb_icontact) && !($nb_icontact instanceof CNabuDataObject)) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$nb_icontact', get_class(...
php
{ "resource": "" }
q3384
CNabuCustomer.getIContactByKey
train
public function getIContactByKey(string $key) { if (!is_string($key) || strlen($key) === 0) { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE, array('$key', print_r($key, true)) ); } return $this->nb_icon...
php
{ "resource": "" }
q3385
TypeService.getAll
train
public function getAll(array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->origins() ->types() ->getAll($queryParams); return new TypesResponse($response); }
php
{ "resource": "" }
q3386
TypeService.getById
train
public function getById($typeId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->origins() ->types() ->getById($typeId, $queryParams); return new TypeResponse($response); }
php
{ "resource": "" }
q3387
CNabuClusterUserBase.setGroupId
train
public function setGroupId(int $group_id) : CNabuDataObject { if ($group_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$group_id") ); } $this->setValue('nb_cluster_user...
php
{ "resource": "" }
q3388
CNabuClusterUserBase.setOSNick
train
public function setOSNick(string $os_nick) : CNabuDataObject { if ($os_nick === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$os_nick") ); } $this->setValue('nb_cluster_user_...
php
{ "resource": "" }
q3389
Result.equals
train
public function equals(Result $result): bool { if (null !== $this->score xor null !== $result->score) { return false; } if (null !== $this->score && !$this->score->equals($result->score)) { return false; } if ($this->success !== $result->success) { ...
php
{ "resource": "" }
q3390
CNabuIContactProspectAttachment.putFile
train
public function putFile(string $sourcefile) { if (file_exists($sourcefile)) { if (($nb_icontact_prospect = $this->getIContactProspect()) instanceof CNabuIContactProspect && ($nb_icontact = $nb_icontact_prospect->getIContact()) instanceof CNabuIContact ) { ...
php
{ "resource": "" }
q3391
CNabuIContactProspectAttachment.deleteFile
train
public function deleteFile() { $retval = false; if (($nb_icontact_prospect = $this->getIContactProspect()) instanceof CNabuIContactProspect && ($nb_icontact = $nb_icontact_prospect->getIContact()) instanceof CNabuIContact ) { $base_path = $nb_icontact->getBasePath();...
php
{ "resource": "" }
q3392
CNabuIContactProspectAttachment.getAttachmentsForProspect
train
public static function getAttachmentsForProspect($nb_prospect) { if (is_numeric($nb_prospect_id = nb_getMixedValue($nb_prospect, NABU_ICONTACT_PROSPECT_FIELD_ID))) { $retval = CNabuIContactProspectAttachment::buildObjectListFromSQL( NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID, ...
php
{ "resource": "" }
q3393
CNabuHTTPSiteTargetPluginAdapter.trap
train
public function trap(CNabuHTTPRequest $nb_request, CNabuHTTPResponse $nb_response) : bool { if (($this->nb_request = $nb_request) === null || ($this->nb_response = $nb_response) === null || ($this->nb_engine = CNabuEngine::getEngine()) === null || ($this->nb_application =...
php
{ "resource": "" }
q3394
IssueService.getAll
train
public function getAll($applicationID, $scanID, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->getAll($applicationID, $scanID, $queryParams); return new IssuesResponse($response); }
php
{ "resource": "" }
q3395
IssueService.getStats
train
public function getStats($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->getStats($appId, $scanId, $queryParams); return new IssueStatsResponse($response); }
php
{ "resource": "" }
q3396
IssueService.getById
train
public function getById($appId, $scanId, $issueId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->getById($appId, $scanId, $issueId, $queryParams); return new IssueResponse($response); }
php
{ "resource": "" }
q3397
IssueService.create
train
public function create($appId, $scanId, $input, array $queryParams = []) { if ($input instanceof IssueBuilder) { $inputArray = $input->toArray(); $defaultInput = true; } else { $inputArray = []; foreach ($input as $key => $value) { if (...
php
{ "resource": "" }
q3398
CNabuSiteRoleBase.setSiteId
train
public function setSiteId(int $nb_site_id) : CNabuDataObject { if ($nb_site_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_id") ); } $this->setValue('nb_site_id...
php
{ "resource": "" }
q3399
CNabuSiteRoleBase.setRoleId
train
public function setRoleId(int $nb_role_id) : CNabuDataObject { if ($nb_role_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_role_id") ); } $this->setValue('nb_role_id...
php
{ "resource": "" }