_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24600 | SnippetRepository.getSnippetsByUuids | train | public function getSnippetsByUuids(array $uuids, $locale, $loadGhostContent = false)
{
$snippets = [];
foreach ($uuids as $uuid) {
try {
$snippet = $this->documentManager->find($uuid, $locale, [
'load_ghost_content' => $loadGhostContent,
| php | {
"resource": ""
} |
q24601 | SnippetRepository.getSnippets | train | public function getSnippets(
$locale,
$type = null,
$offset = null,
$max = null,
$search = null,
$sortBy = null,
$sortOrder = null
| php | {
"resource": ""
} |
q24602 | SnippetRepository.getSnippetsAmount | train | public function getSnippetsAmount(
$locale,
$type = null,
$search = null,
$sortBy = null,
$sortOrder = null
) {
$query = $this->getSnippetsQuery($locale, $type, | php | {
"resource": ""
} |
q24603 | SnippetRepository.copyLocale | train | public function copyLocale($uuid, $userId, $srcLocale, $destLocales)
{
return $this->contentMapper->copyLanguage(
$uuid,
$userId,
| php | {
"resource": ""
} |
q24604 | SnippetRepository.getSnippetsQuery | train | private function getSnippetsQuery(
$locale,
$type = null,
$offset = null,
$max = null,
$search = null,
$sortBy = null,
$sortOrder = null
) {
$snippetNode = $this->sessionManager->getSnippetNode($type);
$workspace = $this->sessionManager->getSes... | php | {
"resource": ""
} |
q24605 | VersionController.cgetAction | train | public function cgetAction(Request $request, $uuid)
{
$locale = $this->getRequestParameter($request, 'language', true);
$document = $this->get('sulu_document_manager.document_manager')->find($uuid, $request->query->get('language'));
$versions = array_reverse(array_filter($document->getVersi... | php | {
"resource": ""
} |
q24606 | CategoryManager.findOrCreateCategoryTranslation | train | private function findOrCreateCategoryTranslation(
CategoryInterface $category,
CategoryWrapper $categoryWrapper,
$locale
) {
$translationEntity = $category->findTranslationByLocale($locale);
if (!$translationEntity) {
$translationEntity = $this->categoryTranslatio... | php | {
"resource": ""
} |
q24607 | CategoryManager.getApiObject | train | public function getApiObject($category, $locale)
{
if ($category instanceof CategoryWrapper) {
$category = $category->getEntity();
}
| php | {
"resource": ""
} |
q24608 | CategoryManager.getApiObjects | train | public function getApiObjects($entities, $locale)
{
return array_map(
function($entity) use ($locale) {
| php | {
"resource": ""
} |
q24609 | FileVersionMetaRepository.getQueryBuilderWithoutSecurity | train | public function getQueryBuilderWithoutSecurity(QueryBuilder $queryBuilder)
{
$queryBuilder->addSelect('fileVersion')
->addSelect('file')
->addSelect('media')
->addSelect('collection')
->leftJoin('d.fileVersion', 'fileVersion')
->leftJoin('fileVersi... | php | {
"resource": ""
} |
q24610 | QueryBuilder.buildPropertiesSelect | train | private function buildPropertiesSelect($locale, &$additionalFields)
{
foreach ($this->propertiesConfig as $parameter) {
$alias = $parameter->getName();
$propertyName = $parameter->getValue();
if (false !== strpos($propertyName, '.')) {
$parts = explode('.... | php | {
"resource": ""
} |
q24611 | QueryBuilder.buildPropertySelect | train | private function buildPropertySelect($alias, $propertyName, $locale, &$additionalFields)
{
foreach ($this->structureManager->getStructures(static::$structureType) as $structure) {
if ($structure->hasProperty($propertyName)) {
$property = $structure->getProperty($propertyName);
... | php | {
"resource": ""
} |
q24612 | QueryBuilder.buildExtensionSelect | train | private function buildExtensionSelect($alias, $extension, $propertyName, $locale, &$additionalFields)
{
$extension = $this->extensionManager->getExtension('all', $extension);
$additionalFields[$locale][] = [
| php | {
"resource": ""
} |
q24613 | QueryBuilder.buildDatasourceWhere | train | private function buildDatasourceWhere()
{
$dataSource = $this->getConfig('dataSource');
$includeSubFolders = $this->getConfig('includeSubFolders', false);
$sqlFunction = false | php | {
"resource": ""
} |
q24614 | QueryBuilder.buildAudienceTargeting | train | private function buildAudienceTargeting($targetGroupId, $locale)
{
if (!$targetGroupId) {
return;
}
$structure = $this->structureManager->getStructure('excerpt');
$property = new TranslatedProperty(
$structure->getProperty('audience_targeting_groups'),
... | php | {
"resource": ""
} |
q24615 | QueryBuilder.buildTagsWhere | train | private function buildTagsWhere($tags, $operator, $languageCode)
{
$structure = $this->structureManager->getStructure('excerpt');
$sql2Where = [];
if ($structure->hasProperty('tags')) {
$property = new TranslatedProperty(
$structure->getProperty('tags'),
... | php | {
"resource": ""
} |
q24616 | QueryBuilder.buildCategoriesWhere | train | private function buildCategoriesWhere($categories, $operator, $languageCode)
{
$structure = $this->structureManager->getStructure('excerpt');
$sql2Where = [];
if ($structure->hasProperty('categories')) {
$property = new TranslatedProperty(
$structure->getProperty... | php | {
"resource": ""
} |
q24617 | QueryBuilder.buildPageSelector | train | protected function buildPageSelector()
{
$idsWhere = [];
foreach ($this->ids as $id) {
$idsWhere[] = sprintf("page.[jcr:uuid] = | php | {
"resource": ""
} |
q24618 | QueryBuilder.buildPageExclude | train | private function buildPageExclude()
{
$idsWhere = [];
foreach ($this->excluded as $id) {
$idsWhere[] = sprintf("(NOT | php | {
"resource": ""
} |
q24619 | TargetGroupSerializeSubscriber.onPostDeserialize | train | public function onPostDeserialize(ObjectEvent $event)
{
/** @var TargetGroupInterface $targetGroup */
$targetGroup = $event->getObject();
if (!$targetGroup instanceof TargetGroupInterface) {
return;
}
/* @var TargetGroupWebspaceInterface $webspace */
if ... | php | {
"resource": ""
} |
q24620 | FilterListBuilder.handleCreatedExpressions | train | protected function handleCreatedExpressions(array $expressions, $conjunction)
{
$expressionCounter = count($expressions);
switch ($expressionCounter) {
case 0: // no expressions - nothing to do
break;
case 1:
$this->listBuilder->addExpression($... | php | {
"resource": ""
} |
q24621 | FilterListBuilder.createConjunctionExpression | train | protected function createConjunctionExpression(array $expressions, $conjunction)
{
// create the appropriate expression
if (ListBuilderInterface::CONJUNCTION_AND === | php | {
"resource": ""
} |
q24622 | FilterListBuilder.createExpression | train | protected function createExpression(Condition $condition, $fieldDescriptor)
{
$value = $this->getValue($condition);
// relative date for cases like "within a week" or "within this month"
if ('between' === $condition->getOperator() && DataTypes::DATETIME_TYPE === $condition->getType()) {
... | php | {
"resource": ""
} |
q24623 | FilterListBuilder.getValue | train | protected function getValue(Condition $condition)
{
$value = $condition->getValue();
$type = $condition->getType();
switch ($type) {
case DataTypes::UNDEFINED_TYPE:
case DataTypes::STRING_TYPE:
case DataTypes::TAGS_TYPE:
case DataTypes::AUTO_C... | php | {
"resource": ""
} |
q24624 | RoleSettingRepository.findSettingValue | train | public function findSettingValue($roleId, $key)
{
$queryBuilder = $this->createQueryBuilder('s')
->select('s.value')
->join('s.role', 'r')
->where('r.id = :roleId')
->andWhere('s.key = :key')
->setParameters(['roleId' => $roleId, 'key' => $key]);
| php | {
"resource": ""
} |
q24625 | RoleSettingRepository.findSetting | train | public function findSetting($roleId, $key)
{
$queryBuilder = $this->createQueryBuilder('s')
->join('s.role', 'r')
->where('r.id = :roleId')
->andWhere('s.key = :key')
->setParameters(['roleId' => $roleId, 'key' => $key]);
| php | {
"resource": ""
} |
q24626 | GeolocatorManager.get | train | public function get($name)
{
if (!isset($this->geolocators[$name])) {
throw new GeolocatorNotFoundException(
sprintf(
'Attempt to retrieve unknown geolocator "%s"',
| php | {
"resource": ""
} |
q24627 | ContactController.cgetAction | train | public function cgetAction(Request $request)
{
$serializationGroups = [];
$locale = $this->getLocale($request);
if ('true' == $request->get('flat')) {
$list = $this->getList($request, $locale);
} else {
if (true == $request->get('bySystem')) {
... | php | {
"resource": ""
} |
q24628 | ContactController.getList | train | private function getList(Request $request, $locale)
{
/** @var RestHelperInterface $restHelper */
$restHelper = $this->getRestHelper();
/** @var DoctrineListBuilderFactory $factory */
$factory = $this->get('sulu_core.doctrine_list_builder_factory');
$listBuilder = $factory-... | php | {
"resource": ""
} |
q24629 | ContactController.prepareListResponse | train | private function prepareListResponse(DoctrineListBuilder $listBuilder, $locale)
{
$listResponse = $listBuilder->execute();
$listResponse = $this->addAvatars($listResponse, $locale);
$ids = $listBuilder->getIds();
if (null !== $ids) {
$comparator = $this->getComparator();... | php | {
"resource": ""
} |
q24630 | ContactController.deleteAction | train | public function deleteAction($id)
{
try {
$deleteCallback = $this->getContactManager()->delete();
$view = $this->responseDelete($id, $deleteCallback);
} catch (EntityNotFoundException $e) {
| php | {
"resource": ""
} |
q24631 | ContactController.getAction | train | public function getAction($id)
{
$contactManager = $this->getContactManager();
$locale = $this->getUser()->getLocale();
try {
$view = $this->responseGetById(
$id,
function($id) use ($contactManager, $locale) {
return $contactMa... | php | {
"resource": ""
} |
q24632 | ContactController.postAction | train | public function postAction(Request $request)
{
try {
$this->checkArguments($request);
$contact = $this->getContactManager()->save(
$request->request->all()
);
$apiContact = $this->getContactManager()->getContact(
$contact,
... | php | {
"resource": ""
} |
q24633 | ContactController.getContactsByUserSystem | train | protected function getContactsByUserSystem()
{
$repo = $this->get('sulu_security.user_repository');
$users = $repo->findUserBySystem($this->getParameter('sulu_security.system'));
$contacts = [];
| php | {
"resource": ""
} |
q24634 | ContactController.addAvatars | train | private function addAvatars($contacts, $locale)
{
$ids = array_filter(array_column($contacts, 'avatar'));
$avatars = $this->get('sulu_media.media_manager')->getFormatUrls($ids, $locale);
foreach ($contacts as $key => $contact) {
if (array_key_exists('avatar', $contact)
... | php | {
"resource": ""
} |
q24635 | DoctrineInExpression.filterNullValues | train | protected function filterNullValues(array $values)
{
$result = array_filter(
$values,
| php | {
"resource": ""
} |
q24636 | AudienceTargetingCacheListener.setTargetGroupHeader | train | private function setTargetGroupHeader(Request $request, CacheInvalidation $kernel)
{
$hadValidTargetGroup = true;
$visitorTargetGroup = $request->cookies->get(static::TARGET_GROUP_COOKIE);
$visitorSession = $request->cookies->get(static::VISITOR_SESSION_COOKIE);
if (null === $visito... | php | {
"resource": ""
} |
q24637 | AudienceTargetingCacheListener.requestTargetGroup | train | private function requestTargetGroup(Request $request, CacheInvalidation $kernel, int $currentTargetGroup = null)
{
$targetGroupRequest = Request::create(
static::TARGET_GROUP_URL,
Request::METHOD_GET,
[],
[],
[],
$request->server->all()... | php | {
"resource": ""
} |
q24638 | AudienceTargetingCacheListener.setTargetGroupCookie | train | private function setTargetGroupCookie(Response $response, Request $request)
{
$response->headers->setCookie(
new Cookie(
static::TARGET_GROUP_COOKIE,
$request->headers->get(static::TARGET_GROUP_HEADER),
static::TARGET_GROUP_COOKIE_LIFETIME
... | php | {
"resource": ""
} |
q24639 | FallbackLocalizationSubscriber.getAvailableLocalization | train | public function getAvailableLocalization(StructureBehavior $document, $locale)
{
$availableLocales = $this->inspector->getLocales($document);
if (in_array($locale, $availableLocales)) {
return $locale;
}
$fallbackLocale = null;
if ($document instanceof Webspace... | php | {
"resource": ""
} |
q24640 | UserBlameSubscriber.loadClassMetadata | train | public function loadClassMetadata(LoadClassMetadataEventArgs $event)
{
$metadata = $event->getClassMetadata();
$reflection = $metadata->getReflectionClass();
if (null !== $reflection && $reflection->implementsInterface('Sulu\Component\Persistence\Model\UserBlameInterface')) {
if... | php | {
"resource": ""
} |
q24641 | TeaserManager.sortTeasers | train | private function sortTeasers(array $teasers, array $result, array $positions, array $items)
{
foreach ($teasers as $teaser) {
$index = $positions[sprintf('%s;%s', $teaser->getType(), $teaser->getId())];
$result[$index] = $teaser;
$item = $items[$index];
| php | {
"resource": ""
} |
q24642 | TeaserManager.sortItems | train | private function sortItems($items)
{
$ids = [];
$positions = [];
$index = 0;
foreach ($items as $item) {
if (!array_key_exists($item['type'], $ids)) {
$ids[$item['type']] = [];
}
| php | {
"resource": ""
} |
q24643 | ItemMetadata.getChild | train | public function getChild($name)
{
if (!isset($this->children[$name])) {
throw new \InvalidArgumentException(sprintf(
'Unknown child "%s" in structure "%s" loaded from: "%s". Children: "%s"',
| php | {
"resource": ""
} |
q24644 | ItemMetadata.addChild | train | public function addChild(self $child)
{
if (isset($this->children[$child->name])) {
throw new \InvalidArgumentException(sprintf(
'Child with key "%s" already exists',
| php | {
"resource": ""
} |
q24645 | ItemMetadata.getParameter | train | public function getParameter($name)
{
if (!isset($this->parameters[$name])) {
throw new \InvalidArgumentException(sprintf(
'Unknown parameter "%s", known parameters: "%s"',
| php | {
"resource": ""
} |
q24646 | ItemMetadata.getTag | train | public function getTag($tagName)
{
foreach ($this->tags as $tag) {
if ($tag['name'] === $tagName) {
return $tag;
}
| php | {
"resource": ""
} |
q24647 | SecuritySubscriber.handlePersist | train | public function handlePersist(PersistEvent $event)
{
/** @var SecurityBehavior $document */
$document = $event->getDocument();
if (!$this->supports($document) || !$document->getPermissions()) {
| php | {
"resource": ""
} |
q24648 | SecuritySubscriber.handleHydrate | train | public function handleHydrate(HydrateEvent $event)
{
$document = $event->getDocument();
$node = $event->getNode();
if (!$this->supports($document)) {
return;
}
$permissions = [];
foreach ($node->getProperties('sec:*') as $property) {
| php | {
"resource": ""
} |
q24649 | SecuritySubscriber.getAllowedPermissions | train | private function getAllowedPermissions($permissions)
{
$allowedPermissions = [];
foreach ($permissions as $permission => $allowed) {
if ($allowed) {
| php | {
"resource": ""
} |
q24650 | AbstractFilingSubscriber.createNode | train | private function createNode(NodeInterface $node, $pathSegment, $uuid)
{
if ($node->hasNode($pathSegment)) {
return $node->getNode($pathSegment);
}
| php | {
"resource": ""
} |
q24651 | AnalyticsController.cgetAction | train | public function cgetAction(Request $request, $webspace)
{
$entities = $this->get('sulu_website.analytics.manager')->findAll($webspace);
$list = new RouteAwareRepresentation(
new CollectionRepresentation($entities, self::RESULT_KEY),
'cget_webspace_analytics',
| php | {
"resource": ""
} |
q24652 | AnalyticsController.getAction | train | public function getAction($webspace, $id)
{
$entity = $this->get('sulu_website.analytics.manager')->find($id);
| php | {
"resource": ""
} |
q24653 | AnalyticsController.postAction | train | public function postAction(Request $request, $webspace)
{
$data = $request->request->all();
$data['content'] = $this->buildContent($data);
$entity = $this->get('sulu_website.analytics.manager')->create($webspace, $data);
| php | {
"resource": ""
} |
q24654 | AnalyticsController.putAction | train | public function putAction(Request $request, $webspace, $id)
{
$data = $request->request->all();
$data['content'] = $this->buildContent($data);
$entity = $this->get('sulu_website.analytics.manager')->update($id, $data);
| php | {
"resource": ""
} |
q24655 | AnalyticsController.deleteAction | train | public function deleteAction($webspace, $id)
{
$this->get('sulu_website.analytics.manager')->remove($id);
$this->get('doctrine.orm.entity_manager')->flush();
| php | {
"resource": ""
} |
q24656 | AnalyticsController.cdeleteAction | train | public function cdeleteAction(Request $request, $webspace)
{
$ids = array_filter(explode(',', $request->get('ids', '')));
$this->get('sulu_website.analytics.manager')->removeMultiple($ids);
| php | {
"resource": ""
} |
q24657 | LoadOperators.getTypeForString | train | protected function getTypeForString($type)
{
switch ($type) {
case 'string':
return DataTypes::STRING_TYPE;
case 'number':
return DataTypes::NUMBER_TYPE;
case 'date':
case 'datetime':
return DataTypes::DATETIME_T... | php | {
"resource": ""
} |
q24658 | NodeNameSlugifier.slugify | train | public function slugify($text)
{
$text = $this->slugifier->slugify($text);
// jackrabbit can not handle node-names which contains a number followed by "e" e.g. 10e
| php | {
"resource": ""
} |
q24659 | TagController.getAction | train | public function getAction($id)
{
$view = $this->responseGetById(
$id,
function($id) {
return $this->getManager()->findById($id);
}
);
$context = new Context();
| php | {
"resource": ""
} |
q24660 | TagController.cgetAction | train | public function cgetAction(Request $request)
{
if ('true' == $request->get('flat')) {
/** @var RestHelperInterface $restHelper */
$restHelper = $this->get('sulu_core.doctrine_rest_helper');
/** @var DoctrineListBuilderFactory $factory */
$factory = $this->get... | php | {
"resource": ""
} |
q24661 | TagController.postAction | train | public function postAction(Request $request)
{
$name = $request->get('name');
try {
if (null == $name) {
throw new MissingArgumentException(self::$entityName, 'name');
}
$tag = $this->getManager()->save($this->getData($request));
$co... | php | {
"resource": ""
} |
q24662 | TagController.deleteAction | train | public function deleteAction($id)
{
$delete = function($id) {
try {
$this->getManager()->delete($id);
} catch (TagNotFoundException $tnfe) | php | {
"resource": ""
} |
q24663 | TagController.postMergeAction | train | public function postMergeAction(Request $request)
{
try {
$srcTagIds = explode(',', $request->get('src'));
$destTagId = $request->get('dest');
$destTag = $this->getManager()->merge($srcTagIds, $destTagId);
$view = $this->view(
null,
... | php | {
"resource": ""
} |
q24664 | StructureSubscriber.addStructureProperties | train | private function addStructureProperties(
StructureMetadata $structureMetadata,
StructureBehavior $document,
VisitorInterface $visitor
) {
/** @var ManagedStructure $structure */
$structure = $document->getStructure();
$data = $structure->toArray();
foreach ($s... | php | {
"resource": ""
} |
q24665 | StructureSubscriber.addBreadcrumb | train | private function addBreadcrumb(StructureBehavior $document, VisitorInterface $visitor)
{
$items = [];
$parentDocument = $this->inspector->getParent($document);
while ($parentDocument instanceof StructureBehavior) {
$item = [];
if ($parentDocument instanceof UuidBehavi... | php | {
"resource": ""
} |
q24666 | Version201512090753.upgradeNode | train | private function upgradeNode(NodeInterface $node)
{
foreach ($node->getProperties('i18n:-*') as $property) {
| php | {
"resource": ""
} |
q24667 | StructureProvider.getMetadataForObject | train | public function getMetadataForObject($object)
{
if (!$object instanceof StructureBehavior) {
return;
}
$documentMetadata = $this->metadataFactory->getMetadataForClass(get_class($object));
$structure = $this->structureFactory->getStructureMetadata(
| php | {
"resource": ""
} |
q24668 | RouteProvider.findRouteByPath | train | private function findRouteByPath($path, $locale)
{
$path = '/' . ltrim($path, '/');
if (!array_key_exists($path, $this->routeCache)) | php | {
"resource": ""
} |
q24669 | RouteProvider.createRoute | train | protected function createRoute(RouteInterface $route, Request $request)
{
$routePath = $this->decodePathInfo($request->getPathInfo());
if ($route->isHistory()) {
return new Route(
$routePath,
[
'_controller' => 'SuluWebsiteBundle:Redir... | php | {
"resource": ""
} |
q24670 | RouteProvider.stripFormatExtension | train | private function stripFormatExtension($path, $format)
{
$extension = '.' . $format;
if (substr($path, -strlen($extension)) === $extension) {
$path = | php | {
"resource": ""
} |
q24671 | CategoryTwigExtension.getCategoriesFunction | train | public function getCategoriesFunction($locale, $parentKey = null)
{
return $this->memoizeCache->memoizeById(
'sulu_categories',
func_get_args(),
function($locale, $parentKey = null) {
$entities = $this->categoryManager->findChildrenByParentKey($parentKey);... | php | {
"resource": ""
} |
q24672 | Version201511240843.findDateProperties | train | private function findDateProperties(StructureMetadata $structureMetadata, array &$properties)
{
$structureName = $structureMetadata->getName();
foreach ($structureMetadata->getProperties() as $property) {
if ('date' === $property->getType()) {
$properties[$structureName][... | php | {
"resource": ""
} |
q24673 | Version201511240843.findDateBlockProperties | train | private function findDateBlockProperties(BlockMetadata $property, $structureName, array &$properties)
{
$result = ['property' => $property, 'components' => []];
foreach ($property->getComponents() as $component) {
$componentResult = ['component' => $component, 'children' => []];
... | php | {
"resource": ""
} |
q24674 | Version201511240843.iterateStructureNodes | train | private function iterateStructureNodes(StructureMetadata $structureMetadata, array $properties, $up)
{
foreach ($this->localizationManager->getLocalizations() as $localization) {
$rows = $this->session->getWorkspace()->getQueryManager()->createQuery(
sprintf(
... | php | {
"resource": ""
} |
q24675 | Version201511240843.upgradeBlockProperty | train | private function upgradeBlockProperty(
BlockMetadata $blockProperty,
array $components,
NodeInterface $node,
$locale,
$up
) {
$componentNames = array_map(
function($item) {
return $item['component']->getName();
},
$c... | php | {
"resource": ""
} |
q24676 | Version201511240843.upgradeProperty | train | private function upgradeProperty(PropertyMetadata $property, NodeInterface $node, $locale, $up)
{
$name = sprintf('i18n:%s-%s', $locale, $property->getName());
if (!$node->hasProperty($name)) {
return;
}
$value = $node->getPropertyValue($name);
| php | {
"resource": ""
} |
q24677 | Version201511240843.upgradeDate | train | private function upgradeDate(&$value)
{
if ($value instanceof \DateTime) {
| php | {
"resource": ""
} |
q24678 | OperatorValueTranslation.setOperatorValue | train | public function setOperatorValue(\Sulu\Bundle\ResourceBundle\Entity\OperatorValue $operatorValue)
{
| php | {
"resource": ""
} |
q24679 | ImagineImageConverter.applyTransformations | train | private function applyTransformations(ImageInterface $image, $tansformations)
{
foreach ($tansformations as $transformation) {
if (!isset($transformation['effect'])) {
throw new ImageProxyInvalidFormatOptionsException('Effect not found');
}
$image = $this-... | php | {
"resource": ""
} |
q24680 | ImagineImageConverter.applyFormatCrop | train | private function applyFormatCrop(ImageInterface $image, array $cropParameters)
{
return $this->modifyAllLayers(
$image,
function(ImageInterface $layer) use ($cropParameters) {
return $this->cropper->crop(
$layer,
$cropParameters... | php | {
"resource": ""
} |
q24681 | ImagineImageConverter.applyFocus | train | private function applyFocus(ImageInterface $image, FileVersion $fileVersion, array $scale)
{
return $this->modifyAllLayers(
$image,
function(ImageInterface $layer) use ($fileVersion, $scale) {
return $this->focus->focus(
$layer,
... | php | {
"resource": ""
} |
q24682 | ImagineImageConverter.applyScale | train | private function applyScale(ImageInterface $image, $scale)
{
return $this->modifyAllLayers(
$image,
function(ImageInterface $layer) use ($scale) {
return $this->scaler->scale(
$layer,
$scale['x'],
$scale['y']... | php | {
"resource": ""
} |
q24683 | ImagineImageConverter.toRGB | train | private function toRGB(ImageInterface $image)
{
if ('cmyk' == $image->palette()->name()) {
| php | {
"resource": ""
} |
q24684 | ImagineImageConverter.getCropParameters | train | private function getCropParameters(ImageInterface $image, $formatOptions, array $format)
{
if (isset($formatOptions)) {
$parameters = [
'x' => $formatOptions->getCropX(),
'y' => $formatOptions->getCropY(),
'width' => $formatOptions->getCropWidth(),... | php | {
"resource": ""
} |
q24685 | ImagineImageConverter.modifyAllLayers | train | private function modifyAllLayers(ImageInterface $image, callable $modifier)
{
if (count($image->layers())) {
$countLayer = 0;
$image->layers()->coalesce();
/** @var ImageInterface $temporaryImage */
$temporaryImage = null;
foreach ($image->layers(... | php | {
"resource": ""
} |
q24686 | ImagineImageConverter.getFormat | train | private function getFormat($formatKey)
{
if (!isset($this->formats[$formatKey])) {
throw new ImageProxyInvalidImageFormat('Format was not | php | {
"resource": ""
} |
q24687 | AnalyticsRepository.findByWebspaceKey | train | public function findByWebspaceKey($webspaceKey)
{
$queryBuilder = $this->createQueryBuilder('a')
->addSelect('domains')
->leftJoin('a.domains', 'domains')
->where('a.webspaceKey = :webspaceKey')
->andWhere('a.allDomains = TRUE OR domains.environment = :environ... | php | {
"resource": ""
} |
q24688 | AnalyticsRepository.findById | train | public function findById($id)
{
$queryBuilder = $this->createQueryBuilder('a')
->addSelect('domains')
->leftJoin('a.domains', 'domains')
->where('a.id = :id'); | php | {
"resource": ""
} |
q24689 | WorkflowStageSubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
/** @var RedirectTypeBehavior $document */
$document = $event->getObject();
if (!$document instanceof WorkflowStageBehavior) {
return;
}
| php | {
"resource": ""
} |
q24690 | Teaser.merge | train | public function merge(array $item)
{
$this->title = $this->getValue('title', $item, $this->getTitle());
$this->description = $this->getValue('description', $item, $this->getDescription());
$this->moreText = $this->getValue('moreText', $item, $this->getMoreText());
| php | {
"resource": ""
} |
q24691 | SerializerEventListener.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
/** @var Content $content */
$content = $event->getObject();
/** @var JsonSerializationVisitor $visitor */
$visitor = $event->getVisitor();
if (!($content instanceof Content)) {
return;
}
fore... | php | {
"resource": ""
} |
q24692 | LocalizationProvider.parse | train | private function parse($locale)
{
$parts = explode('_', $locale);
$localization = new Localization();
$localization->setLanguage($parts[0]);
if | php | {
"resource": ""
} |
q24693 | ContentRepository.generateTreeByPath | train | private function generateTreeByPath(array $contents, $uuid)
{
$childrenByPath = [];
foreach ($contents as $content) {
$path = PathHelper::getParentPath($content->getPath());
if (!isset($childrenByPath[$path])) {
$childrenByPath[$path] = [];
}
... | php | {
"resource": ""
} |
q24694 | ContentRepository.resolvePathByUuid | train | private function resolvePathByUuid($uuid)
{
$queryBuilder = new QueryBuilder($this->qomFactory);
$queryBuilder
->select('node', 'jcr:uuid', 'uuid')
->from($this->qomFactory->selector('node', 'nt:unstructured'))
->where(
$this->qomFactory->comparis... | php | {
"resource": ""
} |
q24695 | ContentRepository.resolveQueryBuilder | train | private function resolveQueryBuilder(
QueryBuilder $queryBuilder,
$locale,
$locales,
MappingInterface $mapping,
UserInterface $user = null
) {
return array_values(
array_filter(
| php | {
"resource": ""
} |
q24696 | ContentRepository.getQueryBuilder | train | private function getQueryBuilder($locale, $locales, UserInterface $user = null)
{
$queryBuilder = new QueryBuilder($this->qomFactory);
$queryBuilder
->select('node', 'jcr:uuid', 'uuid')
->addSelect('node', $this->getPropertyName('nodeType', $locale), 'nodeType')
... | php | {
"resource": ""
} |
q24697 | ContentRepository.getLocalesByWebspaceKey | train | private function getLocalesByWebspaceKey($webspaceKey)
{
$webspace = $this->webspaceManager->findWebspaceByKey($webspaceKey);
return array_map(
function(Localization $localization) {
| php | {
"resource": ""
} |
q24698 | ContentRepository.getLocalesByPortalKey | train | private function getLocalesByPortalKey($portalKey)
{
$portal = $this->webspaceManager->findPortalByKey($portalKey);
return array_map(
function(Localization $localization) {
| php | {
"resource": ""
} |
q24699 | ContentRepository.appendMapping | train | private function appendMapping(QueryBuilder $queryBuilder, MappingInterface $mapping, $locale, $locales)
{
if ($mapping->onlyPublished()) {
$queryBuilder->andWhere(
$this->qomFactory->comparison(
$this->qomFactory->propertyValue(
'node'... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.