_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24500 | LocationContentType.getCountries | train | private function getCountries()
{
$countries = [];
foreach (Intl::getRegionBundle()->getCountryNames() as $countryCode => $countryName) {
$countries[strtolower($countryCode)] = new | php | {
"resource": ""
} |
q24501 | Operator.addValue | train | public function addValue(\Sulu\Bundle\ResourceBundle\Entity\OperatorValue $values)
{
| php | {
"resource": ""
} |
q24502 | Operator.removeValue | train | public function removeValue(\Sulu\Bundle\ResourceBundle\Entity\OperatorValue $values)
{
| php | {
"resource": ""
} |
q24503 | CreateUserCommand.encodePassword | train | private function encodePassword($user, $password, $salt)
{
/** @var PasswordEncoderInterface $encoder */
| php | {
"resource": ""
} |
q24504 | CreateUserCommand.getRoleNames | train | private function getRoleNames()
{
$roleNames = $this->roleRepository->getRoleNames();
if (empty($roleNames)) {
throw new \RuntimeException(sprintf(
| php | {
"resource": ""
} |
q24505 | CollectionController.getAction | train | public function getAction($id, Request $request)
{
if ($this->getBooleanRequestParameter($request, 'tree', false, false)) {
$collections = $this->getCollectionManager()->getTreeById(
$id,
$this->getRequestParameter($request, 'locale', true)
);
... | php | {
"resource": ""
} |
q24506 | CollectionController.cgetAction | train | public function cgetAction(Request $request)
{
try {
/** @var ListRestHelperInterface $listRestHelper */
$listRestHelper = $this->get('sulu_core.list_rest_helper');
$securityChecker = $this->get('sulu_security.security_checker');
$flat = $this->getBooleanRequ... | php | {
"resource": ""
} |
q24507 | CollectionController.deleteAction | train | public function deleteAction($id)
{
$delete = function($id) {
try {
$collectionManager = $this->getCollectionManager();
$collectionManager->delete($id);
} catch (CollectionNotFoundException $cnf) {
| php | {
"resource": ""
} |
q24508 | CollectionController.moveEntity | train | protected function moveEntity($id, Request $request)
{
$destinationId = $this->getRequestParameter($request, 'destination');
$locale = $this->getRequestParameter($request, 'locale', true);
| php | {
"resource": ""
} |
q24509 | StructureMetadataFactory.assertExists | train | private function assertExists($type)
{
if (!isset($this->typePaths[$type])) {
throw new Exception\DocumentTypeNotFoundException(
sprintf(
'Structure path for document type "%s" is not mapped. Mapped structure types: "%s"',
| php | {
"resource": ""
} |
q24510 | StructureMetadataFactory.getPaths | train | private function getPaths($type)
{
$typeConfigs = $this->typePaths[$type];
$paths = [];
foreach ($typeConfigs as $typeConfig) {
| php | {
"resource": ""
} |
q24511 | CategoryRepository.getCategoryQuery | train | private function getCategoryQuery()
{
return $this->createQueryBuilder('category')
->leftJoin('category.meta', 'categoryMeta')
->leftJoin('category.translations', 'categoryTranslations')
->leftJoin('categoryTranslations.keywords', 'categoryKeywords')
->leftJoi... | php | {
"resource": ""
} |
q24512 | OperatorRepository.getOperatorQuery | train | protected function getOperatorQuery($locale)
{
$qb = $this->createQueryBuilder('operator')
->addSelect('operatorValues')
->addSelect('translations')
->addSelect('operatorValueTranslations')
->leftJoin('operator.translations', 'translations', 'WITH', 'translati... | php | {
"resource": ""
} |
q24513 | ReferencesOption.postGenerateSchemaTable | train | public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args)
{
$classMetadata = $args->getClassMetadata();
$table = $args->getClassTable();
foreach ($classMetadata->getFieldNames() as $fieldName) {
$mapping = $classMetadata->getFieldMapping($fieldName);
... | php | {
"resource": ""
} |
q24514 | TagManager.delete | train | public function delete($id)
{
$tag = $this->tagRepository->findTagById($id);
if (!$tag) {
throw new TagNotFoundException($id);
}
$this->em->remove($tag);
$this->em->flush();
| php | {
"resource": ""
} |
q24515 | TagManager.merge | train | public function merge($srcTagIds, $destTagId)
{
$srcTags = [];
$destTag = $this->tagRepository->findTagById($destTagId);
if (!$destTag) {
throw new TagNotFoundException($destTagId);
}
foreach ($srcTagIds as $srcTagId) {
$srcTag = $this->tagRepository... | php | {
"resource": ""
} |
q24516 | TagManager.resolveTagIds | train | public function resolveTagIds($tagIds)
{
$resolvedTags = [];
foreach ($tagIds as $tagId) {
$tag = $this->findById($tagId);
if (null !== $tag) {
| php | {
"resource": ""
} |
q24517 | TagManager.resolveTagNames | train | public function resolveTagNames($tagNames)
{
$resolvedTags = [];
foreach ($tagNames as $tagName) {
$tag = $this->findByName($tagName);
if (null !== $tag) {
| php | {
"resource": ""
} |
q24518 | ApiEntity.createSelfLink | train | public function createSelfLink()
{
// if no apiPath is not set generate it from basepath
if (is_null($this->getApiPath())) {
$class = explode('\\', get_class($this));
$plural = Inflector::pluralize(strtolower(end($class)));
$this->apiPath = $this->apiBasePath . '/... | php | {
"resource": ""
} |
q24519 | BlockPropertyType.getProperty | train | public function getProperty($name)
{
foreach ($this->getChildProperties() as $property) {
if ($property->getName() === $name) { | php | {
"resource": ""
} |
q24520 | BlockPropertyType.getChild | train | public function getChild($name)
{
foreach ($this->childProperties as $child) {
if ($child->getName() === $name) {
| php | {
"resource": ""
} |
q24521 | ReferrerRule.evaluate | train | public function evaluate(array $options)
{
$request = $this->requestStack->getCurrentRequest();
$referrer = $request->headers->get('referer');
if ($this->referrerHeader && $request->headers->has($this->referrerHeader)) {
$referrer = $request->headers->get($this->referrerHeader);
... | php | {
"resource": ""
} |
q24522 | AbstractImageFormatCompilerPass.loadFormatsFromFile | train | private function loadFormatsFromFile($path, array &$formats)
{
$folder = dirname($path);
$file = basename($path);
$locator = new FileLocator($folder);
$xmlLoader10 = new XmlFormatLoader10($locator);
$xmlLoader11 = new XmlFormatLoader11($locator);
$xmlLoader10->setGl... | php | {
"resource": ""
} |
q24523 | CustomUrlController.cgetAction | train | public function cgetAction($webspace, Request $request)
{
// TODO pagination
$result = $this->get('sulu_custom_urls.manager')->findList($webspace);
$list = new RouteAwareRepresentation(
| php | {
"resource": ""
} |
q24524 | CustomUrlController.getAction | train | public function getAction($webspace, $id, Request $request)
{
$document = $this->get('sulu_custom_urls.manager')->find($id);
// FIXME without this target-document will not be loaded (for serialization)
// - issue https://github.com/sulu-io/sulu-document-manager/issues/71
if (null !=... | php | {
"resource": ""
} |
q24525 | CustomUrlController.postAction | train | public function postAction($webspace, Request $request)
{
$document = $this->get('sulu_custom_urls.manager')->create(
$webspace,
$request->request->all(),
$this->getRequestParameter($request, 'targetLocale', true) | php | {
"resource": ""
} |
q24526 | CustomUrlController.putAction | train | public function putAction($webspace, $id, Request $request)
{
$manager = $this->get('sulu_custom_urls.manager');
$document = $manager->save($id, $request->request->all());
$this->get('sulu_document_manager.document_manager')->flush();
| php | {
"resource": ""
} |
q24527 | CustomUrlController.deleteAction | train | public function deleteAction($webspace, $id)
{
$manager = $this->get('sulu_custom_urls.manager');
| php | {
"resource": ""
} |
q24528 | CustomUrlController.cdeleteAction | train | public function cdeleteAction($webspace, Request $request)
{
$ids = array_filter(explode(',', $request->get('ids', '')));
$manager = $this->get('sulu_custom_urls.manager');
foreach ($ids as $ids) {
$manager->delete($ids);
}
| php | {
"resource": ""
} |
q24529 | DocumentInspector.getParent | train | public function getParent($document)
{
$parentNode = $this->getNode($document)->getParent();
if (!$parentNode) {
return;
}
| php | {
"resource": ""
} |
q24530 | Media.getLocalizedMeta | train | private function getLocalizedMeta()
{
if ($this->localizedMeta) {
return $this->localizedMeta;
}
$metas = $this->getFileVersion()->getMeta();
$this->localizedMeta = $metas[0];
foreach ($metas as $key => $meta) {
| php | {
"resource": ""
} |
q24531 | Media.addCategory | train | public function addCategory(CategoryEntity $category)
{
$fileVersion = $this->getFileVersion();
| php | {
"resource": ""
} |
q24532 | Media.getCategories | train | public function getCategories()
{
$apiCategories = [];
$fileVersion = $this->getFileVersion();
$categories = $fileVersion->getCategories();
| php | {
"resource": ""
} |
q24533 | Media.addTargetGroup | train | public function addTargetGroup(TargetGroupInterface $targetGroup)
{
$fileVersion = $this->getFileVersion();
| php | {
"resource": ""
} |
q24534 | DumpSitemapCommand.dumpWebspace | train | private function dumpWebspace(Webspace $webspace)
{
foreach ($webspace->getAllLocalizations() as $localization) {
$this->output->writeln(sprintf(' - %s (%s)', $webspace->getKey(), $localization->getLocale()));
$this->dumpPortalInformations(
$this->webspaceManager->fin... | php | {
"resource": ""
} |
q24535 | DumpSitemapCommand.dumpPortalInformations | train | private function dumpPortalInformations(array $portalInformations)
{
try {
foreach ($portalInformations as $portalInformation) {
| php | {
"resource": ""
} |
q24536 | AccountManager.addAddress | train | public function addAddress($account, AddressEntity $address, $isMain = false)
{
if (!$account || !$address) {
throw new \Exception('Account and Address cannot be null');
}
$accountAddress = new AccountAddressEntity();
$accountAddress->setAccount($account);
$accoun... | php | {
"resource": ""
} |
q24537 | AccountManager.removeAddressRelation | train | public function removeAddressRelation($account, $accountAddress)
{
if (!$account || !$accountAddress) {
throw new \Exception('Account and AccountAddress cannot be null');
}
// Reload address to get all data (including relational data).
/** @var AddressEntity $address */
... | php | {
"resource": ""
} |
q24538 | AccountManager.getById | train | public function getById($id, $locale)
{
$account = $this->accountRepository->findAccountById($id);
if (!$account) | php | {
"resource": ""
} |
q24539 | AccountManager.getByIds | train | public function getByIds($ids, $locale)
{
if (!is_array($ids) || 0 === count($ids)) {
return [];
}
$accounts = $this->accountRepository->findByIds($ids);
return array_map(
| php | {
"resource": ""
} |
q24540 | AccountManager.getByIdAndInclude | train | public function getByIdAndInclude($id, $locale, $includes)
{
$account = $this->accountRepository->findAccountById($id, in_array('contacts', $includes));
if (!$account) {
| php | {
"resource": ""
} |
q24541 | AccountManager.findContactsByAccountId | train | public function findContactsByAccountId($id, $locale, $onlyFetchMainAccounts = false)
{
$contactsEntities = $this->contactRepository->findByAccountId(
$id,
null,
false,
$onlyFetchMainAccounts
);
if (!empty($contactsEntities)) {
| php | {
"resource": ""
} |
q24542 | AccountManager.setMedias | train | public function setMedias(Account $account, $medias)
{
$mediaIds = array_map(
function($media) {
return $media['id'];
},
$medias
);
$foundMedias = $this->mediaRepository->findById($mediaIds);
$foundMediaIds = array_map(
... | php | {
"resource": ""
} |
q24543 | AccountManager.findAll | train | public function findAll($locale, $filter = null)
{
if ($filter) {
$accountEntities = $this->accountRepository->findByFilter($filter);
} else {
$accountEntities = $this->accountRepository->findAll();
}
if (!empty($accountEntities)) {
$accounts = []... | php | {
"resource": ""
} |
q24544 | AccountManager.getApiObject | train | protected function getApiObject($account, $locale)
{
$apiObject = $this->accountFactory->createApiEntity($account, $locale);
if ($account->getLogo()) {
| php | {
"resource": ""
} |
q24545 | DoctrineListBuilderFactory.create | train | public function create($entityName)
{
return new DoctrineListBuilder($this->em, | php | {
"resource": ""
} |
q24546 | RedirectExceptionSubscriber.redirectTrailingSlashOrHtml | train | public function redirectTrailingSlashOrHtml(GetResponseForExceptionEvent $event)
{
if (!$event->getException() instanceof NotFoundHttpException) {
return;
}
$request = $event->getRequest();
/** @var RequestAttributes $attributes */
$attributes = $request->attrib... | php | {
"resource": ""
} |
q24547 | RedirectExceptionSubscriber.redirectPartialMatch | train | public function redirectPartialMatch(GetResponseForExceptionEvent $event)
{
if (!$event->getException() instanceof NotFoundHttpException) {
return;
}
$request = $event->getRequest();
/** @var RequestAttributes $attributes */
$attributes = $event->getRequest()->a... | php | {
"resource": ""
} |
q24548 | RedirectExceptionSubscriber.matchUrl | train | private function matchUrl($url)
{
$request = Request::create($url);
$this->requestAnalyzer->analyze($request);
| php | {
"resource": ""
} |
q24549 | RedirectExceptionSubscriber.resolveRedirectUrl | train | private function resolveRedirectUrl($redirectUrl, $requestUri, $resourceLocatorPrefix)
{
$redirectInfo = $this->parseUrl($redirectUrl);
$requestInfo = $this->parseUrl($requestUri);
$url = sprintf('%s://%s', $requestInfo['scheme'], $requestInfo['host']);
if (isset($redirectInfo['hos... | php | {
"resource": ""
} |
q24550 | PageDocumentType.postSubmitDocumentParent | train | public function postSubmitDocumentParent(FormEvent $event)
{
$document = $event->getData();
if ($document->getParent()) {
return;
}
$form = $event->getForm();
$webspaceKey = $form->getConfig()->getAttribute('webspace_key');
$parent = $this->documentManag... | php | {
"resource": ""
} |
q24551 | WildcardUrlUtil.getRegularExpression | train | private static function getRegularExpression($portalUrl)
{
$patternUrl = rtrim($portalUrl, '/');
$patternUrl = | php | {
"resource": ""
} |
q24552 | WildcardUrlUtil.resolve | train | public static function resolve($url, $portalUrl)
{
$regexp = self::getRegularExpression($portalUrl);
if (preg_match($regexp, $url, $matches)) {
for ($i = 0, $countStar = substr_count($portalUrl, '*'); $i < $countStar; | php | {
"resource": ""
} |
q24553 | Filter.getConditionGroups | train | public function getConditionGroups()
{
$groups = $this->entity->getConditionGroups();
if ($groups) {
$result = [];
foreach ($groups as $group) {
$result[] | php | {
"resource": ""
} |
q24554 | CustomUrlSerializeEventSubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
$customUrl = $event->getObject();
$visitor = $event->getVisitor();
if (!$customUrl instanceof CustomUrlDocument) {
return;
}
if (null !== $customUrl->getTargetDocument()) {
$visitor->addData('targ... | php | {
"resource": ""
} |
q24555 | AnalyticsManager.setData | train | private function setData(Analytics $analytics, $webspaceKey, $data)
{
$analytics->setTitle($this->getValue($data, 'title'));
$analytics->setType($this->getValue($data, 'type'));
$analytics->setContent($this->getValue($data, 'content', ''));
$analytics->setAllDomains($this->getValue($... | php | {
"resource": ""
} |
q24556 | Url.setUrlType | train | public function setUrlType(\Sulu\Bundle\ContactBundle\Entity\UrlType $urlType)
{
| php | {
"resource": ""
} |
q24557 | LocalFormatCache.getIdFromUrl | train | protected function getIdFromUrl($url)
{
$fileName = basename($url);
$idParts = explode('-', $fileName);
if (count($idParts) < 2) {
throw new ImageProxyInvalidUrl('No `id` was found in the url');
}
$id = $idParts[0];
| php | {
"resource": ""
} |
q24558 | LocalFormatCache.getFormatFromUrl | train | protected function getFormatFromUrl($url)
{
$path = dirname($url);
$formatParts = array_reverse(explode('/', $path));
if (count($formatParts) < 2) {
| php | {
"resource": ""
} |
q24559 | DataProviderRepositoryTrait.appendRelation | train | private function appendRelation(QueryBuilder $queryBuilder, $relation, $values, $operator, $alias)
{
switch ($operator) {
case 'or':
return $this->appendRelationOr($queryBuilder, $relation, $values, $alias);
case 'and':
| php | {
"resource": ""
} |
q24560 | DataProviderRepositoryTrait.appendRelationOr | train | private function appendRelationOr(QueryBuilder $queryBuilder, $relation, $values, $alias)
{
| php | {
"resource": ""
} |
q24561 | DataProviderRepositoryTrait.appendRelationAnd | train | private function appendRelationAnd(QueryBuilder $queryBuilder, $relation, $values, $alias)
{
$parameter = [];
$expr = $queryBuilder->expr()->andX();
$length = count($values);
for ($i = 0; $i < $length; ++$i) {
$queryBuilder->leftJoin($relation, $alias . $i);
| php | {
"resource": ""
} |
q24562 | ContentNodeDeleteEvent.getStructure | train | public function getStructure($locale)
{
return $this->contentMapper->loadShallowStruc | php | {
"resource": ""
} |
q24563 | PortalInformationRequestProcessor.getResourceLocatorFromRequest | train | private function getResourceLocatorFromRequest(PortalInformation $portalInformation, Request $request, $path)
{
// extract file and extension info
$pathParts = explode('/', $path);
$fileInfo = explode('.', array_pop($pathParts));
| php | {
"resource": ""
} |
q24564 | ContentType.getProvider | train | private function getProvider(PropertyInterface $property)
{
$params = $property->getParams();
$providerAlias = 'pages';
if (array_key_exists('provider', $params)) {
| php | {
"resource": ""
} |
q24565 | ContentType.getCurrentPage | train | private function getCurrentPage($pageParameter)
{
if (null === $this->requestStack->getCurrentRequest()) {
return 1;
}
$page = $this->requestStack->getCurrentRequest()->get($pageParameter, 1);
| php | {
"resource": ""
} |
q24566 | CsvHandler.createResponse | train | public function createResponse(ViewHandler $handler, View $view, Request $request, $format)
{
if (!$view->getData() instanceof ListRepresentation) {
throw new ObjectNotSupportedException($view);
}
$viewData = $view->getData();
$data = new CallbackCollection($viewData->ge... | php | {
"resource": ""
} |
q24567 | CsvHandler.prepareData | train | public function prepareData($row)
{
if (!$row) {
return $row;
}
if (!is_array($row)) {
$row = $this->serializer->serialize($row, 'array', SerializationContext::create()->setSerializeNull(true));
}
foreach ($row as $key => $value) {
if ($v... | php | {
"resource": ""
} |
q24568 | PersistenceBundleTrait.buildPersistence | train | public function buildPersistence(array $interfaces, ContainerBuilder $container)
{
if (!empty($interfaces)) {
$container->addCompilerPass(
| php | {
"resource": ""
} |
q24569 | Version201511240844.up | train | public function up(SessionInterface $session)
{
$this->session = $session;
| php | {
"resource": ""
} |
q24570 | Version201511240844.down | train | public function down(SessionInterface $session)
{
$this->session = $session;
| php | {
"resource": ""
} |
q24571 | Version201511240844.upgradeExternalLinks | train | private function upgradeExternalLinks($addScheme)
{
foreach ($this->localizationManager->getLocalizations() as $localization) {
$rows = $this->session->getWorkspace()->getQueryManager()->createQuery(
sprintf(
'SELECT * FROM [nt:unstructured] WHERE [%s] = "%s"'... | php | {
"resource": ""
} |
q24572 | Version201511240844.iterateStructures | train | private function iterateStructures($addScheme)
{
$properties = [];
// find templates containing URL fields
$structureMetadatas = array_merge(
$this->structureMetadataFactory->getStructures('page'),
$this->structureMetadataFactory->getStructures('snippet')
);
... | php | {
"resource": ""
} |
q24573 | Version201511240844.findUrlProperties | train | private function findUrlProperties(StructureMetadata $structureMetadata, array &$properties)
{
$structureName = $structureMetadata->getName();
foreach ($structureMetadata->getProperties() as $property) {
if ('url' === $property->getType()) {
$properties[$structureName][] | php | {
"resource": ""
} |
q24574 | Version201511240844.upgradeNode | train | private function upgradeNode(NodeInterface $node, $locale, array $properties, $addScheme)
{
/** @var BasePageDocument $document */
$document = $this->documentManager->find($node->getIdentifier(), $locale);
$documentLocales = $this->documentInspector->getLocales($document);
if (!in_a... | php | {
"resource": ""
} |
q24575 | Version201511240844.upgradeBlockProperty | train | private function upgradeBlockProperty(
BlockMetadata $blockProperty,
array $components,
PropertyValue $propertyValue,
$addScheme
) {
$componentNames = array_map(
function($item) {
return $item['component']->getName();
},
$co... | php | {
"resource": ""
} |
q24576 | Version201511240844.upgradeUrl | train | private function upgradeUrl(&$value)
{
if (!empty($value)
&& false === strpos($value, 'http://')
&& false === strpos($value, 'https://')
&& false === strpos($value, 'ftp://')
&& false === strpos($value, 'ftps://')
&& false === | php | {
"resource": ""
} |
q24577 | AutoNameSubscriber.handleScheduleRename | train | public function handleScheduleRename(PersistEvent $event)
{
$document = $event->getDocument();
if (!$event->getOption('auto_name')
|| !$document instanceof AutoNameBehavior
|| $event->getOption('auto_name_locale') !== $event->getLocale()
|| !$event->hasNode()
... | php | {
"resource": ""
} |
q24578 | AutoNameSubscriber.getName | train | private function getName(
AutoNameBehavior $document,
NodeInterface $parentNode,
$autoRename = true,
NodeInterface $node = null
) {
$title = $document->getTitle();
if (!$title) {
throw new DocumentManagerException(
| php | {
"resource": ""
} |
q24579 | AutoNameSubscriber.handleMoveCopy | train | private function handleMoveCopy(MoveEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof AutoNameBehavior) {
return;
}
$destId = $event->getDestId();
$node = | php | {
"resource": ""
} |
q24580 | HashSerializeEventSubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
$object = $event->getObject();
// FIXME This can be removed, as soon as we've got rid of all ApiEntities.
if ($object instanceof ApiWrapper) {
$object = $object->getEntity();
}
if (!$object instanceof Auditab... | php | {
"resource": ""
} |
q24581 | SystemCollectionManager.getSystemCollections | train | private function getSystemCollections()
{
if (!$this->systemCollections) {
if (!$this->cache->isFresh()) {
$systemCollections = $this->buildSystemCollections(
$this->locale,
$this->getUserId()
);
| php | {
"resource": ""
} |
q24582 | SystemCollectionManager.getUserId | train | private function getUserId()
{
if (!$this->tokenProvider || null === ($token = $this->tokenProvider->getToken())) {
| php | {
"resource": ""
} |
q24583 | SystemCollectionManager.buildSystemCollections | train | private function buildSystemCollections($locale, $userId)
{
$root = $this->getOrCreateRoot(SystemCollectionManagerInterface::COLLECTION_KEY, 'System', $locale, $userId);
$collections = ['root' => $root->getId()];
| php | {
"resource": ""
} |
q24584 | SystemCollectionManager.iterateOverCollections | train | private function iterateOverCollections($children, $userId, $parent = null, $namespace = '')
{
$format = ('' !== $namespace ? '%s.%s' : '%s%s');
$collections = [];
foreach ($children as $collectionKey => $collectionItem) {
$key = sprintf($format, $namespace, $collectionKey);
... | php | {
"resource": ""
} |
q24585 | SystemCollectionManager.getOrCreateRoot | train | private function getOrCreateRoot($namespace, $title, $locale, $userId, $parent = null)
{
if (null !== ($collection = $this->collectionManager->getByKey($namespace, $locale))) {
$collection->setTitle($title);
| php | {
"resource": ""
} |
q24586 | SystemCollectionManager.getOrCreateCollection | train | private function getOrCreateCollection($key, $localizedTitles, $userId, $parent)
{
$locales = array_keys($localizedTitles);
$firstLocale = array_shift($locales);
$collection = $this->collectionManager->getByKey($key, $firstLocale);
if (null === $collection) {
$collection... | php | {
"resource": ""
} |
q24587 | SnippetExport.getExportData | train | public function getExportData()
{
$snippets = $this->getSnippets();
$snippetsData = [];
$progress = new ProgressBar($this->output, count($snippets));
$progress->start();
/*
* @var SnippetDocument
*/
foreach ($snippets as $snippet) {
$co... | php | {
"resource": ""
} |
q24588 | DocumentRegistry.registerDocument | train | public function registerDocument($document, NodeInterface $node, $locale)
{
$oid = $this->getObjectIdentifier($document);
$uuid = $node->getIdentifier();
// do not allow nodes without UUIDs or reregistration of documents
$this->validateDocumentRegistration($document, $locale, $node,... | php | {
"resource": ""
} |
q24589 | DocumentRegistry.hasDocument | train | public function hasDocument($document)
{
$oid = $this->getObjectIdentifier($document);
| php | {
"resource": ""
} |
q24590 | DocumentRegistry.hasNode | train | public function hasNode(NodeInterface $node, $locale)
{
return | php | {
"resource": ""
} |
q24591 | DocumentRegistry.deregisterDocument | train | public function deregisterDocument($document)
{
$oid = $this->getObjectIdentifier($document);
$this->assertDocumentExists($document);
$nodeIdentifier = $this->documentNodeMap[$oid];
$locale = $this->documentLocaleMap[$oid];
unset($this->nodeMap[$nodeIdentifier]);
| php | {
"resource": ""
} |
q24592 | DocumentRegistry.getNodeForDocument | train | public function getNodeForDocument($document)
{
$oid = $this->getObjectIdentifier($document);
$this->assertDocumentExists($document); | php | {
"resource": ""
} |
q24593 | DocumentRegistry.getLocaleForDocument | train | public function getLocaleForDocument($document)
{
$oid = $this->getObjectIdentifier($document); | php | {
"resource": ""
} |
q24594 | DocumentRegistry.getOriginalLocaleForDocument | train | public function getOriginalLocaleForDocument($document)
{
$this->assertDocumentExists($document);
if ($document instanceof LocaleBehavior) {
return $document->getOriginalLocale() ?: | php | {
"resource": ""
} |
q24595 | DocumentRegistry.getDocumentForNode | train | public function getDocumentForNode(NodeInterface $node, $locale)
{
$identifier = $node->getIdentifier();
$this->assertNodeExists($identifier);
| php | {
"resource": ""
} |
q24596 | DocumentRegistry.validateDocumentRegistration | train | private function validateDocumentRegistration($document, $locale, NodeInterface $node, $oid, $uuid)
{
if (null === $uuid) {
throw new DocumentManagerException(sprintf(
'Node "%s" of type "%s" has no UUID. Only referencable nodes can be registered by the document manager',
... | php | {
"resource": ""
} |
q24597 | FilterRepository.getFilterQuery | train | protected function getFilterQuery($locale)
{
$qb = $this->createQueryBuilder('filter')
->addSelect('conditionGroups')
->addSelect('translations')
->addSelect('conditions')
->leftJoin(
'filter.translations',
'translations',
... | php | {
"resource": ""
} |
q24598 | FilterRepository.deleteByIds | train | public function deleteByIds($ids)
{
$qb = $this->createQueryBuilder('filter')->delete()->where(
'filter.id IN (:ids)'
| php | {
"resource": ""
} |
q24599 | SnippetRepository.getReferences | train | public function getReferences($uuid)
{
$session = $this->sessionManager->getSession();
$node | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.