_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q3800 | PageLayoutCompiler.setAppName | train | private function setAppName(stdClass $scaffolderConfig)
{
$this->stub = str_replace('{{app_name}}', | php | {
"resource": ""
} |
q3801 | PageLayoutCompiler.setLinks | train | private function setLinks($links, stdClass $scaffolderConfig)
{
$navLinks = '';
foreach ($links as $link)
{
$navLinks .= sprintf("
<li>
<a href='/%s' class='waves-effect'>
%s
| php | {
"resource": ""
} |
q3802 | SanitizerService.getAll | train | public function getAll($appId, $profileId, array $queryParams)
{
$response = $this->api->applications()->profiles()->sanitizers()->getAll($appId, | php | {
"resource": ""
} |
q3803 | SanitizerService.getById | train | public function getById($appId, $profileId, $sanitizerId, array $queryParams = [])
{
$response = $this->api->applications()->profiles()->sanitizers()->getById($appId, | php | {
"resource": ""
} |
q3804 | SanitizerService.create | train | public function create($appId, $profileId, SanitizerBuilder $input, array $queryParams = [])
{
$response | php | {
"resource": ""
} |
q3805 | IgnoredLocationHydrator.hydrateCollection | train | public static function hydrateCollection(array $ignores)
{
$hydrated = [];
foreach ($ignores as $ignore) {
| php | {
"resource": ""
} |
q3806 | IgnoredLocationHydrator.hydrate | train | public static function hydrate(stdClass $ignore)
{
$hydrated = new IgnoredLocationEntity();
if (isset($ignore->id)) {
$hydrated->setId($ignore->id);
}
if (isset($ignore->path)) {
$hydrated->setPath($ignore->path);
}
if (isset($ignore->match)) {
| php | {
"resource": ""
} |
q3807 | CustomFunctionHydrator.hydrateCollection | train | public static function hydrateCollection(array $customFunctions)
{
$hydrated = [];
foreach ($customFunctions as $customFunction) {
| php | {
"resource": ""
} |
q3808 | CustomFunctionHydrator.hydrate | train | public static function hydrate(stdClass $customFunction)
{
$hydrated = new CustomFunctionEntity();
if (isset($customFunction->id)) {
$hydrated->setId($customFunction->id);
}
if (isset($customFunction->start_line)) {
$hydrated->setStartLine($customFunction->start_line);
}
if (isset($customFunction->end_line)) {
$hydrated->setEndLine($customFunction->end_line);
}
if (isset($customFunction->start_column)) {
$hydrated->setStartColumn($customFunction->start_column);
}
if (isset($customFunction->end_column)) {
$hydrated->setEndColumn($customFunction->end_column);
}
if (isset($customFunction->name)) {
| php | {
"resource": ""
} |
q3809 | IndexViewCompiler.compile | train | public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null)
{
if (File::exists(base_path('scaffolder-config/cache/view_index_' . $hash . self::CACHE_EXT)))
{
return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash));
}
else
{
$this->stub = $stub;
$this->replaceClassName($modelName)
->replaceBreadcrumb($modelName, $modelData->modelLabel)
->addDatatableFields($modelName, $modelData)
->setTableHeaders($modelData)
->replaceRoutePrefix($scaffolderConfig->routing->prefix);
| php | {
"resource": ""
} |
q3810 | IndexViewCompiler.addDatatableFields | train | private function addDatatableFields($modelName, $modelData)
{
$fields = '';
$firstIteration = true;
foreach ($modelData->fields as $field)
{
if ($field->hideInListings === false)
{
if ($firstIteration)
{
$fields .= sprintf("{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name);
$firstIteration = false;
}
else
| php | {
"resource": ""
} |
q3811 | Helpers.getVersionedResourceClassName | train | protected function getVersionedResourceClassName($group, $name)
{
$class = \str_replace('.', '\\', $name);
$version = $this->getVersionNamespace();
| php | {
"resource": ""
} |
q3812 | Helpers.getVersionNamespace | train | protected function getVersionNamespace()
{
$version = $this->api()->getVersion();
$supported = $this->getSupportedVersionNamespace();
| php | {
"resource": ""
} |
q3813 | CNabuCatalogItem.getItemsForCatalog | train | static public function getItemsForCatalog($nb_catalog, int $level)
{
$nb_catalog_id = nb_getMixedValue($nb_catalog, NABU_CATALOG_FIELD_ID);
if (is_numeric($nb_catalog_id)) {
$retval = CNabuCatalogItem::buildObjectListFromSQL(
NABU_CATALOG_ITEM_FIELD_ID,
'SELECT *
FROM nb_catalog_item
WHERE nb_catalog_id=%catalog_id$d '
. ($level > 0 ? 'AND nb_catalog_item_level<=%level$d ' : '')
. 'ORDER BY nb_catalog_item_order ASC',
array(
'catalog_id' => $nb_catalog_id,
'level' => $level
),
($nb_catalog instanceof CNabuCatalog ? $nb_catalog : null)
);
| php | {
"resource": ""
} |
q3814 | CNabuCatalogItem.getItemTranslationsForCatalog | train | static public function getItemTranslationsForCatalog($nb_catalog, int $level)
{
$nb_catalog_id = nb_getMixedValue($nb_catalog, NABU_CATALOG_FIELD_ID);
if (is_numeric($nb_catalog_id)) {
$retval = CNabuCatalogItemLanguage::buildObjectListFromSQL(
null,
'SELECT cil.*
FROM nb_catalog_item ci, nb_catalog_item_lang cil
WHERE ci.nb_catalog_item_id=cil.nb_catalog_item_id
AND ci.nb_catalog_id=%catalog_id$d '
. ($level > 0 ? 'and ci.nb_catalog_item_level<=%level$d ' : '')
| php | {
"resource": ""
} |
q3815 | CNabuCatalogItem.getItems | train | public function getItems(bool $force = false) : CNabuCatalogItemList
{
if ($this->nb_tree_child_list->isEmpty() || $force) {
$this->nb_tree_child_list->merge(
CNabuCatalogItem::buildObjectListFromSQL(
'nb_catalog_item_id',
'SELECT *
FROM nb_catalog_item
WHERE nb_catalog_id=%catalog_id$d
AND nb_catalog_item_parent_id=%parent_id$d
| php | {
"resource": ""
} |
q3816 | CNabuCatalogTaxonomyBase.getAllCatalogTaxonomies | train | public static function getAllCatalogTaxonomies(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_catalog_taxonomy_id',
'select * '
. 'from nb_catalog_taxonomy '
. 'where | php | {
"resource": ""
} |
q3817 | CNabuCatalogTaxonomyBase.setScope | train | public function setScope(string $scope = "O") : CNabuDataObject
{
if ($scope === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$scope")
| php | {
"resource": ""
} |
q3818 | CNabuUserGroupMemberBase.setNew | train | public function setNew(string $new = "T") : CNabuDataObject
{
if ($new === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$new")
| php | {
"resource": ""
} |
q3819 | CNabuUserGroupMemberBase.setAdmin | train | public function setAdmin(string $admin = "F") : CNabuDataObject
{
if ($admin === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$admin")
| php | {
"resource": ""
} |
q3820 | CNabuProviderModuleManagerAdapter.setVendorKey | train | public function setVendorKey(string $vendor_key)
{
if (!nb_isValidKey($vendor_key)) {
throw new ENabuProviderException(ENabuProviderException::ERROR_VENDOR_KEY_NOT_VALID, array($vendor_key));
| php | {
"resource": ""
} |
q3821 | CNabuProviderModuleManagerAdapter.setModuleKey | train | public function setModuleKey(string $module_key)
{
if (!nb_isValidKey($module_key)) {
throw new ENabuProviderException(ENabuProviderException::ERROR_MODULE_KEY_NOT_VALID, array($module_key));
}
| php | {
"resource": ""
} |
q3822 | CNabuUserGroupTypeBase.getAllUserGroupTypes | train | public static function getAllUserGroupTypes(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_user_group_type_id',
'select * '
. 'from nb_user_group_type '
. 'where | php | {
"resource": ""
} |
q3823 | CNabuUserGroupTypeBase.setExclusive | train | public function setExclusive(string $exclusive = "F") : CNabuDataObject
{
if ($exclusive === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3824 | CNabuUserGroupTypeBase.setCreatorOwner | train | public function setCreatorOwner(string $creator_owner = "T") : CNabuDataObject
{
if ($creator_owner === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3825 | ChildMe.addElementTableAttributes | train | protected function addElementTableAttributes()
{
$segments = Craft::$app->getRequest()->getSegments();
$actionSegment = $segments[count($segments) - 1] ?? null;
$classes = [Entry::class, Category::class];
foreach ($classes as $class) {
// Register "Add child" attribute
Event::on($class, Element::EVENT_REGISTER_TABLE_ATTRIBUTES, function (RegisterElementTableAttributesEvent $event) use ($actionSegment) {
$event->tableAttributes['_childme_addChild'] = $actionSegment !== 'get-elements' ? Craft::t('child-me', 'Add child') : '';
});
// Get the HTML for that attribute
Event::on($class, Element::EVENT_SET_TABLE_ATTRIBUTE_HTML, function (SetElementTableAttributeHtmlEvent $event) use ($class) {
if ($event->attribute === '_childme_addChild') {
$html = '';
switch ($class) {
case 'craft\elements\Entry':
$entry = $event->sender;
if ($entry->section->type !== 'structure') {
break;
}
$maxLevels = $entry->section->maxLevels;
$visible = !$maxLevels || $entry->level < $maxLevels;
$newUrl = UrlHelper::cpUrl(implode('/', ['entries', $entry->section->handle, 'new']), [
'typeId' => $entry->type->id,
'parentId' => $entry->id,
]);
| php | {
"resource": ""
} |
q3826 | CNabuCommerceProductCategoryLanguageBase.setCommerceProductCategoryId | train | public function setCommerceProductCategoryId(int $nb_commerce_product_category_id) : CNabuDataObject
{
if ($nb_commerce_product_category_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3827 | CNabuUserGroupBase.getAllUserGroups | train | public static function getAllUserGroups(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_user_group_id',
'select * '
. 'from nb_user_group '
. 'where | php | {
"resource": ""
} |
q3828 | CNabuUserGroupBase.setStatus | train | public function setStatus(string $status = "E") : CNabuDataObject
{
if ($status === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3829 | CNabuCommerce.newProductCategory | train | public function newProductCategory(string $key = null, int $order = 1) : CNabuCommerceProductCategory
{
$nb_commerce_product_category = $this->isBuiltIn()
? new CNabuBuiltInCommerceProductCategory()
| php | {
"resource": ""
} |
q3830 | CNabuCommerce.addProductCategoryObject | train | public function addProductCategoryObject(CNabuCommerceProductCategory $nb_commerce_product_category)
{
$nb_commerce_product_category->setCommerce($this);
return | php | {
"resource": ""
} |
q3831 | CNabuCommerce.getProductCategory | train | public function getProductCategory($nb_commerce_product_category)
{
$nb_category = false;
$nb_category_id = nb_getMixedValue($nb_commerce_product_category, NABU_COMMERCE_PRODUCT_CATEGORY_FIELD_ID);
if (is_numeric($nb_category_id)) {
| php | {
"resource": ""
} |
q3832 | CNabuCommerce.getProductCategories | train | public function getProductCategories(bool $force = false) : CNabuCommerceProductCategoryList
{
if ($this->nb_commerce_product_category_list->isEmpty() || $force) {
$this->nb_commerce_product_category_list->clear(); | php | {
"resource": ""
} |
q3833 | CNabuCommerce.getProducts | train | public function getProducts(bool $force = false) : CNabuCommerceProductList
{
if ($this->nb_commerce_product_list->isEmpty() || $force) {
$this->nb_commerce_product_list->clear();
$this->nb_commerce_product_list->merge(
| php | {
"resource": ""
} |
q3834 | CNabuCommerce.getProduct | train | public function getProduct($nb_commerce_product)
{
$nb_product = false;
$nb_product_id = nb_getMixedValue($nb_commerce_product, NABU_COMMERCE_PRODUCT_FIELD_ID);
if (is_numeric($nb_product_id)) {
| php | {
"resource": ""
} |
q3835 | CNabuCommerce.findProductBySlug | train | public function findProductBySlug(string $slug, $nb_language = null)
{
$retval = false;
$nb_language_id = nb_getMixedValue($nb_language, NABU_LANG_FIELD_ID);
$this->getProducts()->iterate(
function ($key, CNabuCommerceProduct $nb_product)
use (&$retval, $slug, $nb_language_id)
{
if (is_numeric($nb_language_id) &&
($nb_translation = $nb_product->getTranslation($nb_language_id)) instanceof CNabuCommerceProductLanguage &&
$nb_translation->getSlug() === $slug
) {
$retval = $nb_product;
} else {
$nb_product->getTranslations()->iterate(
function ($key, CNabuCommerceProductLanguage $nb_translation)
| php | {
"resource": ""
} |
q3836 | CNabuCommerce.refresh | train | public function refresh(bool $force = false, bool $cascade = false) : bool
{
return parent::refresh($force, $cascade) &&
(!$cascade || (
| php | {
"resource": ""
} |
q3837 | CNabuHTTPServerAdapter.isServerValid | train | public function isServerValid()
{
return ($this->nb_server !== null &&
| php | {
"resource": ""
} |
q3838 | CNabuMessagingServiceStackAttachmentBase.setMessagingServiceStackId | train | public function setMessagingServiceStackId(int $nb_messaging_service_stack_id) : CNabuDataObject
{
if ($nb_messaging_service_stack_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3839 | CNabuRenderTransformFactory.transform | train | public function transform($source)
{
if ($this->discoverInterface()) {
$this->nb_interface->transform($source);
} else {
throw new ENabuRenderException(
| php | {
"resource": ""
} |
q3840 | TNabuSiteChild.getSite | train | public function getSite(CNabuCustomer $nb_customer = null, $force = false)
{
if ($nb_customer !== null && ($this->nb_site === null || $force)) {
$this->nb_site = null;
| php | {
"resource": ""
} |
q3841 | TNabuSiteChild.setSite | train | public function setSite(CNabuSite $nb_site = null, $field = NABU_SITE_FIELD_ID)
{
$this->nb_site = $nb_site;
if ($this instanceof CNabuDataObject) {
| php | {
"resource": ""
} |
q3842 | Actor.equals | train | public function equals(StatementObject $actor): bool
{
if (!parent::equals($actor)) {
return false;
}
if (!$actor instanceof Actor) {
return false;
}
if ($this->name !== $actor->name) | php | {
"resource": ""
} |
q3843 | FileUtils.mkdir | train | public static function mkdir($path, $mode = 0755)
{
$filesystem = new Filesystem();
try {
$filesystem->mkdir($path, $mode);
| php | {
"resource": ""
} |
q3844 | FileUtils.rmdir | train | public static function rmdir($path)
{
$files = array_diff(scandir($path), array('.', '..'));
$filesystem = new Filesystem();
foreach ($files as $file) {
$file = $path . DIRECTORY_SEPARATOR . $file;
if (!file_exists($file)) {
continue;
}
try {
| php | {
"resource": ""
} |
q3845 | FileUtils.detectStream | train | private static function detectStream($path)
{
$stream = 'file';
if (false !== strpos($path, '://')) {
$parts = | php | {
"resource": ""
} |
q3846 | LanguageService.getAll | train | public function getAll(array $queryParams = [])
{
$response = $this->api->languages()->getAll($queryParams);
| php | {
"resource": ""
} |
q3847 | LanguageService.getById | train | public function getById($languageId, array $queryParams = [])
{
$response = $this->api->languages()->getById($languageId, | php | {
"resource": ""
} |
q3848 | CNabuHTTPResponse.calculateFrameOptions | train | private function calculateFrameOptions()
{
$retval = null;
$nb_site = $this->nb_request->getSite();
switch ($nb_site->getXFrameOptions()) {
case 'D':
$retval = 'DENY';
break;
case 'S':
$retval = 'SAMEORIGIN';
break;
case 'A':
if (is_string($url = $nb_site->getXFrameOptionsURL()) &&
strlen($url | php | {
"resource": ""
} |
q3849 | CNabuHTTPResponse.buildHeaders | train | public function buildHeaders()
{
if ($this->use_cors) {
if (strlen($this->cors_allow_origin) > 0) {
header("Access-Control-Allow-Origin: $this->cors_allow_origin");
}
if ($this->cors_with_credentials) {
header('Access-Control-Allow-Credentials: true');
} else {
header('Access-Control-Allow-Credentials: false');
}
}
// Cache Control RFC: https://tools.ietf.org/html/rfc7234
if ($this->nb_request instanceof CNabuHTTPRequest &&
($nb_site_target = $this->nb_request->getSiteTarget()) instanceof CNabuSiteTarget
) {
if (($max_age = $nb_site_target->getDynamicCacheEffectiveMaxAge()) !== false) {
$expire_date = gmdate("D, d M Y H:i:s", time() + $max_age);
$this->setHeader('Expires', $expire_date . 'GMT');
$this->setHeader('Cache-Control', "max-age=$max_age");
$this->setHeader('User-Cache-Control', "max-age=$max_age");
$this->setHeader('Pragma', 'cache');
} else {
$this->setHeader('Expires', 'Thu, 1 Jan 1981 00:00:00 GMT');
$this->setheader('Cache-Control', 'no-store, no-cache, must-revalidate');
| php | {
"resource": ""
} |
q3850 | CNabuHTTPResponse.getRender | train | public function getRender()
{
if ($this->render_factory !== null) {
$retval = $this->render_factory->getInterface();
} else {
| php | {
"resource": ""
} |
q3851 | CNabuHTTPResponse.redirect | train | public function redirect($code, $nb_site_target, $nb_language = null, $params = null)
{
global $NABU_HTTP_CODES;
if (is_string($nb_site_target)) {
$url = new CNabuURL($nb_site_target);
if (!$url->isValid()) {
$nb_site_target = CNabuSiteTarget::findByKey($this, $nb_site_target);
unset($url);
}
} elseif (is_numeric($nb_site_target)) {
$nb_site_target = new CNabuSiteTarget($nb_site_target);
if ($nb_site_target->isNew()) {
$nb_site_target = null;
}
} elseif ($nb_site_target instanceof CNabuDataObject) {
if (!($nb_site_target instanceof CNabuSiteTarget)) {
$nb_site_target = new CNabuSiteTarget($nb_site_target);
if ($nb_site_target->isNew()) {
$nb_site_target = null;
| php | {
"resource": ""
} |
q3852 | DB.query | train | public function query($q, $params = array()){
try{
if(!empty($this->pdo)){
$this->st = $this->pdo->prepare($q);
if(!empty($params)){
$keys = array_keys($params);
$qmark = false;//qmark = question mark
if(is_int($keys[0])){//mode '?'
$qmark = true;
}
foreach($params as $p => $val){
if($qmark){
//$p is a numeric - 0, 1, 2, ...
$p += 1;//bindValue starts to 1
}
if(is_array($val) && count($val) == 2){//if called with PDO::PARAM_STR or PDO::PARAM_INT, PDO::PARAM_BOOL
$this->st->bindValue($p, $val[0], $val[1]);
}
else{
if(! is_bool($val)) { //fix fatal error with some php versions
| php | {
"resource": ""
} |
q3853 | ContextService.getUserInfo | train | public function getUserInfo(array $params)
{
$this->logger->debug('Get User Info.');
if (array_key_exists("error", $params)) {
$this->logger->error(
$params["error"].array_key_exists("error_description", $params) ? $params["error_description"] : ''
);
throw new Exception('FranceConnect error => '.$params["error"]);
}
$this->verifyState($params['state']);
$accessToken = $this->getAccessToken($params['code']);
$userInfo = $this->getInfos($accessToken);
$userInfo['access_token'] = $accessToken;
$token = new FranceConnectToken($userInfo,
[
FranceConnectAuthenticatedVoter::IS_FRANCE_CONNECT_AUTHENTICATED,
| php | {
"resource": ""
} |
q3854 | ContextService.verifyState | train | private function verifyState($state)
{
$this->logger->debug('Verify parameter state.');
$state = urldecode($state);
$stateArray = [];
parse_str($state, $stateArray);
$token = $stateArray['token'];
$token = preg_replace('~{~', '', $token, 1);
$token = preg_replace('~}~', '', $token, 1);
| php | {
"resource": ""
} |
q3855 | ContextService.getAccessToken | train | private function getAccessToken($code)
{
$this->logger->debug('Get Access Token.');
$this->initRequest();
$token_url = $this->fcBaseUrl.'token';
$post_data = [
"grant_type" => "authorization_code",
"redirect_uri" => $this->callbackUrl,
"client_id" => $this->clientId,
"client_secret" => $this->clientSecret,
"code" => $code,
];
$this->logger->debug('POST Data to FranceConnect.');
$this->setPostFields($post_data);
$response = \Unirest\Request::post($token_url);
// check status code
if ($response->code != Response::HTTP_OK) {
$result_array = $response->body;
$description = array_key_exists(
"error_description",
$result_array
) ? $result_array["error_description"] : '';
$this->logger->error(
$result_array["error"].$description
);
throw new Exception("FranceConnectError".$response->code." msg = ".$response->raw_body);
}
$result_array = $response->body;
$id_token = $result_array['id_token'];
$this->session->set(static::ID_TOKEN_HINT, $id_token);
$all_part = explode(".", $id_token);
$payload = json_decode(base64_decode($all_part[1]), true);
| php | {
"resource": ""
} |
q3856 | ContextService.setPostFields | train | private function setPostFields(array $post_data)
{
$pd = [];
foreach ($post_data as $k => $v) {
$pd[] = "$k=$v";
}
$pd = implode("&", $pd);
\Unirest\Request::curlOpt(CURLOPT_POST, true);
| php | {
"resource": ""
} |
q3857 | SourceService.getAll | train | public function getAll($appId, $scanId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sources()
| php | {
"resource": ""
} |
q3858 | SourceService.getById | train | public function getById($appId, $scanId, $sourceId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sources()
| php | {
"resource": ""
} |
q3859 | InverseFunctionalIdentifier.equals | train | public function equals(InverseFunctionalIdentifier $iri): bool
{
if (null !== $this->mbox && null !== $iri->mbox && !$this->mbox->equals($iri->mbox)) {
return false;
}
if ($this->mboxSha1Sum !== $iri->mboxSha1Sum) {
return false;
}
if ($this->openId !== $iri->openId) {
return false;
}
if (null === $this->account && null !== $iri->account) {
return false;
| php | {
"resource": ""
} |
q3860 | UploadService.getAll | train | public function getAll($appId = null, array $queryParams = [])
{
$response = $this->api->applications()->uploads()->getAll($appId, | php | {
"resource": ""
} |
q3861 | UploadService.getById | train | public function getById($appId, $uploadId, array $queryParams = [])
{
$response = $this->api->applications()->uploads()->getById($appId, | php | {
"resource": ""
} |
q3862 | UploadService.deleteAll | train | public function deleteAll($appId, array $queryParams = [])
{
$response = $this->api->applications()->uploads()->deleteAll($appId, | php | {
"resource": ""
} |
q3863 | UploadService.deleteById | train | public function deleteById($appId, $uploadId, array $queryParams = [])
{
$response = $this->api->applications()->uploads()->deleteById($appId, | php | {
"resource": ""
} |
q3864 | IgnoredCodeHydrator.hydrate | train | public static function hydrate(stdClass $ignore)
{
$hydrated = new IgnoredCodeEntity();
if (isset($ignore->id)) {
$hydrated->setId($ignore->id);
}
if (isset($ignore->class)) {
$hydrated->setClass($ignore->class);
}
if (isset($ignore->method)) {
| php | {
"resource": ""
} |
q3865 | AclHydrator.hydrateCollection | train | public static function hydrateCollection(array $acls)
{
$hydrated = [];
foreach ($acls as $acl) {
| php | {
"resource": ""
} |
q3866 | CNabuServerHostBase.setServerId | train | public function setServerId(int $nb_server_id) : CNabuDataObject
{
if ($nb_server_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3867 | CNabuServerHostBase.setIPId | train | public function setIPId(int $nb_ip_id) : CNabuDataObject
{
if ($nb_ip_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$nb_ip_id") | php | {
"resource": ""
} |
q3868 | CNabuServerHostBase.setClusterGroupServiceId | train | public function setClusterGroupServiceId(int $nb_cluster_group_service_id) : CNabuDataObject
{
if ($nb_cluster_group_service_id === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
| php | {
"resource": ""
} |
q3869 | CNabuServerHostBase.setPort | train | public function setPort(int $port = 80) : CNabuDataObject
{
if ($port === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$port")
| php | {
"resource": ""
} |
q3870 | CNabuSiteTarget.findByURL | train | public static function findByURL(CNabuSite $nb_site, string $target_url)
{
$retval = null;
if ($nb_site->isPublicBasePathEnabled()) {
$check_pbp = CNabuEngine::getEngine()->getMainDB()->getQueryAsSingleField(
'nb_site_lang_public_base_path',
"SELECT *
FROM nb_site_lang
WHERE nb_site_id=%site_id\$d
AND length(nb_site_lang_public_base_path) > 0
AND instr('%url\$s', nb_site_lang_public_base_path)=1
LIMIT 1",
array(
'site_id' => $nb_site->getId(),
'url' => $target_url
)
);
if (strlen($check_pbp) > 0) {
$target_url = substr($target_url, strlen($check_pbp));
} else {
$target_url = null;
}
}
if ($target_url !== null) {
$retval = CNabuSiteTarget::buildObjectFromSQL(
"SELECT ca.*, cal.nb_language_id, cal.nb_site_target_lang_url
FROM nb_site_target ca, nb_site_target_lang cal, nb_site_lang sl
WHERE ca.nb_site_target_id = cal.nb_site_target_id
AND ca.nb_site_id=%site_id\$d
AND ca.nb_site_id=sl.nb_site_id
AND sl.nb_site_lang_enabled='T'
AND cal.nb_language_id=sl.nb_language_id
AND ca.nb_site_target_url_filter='U'
AND cal.nb_site_target_lang_url='%url\$s'
LIMIT 1",
array('site_id' => $nb_site->getId(), 'url' => $target_url)
)
??
CNabuSiteTarget::buildObjectFromSQL(
"SELECT ca.*, cal.nb_language_id, cal.nb_site_target_lang_url
FROM nb_site_target ca, nb_site_target_lang cal, nb_site_lang sl
WHERE ca.nb_site_target_id = cal.nb_site_target_id
AND ca.nb_site_id=%site_id\$d
AND ca.nb_site_id=sl.nb_site_id
AND sl.nb_site_lang_enabled='T'
| php | {
"resource": ""
} |
q3871 | CNabuSiteTarget.addCTAObject | train | public function addCTAObject(CNabuSiteTargetCTA $nb_site_target_cta)
{
$nb_site_target_cta->setSiteTarget($this);
| php | {
"resource": ""
} |
q3872 | CNabuSiteTarget.getCTAs | train | public function getCTAs($force = false)
{
if ($this->nb_site_target_cta_list->isEmpty() || $force) {
$this->nb_site_target_cta_list->clear();
$this->nb_site_target_cta_list->merge(CNabuSiteTargetCTA::getSiteTargetCTAs($this));
$translations = CNabuSiteTargetCTALanguage::getCTATranslationsForSiteTarget($this);
if (is_array($translations) && count($translations) > 0) {
foreach ($translations as $translation) {
$nb_site_target_cta = $this->nb_site_target_cta_list->getItem($translation->getSiteTargetCTAId());
| php | {
"resource": ""
} |
q3873 | CNabuSiteTarget.getCTAByKey | train | public function getCTAByKey($key, $force = false)
{
$this->getCTAs($force);
| php | {
"resource": ""
} |
q3874 | CNabuSiteTarget.getDynamicCacheEffectiveMaxAge | train | public function getDynamicCacheEffectiveMaxAge()
{
if (($nb_site = $this->getSite()) === null) {
throw new ENabuCoreException(ENabuCoreException::ERROR_SITE_NOT_FOUND);
}
$retval = false;
if (($nb_application = CNabuEngine::getEngine()->getApplication()) !== null) {
if (($nb_running_site = $nb_application->getRequest()->getSite()) instanceof CNabuSite &&
($nb_running_site->getId() === $nb_site->getId())
) {
if (($nb_security_manager = $nb_application->getSecurityManager()) !== null &&
(!$nb_security_manager->isUserLogged() || $nb_security_manager->arePoliciesAccepted())) {
$site_cache_control = $nb_site->getDynamicCacheControl();
$site_max_age = $nb_site->getDynamicCacheDefaultMaxAge();
$target_cache_control = $this->getDynamicCacheControl();
$target_max_age = $this->getDynamicCacheMaxAge();
if ($target_cache_control === self::DYNAMIC_CACHE_CONTROL_INHERITED &&
$site_cache_control === CNabuSite::DYNAMIC_CACHE_CONTROL_ENABLED &&
| php | {
"resource": ""
} |
q3875 | CNabuSiteUser.logAccess | train | public function logAccess()
{
$this->db->executeUpdate(
"update nb_site_user "
. "set nb_site_user_last_login_datetime=now() "
. "where nb_site_id=%site_id\$d "
. "and nb_role_id=%role_id\$d "
. "and nb_user_id=%user_id\$d",
array(
'site_id' | php | {
"resource": ""
} |
q3876 | CNabuSiteUser.getSitesForUser | train | public static function getSitesForUser($nb_user)
{
if (is_numeric ($nb_user_id = nb_getMixedValue($nb_user, NABU_USER_FIELD_ID))) {
$retval = CNabuSiteUser::buildObjectListFromSQL(
'nb_site_id',
'SELECT su.*
FROM nb_site_user su, nb_user u, nb_site s
WHERE su.nb_user_id=u.nb_user_id
AND su.nb_site_id=s.nb_site_id
AND su.nb_user_id=%user_id$d',
| php | {
"resource": ""
} |
q3877 | CNabuSiteUser.getAvailableSitesForUser | train | public static function getAvailableSitesForUser(CNabuCustomer $nb_customer, $nb_user)
{
if ($nb_customer->isFetched() &&
is_numeric($nb_user_id = nb_getMixedValue($nb_user, NABU_USER_FIELD_ID))
) {
if (!($nb_user = $nb_customer->getUser($nb_user_id))) {
throw new ENabuSecurityException(ENabuSecurityException::ERROR_USER_NOT_ALLOWED);
}
$retval = CNabuSite::buildObjectListFromSQL(
'nb_site_id',
'SELECT s.*, su.nb_user_id
FROM nb_site s
LEFT OUTER JOIN nb_site_user su
ON s.nb_site_id=su.nb_site_id
AND su.nb_user_id=%user_id$d
WHERE | php | {
"resource": ""
} |
q3878 | BaseCommand.writeStatus | train | protected function writeStatus($status, $webExecution)
{
if ($webExecution)
{
$cachedStatus = unserialize(Cache::get('scaffolder-status'));
array_push($cachedStatus, $status);
| php | {
"resource": ""
} |
q3879 | QuotaService.getAll | train | public function getAll(array $queryParams = [])
{
$response | php | {
"resource": ""
} |
q3880 | QuotaService.create | train | public function create(QuotaBuilder $input, array $queryParams = [])
{
$response = $this->api->quotas()->create($input->toArray(), | php | {
"resource": ""
} |
q3881 | QuotaService.update | train | public function update($quotaId, QuotaBuilder $input, array $queryParams = [])
{
$response = $this->api->quotas()->update($quotaId, | php | {
"resource": ""
} |
q3882 | QuotaService.deleteAll | train | public function deleteAll(array $queryParams = [])
{
$response | php | {
"resource": ""
} |
q3883 | ContextHydrator.hydrateCollection | train | public static function hydrateCollection(array $contexts)
{
$hydrated = [];
foreach ($contexts as $context) {
| php | {
"resource": ""
} |
q3884 | ContextHydrator.hydrate | train | public static function hydrate(stdClass $context)
{
$hydrated = new ContextEntity();
if (isset($context->id)) {
$hydrated->setId($context->id);
}
if (isset($context->parts)) {
| php | {
"resource": ""
} |
q3885 | CNabuMessagingServiceBase.findByKey | train | public static function findByKey($nb_messaging, $key)
{
$nb_messaging_id = nb_getMixedValue($nb_messaging, 'nb_messaging_id');
if (is_numeric($nb_messaging_id)) {
$retval = CNabuMessagingService::buildObjectFromSQL(
'select * '
. 'from nb_messaging_service '
. 'where nb_messaging_id=%messaging_id$d '
. "and nb_messaging_service_key='%key\$s'",
| php | {
"resource": ""
} |
q3886 | CNabuMessagingServiceBase.getFilteredMessagingServiceList | train | public static function getFilteredMessagingServiceList($nb_messaging = null, $q = null, $fields = null, $order = null, $offset = 0, $num_items = 0)
{
$nb_messaging_id = nb_getMixedValue($nb_customer, NABU_MESSAGING_FIELD_ID);
if (is_numeric($nb_messaging_id)) {
$fields_part = nb_prefixFieldList(CNabuMessagingServiceBase::getStorageName(), $fields, false, true, '`');
$order_part = nb_prefixFieldList(CNabuMessagingServiceBase::getStorageName(), $fields, false, false, '`');
if ($num_items !== 0) {
$limit_part = ($offset > 0 ? $offset . ', ' : '') . $num_items;
} else {
$limit_part = false;
}
$nb_item_list = CNabuEngine::getEngine()->getMainDB()->getQueryAsArray(
"select " . ($fields_part ? $fields_part . ' ' : '* ')
| php | {
"resource": ""
} |
q3887 | TNabuCustomerChild.setCustomer | train | public function setCustomer(CNabuCustomer $nb_customer, $field = NABU_CUSTOMER_FIELD_ID)
{
$this->nb_customer = $nb_customer;
if ($this instanceof CNabuDataObject) {
if ($nb_customer !== null) {
$this->transferValue($nb_customer, NABU_CUSTOMER_FIELD_ID, | php | {
"resource": ""
} |
q3888 | TNabuCustomerChild.validateCustomer | train | public function validateCustomer($nb_customer)
{
$nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID);
return ($this instanceof CNabuDataObject) &&
| php | {
"resource": ""
} |
q3889 | CNabuRenderPoolManager.getRenderFactory | train | public function getRenderFactory(CNabuRenderInterfaceDescriptor $nb_descriptor)
{
if (!($retval = $this->nb_render_factory_list->getItem($nb_descriptor->getKey()))) { | php | {
"resource": ""
} |
q3890 | CNabuRenderPoolManager.getTransformFactory | train | public function getTransformFactory(CNabuRenderTransformInterfaceDescriptor $nb_descriptor)
{
if (!($retval = $this->nb_render_transform_factory_list->getItem($nb_descriptor->getKey()))) { | php | {
"resource": ""
} |
q3891 | AclService.getById | train | public function getById($quotaId, $aclId, array $queryParams = [])
{
$response | php | {
"resource": ""
} |
q3892 | AclService.create | train | public function create($quotaId, AclBuilder $input, array $queryParams = [])
{
$response = $this->api->quotas()->acls()->create($quotaId, | php | {
"resource": ""
} |
q3893 | AclService.update | train | public function update($quotaId, $aclId, AclBuilder $input, array $queryParams = [])
{
$response | php | {
"resource": ""
} |
q3894 | AclService.deleteAll | train | public function deleteAll($quotaId, array $queryParams = [])
{
$response = $this->api->quotas()->acls()->deleteAll($quotaId, | php | {
"resource": ""
} |
q3895 | CNabuMedioteca.getItems | train | public function getItems($force = false)
{
if (!$this->isBuiltIn() && ($this->nb_medioteca_item_list->isEmpty() || | php | {
"resource": ""
} |
q3896 | CNabuMedioteca.getItem | train | public function getItem($nb_medioteca_item)
{
$nb_medioteca_item_id = nb_getMixedValue($nb_medioteca_item, 'nb_medioteca_item_id');
if (is_numeric($nb_medioteca_item_id) || nb_isValidGUID($nb_medioteca_item_id)) {
| php | {
"resource": ""
} |
q3897 | CNabuMedioteca.newItem | train | public function newItem(string $key = null)
{
$nb_medioteca_item = $this->isBuiltIn()
? new CNabuBuiltInMediotecaItem()
: new CNabuMediotecaItem()
| php | {
"resource": ""
} |
q3898 | CNabuMedioteca.findItemByURL | train | public function findItemByURL(string $url, $nb_language = null)
{
$retval = false;
$nb_language_id = nb_getMixedValue($nb_language, NABU_LANG_FIELD_ID);
$this->getItems()->iterate(
function ($key, CNabuMediotecaItem $nb_item)
use (&$retval, $url, $nb_language_id)
{
if (is_numeric($nb_language_id) &&
($nb_translation = $nb_item->getTranslation($nb_language_id)) instanceof CNabuMediotecaItemLanguage &&
$nb_translation->getURL() === $url
) {
$retval = $nb_item;
} else {
$nb_item->getTranslations()->iterate(
function ($key, CNabuMediotecaItemLanguage $nb_translation)
| php | {
"resource": ""
} |
q3899 | CNabuMedioteca.addItemObject | train | public function addItemObject(CNabuMediotecaItem $nb_medioteca_item)
{
$nb_medioteca_item->setMedioteca($this);
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.