_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q3700
CNabuSiteTargetList.acquireItem
train
public function acquireItem($key, $index = false) { if ($index === self::INDEX_KEY) { $nb_site = CNabuEngine::getEngine()->getApplication()->getRequest()->getSite(); $retval = CNabuSiteTarget::findByKey($nb_site, $key); } else { $retval = parent::acquireItem($key,...
php
{ "resource": "" }
q3701
CNabuSiteTargetCTARoleBase.setSiteTargetCTAId
train
public function setSiteTargetCTAId(int $nb_site_target_cta_id) : CNabuDataObject { if ($nb_site_target_cta_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_target_cta_id") ); ...
php
{ "resource": "" }
q3702
CNabuSiteTargetSectionBase.findByKey
train
public static function findByKey($nb_medioteca, $key) { $nb_medioteca_id = nb_getMixedValue($nb_medioteca, 'nb_medioteca_id'); if (is_numeric($nb_medioteca_id)) { $retval = CNabuSiteTargetSection::buildObjectFromSQL( 'select * ' . 'from nb_site_tar...
php
{ "resource": "" }
q3703
CNabuSiteTargetSectionBase.getAllSiteTargetSections
train
public static function getAllSiteTargetSections(CNabuMedioteca $nb_medioteca) { $nb_medioteca_id = nb_getMixedValue($nb_medioteca, 'nb_medioteca_id'); if (is_numeric($nb_medioteca_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), ...
php
{ "resource": "" }
q3704
CNabuSiteTargetSectionBase.getFilteredSiteTargetSectionList
train
public static function getFilteredSiteTargetSectionList($nb_medioteca = null, $q = null, $fields = null, $order = null, $offset = 0, $num_items = 0) { $nb_medioteca_id = nb_getMixedValue($nb_customer, NABU_MEDIOTECA_FIELD_ID); if (is_numeric($nb_medioteca_id)) { $fields_part = nb_prefixF...
php
{ "resource": "" }
q3705
CNabuSiteTargetSectionBase.setOrder
train
public function setOrder(int $order) : CNabuDataObject { if ($order === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$order") ); } $this->setValue('nb_site_target_section_ord...
php
{ "resource": "" }
q3706
AuthController.deauthenticate
train
public function deauthenticate(ResponseFactory $response, Guard $guard, JWTAuth $auth) { $guard->logout(); $auth->invalidate(); return $response->json([]); }
php
{ "resource": "" }
q3707
AuthController.refresh
train
public function refresh(ResponseFactory $response, JWTAuth $auth) { try { $token = $auth->parseToken()->refresh(); } catch (JWTException $e) { throw new UnauthorizedHttpException('jwt-auth', $e->getMessage()); } return $response->json(['token' => $token]); ...
php
{ "resource": "" }
q3708
CNabuCommerceProductBase.getAllCommerceProducts
train
public static function getAllCommerceProducts(CNabuCommerce $nb_commerce) { $nb_commerce_id = nb_getMixedValue($nb_commerce, 'nb_commerce_id'); if (is_numeric($nb_commerce_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), ...
php
{ "resource": "" }
q3709
CNabuCommerceProductBase.getFilteredCommerceProductList
train
public static function getFilteredCommerceProductList($q = null, $fields = null, $order = null, $offset = 0, $num_items = 0) { $nb_commerce_id = nb_getMixedValue($nb_customer, NABU_COMMERCE_FIELD_ID); if (is_numeric($nb_commerce_id)) { $fields_part = nb_prefixFieldList(CNabuCommerceProdu...
php
{ "resource": "" }
q3710
CNabuCommerceProductBase.setTaxPercentage
train
public function setTaxPercentage($tax_percentage) : CNabuDataObject { if ($tax_percentage === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$tax_percentage") ); } $this->setVa...
php
{ "resource": "" }
q3711
CNabuCommerceProductBase.setTaxAmount
train
public function setTaxAmount($tax_amount) : CNabuDataObject { if ($tax_amount === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$tax_amount") ); } $this->setValue('nb_commerce...
php
{ "resource": "" }
q3712
CNabuCommerceProductBase.setPriceWithTax
train
public function setPriceWithTax($price_with_tax) : CNabuDataObject { if ($price_with_tax === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$price_with_tax") ); } $this->setVal...
php
{ "resource": "" }
q3713
CNabuCommerceProductBase.setIsUpselling
train
public function setIsUpselling(string $is_upselling = "F") : CNabuDataObject { if ($is_upselling === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$is_upselling") ); } $this->...
php
{ "resource": "" }
q3714
CNabuCommerceProductBase.setSoldIndividually
train
public function setSoldIndividually(string $sold_individually = "T") : CNabuDataObject { if ($sold_individually === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$sold_individually") ); ...
php
{ "resource": "" }
q3715
CNabuCommerceProductBase.setIsVirtual
train
public function setIsVirtual(string $is_virtual = "F") : CNabuDataObject { if ($is_virtual === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$is_virtual") ); } $this->setValue...
php
{ "resource": "" }
q3716
TNabuCommerceChild.getCommerce
train
public function getCommerce($force = false) { if ($this->nb_commerce === null || $force) { $this->nb_commerce = null; if (!$this->isBuiltIn() && $this->isValueNumeric(NABU_COMMERCE_FIELD_ID)) { $nb_commerce = new CNabuCommerce($this->getValue(NABU_COMMERCE_FIELD_ID));...
php
{ "resource": "" }
q3717
TNabuCommerceChild.setCommerce
train
public function setCommerce(CNabuCommerce $nb_commerce) { $this->nb_commerce = $nb_commerce; $this->transferValue($nb_commerce, NABU_COMMERCE_FIELD_ID); return $this; }
php
{ "resource": "" }
q3718
CNabuIContactProspect.getProspectsForIContact
train
public static function getProspectsForIContact( $nb_icontact, CNabuIContactProspectStatusType $nb_status_type = null ) : CNabuIContactProspectList { if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id'))) { $status_id = nb_getMixedValue($nb_status_type...
php
{ "resource": "" }
q3719
CNabuIContactProspect.getCountProspectsOfUser
train
public static function getCountProspectsOfUser( $nb_icontact, $nb_user, CNabuIContactProspectStatusType $nb_status_type = null ) : int { if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id')) && is_numeric($nb_user_id = nb_getMixedValue($nb_use...
php
{ "resource": "" }
q3720
CNabuIContactProspect.encodeEmail
train
public static function encodeEmail(string $email) : string { return md5(self::EMAIL_PREF . preg_replace('/\\s/', '', mb_strtolower($email)) . self::EMAIL_SUFF); }
php
{ "resource": "" }
q3721
CNabuIContactProspect.setEmail
train
public function setEmail(string $email = null) : CNabuDataObject { parent::setEmail($email); return parent::setEmailHash(is_string($email) ? self::encodeEmail($email) : null); }
php
{ "resource": "" }
q3722
CNabuIContactProspect.findIContactProspectsByEmailHash
train
public static function findIContactProspectsByEmailHash( CNabuIContact $nb_icontact, string $hash ) : CNabuIContactProspectList { if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id')) && strlen($hash) === 32 ) { $list = CNabuIConta...
php
{ "resource": "" }
q3723
CNabuIContactProspect.getAttachments
train
public function getAttachments(bool $force = false) : CNabuIContactProspectAttachmentList { if ($this->nb_attachment_list->isEmpty() || $force) { $this->nb_attachment_list->clear(); $this->nb_attachment_list->merge(CNabuIContactProspectAttachment::getAttachmentsForProspect($this)); ...
php
{ "resource": "" }
q3724
CNabuIContactProspect.addAttachment
train
public function addAttachment( string $name, string $mimetype, string $file, CNabuIContactProspectDiary $nb_diary = null, bool $save = true ) { if ($this->isFetched()) { $nb_icontact = $this->getIContact(); $base_path = $nb_icontact->getBasePat...
php
{ "resource": "" }
q3725
CNabuIContactProspect.deleteAttachment
train
public function deleteAttachment($nb_attachment) : bool { $retval = false; $nb_attachment_id = nb_getMixedValue($nb_attachment, NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID); if (is_numeric($nb_attachment_id)) { $nb_attachment = $this->nb_attachment_list->getItem($nb_attachment_id...
php
{ "resource": "" }
q3726
CNabuIContactProspect.save
train
public function save($trace = false) { $retval = parent::save($trace); $this->nb_attachment_list->iterate( function ($key, CNabuIContactProspectAttachment $nb_attachment) use ($retval) { $retval |= $nb_attachment->save(); return true; } ...
php
{ "resource": "" }
q3727
MetadataServiceProvider.registerAnnotations
train
public function registerAnnotations() { $app = $this->app; $loader = new AnnotationLoader($app['files'], __DIR__ . '/../Annotations'); $loader->registerAll(); }
php
{ "resource": "" }
q3728
CNabuLanguageBase.setIsApi
train
public function setIsApi(string $is_api = "F") : CNabuDataObject { if ($is_api === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$is_api") ); } $this->setValue('nb_language_is...
php
{ "resource": "" }
q3729
CNabuLanguageBase.setName
train
public function setName(string $name) : CNabuDataObject { if ($name === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$name") ); } $this->setValue('nb_language_name', $name); ...
php
{ "resource": "" }
q3730
SummaryHydrator.hydrateCollection
train
public static function hydrateCollection(array $summaries) { $hydrated = []; foreach ($summaries as $summary) { $hydrated[] = self::hydrate($summary); } return $hydrated; }
php
{ "resource": "" }
q3731
SummaryHydrator.hydrate
train
public static function hydrate(stdClass $summary) { $hydrated = new SummaryEntity(); if (isset($summary->id)) { $hydrated->setId($summary->id); } if (isset($summary->line)) { $hydrated->setLine($summary->line); } if (isset($summary->content)...
php
{ "resource": "" }
q3732
CNabuXMLSite.setRedirections
train
private function setRedirections(SimpleXMLElement $element) { $pages = $element->addChild('redirections'); $this->setRedirection($pages, 'default', 'default'); $this->setRedirection($pages, 'page_not_found', 'pageNotFound'); $this->setRedirection($pages, 'login', 'login'); $t...
php
{ "resource": "" }
q3733
CNabuXMLSite.setRedirection
train
private function setRedirection(SimpleXMLElement $element, string $field, string $tag_name) { $page = $element->addChild($tag_name); switch ($this->nb_data_object->getValue("nb_site_${field}_target_use_uri")) { case 'T': $id = $this->nb_data_object->getValue("nb_site_${fi...
php
{ "resource": "" }
q3734
CNabuXMLSite.setTargets
train
private function setTargets(SimpleXMLElement $parent) { $xml_targets = new CNabuXMLSiteTargetList($this->nb_data_object->getTargets(true)); $xml_targets->build($parent); }
php
{ "resource": "" }
q3735
CNabuXMLSite.setMaps
train
private function setMaps(SimpleXMLElement $parent) { $xml_targets = new CNabuXMLSiteMapList($this->nb_data_object->getSiteMaps(true)); $xml_targets->build($parent); }
php
{ "resource": "" }
q3736
CNabuXMLSite.setStaticContents
train
private function setStaticContents(SimpleXMLElement $parent) { $xml_statics = new CNabuXMLSiteStaticContentList($this->nb_data_object->getStaticContents(true)); $xml_statics->build($parent); }
php
{ "resource": "" }
q3737
CNabuXMLSite.grantTargetHash
train
private function grantTargetHash(int $nb_site_target_id) : string { $nb_site_target = $this->nb_data_object->getTarget($nb_site_target_id); return $nb_site_target->isFetched() ? $nb_site_target->grantHash(true) : null; }
php
{ "resource": "" }
q3738
FileHydrator.hydrateCollection
train
public static function hydrateCollection(array $files) { $hydrated = []; foreach ($files as $file) { $hydrated[] = self::hydrate($file); } return $hydrated; }
php
{ "resource": "" }
q3739
FileHydrator.hydrate
train
public static function hydrate(stdClass $file) { $hydrated = new FileEntity(); if (isset($file->id)) { $hydrated->setId($file->id); } if (isset($file->loc)) { $hydrated->setLoc($file->loc); } if (isset($file->path)) { $hydrated->...
php
{ "resource": "" }
q3740
CNabuSite.addTarget
train
public function addTarget(CNabuSiteTarget $nb_site_target, $default = false) { $nb_site_target->setSite($this); if ($default) { $this->setDefaultTarget($nb_site_target); } return $this->nb_site_target_list->addItem($nb_site_target); }
php
{ "resource": "" }
q3741
CNabuSite.getTarget
train
public function getTarget($nb_site_target) { $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id'); return (is_numeric($nb_site_target_id) || nb_isValidGUID($nb_site_target_id)) ? $this->nb_site_target_list->getItem($nb_site_target_id)->setSite($this) ...
php
{ "resource": "" }
q3742
CNabuSite.getTargets
train
public function getTargets($force = false) : CNabuSiteTargetList { if (!$this->isBuiltIn() && ($this->nb_site_target_list->isEmpty() || $force) ) { $this->nb_site_target_list->clear(); $this->nb_site_target_list->merge(CNabuSiteTarget::getAllSiteTargets($this)); ...
php
{ "resource": "" }
q3743
CNabuSite.addStaticContent
train
public function addStaticContent(CNabuSiteStaticContent $nb_site_static_content) { $nb_site_static_content->setSite($this); return $this->nb_site_static_content_list->addItem($nb_site_static_content); }
php
{ "resource": "" }
q3744
CNabuSite.getStaticContent
train
public function getStaticContent($nb_site_static_content) { $nb_site_static_content_id = nb_getMixedValue($nb_site_static_content, 'nb_site_static_content_id'); return (is_numeric($nb_site_static_content_id) || nb_isValidGUID($nb_site_static_content_id)) ? $this->nb_site_static_conte...
php
{ "resource": "" }
q3745
CNabuSite.getStaticContents
train
public function getStaticContents($force = false) : CNabuSiteStaticContentList { if (!$this->isBuiltIn() && ($this->nb_site_static_content_list->isEmpty() || $force) ) { $this->nb_site_static_content_list = CNabuSiteStaticContent::getStaticContentsForSite($this); ...
php
{ "resource": "" }
q3746
CNabuSite.isDefaultTargetUsingTarget
train
public function isDefaultTargetUsingTarget() { return $this->getDefaultTargetUseURI() === CNabuSiteTargetLink::USE_URI_TRANSLATED && $this->nb_site_target_list->containsKey($this->getDefaultTargetId()); }
php
{ "resource": "" }
q3747
CNabuSite.setDefaultTarget
train
public function setDefaultTarget(CNabuDataObject $nb_site_target) { $this->setDefaultTargetUseURI(CNabuSiteTargetLink::USE_URI_TRANSLATED); $this->transferValue($nb_site_target, 'nb_site_target_id', 'nb_site_default_target_id'); return $this; }
php
{ "resource": "" }
q3748
CNabuSite.setLoginTarget
train
public function setLoginTarget(CNabuDataObject $nb_site_target) { $this->setLoginTargetUseURI(CNabuSiteTargetLink::USE_URI_TRANSLATED); $this->transferValue($nb_site_target, 'nb_site_target_id', 'nb_site_login_target_id'); return $this; }
php
{ "resource": "" }
q3749
CNabuSite.getSiteMap
train
public function getSiteMap($nb_site_map, $cascade = false) { $retval = null; $nb_site_map_id = nb_getMixedValue($nb_site_map, 'nb_site_map_id'); if (is_numeric($nb_site_map_id) || nb_isValidGUID($nb_site_map_id)) { $retval = $this->nb_site_map_tree->getItem($nb_site_map_id); ...
php
{ "resource": "" }
q3750
CNabuSite.addSiteMap
train
public function addSiteMap(CNabuSiteMap $nb_site_map) { $nb_site_map->transferValue($this, 'nb_site_id'); return $this->nb_site_map_tree->addItem($nb_site_map); }
php
{ "resource": "" }
q3751
CNabuSite.getNaturalLanguages
train
public function getNaturalLanguages(bool $force = false) : CNabuLanguageList { $nb_natural = new CNabuLanguageList(); $this->getLanguages($force)->iterate(function ($key, CNabuLanguage $nb_language) use ($nb_natural) { if ($nb_language->isNaturalLanguage()) { $nb_natural-...
php
{ "resource": "" }
q3752
CNabuSite.getAPILanguages
train
public function getAPILanguages(bool $force = false) : CNabuLanguageList { $nb_api = new CNabuLanguageList(); $this->getLanguages($force)->iterate(function ($key, CNabuLanguage $nb_language) use ($nb_api) { if ($nb_language->isAPILanguage()) { $nb_api->addItem($nb_languag...
php
{ "resource": "" }
q3753
CNabuSite.getRoles
train
public function getRoles(bool $force = false) : CNabuRoleList { if ($this->nb_role_list->isEmpty() || $force) { $this->nb_role_list->fillFromSite($this); } return $this->nb_role_list; }
php
{ "resource": "" }
q3754
CNabuSite.getSiteRoles
train
public function getSiteRoles(bool $force = false) : CNabuSiteRoleList { if ($this->nb_site_role_list->isEmpty() || $force) { $this->nb_site_role_list->clear(); $this->nb_site_role_list->merge(CNabuSiteRole::getSiteRolesForSite($this)); } return $this->nb_site_role_li...
php
{ "resource": "" }
q3755
CNabuSite.getSiteRole
train
public function getSiteRole($nb_site_role) { if (is_numeric($nb_role_id = nb_getMixedValue($nb_site_role, NABU_ROLE_FIELD_ID))) { $retval = $this->getSiteRoles()->getItem($nb_role_id); } else { $retval = false; } return $retval; }
php
{ "resource": "" }
q3756
CNabuSite.sendNewUserNotification
train
public function sendNewUserNotification(CNabuUser $nb_user, array $params = null) : bool { $retval = false; $nb_engine = CNabuEngine::getEngine(); if (($nb_profile = $this->getUserProfile($nb_user)) instanceof CNabuSiteUser && ($nb_language_id = $nb_profile->getLanguageId()) ...
php
{ "resource": "" }
q3757
Statement.withAuthority
train
public function withAuthority(Actor $authority = null): self { $statement = clone $this; $statement->authority = $authority; return $statement; }
php
{ "resource": "" }
q3758
Statement.getVoidStatement
train
public function getVoidStatement(Actor $actor): self { return new Statement( null, $actor, Verb::createVoidVerb(), $this->getStatementReference() ); }
php
{ "resource": "" }
q3759
Statement.equals
train
public function equals(Statement $statement): bool { if (null !== $this->id xor null !== $statement->id) { return false; } if (null !== $this->id && null !== $statement->id && !$this->id->equals($statement->id)) { return false; } if (!$this->actor->e...
php
{ "resource": "" }
q3760
QueueHydrator.hydrateCollection
train
public static function hydrateCollection(array $queues) { $hydrated = []; foreach ($queues as $queue) { $hydrated[] = self::hydrate($queue); } return $hydrated; }
php
{ "resource": "" }
q3761
QueueHydrator.hydrate
train
public static function hydrate(stdClass $queue) { $hydrated = new QueueEntity(); if (isset($queue->id)) { $hydrated->setId($queue->id); } if (isset($queue->started_at)) { $hydrated->setStartedAt(new DateTime($queue->started_at)); } if (isset...
php
{ "resource": "" }
q3762
TNabuIContactChild.getIContact
train
public function getIContact($force = false) { if ($this->nb_icontact === null || $force) { $this->nb_icontact = null; if ($this instanceof CNabuDataObject && !$this->isBuiltIn() && $this->isValueNumeric(NABU_ICONTACT_FIELD_ID) ) { ...
php
{ "resource": "" }
q3763
TNabuIContactChild.setIContact
train
public function setIContact(CNabuIContact $nb_icontact) { $this->nb_icontact = $nb_icontact; if ($this instanceof CNabuDataObject && $nb_icontact->contains(NABU_ICONTACT_FIELD_ID)) { $this->transferValue($nb_icontact, NABU_ICONTACT_FIELD_ID); } return $this; }
php
{ "resource": "" }
q3764
CNabuUserGroup.getMembers
train
public function getMembers($force = false) { if ($this->nb_user_group_member_list->isEmpty() || $force) { $this->nb_user_group_member_list->clear(); if ($this->isValueNumeric('nb_user_group_id')) { $this->nb_user_group_member_list->merge(CNabuUserGroupMember::getMembe...
php
{ "resource": "" }
q3765
CNabuUserGroup.getAdminMembers
train
public function getAdminMembers($force = false) : CNabuUserGroupMemberList { $this->getMembers($force); $nb_admin_list = new CNabuUserGroupMemberList(); $this->nb_user_group_member_list->iterate( function($key, CNabuUserGroupMember $nb_user_group_member) use ($nb_admin_list) ...
php
{ "resource": "" }
q3766
ApplicationHydrator.hydrateCollection
train
public static function hydrateCollection(array $applications) { $hydrated = []; foreach ($applications as $application) { $hydrated[] = self::hydrate($application); } return $hydrated; }
php
{ "resource": "" }
q3767
ApplicationHydrator.hydrate
train
public static function hydrate(stdClass $application) { $hydrated = new ApplicationEntity(); if (isset($application->id)) { $hydrated->setId($application->id); } if (isset($application->name)) { $hydrated->setName($application->name); } if (...
php
{ "resource": "" }
q3768
CNabuHTTPSecurityManager.validateZone
train
public function validateZone(CNabuSiteTarget $nb_site_target) { $nb_engine = CNabuEngine::getEngine(); if (!(($nb_site = $nb_site_target->getSite()) instanceof CNabuSite)) { throw new ENabuCoreException(ENabuCoreException::ERROR_SITE_NOT_FOUND); } $this->zone = ($this->...
php
{ "resource": "" }
q3769
CNabuHTTPSecurityManager.isSignInLocked
train
public function isSignInLocked() { $nb_session = $this->nb_application->getSession(); if ($nb_session === null || !($nb_session instanceof CNabuHTTPSession)) { throw new ENabuCoreException(ENabuCoreException::ERROR_SESSION_NOT_FOUND); } $nb_site = $this->nb_application->...
php
{ "resource": "" }
q3770
CNabuHTTPSecurityManager.resetSignInLock
train
public function resetSignInLock() { $nb_session = $this->nb_application->getSession(); if ($nb_session === null || !($nb_session instanceof CNabuHTTPSession)) { throw new ENabuCoreException(ENabuCoreException::ERROR_SESSION_NOT_FOUND); } $nb_session->unsetVariable('signi...
php
{ "resource": "" }
q3771
CNabuHTTPSecurityManager.lockSignIn
train
public function lockSignIn() { $retval = false; $nb_session = $this->nb_application->getSession(); if ($nb_session === null || !($nb_session instanceof CNabuHTTPSession)) { throw new ENabuCoreException(ENabuCoreException::ERROR_SESSION_NOT_FOUND); } $nb_response...
php
{ "resource": "" }
q3772
CNabuHTTPSecurityManager.isUserLogged
train
public function isUserLogged() { return ($this->nb_user !== null && $this->nb_role !== null && $this->nb_site_user !== null); }
php
{ "resource": "" }
q3773
CNabuHTTPSecurityManager.revalidatePassword
train
public function revalidatePassword(CNabuSite $nb_site, CNabuUser $nb_user, string $passwd) : bool { if (!($nb_site instanceof CNabuSite)) { throw new ENabuCoreException(ENabuCoreException::ERROR_METHOD_PARAMETER_NOT_VALID, array('$nb_site')); } if (!($nb_user instanceof CNabuUse...
php
{ "resource": "" }
q3774
CNabuHTTPSecurityManager.applyRoleMask
train
public function applyRoleMask(INabuRoleMask $object, array $params = null) : bool { return $object->applyRoleMask( $this->nb_role, array( self::ROLE_MASK_USER_SIGNED => $this->isUserLogged(), self::ROLE_MASK_WORK_CUSTOMER => $this->hasWorkCustomer() ...
php
{ "resource": "" }
q3775
CNabuHTTPSecurityManager.acceptPolicies
train
public function acceptPolicies(bool $save = true) { $nb_site = $this->nb_application->getHTTPServer()->getSite(); if ($nb_site === null || !($nb_site instanceof CNabuSite)) { throw new ENabuCoreException(ENabuCoreException::ERROR_SITE_NOT_FOUND); } if ($this->isUserLogge...
php
{ "resource": "" }
q3776
CustomClassService.getAll
train
public function getAll($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->classes() ->getAll($appId, $scanId, $queryParams); return new CustomClassesResponse($response); }
php
{ "resource": "" }
q3777
CustomClassService.getById
train
public function getById($appId, $scanId, $classId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->classes() ->getById($appId, $scanId, $classId, $queryParams); return new CustomClassResponse($response); }
php
{ "resource": "" }
q3778
CustomClassService.create
train
public function create($appId, $scanId, $input, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->classes() ->create($appId, $scanId, $input->toArray(), $queryParams); return new CustomClassResponse($response); }
php
{ "resource": "" }
q3779
FileService.getAll
train
public function getAll($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->files() ->getAll($appId, $scanId, $queryParams); return new FilesResponse($response); }
php
{ "resource": "" }
q3780
FileService.getById
train
public function getById($appId, $scanId, $fileId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->files() ->getById($appId, $scanId, $fileId, $queryParams); return new FileResponse($response); }
php
{ "resource": "" }
q3781
FileService.delete
train
public function delete($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->files() ->delete($appId, $scanId, $queryParams); return new BaseResponse($response); }
php
{ "resource": "" }
q3782
CNabuIContactBase.getAlliContacts
train
public static function getAlliContacts(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": "" }
q3783
SocialLoginService.getProvidersConfig
train
private function getProvidersConfig() { $config = []; foreach (self::PROVIDERS as $provider) { $config[ucfirst($provider)] = [ 'enabled' => (bool)$this->scopeConfig->getValue( sprintf(self::CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_ENABLED, $provider), ...
php
{ "resource": "" }
q3784
SocialLoginService.getCustomerData
train
private function getCustomerData(UserProfile $profile) { $customerData = []; foreach (['firstName', 'lastName', 'email'] as $field) { $data = $profile->{$field}; $customerData[strtolower($field)] = $data !== null ? $data : '-'; } return $customerData; }
php
{ "resource": "" }
q3785
SocialLoginService.handleProviderQuirks
train
private function handleProviderQuirks($provider, $customer) { switch ($provider) { case 'Twitter': if ($customer->getData('lastname') === '-') { $nameParts = explode(' ', $customer->getData('firstname')); if (count($nameParts) > 1) { ...
php
{ "resource": "" }
q3786
SocialLoginService.getCustomerForProfile
train
private function getCustomerForProfile($provider, UserProfile $profile) { /** @var Customer $customer */ $customer = $this->customerFactory->create(); $customer->setWebsiteId($this->getCurrentWebsiteId()); $customer->loadByEmail($profile->emailVerified); if (!$customer->getId...
php
{ "resource": "" }
q3787
CheckoutConfigProvider.isProviderEnabled
train
private function isProviderEnabled($provider) { return (bool)$this->scopeConfig->getValue( sprintf(SocialLoginService::CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_ENABLED, $provider), ScopeInterface::SCOPE_STORE ); }
php
{ "resource": "" }
q3788
CNabuClusterUserGroupBase.setClusterGroupId
train
public function setClusterGroupId(int $nb_cluster_group_id) : CNabuDataObject { if ($nb_cluster_group_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_cluster_group_id") ); } ...
php
{ "resource": "" }
q3789
CNabuClusterUserGroupBase.setOSId
train
public function setOSId(int $os_id) : CNabuDataObject { if ($os_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$os_id") ); } $this->setValue('nb_cluster_user_group_os_id...
php
{ "resource": "" }
q3790
EntrypointHydrator.hydrateCollection
train
public static function hydrateCollection(array $entrypoints) { $hydrated = []; foreach ($entrypoints as $entrypoint) { $hydrated[] = self::hydrate($entrypoint); } return $hydrated; }
php
{ "resource": "" }
q3791
EntrypointHydrator.hydrate
train
public static function hydrate(stdClass $entrypoint) { $hydrated = new EntrypointEntity(); if (isset($entrypoint->id)) { $hydrated->setId($entrypoint->id); } if (isset($entrypoint->line)) { $hydrated->setLine($entrypoint->line); } if (isset(...
php
{ "resource": "" }
q3792
CustomClassHydrator.hydrateCollection
train
public static function hydrateCollection(array $customClasses) { $hydrated = []; foreach ($customClasses as $customClass) { $hydrated[] = self::hydrate($customClass); } return $hydrated; }
php
{ "resource": "" }
q3793
CustomClassHydrator.hydrate
train
public static function hydrate(stdClass $customClass) { $hydrated = new CustomClassEntity(); if (isset($customClass->id)) { $hydrated->setId($customClass->id); } if (isset($customClass->start_line)) { $hydrated->setStartLine($customClass->start_line); ...
php
{ "resource": "" }
q3794
Chunker.setEncoding
train
public function setEncoding($encoding) { if ( ! is_string($encoding) || ! in_array($encoding, mb_list_encodings())) { throw new \InvalidArgumentException( __METHOD__."() expects parameter one, encoding, to be a valid " . "character encoding name" ); } $this->encoding = $encoding; return $t...
php
{ "resource": "" }
q3795
Chunker.setIndex
train
public function setIndex($index) { if ( ! is_numeric($index) || ! is_int(+$index) || $index < 0) { throw new \InvalidArgumentException( __METHOD__."() expects parameter one, index, to be a positive " ."integer or zero" ); } $this->index = $index; return $this; }
php
{ "resource": "" }
q3796
Chunker.setSize
train
public function setSize($size) { if ( ! is_numeric($size) || ! is_int(+$size) || $size < 1) { throw new \InvalidArgumentException( __METHOD__."() expects parameter one, size, to be a positive integer" ); } $this->size = $size; return $this; }
php
{ "resource": "" }
q3797
Chunker.getPreviousChunk
train
public function getPreviousChunk() { $offset = --$this->index * $this->size; if ($offset >= 0) { $chunk = $this->getChunk($offset); } else { $chunk = false; } return $chunk; }
php
{ "resource": "" }
q3798
PageLayoutCompiler.compile
train
public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null) { $this->stub = $stub; return $this->setPageTitle($scaffolderConfig) ->setAppName($scaffolderConfig) ...
php
{ "resource": "" }
q3799
PageLayoutCompiler.setPageTitle
train
private function setPageTitle(stdClass $scaffolderConfig) { $this->stub = str_replace('{{page_title}}', $scaffolderConfig->userInterface->pageTitle, $this->stub); return $this; }
php
{ "resource": "" }