_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q4100
LdapHydrator.hydrateCollection
train
public static function hydrateCollection(array $ldaps) { $hydrated = []; foreach ($ldaps as $ldap) { $hydrated[] = self::hydrate($ldap); } return $hydrated; }
php
{ "resource": "" }
q4101
LdapHydrator.hydrate
train
public static function hydrate(stdClass $ldap) { $hydrated = new LdapEntity(); if (isset($ldap->id)) { $hydrated->setId($ldap->id); } if (isset($ldap->enabled)) { $hydrated->setEnabled($ldap->enabled); } if (isset($ldap->search_dn)) { ...
php
{ "resource": "" }
q4102
LocalDriver.getData
train
public function getData(string $table, $name = ""){ $file = $this->base . '/' . $table . '.json'; if(file_exists($file)){ return json_decode(file_get_contents($file), true); }else{ throw new \NonDB\Exceptions\DriverException('Table Not Exi...
php
{ "resource": "" }
q4103
LocalDriver.setData
train
public function setData(string $table, $data){ $file = $this->base . '/' . $table . '.json'; if(file_exists($file)){ if(file_put_contents($file, json_encode($data))){ $status = true; }else{ $status = false; ...
php
{ "resource": "" }
q4104
LocalDriver.newTable
train
public function newTable(string $name){ $status = file_put_contents($file = $this->base . '/' . $name . '.json', "[]"); return new \NonDB\Components\Status($status); }
php
{ "resource": "" }
q4105
LocalDriver.removeTable
train
public function removeTable(string $name){ $status = unlink($file = $this->base . '/' . $name . '.json'); return new \NonDB\Components\Status($status); }
php
{ "resource": "" }
q4106
APIService.initialize
train
public function initialize($email, $password, $config) { $this->api = new API($email, $password, $config); }
php
{ "resource": "" }
q4107
ProcessHydrator.hydrateCollection
train
public static function hydrateCollection(array $processes) { $hydrated = []; foreach ($processes as $process) { $hydrated[] = self::hydrate($process); } return $hydrated; }
php
{ "resource": "" }
q4108
ProcessHydrator.hydrate
train
public static function hydrate(stdClass $process) { $hydrated = new ProcessEntity(); if (isset($process->id)) { $hydrated->setId($process->id); } if (isset($process->pid)) { $hydrated->setPid($process->pid); } if (isset($process->version)) {...
php
{ "resource": "" }
q4109
ExtensionHydrator.hydrateCollection
train
public static function hydrateCollection(array $extensions) { $hydrated = []; foreach ($extensions as $extension) { $hydrated[] = self::hydrate($extension); } return $hydrated; }
php
{ "resource": "" }
q4110
ExtensionHydrator.hydrate
train
public static function hydrate(stdClass $extension) { $hydrated = new ExtensionEntity(); if (isset($extension->id)) { $hydrated->setId($extension->id); } if (isset($extension->extension)) { $hydrated->setExtension($extension->extension); } r...
php
{ "resource": "" }
q4111
QuotaHydrator.hydrateCollection
train
public static function hydrateCollection(array $quotas) { $hydrated = []; foreach ($quotas as $quota) { $hydrated[] = self::hydrate($quota); } return $hydrated; }
php
{ "resource": "" }
q4112
CNabuSiteTargetSectionListBase.createSecondaryIndexes
train
protected function createSecondaryIndexes() { $this->addIndex( new CNabuDataObjectListIndex($this, 'nb_site_target_section_key', 'nb_site_target_section_order', self::INDEX_KEY) ); $this->addIndex( new CNabuDataObjectListIndex($this, 'nb_site_target_section_order', 'n...
php
{ "resource": "" }
q4113
CNabuSiteTargetSectionListBase.acquireItem
train
public function acquireItem($key, $index = false) { $retval = false; if ($index === false && CNabuEngine::getEngine()->isMainDBAvailable()) { $item = new CNabuSiteTargetSection($key); if ($item->isFetched()) { $retval = $item; } } ...
php
{ "resource": "" }
q4114
CNabuMessagingBase.getAllMessagings
train
public static function getAllMessagings(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...
php
{ "resource": "" }
q4115
ProcessService.getAll
train
public function getAll($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->processes() ->getAll($appId, $scanId, $queryParams); return new ProcessesResponse($response); }
php
{ "resource": "" }
q4116
ProcessService.getById
train
public function getById($appId, $scanId, $processId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->processes() ->getById($appId, $scanId, $processId, $queryParams); return new ProcessResponse($response); }
php
{ "resource": "" }
q4117
ProcessService.create
train
public function create($appId, $scanId, $input, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->processes() ->create($appId, $scanId, $input->toArray(), $queryParams); return new ProcessResponse($response); }
php
{ "resource": "" }
q4118
CNabuDataObjectList.clear
train
public function clear() { $this->list = null; if (is_array($this->secondary_indexes)) { foreach ($this->secondary_indexes as $index) { $index->clear(); } } }
php
{ "resource": "" }
q4119
CNabuDataObjectList.addIndex
train
public function addIndex(CNabuDataObjectListIndex $index) { $name = $index->getName(); if (is_array($this->secondary_indexes)) { $this->secondary_indexes[$name] = $index; } else { $this->secondary_indexes = array($name => $index); } return $index; ...
php
{ "resource": "" }
q4120
CNabuDataObjectList.getIndex
train
public function getIndex($index) { if (is_string($index) && is_array($this->secondary_indexes) && array_key_exists($index, $this->secondary_indexes) ) { return $this->secondary_indexes[$index]; } else { throw new ENabuCoreException(ENabuCoreExc...
php
{ "resource": "" }
q4121
CNabuDataObjectList.getKeys
train
public function getKeys($index = false) { $retval = null; if ($index === false) { $retval = is_array($this->list) ? array_keys($this->list) : null; } elseif (is_string($index) && is_array($this->secondary_indexes) && array_key_exists($index, $this->second...
php
{ "resource": "" }
q4122
CNabuDataObjectList.addItem
train
public function addItem(CNabuDataObject $item) { $retval = false; if ($this->index_field !== false) { if ($item->contains($this->index_field)) { if (is_array($this->list)) { $this->list[$item->getValue($this->index_field)] = $item; ...
php
{ "resource": "" }
q4123
CNabuDataObjectList.indexItem
train
protected function indexItem(CNabuDataObject $item) { if (is_array($this->secondary_indexes)) { foreach ($this->secondary_indexes as $index) { $index->addItem($item); } } }
php
{ "resource": "" }
q4124
CNabuDataObjectList.removeItemIndex
train
protected function removeItemIndex(CNabuDataObject $item) { if (is_array($this->secondary_indexes)) { foreach ($this->secondary_indexes as $index) { $index->removeItem($item->getValue($this->index_field)); } } }
php
{ "resource": "" }
q4125
CNabuDataObjectList.removeItem
train
public function removeItem($item) { $nb_index_id = nb_getMixedValue($item, $this->index_field); if ((is_numeric($nb_index_id) || nb_isValidGUID($nb_index_id)) && $this->containsKey($nb_index_id)) { unset($this->list[$nb_index_id]); $this->removeItemIndex($item); } ...
php
{ "resource": "" }
q4126
CNabuDataObjectList.mergeArray
train
public function mergeArray(array $array = null) { $count = 0; if (is_array($array)) { if (count($array) > 0) { foreach ($array as $key => $item) { if (!$this->containsKey($key)) { $this->addItem($item); ...
php
{ "resource": "" }
q4127
MigrationCompiler.compile
train
public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, array $extensions, $extra = null) { // Add time to migration $this->date->addSeconds(5); if (File::exists(base_path('scaffolder-config/cache/migration_' . $hash . self::CACHE_EXT))) { ...
php
{ "resource": "" }
q4128
MigrationCompiler.replaceTableName
train
private function replaceTableName(stdClass $scaffolderConfig, $modelName) { $tableName = isset($scaffolderConfig->tableName) && !empty($scaffolderConfig->tableName) ? $scaffolderConfig->tableName : $modelName . 's'; $this->stub = str_replace('{{table_name}}', strtolower($tableName), $this->stub); ...
php
{ "resource": "" }
q4129
MigrationCompiler.addFields
train
private function addFields($modelData) { // Default primary key $fields = $this->tab(3) . "\$table->increments('id');" . PHP_EOL . PHP_EOL; // Check primary key foreach ($modelData->fields as $field) { if ($field->index == 'primary') { ...
php
{ "resource": "" }
q4130
CNabuCatalog.getTaxonomies
train
public function getTaxonomies(bool $force = false) { if ($this->nb_catalog_taxonomy_list->isEmpty() || $force) { $this->nb_catalog_taxonomy_list->clear(); $this->nb_catalog_taxonomy_list->merge( CNabuCatalogTaxonomy::getAllCatalogTaxonomies($this) ); ...
php
{ "resource": "" }
q4131
CNabuCatalog.getTags
train
public function getTags(bool $force = false) { if ($this->nb_catalog_tag_list->isEmpty() || $force) { $this->nb_catalog_tag_list->clear(); $this->nb_catalog_tag_list->merge( CNabuCatalogTag::getAllCatalogTags($this) ); } return $this->nb_c...
php
{ "resource": "" }
q4132
CNabuXMLSiteMap.setTarget
train
private function setTarget(SimpleXMLElement $element) { $target = $element->addChild('target'); switch ($this->nb_data_object->getUseURI()) { case 'T': if (($nb_site = $this->nb_data_object->getSite()) instanceof CNabuSite && ($nb_site_target = $nb_sit...
php
{ "resource": "" }
q4133
CNabuXMLSiteMap.setSecurity
train
private function setSecurity(SimpleXMLElement $element) { $security = $element->addChild('security'); $xml_roles = new CNabuXMLSiteMapRoleList($this->nb_data_object->getRoles()); $xml_roles->build($security); }
php
{ "resource": "" }
q4134
CNabuXMLSiteMap.setMapChilds
train
private function setMapChilds(SimpleXMLElement $element) { $nb_map_list = $this->nb_data_object->getChilds(); if ($nb_map_list->getSize() > 0) { $xml_childs = new CNabuXMLSiteMapList($nb_map_list); $xml_childs->build($element); } }
php
{ "resource": "" }
q4135
Tool.checkImplement
train
public static function checkImplement($class, string $interface){ $ref = new \ReflectionClass($class); $names = $ref->getInterfaceNames(); if(in_array($interface, $names)){ return true; }else{ return false; } }
php
{ "resource": "" }
q4136
Dump.arrayToXML
train
protected static function arrayToXML($data, &$xml = null){ if($xml === null) $xml = new \SimpleXMLElement("<?xml version=\"1.0\"?><nondb></nondb>"); foreach($data as $k=>$v){ if(is_array($v)){ $sub = $xml->addChild("$k"); s...
php
{ "resource": "" }
q4137
ProfileHydrator.hydrateCollection
train
public static function hydrateCollection(array $profiles) { $hydrated = []; foreach ($profiles as $profile) { $hydrated[] = self::hydrate($profile); } return $hydrated; }
php
{ "resource": "" }
q4138
ProfileHydrator.hydrate
train
public static function hydrate(stdClass $profile) { $hydrated = new ProfileEntity(); if (isset($profile->id)) { $hydrated->setId($profile->id); } if (isset($profile->name)) { $hydrated->setName($profile->name); } if (isset($profile->setting)...
php
{ "resource": "" }
q4139
Verb.equals
train
public function equals(Verb $verb): bool { if (!$this->id->equals($verb->id)) { return false; } if (null === $this->display && null === $verb->display) { return true; } if (null !== $this->display xor null !== $verb->display) { return fal...
php
{ "resource": "" }
q4140
JavaHydrator.hydrateCollection
train
public static function hydrateCollection(array $javas) { $hydrated = []; foreach ($javas as $java) { $hydrated[] = self::hydrate($java); } return $hydrated; }
php
{ "resource": "" }
q4141
JavaHydrator.hydrate
train
public static function hydrate(stdClass $java) { $hydrated = new JavaEntity(); if (isset($java->id)) { $hydrated->setId($java->id); } if (isset($java->major_version)) { $hydrated->setMajorVersion($java->major_version); } if (isset($java->min...
php
{ "resource": "" }
q4142
ParentClass.setParent
train
public function setParent($parent){ $this->parent = $parent; if($this->parentCallback){ call_user_func($this->parentCallback); } return $this; }
php
{ "resource": "" }
q4143
ParentClass.setCallback
train
public function setCallback(Callable $callback, bool $force = false){ if($force || !$this->parentCallback){ $this->parentCallback = $callback; } return $this; }
php
{ "resource": "" }
q4144
FoundationSupports.withFoundation
train
public function withFoundation() { $this->make('events')->listen('orchestra.auth: roles', UserAccess::class); $this->registerMemoryBindings(); $this->registerAuthorizationBindings(); return $this; }
php
{ "resource": "" }
q4145
CNabuDBAbstractDescriptor.getPrimaryConstraint
train
protected function getPrimaryConstraint($force = false) { if ($this->primary_constraint === null || $force) { $this->primary_constraint = null; if (array_key_exists('constraints', $this->storage_descriptor)) { foreach ($this->storage_descriptor['constraints'] as $cons...
php
{ "resource": "" }
q4146
TNabuSiteTargetCTAChild.setSiteTargetCTA
train
public function setSiteTargetCTA(CNabuSiteTargetCTA $nb_site_target_cta, $field = NABU_SITE_TARGET_CTA_FIELD_ID) { $this->nb_site_target_cta = $nb_site_target_cta; if ($this instanceof CNabuDataObject) { $this->transferValue($nb_site_target_cta, NABU_SITE_TARGET_CTA_FIELD_ID, $field); ...
php
{ "resource": "" }
q4147
TNabuMediotecaChild.getMedioteca
train
public function getMedioteca($nb_customer = false, $force = false) { if (($this->nb_medioteca === null || $force) && !$this->isValueNull(NABU_MEDIOTECA_FIELD_ID)) { $this->nb_medioteca = null; if (($nb_final_cust = nb_grantCustomer($nb_customer, $force)) !==false) { $...
php
{ "resource": "" }
q4148
TNabuMediotecaChild.setMedioteca
train
public function setMedioteca(CNabuMedioteca $nb_medioteca, $field = NABU_MEDIOTECA_FIELD_ID) { $this->nb_medioteca = $nb_medioteca; if ($this instanceof CNabuDataObject) { $this->transferValue($nb_medioteca, NABU_MEDIOTECA_FIELD_ID, $field); } return $this; }
php
{ "resource": "" }
q4149
CNabuMediotecaBase.getAllMediotecas
train
public static function getAllMediotecas(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...
php
{ "resource": "" }
q4150
CNabuMediotecaBase.getCustomerUsedLanguages
train
public static function getCustomerUsedLanguages($nb_customer) { $nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID); if (is_numeric($nb_customer_id)) { $nb_language_list = CNabuLanguage::buildObjectListFromSQL( 'nb_language_id', 'selec...
php
{ "resource": "" }
q4151
QueryBuilder.forge
train
public static function forge($classname = null, $db_table_alias = null, $escape = true){ if (!is_null($classname)) { $object = new $classname; } else if(get_called_class() != "Pragma\ORM\QueryBuilder") { $object = new static(); } else { throw new \Exception("QueryBuilder can't be built without classnam...
php
{ "resource": "" }
q4152
IdGenerator.encode
train
public static function encode( $cacheVersion = WurflConstants::API_NAMESPACE, $namespace = AbstractAdapter::DEFAULT_NAMESPACE, $cacheId = '' ) { $cacheId = implode(':', array($cacheVersion, $namespace, $cacheId)); return hash('sha512', $cacheId); }
php
{ "resource": "" }
q4153
CNabuMessagingService.getTemplateConnections
train
public function getTemplateConnections(bool $force = false) : CNabuMessagingServiceTemplateList { if ($this->nb_messaging_template_service_list->isEmpty() || $force) { $this->nb_messaging_template_service_list->clear(); $this->nb_messaging_template_service_list->merge( ...
php
{ "resource": "" }
q4154
CNabuMessagingService.isTemplateConnected
train
public function isTemplateConnected($nb_template) : bool { $retval = false; if (is_numeric($nb_template_id = nb_getMixedValue($nb_template, NABU_MESSAGING_TEMPLATE_FIELD_ID))) { $this->getTemplateConnections(); $retval = $this->nb_messaging_template_service_list->containsKey...
php
{ "resource": "" }
q4155
CNabuMessagingService.getActiveMessagingServices
train
public static function getActiveMessagingServices(CNabuMessaging $nb_messaging) { $nb_messaging_id = nb_getMixedValue($nb_messaging, 'nb_messaging_id'); if (is_numeric($nb_messaging_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), ...
php
{ "resource": "" }
q4156
TNabuUserChild.getUser
train
public function getUser($force = false) { if ($this->nb_user === null || $force) { $this->nb_user = null; if ($this instanceof CNabuDataObject && $this->contains(NABU_USER_FIELD_ID) && $this->isValueNumeric(NABU_USER_FIELD_ID) ) { ...
php
{ "resource": "" }
q4157
TNabuUserChild.setUser
train
public function setUser(CNabuUser $nb_user) { $this->nb_user = $nb_user; if ($this instanceof CNabuDataObject) { $this->transferValue($nb_user, NABU_USER_FIELD_ID); } return $this; }
php
{ "resource": "" }
q4158
TNabuSiteTargetChild.setSiteTarget
train
public function setSiteTarget(CNabuSiteTarget $nb_site_target = null, $field = NABU_SITE_TARGET_FIELD_ID) { $this->nb_site_target = $nb_site_target; if ($this instanceof CNabuDataObject) { if ($nb_site_target instanceof CNabuSiteTarget) { $this->transferValue($nb_site_tar...
php
{ "resource": "" }
q4159
AuthServiceProvider.bindAuthForApiToken
train
protected function bindAuthForApiToken() { Auth::viaRequest('api', function ($request) { if ($request->input('api_token')) { return User::where('api_token', $request->input('api_token'))->first(); } }); }
php
{ "resource": "" }
q4160
AuthServiceProvider.bindAuthForJwtToken
train
protected function bindAuthForJwtToken() { Auth::viaRequest('jwt', function ($request) { try { if (! $user = JWTAuth::parseToken()->authenticate()) { return; } } catch (Exception $e) { return; } ...
php
{ "resource": "" }
q4161
BaseBuilder.toArray
train
public function toArray() { $out = []; foreach ($this->setFields as $key) { $property = $this->{$key}; if ($property instanceof DateTime) { $out[$key] = $property->format(DateTime::ISO8601); } else { $out[$key] = $property; ...
php
{ "resource": "" }
q4162
CNabuSiteMapRoleBase.setSiteMapId
train
public function setSiteMapId(int $nb_site_map_id = 0) : CNabuDataObject { if ($nb_site_map_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_map_id") ); } $this->s...
php
{ "resource": "" }
q4163
CNabuSiteMapRoleBase.setZone
train
public function setZone(string $zone = "B") : CNabuDataObject { if ($zone === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$zone") ); } $this->setValue('nb_site_map_role_zone...
php
{ "resource": "" }
q4164
CNabuDomainZoneBase.getAllDomainZones
train
public static function getAllDomainZones(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'), 'n...
php
{ "resource": "" }
q4165
CNabuDomainZoneBase.setOrigin
train
public function setOrigin($origin) : CNabuDataObject { if ($origin === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$origin") ); } $this->setValue('nb_domain_zone_origin', $o...
php
{ "resource": "" }
q4166
CNabuDomainZoneBase.setTtl
train
public function setTtl(int $ttl = 86400) : CNabuDataObject { if ($ttl === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$ttl") ); } $this->setValue('nb_domain_zone_ttl', $ttl)...
php
{ "resource": "" }
q4167
CNabuDomainZoneBase.setAdminEmail
train
public function setAdminEmail(string $admin_email) : CNabuDataObject { if ($admin_email === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$admin_email") ); } $this->setValue('...
php
{ "resource": "" }
q4168
CNabuDomainZoneBase.setSerial
train
public function setSerial(int $serial = 1) : CNabuDataObject { if ($serial === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$serial") ); } $this->setValue('nb_domain_zone_ser...
php
{ "resource": "" }
q4169
CNabuDomainZoneBase.setRefresh
train
public function setRefresh(int $refresh = 10800) : CNabuDataObject { if ($refresh === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$refresh") ); } $this->setValue('nb_domain_...
php
{ "resource": "" }
q4170
CNabuDomainZoneBase.setRetry
train
public function setRetry(int $retry = 3600) : CNabuDataObject { if ($retry === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$retry") ); } $this->setValue('nb_domain_zone_retr...
php
{ "resource": "" }
q4171
CNabuDomainZoneBase.setExpiry
train
public function setExpiry(int $expiry = 604800) : CNabuDataObject { if ($expiry === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$expiry") ); } $this->setValue('nb_domain_zon...
php
{ "resource": "" }
q4172
CNabuDomainZoneBase.setMinimum
train
public function setMinimum(int $minimum = 10800) : CNabuDataObject { if ($minimum === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$minimum") ); } $this->setValue('nb_domain_...
php
{ "resource": "" }
q4173
CNabuDomainZoneBase.setDns01
train
public function setDns01(string $dns_01) : CNabuDataObject { if ($dns_01 === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$dns_01") ); } $this->setValue('nb_domain_zone_dns_0...
php
{ "resource": "" }
q4174
CNabuDomainZoneBase.setDns02
train
public function setDns02(string $dns_02) : CNabuDataObject { if ($dns_02 === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$dns_02") ); } $this->setValue('nb_domain_zone_dns_0...
php
{ "resource": "" }
q4175
CNabuDomainZoneBase.setDnsOrigin
train
public function setDnsOrigin($dns_origin) : CNabuDataObject { if ($dns_origin === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$dns_origin") ); } $this->setValue('nb_domain_z...
php
{ "resource": "" }
q4176
CNabuDomainZoneBase.setShareAll
train
public function setShareAll(string $share_all = "F") : CNabuDataObject { if ($share_all === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$share_all") ); } $this->setValue('nb...
php
{ "resource": "" }
q4177
SettingHydrator.hydrateCollection
train
public static function hydrateCollection(array $settings) { $hydrated = []; foreach ($settings as $setting) { $hydrated[] = self::hydrate($setting); } return $hydrated; }
php
{ "resource": "" }
q4178
SettingHydrator.hydrate
train
public static function hydrate(stdClass $setting) { $hydrated = new SettingEntity(); if (isset($setting->key)) { $hydrated->setKey($setting->key); } if (isset($setting->value)) { $hydrated->setValue($setting->value); } if (isset($setting->cr...
php
{ "resource": "" }
q4179
CNabuMessagingTemplateBase.getAllMessagingTemplates
train
public static function getAllMessagingTemplates(CNabuMessaging $nb_messaging) { $nb_messaging_id = nb_getMixedValue($nb_messaging, 'nb_messaging_id'); if (is_numeric($nb_messaging_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), ...
php
{ "resource": "" }
q4180
CommandsServiceProvider.registerEntityScanner
train
protected function registerEntityScanner() { $app = $this->app; $app->singleton('datamapper.entity.scanner', function ($app) { $reader = $app['datamapper.annotationreader']; $validator = new EntityValidator; return new EntityScanner($reader, $validator); ...
php
{ "resource": "" }
q4181
CNabuCatalogTagBase.findByKey
train
public static function findByKey($nb_catalog, $key) { $nb_catalog_id = nb_getMixedValue($nb_catalog, 'nb_catalog_id'); if (is_numeric($nb_catalog_id)) { $retval = CNabuCatalogTag::buildObjectFromSQL( 'select * ' . 'from nb_catalog_tag ' ...
php
{ "resource": "" }
q4182
CNabuCatalogTagBase.getAllCatalogTags
train
public static function getAllCatalogTags(CNabuCatalog $nb_catalog) { $nb_catalog_id = nb_getMixedValue($nb_catalog, 'nb_catalog_id'); if (is_numeric($nb_catalog_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_cata...
php
{ "resource": "" }
q4183
CNabuCatalogTagBase.getFilteredCatalogTagList
train
public static function getFilteredCatalogTagList($nb_catalog, $q = null, $fields = null, $order = null, $offset = 0, $num_items = 0) { $nb_catalog_id = nb_getMixedValue($nbu_customer, NABU_CATALOG_FIELD_ID); if (is_numeric($nb_catalog_id)) { $fields_part = nb_prefixFieldList(CNabuCatalog...
php
{ "resource": "" }
q4184
CNabuMessagingPoolManager.getFactory
train
public function getFactory(CNabuMessaging $nb_messaging) { $retval = false; $nb_customer = $this->getCustomer(); if ($nb_messaging->validateCustomer($nb_customer)) { if (is_numeric($nb_messaging_id = nb_getMixedValue($nb_messaging, NABU_MESSAGING_FIELD_ID))) { $r...
php
{ "resource": "" }
q4185
LibraryHydrator.hydrateCollection
train
public static function hydrateCollection(array $libraries) { $hydrated = []; foreach ($libraries as $library) { $hydrated[] = self::hydrate($library); } return $hydrated; }
php
{ "resource": "" }
q4186
LibraryHydrator.hydrate
train
public static function hydrate(stdClass $library) { $hydrated = new LibraryEntity(); if (isset($library->id)) { $hydrated->setId($library->id); } if (isset($library->name)) { $hydrated->setName($library->name); } if (isset($library->version)...
php
{ "resource": "" }
q4187
CheckIfDead.isLinkDead
train
public function isLinkDead( $url ) { $deadVal = $this->areLinksDead( [ $url ] ); $deadVal = $deadVal[$url]; return $deadVal; }
php
{ "resource": "" }
q4188
CheckIfDead.performFullRequest
train
protected function performFullRequest( $urls ) { // Create multiple curl handle $multicurl_resource = curl_multi_init(); if ( $multicurl_resource === false ) { return false; } $curl_instances = []; $deadlinks = []; foreach ( $urls as $id => $url ) { $curl_instances[$id] = curl_init(); if ( $curl_...
php
{ "resource": "" }
q4189
CheckIfDead.queueRequests
train
protected function queueRequests( $urls ) { $this->curlQueue = []; if ( $this->queuedTesting === false ) { $this->curlQueue[] = $urls; return; } foreach ( $urls as $url ) { $domain = $this->parseURL( $url )['host']; $queuedUrl = false; $queueIndex = -1; foreach ( $this->curlQueue as $queueInd...
php
{ "resource": "" }
q4190
CheckIfDead.getCurlOptions
train
protected function getCurlOptions( $url, $full = false ) { $requestType = $this->getRequestType( $url ); if ( $requestType == "MMS" ) { $url = str_ireplace( "mms://", "rtsp://", $url ); } $options = [ CURLOPT_URL => $url, CURLOPT_HEADER => 1, CURLOPT_RETURNTRANSFER => true, CURLOPT_AUTOREFERER =>...
php
{ "resource": "" }
q4191
CheckIfDead.processCurlResults
train
protected function processCurlResults( $curlInfo, $full = false ) { // Determine if we are using FTP or HTTP $requestType = $this->getRequestType( $curlInfo['url'] ); // Get HTTP code returned $httpCode = $curlInfo['http_code']; // Get final URL $effectiveUrl = $curlInfo['effective_url']; // Clean final u...
php
{ "resource": "" }
q4192
CheckIfDead.getDomainRoots
train
protected function getDomainRoots( $url ) { $roots = []; $pieces = parse_url( $url ); if ( !isset( $pieces['host'], $pieces['host'] ) ) { return []; } $roots[] = $pieces['host']; $roots[] = $pieces['host'] . '/'; $domain = isset( $pieces['host'] ) ? $pieces['host'] : ''; if ( preg_match( '/(?P<domain...
php
{ "resource": "" }
q4193
CheckIfDead.parseURL
train
public function parseURL( $url ) { // Feeding fully encoded URLs will not work. So let's detect and decode if needed first. // This is just idiot proofing. // See if the URL is fully encoded by checking if the :// is encoded. // This prevents URLs where double encoded values aren't mistakenly decoded breaking ...
php
{ "resource": "" }
q4194
CheckIfDead.cleanURL
train
public function cleanURL( $input ) { // scheme and www $url = preg_replace( '/^((https?:|ftp:)?(\/\/))?(www\.)?/', '', $input ); // fragment $url = preg_replace( '/#.*/', '', $url ); // trailing slash $url = preg_replace( '{/$}', '', $url ); return $url; }
php
{ "resource": "" }
q4195
CNabuSiteAliasHostBase.setSiteAliasId
train
public function setSiteAliasId(int $nb_site_alias_id) : CNabuDataObject { if ($nb_site_alias_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_alias_id") ); } $thi...
php
{ "resource": "" }
q4196
CNabuSiteAliasHostBase.setServerHostId
train
public function setServerHostId(int $nb_server_host_id) : CNabuDataObject { if ($nb_server_host_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_server_host_id") ); } ...
php
{ "resource": "" }
q4197
CNabuSiteAliasHostBase.setLastUpdateErrorCode
train
public function setLastUpdateErrorCode(int $last_update_error_code = 0) : CNabuDataObject { if ($last_update_error_code === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$last_update_error_code") ...
php
{ "resource": "" }
q4198
CNabuHTTPRenderDescriptor.setKey
train
public function setKey($key) { if ($key === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$key") ); } $this->setValue("nb_http_render_descriptor_key", $key); return $...
php
{ "resource": "" }
q4199
CNabuHTTPRenderDescriptor.setClassName
train
public function setClassName($class_name) { if ($class_name === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$class_name") ); } $implements_list = class_implements($class_na...
php
{ "resource": "" }