_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q3400 | CNabuSiteRoleBase.setLoginRedirectionTargetUseURI | train | public function setLoginRedirectionTargetUseURI($login_redirection_target_use_uri) : CNabuDataObject
{
if ($login_redirection_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$login_redir... | php | {
"resource": ""
} |
q3401 | CNabuSiteRoleBase.setPoliciesTargetUseURI | train | public function setPoliciesTargetUseURI($policies_target_use_uri) : CNabuDataObject
{
if ($policies_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$policies_target_use_uri")
... | php | {
"resource": ""
} |
q3402 | CNabuUserGroupLanguageBase.setUserGroupId | train | public function setUserGroupId(int $nb_user_group_id) : CNabuDataObject
{
if ($nb_user_group_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_user_group_id")
);
}
$thi... | php | {
"resource": ""
} |
q3403 | CNabuUserGroupLanguageBase.setTitle | train | public function setTitle(string $title) : CNabuDataObject
{
if ($title === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$title")
);
}
$this->setValue('nb_user_group_lang_titl... | php | {
"resource": ""
} |
q3404 | CNabuCommerceProduct.getProductsForCommerce | train | static public function getProductsForCommerce($nb_commerce)
{
$nb_commerce_id = nb_getMixedValue($nb_commerce, NABU_COMMERCE_FIELD_ID);
if (is_numeric($nb_commerce_id)) {
$retval = CNabuCommerceProduct::buildObjectListFromSQL(
'nb_commerce_product_id',
'SE... | php | {
"resource": ""
} |
q3405 | CNabuCommerceProduct.findBySKU | train | static public function findBySKU($nb_commerce, string $sku)
{
$retval = false;
$nb_commerce_id = nb_getMixedValue($nb_commerce, NABU_COMMERCE_FIELD_ID);
if (is_numeric($nb_commerce_id)) {
$retval = CNabuCommerceProduct::buildObjectFromSQL(
'SELECT *
... | php | {
"resource": ""
} |
q3406 | CNabuUser.setEmail | train | public function setEmail(string $email) : CNabuDataObject
{
$value = parent::setEmail(strtolower($email));
return $value;
} | php | {
"resource": ""
} |
q3407 | CNabuUser.activate | train | public function activate(bool $save = false) : bool
{
$retval = false;
$current = $this->getValidationStatus();
if ($current === self::USER_VALIDATION_PENDING || $current === self::USER_VALIDATION_PENDING_WITH_INVITATION) {
$this->setActivationDatetime(date('Y-m-d H:i:s', time()... | php | {
"resource": ""
} |
q3408 | CNabuUser.findByStaticEncodedId | train | public static function findByStaticEncodedId($nb_customer, string $key)
{
$retval = null;
if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID)) &&
strlen($key) > 0
) {
$retval = CNabuUser::buildObjectFromSQL(
'select... | php | {
"resource": ""
} |
q3409 | CNabuUser.findByStaticEncodedLogin | train | public static function findByStaticEncodedLogin($nb_customer, string $key)
{
$retval = null;
if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID)) &&
strlen($key) > 0
) {
$retval = CNabuUser::buildObjectFromSQL(
'sel... | php | {
"resource": ""
} |
q3410 | CNabuUser.findByTemporalEncodedId | train | public static function findByTemporalEncodedId($nb_customer, string $key, int $expires = NABU_TEMP_ENC_ID_EXPIRATION_TIME)
{
$retval = null;
if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID)) &&
strlen($key) > 0
) {
$hash_left = ... | php | {
"resource": ""
} |
q3411 | CNabuUser.findBySiteLogin | train | static public function findBySiteLogin($nb_site, $login, $passwd, $active = true)
{
$retval = null;
$nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
if (is_numeric($nb_site_id)) {
$retval = CNabuUser::buildObjectFromSQL(
"select u.*, su.nb_role_id "
... | php | {
"resource": ""
} |
q3412 | CNabuUser.findByEMail | train | static public function findByEMail($nb_customer, string $email)
{
$retval = null;
if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID))) {
$retval = CNabuUser::buildObjectFromSQL(
'select u.* '
. 'from nb_user u, nb_cust... | php | {
"resource": ""
} |
q3413 | CNabuUser.getPrescriber | train | public function getPrescriber(bool $force = false)
{
if ($this->nb_prescriber == NULL ||
$this->nb_prescriber->getId() != $this->getPrescriberId() ||
$force
) {
$nb_prescriber_id = $this->getPrescriberId();
if ($nb_prescriber_id === null || $this->getC... | php | {
"resource": ""
} |
q3414 | CallbackHydrator.hydrateCollection | train | public static function hydrateCollection(array $callbacks)
{
$hydrated = [];
foreach ($callbacks as $callback) {
$hydrated[] = self::hydrate($callback);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3415 | CallbackHydrator.hydrate | train | public static function hydrate(stdClass $callback)
{
$hydrated = new CallbackEntity();
if (isset($callback->id)) {
$hydrated->setId($callback->id);
}
if (isset($callback->internal)) {
$hydrated->setInternal($callback->internal);
}
if (isset(... | php | {
"resource": ""
} |
q3416 | TNabuSiteRoleMask.isForPublicZone | train | public function isForPublicZone(bool $strict = false)
{
if (!method_exists($this, 'getZone')) {
throw new ENabuCoreException(ENabuCoreException::ERROR_FEATURE_NOT_IMPLEMENTED);
}
$zone = $this->getZone();
return ($zone === CNabuSite::ZONE_PUBLIC || (!$strict && $zone ==... | php | {
"resource": ""
} |
q3417 | TNabuSiteRoleMask.isForPrivateZone | train | public function isForPrivateZone(bool $strict = false)
{
if (!method_exists($this, 'getZone')) {
throw new ENabuCoreException(ENabuCoreException::ERROR_FEATURE_NOT_IMPLEMENTED);
}
$zone = $this->getZone();
return ($zone === CNabuSite::ZONE_PRIVATE || (!$strict && $zone ... | php | {
"resource": ""
} |
q3418 | TNabuSiteRoleMask.isForBothZones | train | public function isForBothZones()
{
if (!method_exists($this, 'getZone')) {
throw new ENabuCoreException(ENabuCoreException::ERROR_FEATURE_NOT_IMPLEMENTED);
}
return $this->getZone() === CNabuSite::ZONE_BOTH;
} | php | {
"resource": ""
} |
q3419 | TNabuSiteRoleMask.isZoneHidden | train | public function isZoneHidden()
{
if (!method_exists($this, 'getZone')) {
throw new ENabuCoreException(ENabuCoreException::ERROR_FEATURE_NOT_IMPLEMENTED);
}
$zone = $this->getZone();
return $zone !== CNabuSite::ZONE_PUBLIC && $zone !== CNabuSite::ZONE_PRIVATE && $zone !=... | php | {
"resource": ""
} |
q3420 | TNabuHashed.grantHash | train | public function grantHash(bool $save = false) : string
{
if (!nb_isValidGUID($hash = $this->getHash())) {
$this->setHash($hash = nb_generateGUID());
if ($save && $this instanceof CNabuDBObject) {
$this->save();
}
}
return $hash;
} | php | {
"resource": ""
} |
q3421 | UserHydrator.hydrateCollection | train | public static function hydrateCollection(array $users)
{
$hydrated = [];
foreach ($users as $user) {
$hydrated[] = self::hydrate($user);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3422 | UserHydrator.hydrate | train | public static function hydrate(stdClass $user)
{
$hydrated = new UserEntity();
if (isset($user->id)) {
$hydrated->setId($user->id);
}
if (isset($user->email)) {
$hydrated->setEmail($user->email);
}
if (isset($user->firstname)) {
... | php | {
"resource": ""
} |
q3423 | UrlGenerator.replaceRouteParameters | train | protected function replaceRouteParameters($route, &$parameters = [])
{
return \preg_replace_callback('/\{(.*?)(:.*?)?(\{[0-9,]+\})?\}/', function ($m) use (&$parameters) {
return isset($parameters[$m[1]]) ? Arr::pull($parameters, $m[1]) : $m[0];
}, $route);
} | php | {
"resource": ""
} |
q3424 | CNabuSiteMapRole.getMapRolesForSite | train | static public function getMapRolesForSite($nb_site)
{
$nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID);
if (is_numeric($nb_site_id)) {
$retval = CNabuEngine::getEngine()
->getMainDB()
->getQueryAsObjectArray(
'\n... | php | {
"resource": ""
} |
q3425 | CommentHydrator.hydrateCollection | train | public static function hydrateCollection(array $comments)
{
$hydrated = [];
foreach ($comments as $comment) {
$hydrated[] = self::hydrate($comment);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3426 | CommentHydrator.hydrate | train | public static function hydrate(stdClass $comment)
{
$hydrated = new CommentEntity();
if (isset($comment->id)) {
$hydrated->setId($comment->id);
}
if (isset($comment->comment)) {
$hydrated->setComment($comment->comment);
}
if (isset($comment-... | php | {
"resource": ""
} |
q3427 | CNabuCatalogItemTagBase.setCatalogItemId | train | public function setCatalogItemId(int $nb_catalog_item_id) : CNabuDataObject
{
if ($nb_catalog_item_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_catalog_item_id")
);
}
... | php | {
"resource": ""
} |
q3428 | LdapService.get | train | public function get(array $queryParams = [])
{
$response = $this->api->systems()->ldap()->get($queryParams);
return new LdapResponse($response);
} | php | {
"resource": ""
} |
q3429 | LdapService.update | train | public function update(LdapBuilder $input, array $queryParams = [])
{
$response = $this->api->systems()->ldap()->update($input->toArray(), $queryParams);
return new LdapResponse($response);
} | php | {
"resource": ""
} |
q3430 | LdapService.sync | train | public function sync(array $queryParams = [])
{
$response = $this->api->systems()->ldap()->sync($queryParams);
return new BaseResponse($response);
} | php | {
"resource": ""
} |
q3431 | SettingService.getAll | train | public function getAll(array $queryParams = [])
{
$response = $this->api->settings()->getAll($queryParams);
return new SettingsResponse($response);
} | php | {
"resource": ""
} |
q3432 | SettingService.createOrUpdate | train | public function createOrUpdate($key, SettingBuilder $input, array $queryParams = [])
{
$response = $this->api->settings()->createOrUpdate($key, $input->toArray(), $queryParams);
return new SettingResponse($response);
} | php | {
"resource": ""
} |
q3433 | SettingService.deleteAll | train | public function deleteAll(array $queryParams = [])
{
$response = $this->api->settings()->deleteAll($queryParams);
return new BaseResponse($response);
} | php | {
"resource": ""
} |
q3434 | CNabuErrorHandler.errorHandler | train | public function errorHandler(int $errno, string $errstr, string $errfile, string $errline, array $errcontext)
{
$this->dumpStack($errstr, $errno, $errfile, $errline, $errcontext);
return true;
} | php | {
"resource": ""
} |
q3435 | CNabuErrorHandler.dumpStack | train | public function dumpStack(
string $message = null,
string $type = null,
string $errfile = null,
int $errline = null,
$errcontext = null,
array $stack = null
) {
global $NABU_MESSAGE_TYPE_NAME;
if (($errtype = nb_getArrayValueByKey($type, $NABU_MESSAGE... | php | {
"resource": ""
} |
q3436 | CNabuErrorHandler.traceLog | train | public function traceLog(string $key = null, $message = null)
{
if ($this->trace_log_enabled) {
if (is_array($message) || is_object($message)) {
$text = print_r($message, true);
} elseif ($message === null) {
$text = "[null]";
} elseif ($me... | php | {
"resource": ""
} |
q3437 | AutoUuid.bootAutoUuid | train | protected static function bootAutoUuid()
{
static::creating(function ($model) {
foreach($model->getAutoUuids() as $autoUuid) {
if (empty($model->{$autoUuid})) {
$model->setAttribute($autoUuid, $model->generateUuid()->getBytes());
}
... | php | {
"resource": ""
} |
q3438 | ApplicationService.getById | train | public function getById($appId, array $queryParams = [])
{
$response = $this->api->applications()->getById($appId, $queryParams);
return new ApplicationResponse($response);
} | php | {
"resource": ""
} |
q3439 | ApplicationService.update | train | public function update($appId, ApplicationBuilder $input, array $queryParams = [])
{
$response = $this->api->applications()->update($appId, $input->toArray(), $queryParams);
return new ApplicationResponse($response);
} | php | {
"resource": ""
} |
q3440 | ApplicationService.deleteAll | train | public function deleteAll(array $queryParams = [])
{
$response = $this->api->applications()->deleteAll($queryParams);
return new BaseResponse($response);
} | php | {
"resource": ""
} |
q3441 | Historable.writeHistory | train | public function writeHistory($action, $title = null, array $old = [], array $new = [])
{
$data['historable_id'] = $this->getKey();
$data['historable_type'] = get_class($this);
$data['user_id'] = auth()->id();
$data['title'] = $title;
$data['icon_class'] = $this->iconClass($ac... | php | {
"resource": ""
} |
q3442 | EditLayoutCompiler.compile | train | public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null)
{
$this->stub = $stub;
return $this->store(null, $scaffolderConfig, $themeExtension->runAfterEditLayoutIsCompiled($this->stu... | php | {
"resource": ""
} |
q3443 | CNabuCatalogItemList.populate | train | public function populate(int $deep = 0)
{
$nb_catalog = $this->getCatalog();
$this->clear();
$this->merge(CNabuCatalogItem::getItemsForCatalog($nb_catalog, $deep));
$translations = CNabuCatalogItem::getItemTranslationsForCatalog($nb_catalog, $deep);
$translations->iterate(
... | php | {
"resource": ""
} |
q3444 | CNabuDBObject.getDescriptor | train | public function getDescriptor($force = false)
{
if (!($this->storage_descriptor instanceof INabuDBDescriptor) || $force) {
$this->storage_descriptor = null;
$this->storage_descriptor = $this->db->getDescriptorFromFile($this->getStorageDescriptorPath());
}
return $thi... | php | {
"resource": ""
} |
q3445 | CNabuDBObject.refresh | train | public function refresh(bool $force = false, bool $cascade = false) : bool
{
$this->relinkDB();
return $this->load();
} | php | {
"resource": ""
} |
q3446 | CNabuSiteTargetBase.findByKey | train | public static function findByKey($nb_site, $key)
{
$nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
if (is_numeric($nb_site_id)) {
$retval = CNabuSiteTarget::buildObjectFromSQL(
'select * '
. 'from nb_site_target '
. 'wher... | php | {
"resource": ""
} |
q3447 | CNabuSiteTargetBase.getAllSiteTargets | train | public static function getAllSiteTargets(CNabuSite $nb_site)
{
$nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
if (is_numeric($nb_site_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_site_target_id',
... | php | {
"resource": ""
} |
q3448 | CNabuSiteTargetBase.setUseHTTP | train | public function setUseHTTP(string $use_http = "F") : CNabuDataObject
{
if ($use_http === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_http")
);
}
$this->setValue('nb_sit... | php | {
"resource": ""
} |
q3449 | CNabuSiteTargetBase.setUseHTTPS | train | public function setUseHTTPS(string $use_https = "F") : CNabuDataObject
{
if ($use_https === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_https")
);
}
$this->setValue('nb... | php | {
"resource": ""
} |
q3450 | CNabuSiteTargetBase.setAttachment | train | public function setAttachment(string $attachment = "F") : CNabuDataObject
{
if ($attachment === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$attachment")
);
}
$this->setValu... | php | {
"resource": ""
} |
q3451 | CNabuSiteTargetBase.setSmartyDebugging | train | public function setSmartyDebugging(string $smarty_debugging = "F") : CNabuDataObject
{
if ($smarty_debugging === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$smarty_debugging")
);
}... | php | {
"resource": ""
} |
q3452 | CNabuSiteTargetBase.setPHPTrace | train | public function setPHPTrace(string $php_trace = "F") : CNabuDataObject
{
if ($php_trace === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$php_trace")
);
}
$this->setValue('nb... | php | {
"resource": ""
} |
q3453 | CNabuSiteTargetBase.setIgnorePolicies | train | public function setIgnorePolicies(string $ignore_policies = "F") : CNabuDataObject
{
if ($ignore_policies === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$ignore_policies")
);
}
... | php | {
"resource": ""
} |
q3454 | CNabuSiteTargetBase.setUseCommerce | train | public function setUseCommerce(string $use_commerce = "F") : CNabuDataObject
{
if ($use_commerce === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_commerce")
);
}
$this->... | php | {
"resource": ""
} |
q3455 | CNabuSiteTargetBase.setUseApps | train | public function setUseApps(string $use_apps = "F") : CNabuDataObject
{
if ($use_apps === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_apps")
);
}
$this->setValue('nb_sit... | php | {
"resource": ""
} |
q3456 | CNabuSiteTargetBase.setDynamicCacheControl | train | public function setDynamicCacheControl(string $dynamic_cache_control = "S") : CNabuDataObject
{
if ($dynamic_cache_control === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$dynamic_cache_control")
... | php | {
"resource": ""
} |
q3457 | CNabuMessagingTemplate.getActiveServices | train | public function getActiveServices(bool $force = false) : CNabuMessagingServiceList
{
if ($this->nb_messaging_service_list->isEmpty() || $force) {
$this->nb_messaging_service_list->clear();
if (($nb_messaging = $this->getMessaging()) instanceof CNabuMessaging &&
!($nb_... | php | {
"resource": ""
} |
q3458 | CNabuMessagingServiceStackBase.getAllMessagingServiceStacks | train | public static function getAllMessagingServiceStacks(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": ""
} |
q3459 | CNabuMessagingServiceStackBase.setMessagingId | train | public function setMessagingId(int $nb_messaging_id) : CNabuDataObject
{
if ($nb_messaging_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_messaging_id")
);
}
$this->... | php | {
"resource": ""
} |
q3460 | CNabuMessagingServiceStackBase.setMessagingServiceId | train | public function setMessagingServiceId(int $nb_messaging_service_id) : CNabuDataObject
{
if ($nb_messaging_service_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_messaging_service_id")
... | php | {
"resource": ""
} |
q3461 | CNabuMessagingServiceStackBase.setMessagingTemplateId | train | public function setMessagingTemplateId(int $nb_messaging_template_id) : CNabuDataObject
{
if ($nb_messaging_template_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_messaging_template_id")
... | php | {
"resource": ""
} |
q3462 | CNabuProjectVersionBase.getAllProjectVersions | train | public static function getAllProjectVersions(CNabuProject $nb_project)
{
$nb_project_id = nb_getMixedValue($nb_project, 'nb_project_id');
if (is_numeric($nb_project_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_... | php | {
"resource": ""
} |
q3463 | CNabuProjectVersionBase.getFilteredProjectVersionList | train | public static function getFilteredProjectVersionList($nb_project = null, $q = null, $fields = null, $order = null, $offset = 0, $num_items = 0)
{
$nb_project_id = nb_getMixedValue($nb_customer, NABU_PROJECT_FIELD_ID);
if (is_numeric($nb_project_id)) {
$fields_part = nb_prefixFieldList(CN... | php | {
"resource": ""
} |
q3464 | CNabuProjectVersionBase.setProjectId | train | public function setProjectId(int $nb_project_id) : CNabuDataObject
{
if ($nb_project_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_project_id")
);
}
$this->setValue... | php | {
"resource": ""
} |
q3465 | LogHydrator.hydrateCollection | train | public static function hydrateCollection(array $logs)
{
$hydrated = [];
foreach ($logs as $log) {
$hydrated[] = self::hydrate($log);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3466 | LogHydrator.hydrate | train | public static function hydrate(stdClass $log)
{
$hydrated = new LogEntity();
if (isset($log->id)) {
$hydrated->setId($log->id);
}
if (isset($log->text)) {
$hydrated->setText($log->text);
}
if (isset($log->level)) {
$hydrated->set... | php | {
"resource": ""
} |
q3467 | PartHydrator.hydrateCollection | train | public static function hydrateCollection(array $parts)
{
$hydrated = [];
foreach ($parts as $part) {
$hydrated[] = self::hydrate($part);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3468 | PartHydrator.hydrate | train | public static function hydrate(stdClass $part)
{
$hydrated = new PartEntity();
if (isset($part->id)) {
$hydrated->setId($part->id);
}
if (isset($part->type)) {
$hydrated->setType($part->type);
}
if (isset($part->content)) {
$hydr... | php | {
"resource": ""
} |
q3469 | EntityManager.insert | train | public function insert($entity)
{
$eloquentModel = $this->getEloquentModel($entity);
$this->updateRelations($eloquentModel, 'insert');
$eloquentModel->save();
$eloquentModel->afterSaving($entity, 'insert');
} | php | {
"resource": ""
} |
q3470 | EntityManager.update | train | public function update($entity)
{
$eloquentModel = $this->getEloquentModel($entity, true);
$this->updateRelations($eloquentModel, 'update');
$eloquentModel->save();
$eloquentModel->afterSaving($entity, 'update');
} | php | {
"resource": ""
} |
q3471 | EntityManager.updateRelations | train | protected function updateRelations($eloquentModel, $action)
{
$mapping = $eloquentModel->getMapping();
$eloquentRelations = $eloquentModel->getRelations();
foreach($mapping['relations'] as $name => $relationMapping) {
if (isset($eloquentRelations[$name])) {
$this... | php | {
"resource": ""
} |
q3472 | EntityManager.updateRelation | train | protected function updateRelation($eloquentModel, $name, $relationMapping, $action)
{
// set foreign key for belongsTo/morphTo relation
if ($relationMapping['type'] == 'belongsTo' || $relationMapping['type'] == 'morphTo') {
$this->updateBelongsToRelation($eloquentModel, $name, $action);
... | php | {
"resource": ""
} |
q3473 | EntityManager.updateBelongsToRelation | train | protected function updateBelongsToRelation($eloquentModel, $name, $action)
{
if ($action == 'insert' || $action == 'update') {
$eloquentModel->{$name}()->associate($eloquentModel->getRelation($name));
}
} | php | {
"resource": ""
} |
q3474 | EntityManager.updateBelongsToManyRelation | train | protected function updateBelongsToManyRelation($eloquentModel, $name, $action)
{
$eloquentCollection = $eloquentModel->getRelation($name);
if (! $eloquentCollection instanceof \Illuminate\Database\Eloquent\Collection) {
throw new Exception("Many-to-many relation '".$name."' is not a val... | php | {
"resource": ""
} |
q3475 | ContextService.getAll | train | public function getAll($appId, $scanId, $issueId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->issues()
->contexts()
->getAll($appId, $scanId, $issueId, $queryParams);
return new ContextsResponse($response... | php | {
"resource": ""
} |
q3476 | ContextService.getById | train | public function getById($appId, $scanId, $issueId, $contextId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->issues()
->contexts()
->getById($appId, $scanId, $issueId, $contextId, $queryParams);
return new ... | php | {
"resource": ""
} |
q3477 | GraphBuilder.getResults | train | protected function getResults($method)
{
if ($this->schema) {
// set root constraints
if (isset($this->constraints[$this->root])) {
$this->constraints[$this->root]($this->eloquentQuery);
}
// set eager load constraints
$this->eloqu... | php | {
"resource": ""
} |
q3478 | GraphBuilder.parseRelationsFromSchema | train | protected function parseRelationsFromSchema(array $schema, $path='')
{
$results = [];
foreach ($schema as $key => $value) {
if (! is_numeric($key)) {
// join relation
if (substr($key, 0, 3) != '...') {
$childPath = ($path)
... | php | {
"resource": ""
} |
q3479 | GraphBuilder.schema | train | public function schema(array $schema)
{
$this->root = key($schema);
$this->schema = current($schema);
return $this;
} | php | {
"resource": ""
} |
q3480 | ResourceHydrator.hydrateCollection | train | public static function hydrateCollection(array $resources)
{
$hydrated = [];
foreach ($resources as $resource) {
$hydrated[] = self::hydrate($resource);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3481 | ResourceHydrator.hydrate | train | public static function hydrate(stdClass $resource)
{
$hydrated = new ResourceEntity();
if (isset($resource->id)) {
$hydrated->setId($resource->id);
}
if (isset($resource->title)) {
$hydrated->setTitle($resource->title);
}
if (isset($resource... | php | {
"resource": ""
} |
q3482 | CNabuSiteAliasBase.getAllSiteAliass | train | public static function getAllSiteAliass(CNabuSite $nb_site)
{
$nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
if (is_numeric($nb_site_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_site_alias_id',
... | php | {
"resource": ""
} |
q3483 | CNabuSiteAliasBase.setDomainZoneHostId | train | public function setDomainZoneHostId(int $nb_domain_zone_host_id) : CNabuDataObject
{
if ($nb_domain_zone_host_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_domain_zone_host_id")
);... | php | {
"resource": ""
} |
q3484 | CNabuSiteAliasBase.setType | train | public function setType(string $type = "F") : CNabuDataObject
{
if ($type === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$type")
);
}
$this->setValue('nb_site_alias_type', ... | php | {
"resource": ""
} |
q3485 | TypeHydrator.hydrateCollection | train | public static function hydrateCollection(array $types)
{
$hydrated = [];
foreach ($types as $type) {
$hydrated[] = self::hydrate($type);
}
return $hydrated;
} | php | {
"resource": ""
} |
q3486 | CNabuSiteVisualEditorItemBase.setVRId | train | public function setVRId(string $vr_id) : CNabuDataObject
{
if ($vr_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$vr_id")
);
}
$this->setValue('nb_site_visual_editor_it... | php | {
"resource": ""
} |
q3487 | Model.toDatamapperObject | train | public function toDatamapperObject()
{
// directly set private properties if entity extends the datamapper entity class (fast!)
if (is_subclass_of($this->class, '\ProAI\Datamapper\Support\Entity')) {
$class = $this->class;
return $class::newFromEloquentObject($this);
... | php | {
"resource": ""
} |
q3488 | Model.setProperty | train | protected function setProperty(&$reflectionClass, $entity, $name, $value)
{
$property = $reflectionClass->getProperty($name);
$property->setAccessible(true);
$property->setValue($entity, $value);
} | php | {
"resource": ""
} |
q3489 | Model.toDataTransferObject | train | public function toDataTransferObject($root, $schema, $transformations, $path='')
{
$dto = new DataTransferObject();
// get morphed schema
if($this->morphClass) {
$morphKey = '...'.Str::studly($this->morphClass);
if (isset($schema[$morphKey])) {
$schem... | php | {
"resource": ""
} |
q3490 | Model.newFromDatamapperObject | train | public static function newFromDatamapperObject(EntityContract $entity, $lastObjectId = null, $lastEloquentModel = null)
{
// directly get private properties if entity extends the datamapper entity class (fast!)
if ($entity instanceof \ProAI\Datamapper\Support\Entity) {
return $entity->to... | php | {
"resource": ""
} |
q3491 | Model.isAutomaticallyUpdatedDate | train | public function isAutomaticallyUpdatedDate($attribute)
{
// soft deletes
if (in_array('Illuminate\Database\Eloquent\SoftDeletes', class_uses(static::class)) && $attribute == $this->getDeletedAtColumn()) {
return true;
}
// timestamps
if ($this->timestamps && ($at... | php | {
"resource": ""
} |
q3492 | Model.getProperty | train | protected function getProperty($reflectionObject, $entity, $name)
{
$property = $reflectionObject->getProperty($name);
$property->setAccessible(true);
return $property->getValue($entity);
} | php | {
"resource": ""
} |
q3493 | Model.getColumnName | train | protected function getColumnName($name)
{
// check attributes for given name
if (isset($this->mapping['attributes'][$name])) {
return $this->mapping['attributes'][$name];
}
// check embeddeds for given name
foreach($this->mapping['embeddeds'] as $embedded) {
... | php | {
"resource": ""
} |
q3494 | CNabuMediotecasManager.getMedioteca | train | public function getMedioteca($nb_medioteca)
{
$nb_medioteca_id = nb_getMixedValue($nb_medioteca, NABU_MEDIOTECA_FIELD_ID);
return is_numeric($nb_medioteca_id) || nb_isValidGUID($nb_medioteca_id)
? $this->nb_medioteca_list->getItem($nb_medioteca_id)
: false
;
... | php | {
"resource": ""
} |
q3495 | CNabuMediotecasManager.getMediotecas | train | public function getMediotecas($force = false)
{
if ($this->nb_medioteca_list->isEmpty() || $force) {
$this->nb_medioteca_list->merge(
CNabuMedioteca::getMediotecasForCustomer(CNabuEngine::getEngine()->getCustomer())
);
}
return $this->nb_medioteca_list... | php | {
"resource": ""
} |
q3496 | TNabuTranslated.getLanguage | train | public function getLanguage($nb_language)
{
$retval = false;
$nb_language_id = nb_getMixedValue($nb_language, NABU_LANG_FIELD_ID);
if (is_numeric($nb_language_id) || nb_isValidGUID($nb_language_id)) {
$this->getLanguages();
if ($this->languages_list->containsKey($nb_... | php | {
"resource": ""
} |
q3497 | TNabuTranslated.setLanguage | train | public function setLanguage(CNabuLanguage $nb_language)
{
if ($nb_language->isValueNumeric(NABU_LANG_FIELD_ID) || $nb_language->isValueGUID(NABU_LANG_FIELD_ID)) {
$nb_language_id = $nb_language->getValue(NABU_LANG_FIELD_ID);
$this->languages_list->addItem($nb_language);
}
... | php | {
"resource": ""
} |
q3498 | TNabuTranslated.getTranslation | train | public function getTranslation($nb_language)
{
$retval = false;
$nb_language_id = nb_getMixedValue($nb_language, NABU_LANG_FIELD_ID);
if (is_numeric($nb_language_id) || nb_isValidGUID($nb_language_id)) {
$this->getTranslations();
if ($this->translations_list->contain... | php | {
"resource": ""
} |
q3499 | TNabuTranslated.hasTranslations | train | public function hasTranslations(bool $force = false)
{
$this->getTranslations($force);
return $this->translations_list->isFilled();
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.