_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q25100 | CustomerManager.findContactsByIds | train | private function findContactsByIds($ids)
{
if (0 === count($ids)) {
return [];
}
$queryBuilder = $this->entityManager->createQueryBuilder()
->select('CONCAT(\'c\', c.id) AS | php | {
"resource": ""
} |
q25101 | MediaFormatController.cgetAction | train | public function cgetAction($id, Request $request)
{
$formatOptions = $this->getFormatOptionsManager()->getAll($id);
| php | {
"resource": ""
} |
q25102 | MediaFormatController.putAction | train | public function putAction($id, $key, Request $request)
{
$options = $request->request->all();
if (empty($options)) {
$this->getFormatOptionsManager()->delete($id, $key);
} else {
$this->getFormatOptionsManager()->save($id, $key, $options);
}
| php | {
"resource": ""
} |
q25103 | XmlSitemapDumper.dumpProviderSitemap | train | private function dumpProviderSitemap($alias, PortalInformation $portalInformation, $scheme)
{
$maxPage = $this->sitemapProviderPool->getProvider($alias)->getMaxPage();
for ($page = 1; $page <= $maxPage; ++$page) {
$sitemap = $this->sitemapRenderer->renderSitemap(
$alias,
... | php | {
"resource": ""
} |
q25104 | StructureRemoveSubscriber.removeRoute | train | private function removeRoute(StructureBehavior $document)
{
foreach ($this->documentInspector->getReferrers($document) as $referrer) {
if ($referrer instanceof | php | {
"resource": ""
} |
q25105 | Content.getPropertyWithDefault | train | public function getPropertyWithDefault($name, $default = null)
{
if (!array_key_exists($name, $this->data)) | php | {
"resource": ""
} |
q25106 | RelationTrait.compareEntitiesWithData | train | public function compareEntitiesWithData(
$entities,
array $requestEntities,
callable $compare,
callable $add = null,
callable $update = null,
callable $delete = null
) {
// define a matching | php | {
"resource": ""
} |
q25107 | RelationTrait.compareData | train | public function compareData(
$entities,
array $requestEntities,
callable $compare = null,
callable $add = null,
callable $update = null,
callable $delete = null
) {
$success = true;
if (!empty($entities)) {
foreach ($entities as $entity) {... | php | {
"resource": ""
} |
q25108 | FaxType.removeFaxe | train | public function removeFaxe(\Sulu\Bundle\ContactBundle\Entity\Fax $faxes)
{
| php | {
"resource": ""
} |
q25109 | AddressType.removeAddresse | train | public function removeAddresse(\Sulu\Bundle\ContactBundle\Entity\Address $addresses)
{
| php | {
"resource": ""
} |
q25110 | TitleSubscriber.setTitleOnDocument | train | public function setTitleOnDocument(AbstractMappingEvent $event)
{
$document = $event->getDocument();
if (!$this->supports($document)) {
return;
}
if ($document instanceof LocalizedTitleBehavior) {
if (!$event->getLocale()) {
return;
... | php | {
"resource": ""
} |
q25111 | TitleSubscriber.setTitleOnNode | train | public function setTitleOnNode(AbstractMappingEvent $event)
{
$document = $event->getDocument();
if (!$this->supports($document)) {
return;
}
if ($document instanceof LocalizedTitleBehavior) {
if (!$event->getLocale()) {
| php | {
"resource": ""
} |
q25112 | ListRestHelper.getRepository | train | public function getRepository($entityName)
{
return new ListRepository($this->em, | php | {
"resource": ""
} |
q25113 | ListRestHelper.find | train | public function find($entityName, $where = [], $joinConditions = [])
{
| php | {
"resource": ""
} |
q25114 | ListRestHelper.getSorting | train | public function getSorting()
{
$sortOrder = $this->getRequest()->get('sortOrder', 'asc');
| php | {
"resource": ""
} |
q25115 | ListRestHelper.getOffset | train | public function getOffset()
{
$page = $this->getRequest()->get('page', 1);
$limit = $this->getRequest()->get('limit');
| php | {
"resource": ""
} |
q25116 | ListRestHelper.getTotalPages | train | public function getTotalPages($totalNumber = null)
{
if (is_null($totalNumber)) {
$totalNumber = $this->totalNumberOfElements;
} | php | {
"resource": ""
} |
q25117 | SuluSecurityListener.onKernelController | train | public function onKernelController(FilterControllerEvent $event)
{
$controllerDefinition = $event->getController();
$controller = $controllerDefinition[0];
if (
!$controller instanceof SecuredControllerInterface &&
!$controller instanceof SecuredObjectControllerInter... | php | {
"resource": ""
} |
q25118 | Generator.localizeDomain | train | protected function localizeDomain($domain, Localization $locale)
{
if (!$this->urlReplacer->hasLocalizationReplacer($domain)
&& !$this->urlReplacer->hasLanguageReplacer($domain)
) {
$domain = $this->urlReplacer->appendLocalizationReplacer($domain);
| php | {
"resource": ""
} |
q25119 | PathBuilder.build | train | public function build(array $segments)
{
$results = [];
foreach ($segments as $segment) {
$result = $this->buildSegment($segment);
if (null === $result) {
continue;
| php | {
"resource": ""
} |
q25120 | SuluResourceExtension.createOrGetFolder | train | private function createOrGetFolder($directory, ContainerBuilder $container)
{
$filesystem = new Filesystem();
$directory = $container->getParameterBag()->resolveValue($directory);
| php | {
"resource": ""
} |
q25121 | SuluResourceExtension.setDefaultForFilterConditionsConjunction | train | private function setDefaultForFilterConditionsConjunction(&$config)
{
if (!array_key_exists('filters', $config) ||
!array_key_exists('conjunctions', $config['filters']) ||
0 === count($config['filters']['conjunctions'])
) {
$config['filters'] = [];
$co... | php | {
"resource": ""
} |
q25122 | ManagedExtensionContainer.offsetGet | train | public function offsetGet($extensionName)
{
if (isset($this->data[$extensionName])) {
return $this->data[$extensionName];
}
$extension = $this->extensionManager->getExtension($this->structureType, $extensionName);
// TODO: should not pass namespace here.
// ... | php | {
"resource": ""
} |
q25123 | WebsiteSearchController.queryAction | train | public function queryAction(Request $request)
{
$query = $this->getRequestParameter($request, 'q', true);
$locale = $this->requestAnalyzer->getCurrentLocalization()->getLocale();
$webspace = $this->requestAnalyzer->getWebspace();
$queryString = '';
if (strlen($query) < 3) {... | php | {
"resource": ""
} |
q25124 | NavigationItem.copyChildless | train | public function copyChildless()
{
$new = $this->copyWithName();
$new->setAction($this->getAction());
$new->setMainRoute($this->getMainRoute());
$new->setChildRoutes($this->getChildRoutes());
$new->setEvent($this->getEvent());
$new->setEventArguments($this->getEventArg... | php | {
"resource": ""
} |
q25125 | NavigationItem.find | train | public function find($navigationItem)
{
$stack = [$this];
while (!empty($stack)) {
/** @var NavigationItem $item */
$item = array_pop($stack);
if ($item->equalsChildless($navigationItem)) {
return $item;
| php | {
"resource": ""
} |
q25126 | NavigationItem.findChildren | train | public function findChildren(self $navigationItem)
{
foreach ($this->getChildren() as $child) {
/** @var NavigationItem $child */
| php | {
"resource": ""
} |
q25127 | NavigationItem.merge | train | public function merge(self $other = null)
{
// Create new item
$new = $this->copyChildless();
// Add all children from this item
foreach ($this->getChildren() as $child) {
/* @var NavigationItem $child */
$new->addChild($child->merge((null != $other) ? $other... | php | {
"resource": ""
} |
q25128 | NavigationItem.toArray | train | public function toArray()
{
$array = [
'title' => $this->getName(),
'label' => $this->getLabel(),
'icon' => $this->getIcon(),
'action' => $this->getAction(),
'mainRoute' => $this->getMainRoute(),
'event' => $this->getEvent(),
... | php | {
"resource": ""
} |
q25129 | MultipleTranslatedProperties.setLanguage | train | public function setLanguage($languageKey)
{
$this->translatedProperties = [];
foreach ($this->properties as $key => $property) {
| php | {
"resource": ""
} |
q25130 | MultipleTranslatedProperties.getName | train | public function getName($key)
{
// templates do not translate the template key
if (Structure::TYPE_SNIPPET === $this->structureType) {
if ('template' === $key) {
| php | {
"resource": ""
} |
q25131 | ProfileController.putLanguageAction | train | public function putLanguageAction(Request $request)
{
$user = $this->tokenStorage->getToken()->getUser();
$user->setLocale($request->get('locale'));
$this->objectManager->flush();
| php | {
"resource": ""
} |
q25132 | ProfileController.patchSettingsAction | train | public function patchSettingsAction(Request $request)
{
$settings = $request->request->all();
try {
$user = $this->tokenStorage->getToken()->getUser();
foreach ($settings as $settingKey => $settingValue) {
// get setting
// TODO: move this lo... | php | {
"resource": ""
} |
q25133 | ProfileController.deleteSettingsAction | train | public function deleteSettingsAction(Request $request)
{
$key = $request->get('key');
try {
if (!$key) {
throw new MissingArgumentException(static::$entityNameUserSetting, 'key');
}
$user = $this->tokenStorage->getToken()->getUser();
... | php | {
"resource": ""
} |
q25134 | TargetGroupSubscriber.setTargetGroup | train | public function setTargetGroup(GetResponseEvent $event)
{
$request = $event->getRequest();
if ($targetGroupId = $request->headers->get($this->targetGroupHeader)) {
$this->targetGroupStore->setTargetGroupId($targetGroupId);
} elseif ($targetGroupId = $request->cookies->get($this-... | php | {
"resource": ""
} |
q25135 | TargetGroupSubscriber.addVaryHeader | train | public function addVaryHeader(FilterResponseEvent $event)
{
$request = $event->getRequest();
$response = $event->getResponse();
| php | {
"resource": ""
} |
q25136 | TargetGroupSubscriber.addSetCookieHeader | train | public function addSetCookieHeader(FilterResponseEvent $event)
{
if (!$this->targetGroupStore->hasChangedTargetGroup()
|| $event->getRequest()->getPathInfo() === $this->targetGroupUrl
) {
return;
}
$response = $event->getResponse();
$response->header... | php | {
"resource": ""
} |
q25137 | TargetGroupSubscriber.addTargetGroupHitScript | train | public function addTargetGroupHitScript(FilterResponseEvent $event)
{
$request = $event->getRequest();
$response = $event->getResponse();
if ($this->preview
|| 0 !== strpos($response->headers->get('Content-Type'), 'text/html')
|| Request::METHOD_GET !== $request->get... | php | {
"resource": ""
} |
q25138 | AdminPool.getNavigation | train | public function getNavigation()
{
/** @var Navigation $navigation */
$navigation = null;
$this->iterateAdmins(function(Admin $admin) use (&$navigation) {
if (null === $navigation) {
$navigation = | php | {
"resource": ""
} |
q25139 | AdminPool.getSecurityContexts | train | public function getSecurityContexts()
{
$contexts = [];
$this->iterateAdmins(function(Admin $admin) use (&$contexts) {
$contexts = | php | {
"resource": ""
} |
q25140 | ArrayUtils.filter | train | public static function filter(array $collection, $expression, array $context = [])
{
$language = new ExpressionLanguage();
$result = [];
foreach ($collection as $key => $item) {
| php | {
"resource": ""
} |
q25141 | WebsiteController.renderStructure | train | protected function renderStructure(
StructureInterface $structure,
$attributes = [],
$preview = false,
$partial = false
) {
// extract format twig file
if (!$preview) {
$request = $this->getRequest();
$requestFormat = $request->getRequestFormat... | php | {
"resource": ""
} |
q25142 | WebsiteController.getAttributes | train | protected function getAttributes($attributes, StructureInterface $structure = null, $preview = false)
{
return $this->get('sulu_website.resolver.parameter')->resolve(
$attributes,
| php | {
"resource": ""
} |
q25143 | WebsiteController.renderBlock | train | protected function renderBlock($template, $block, $attributes = [])
{
$twig = $this->get('twig');
$attributes = $twig->mergeGlobals($attributes);
/** @var \Twig_Template $template */
$template = $twig->loadTemplate($template);
| php | {
"resource": ""
} |
q25144 | Collection.addChild | train | public function addChild(self $child)
{
if (!is_array($this->children)) { | php | {
"resource": ""
} |
q25145 | TreeLeafEditStrategy.adaptResourceLocators | train | private function adaptResourceLocators(ResourceSegmentBehavior $document, $userId)
{
if (!$document instanceof ChildrenBehavior) {
return;
}
$webspaceKey = $this->documentInspector->getWebspace($document);
$languageCode = $this->documentInspector->getOriginalLocale($docu... | php | {
"resource": ""
} |
q25146 | RestController.replaceOrAddUrlString | train | public function replaceOrAddUrlString($url, $key, $value, $add = true)
{
if ($value) {
if ($pos = strpos($url, $key)) {
return preg_replace('/(.*' . $key . ')([\,|\w]*)(\&*.*)/', '${1}' . $value . '${3}', $url);
} else {
if ($add) {
... | php | {
"resource": ""
} |
q25147 | RestController.responseGetById | train | protected function responseGetById($id, $findCallback)
{
$entity = $findCallback($id);
if (!$entity) {
$exception = new EntityNotFoundException(self::$entityName, $id);
// Return a 404 together with an error message, given by the exception, if the entity is not found
... | php | {
"resource": ""
} |
q25148 | RestController.responseDelete | train | public function responseDelete($id, $deleteCallback)
{
try {
$deleteCallback($id);
$view = $this->view(null, 204);
| php | {
"resource": ""
} |
q25149 | MarkupListener.replaceMarkup | train | public function replaceMarkup(FilterResponseEvent $event)
{
$request = $event->getRequest();
$response = $event->getResponse();
$format = $request->getRequestFormat();
$content = $response->getContent();
if (!$content || !array_key_exists($format, $this->markupParser)) {
... | php | {
"resource": ""
} |
q25150 | Contact.getLocales | train | public function getLocales()
{
$entities = [];
if ($this->entity->getLocales()) {
foreach ($this->entity->getLocales() as $locale) {
| php | {
"resource": ""
} |
q25151 | Contact.getAvatar | train | public function getAvatar()
{
if ($this->avatar) {
return [
'id' => $this->avatar->getId(),
| php | {
"resource": ""
} |
q25152 | Contact.getAccount | train | public function getAccount()
{
$mainAccount = $this->entity->getMainAccount();
if (!is_null($mainAccount)) {
| php | {
"resource": ""
} |
q25153 | Contact.getAddresses | train | public function getAddresses()
{
$contactAddresses = $this->entity->getContactAddresses();
$addresses = [];
if (!is_null($contactAddresses)) {
/** @var ContactAddressEntity $contactAddress */
foreach ($contactAddresses as $contactAddress) {
$address = | php | {
"resource": ""
} |
q25154 | Contact.getMedias | train | public function getMedias()
{
$entities = [];
if ($this->entity->getMedias()) {
foreach ($this->entity->getMedias() as $media) {
| php | {
"resource": ""
} |
q25155 | MediaRepository.extractFilterVars | train | private function extractFilterVars(array $filter)
{
$collection = array_key_exists('collection', $filter) ? $filter['collection'] : null;
$systemCollections = array_key_exists('systemCollections', $filter) ? $filter['systemCollections'] : true;
$types = array_key_exists('types', $filter) ? $... | php | {
"resource": ""
} |
q25156 | MediaRepository.findMediaWithFilenameInCollectionWithId | train | public function findMediaWithFilenameInCollectionWithId($filename, $collectionId)
{
$queryBuilder = $this->createQueryBuilder('media')
->innerJoin('media.files', 'files')
->innerJoin('files.fileVersions', 'versions', 'WITH', 'versions.version = files.version')
->join('med... | php | {
"resource": ""
} |
q25157 | MediaRepository.getIdsQuery | train | private function getIdsQuery(
$collection = null,
$systemCollections = true,
$types = null,
$search = null,
$orderBy = null,
$orderSort = null,
$limit = null,
$offset = null,
$select = 'media.id'
) {
$queryBuilder = $this->createQueryBu... | php | {
"resource": ""
} |
q25158 | MediaRepository.getIds | train | private function getIds(
$collection = null,
$systemCollections = true,
$types = null,
$search = null,
$orderBy = null,
$orderSort = null,
$limit = null,
$offset = null
) {
$subQuery = $this->getIdsQuery(
$collection,
$s... | php | {
"resource": ""
} |
q25159 | ValidateWebspacesCommand.outputWebspace | train | private function outputWebspace(Webspace $webspace)
{
$this->output->writeln(
sprintf(
'<info>%s</info> - <info>%s</info>',
$webspace->getKey(),
$webspace->getName()
)
| php | {
"resource": ""
} |
q25160 | ValidateWebspacesCommand.outputWebspacePageTemplates | train | private function outputWebspacePageTemplates(Webspace $webspace)
{
$this->output->writeln('Page Templates:');
$structures = $this->structureManager->getStructures();
$checkedTemplates = [];
foreach ($webspace->getDefaultTemplates() as $template) {
$checkedTemplates[] =... | php | {
"resource": ""
} |
q25161 | ValidateWebspacesCommand.outputWebspaceLocalizations | train | private function outputWebspaceLocalizations(Webspace $webspace)
{
$this->output->writeln('Localizations:');
foreach ($webspace->getAllLocalizations() as $localization) {
$this->output->writeln(
sprintf(
| php | {
"resource": ""
} |
q25162 | ValidateWebspacesCommand.validatePageTemplate | train | private function validatePageTemplate($type, $template)
{
$status = '<info>ok</info>';
try {
$this->validateStructure($type, $template);
} catch (\Exception $e) {
$status = sprintf('<error>failed: %s</error>', $e->getMessage());
$this->errors[] = $e->getM... | php | {
"resource": ""
} |
q25163 | ValidateWebspacesCommand.validateStructure | train | private function validateStructure($type, $template)
{
$valid = true;
$metadata = $this->structureMetadataFactory->getStructureMetadata($type, $template);
if (!$metadata) {
throw new \RuntimeException(
sprintf(
'Structure meta data not found ... | php | {
"resource": ""
} |
q25164 | ValidateWebspacesCommand.validateTemplate | train | private function validateTemplate($type, $template)
{
$status = '<info>ok</info>';
try {
$this->validateTwigTemplate($template);
} catch (\Exception $e) {
$status = sprintf('<error>failed: %s</error>', $e->getMessage());
$this->errors[] = $e->getMessage()... | php | {
"resource": ""
} |
q25165 | ValidateWebspacesCommand.validateTwigTemplate | train | private function validateTwigTemplate($template)
{
$loader = $this->twig->getLoader();
if (!$loader->exists($template)) {
| php | {
"resource": ""
} |
q25166 | ValidateWebspacesCommand.validateControllerAction | train | private function validateControllerAction($controllerAction)
{
$result = $this->controllerNameConverter->parse($controllerAction);
list($class, $method) = explode('::', $result);
if (!method_exists($class, $method)) {
$reflector = new \ReflectionClass($class);
thro... | php | {
"resource": ""
} |
q25167 | KeywordController.cgetAction | train | public function cgetAction($categoryId, Request $request)
{
/** @var RestHelperInterface $restHelper */
$restHelper = $this->get('sulu_core.doctrine_rest_helper');
/** @var DoctrineListBuilderFactory $factory */
$factory = $this->get('sulu_core.doctrine_list_builder_factory');
... | php | {
"resource": ""
} |
q25168 | KeywordController.postAction | train | public function postAction($categoryId, Request $request)
{
/** @var KeywordInterface $keyword */
$keyword = $this->getKeywordRepository()->createNew();
$category = $this->getCategoryRepository()->findCategoryById($categoryId);
$keyword->setKeyword($request->get('keyword'));
... | php | {
"resource": ""
} |
q25169 | KeywordController.putAction | train | public function putAction($categoryId, $keywordId, Request $request)
{
$keyword = $this->getKeywordRepository()->findById($keywordId);
if (!$keyword) {
return $this->handleView($this->view(null, 404));
}
$force = $request->get('force');
| php | {
"resource": ""
} |
q25170 | ContactTitleController.postAction | train | public function postAction(Request $request)
{
$name = $request->get('title');
try {
if (null == $name) {
throw new RestException(
'There is no title-name for the given title'
);
}
$em = $this->getDoctrine()->g... | php | {
"resource": ""
} |
q25171 | ContactTitleController.putAction | train | public function putAction(Request $request, $id)
{
try {
/** @var ContactTitle $title */
$title = $this->getDoctrine()
->getRepository(self::$entityName)
->find($id);
if (!$title) {
throw new EntityNotFoundException(self::$... | php | {
"resource": ""
} |
q25172 | ContactTitleController.deleteAction | train | public function deleteAction($id)
{
try {
$delete = function($id) {
/* @var ContactTitle $title */
$title = $this->getDoctrine()
->getRepository(self::$entityName)
->find($id);
if (!$title) {
... | php | {
"resource": ""
} |
q25173 | ContactTitleController.cpatchAction | train | public function cpatchAction(Request $request)
{
try {
$data = [];
$i = 0;
while ($item = $request->get($i)) {
if (!isset($item['title'])) {
throw new RestException(
'There is no title-name for the given title'
... | php | {
"resource": ""
} |
q25174 | ContentMapper.getRootRouteNode | train | protected function getRootRouteNode($webspaceKey, $locale, $segment)
{
return $this->documentManager->find(
| php | {
"resource": ""
} |
q25175 | ContentMapper.getFieldData | train | private function getFieldData($field, Row $row, NodeInterface $node, $document, $templateKey, $webspaceKey, $locale)
{
if (isset($field['column'])) {
// normal data from node property
return $row->getValue($field['column']);
} elseif (isset($field['extension'])) {
... | php | {
"resource": ""
} |
q25176 | ContentMapper.getPropertyData | train | private function getPropertyData($document, LegacyProperty $property)
{
| php | {
"resource": ""
} |
q25177 | ContentMapper.getExtensionData | train | private function getExtensionData(
NodeInterface $node,
ExtensionInterface $extension,
$propertyName,
$webspaceKey,
$locale
) {
// extension data: load ones
if (!$this->extensionDataCache->contains($extension->getName())) {
$this->extensionDataCach... | php | {
"resource": ""
} |
q25178 | ContentMapper.loadExtensionData | train | private function loadExtensionData(NodeInterface $node, ExtensionInterface $extension, $webspaceKey, $locale)
{
$extension->setLanguageCode($locale, $this->namespaceRegistry->getPrefix('extension_localized'), '');
$data = $extension->load(
| php | {
"resource": ""
} |
q25179 | SecuritySubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
$document = $event->getObject();
if (!($document instanceof SecurityBehavior
&& $document instanceof LocaleBehavior
&& $document instanceof WebspaceBehavior
&& null !== $this->tokenStorage
&& null ... | php | {
"resource": ""
} |
q25180 | FileVersionPublishLanguage.setFileVersion | train | public function setFileVersion(\Sulu\Bundle\MediaBundle\Entity\FileVersion $fileVersion | php | {
"resource": ""
} |
q25181 | AccountRecoverCommand.findInitialWrongDepthGap | train | private function findInitialWrongDepthGap()
{
// get nodes where difference to parents depth > 1
$qb = $this->accountRepository->createQueryBuilder('c2')
->select('count(c2.id) as results')
->join('c2.parent', 'c1')
| php | {
"resource": ""
} |
q25182 | AccountRecoverCommand.findNodesWithoutParents | train | private function findNodesWithoutParents()
{
// get nodes that have no parent but depth > 0
$qb = $this->accountRepository->createQueryBuilder('c2')
->select('count(c2.id)')
->leftJoin('c2.parent', 'c1')
| php | {
"resource": ""
} |
q25183 | AccountRecoverCommand.fixNodesWithoutParents | train | private function fixNodesWithoutParents()
{
// fix nodes that have no parent but depth > 0
$qb = $this->accountRepository->createQueryBuilder('c2')
->update()
| php | {
"resource": ""
} |
q25184 | ParentSubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
$visitor = $event->getVisitor();
$document = $event->getObject();
if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
| php | {
"resource": ""
} |
q25185 | SessionManager.setNodePropertyForSession | train | private function setNodePropertyForSession(SessionInterface $session, $nodePath, $propertyName, | php | {
"resource": ""
} |
q25186 | FormatOptionsManager.getFileVersionForMedia | train | private function getFileVersionForMedia(MediaInterface $media)
{
/** @var File $file */
$file = $media->getFiles()->get(0);
if (!isset($file)) {
throw new FileVersionNotFoundException($media->getId(), | php | {
"resource": ""
} |
q25187 | FormatOptionsManager.setDataOnEntity | train | private function setDataOnEntity(FormatOptions $formatOptions, array $data)
{
if (!isset($data['cropX']) || !isset($data['cropY']) || !isset($data['cropWidth']) || !isset($data['cropHeight'])) {
| php | {
"resource": ""
} |
q25188 | FormatOptionsManager.entityToArray | train | private function entityToArray(FormatOptions $formatOptions)
{
return [
'cropX' => $formatOptions->getCropX(),
'cropY' => $formatOptions->getCropY(),
| php | {
"resource": ""
} |
q25189 | FormatOptionsManager.purgeMedia | train | private function purgeMedia($mediaId, FileVersion $fileVersion)
{
$this->formatManager->purge(
$mediaId,
$fileVersion->getName(),
| php | {
"resource": ""
} |
q25190 | Version201510210733.findUrlBlockProperties | train | private function findUrlBlockProperties(BlockMetadata $property, $structureName, array &$properties)
{
foreach ($property->getComponents() as $component) {
foreach ($component->getChildren() as $childProperty) {
if ('url' === | php | {
"resource": ""
} |
q25191 | FilterController.getAction | train | public function getAction(Request $request, $id)
{
$locale = $this->getRequestParameter($request, 'locale', true);
$view = $this->responseGetById(
$id,
function($id) use ($locale) {
| php | {
"resource": ""
} |
q25192 | FilterController.cgetAction | train | public function cgetAction(Request $request)
{
try {
// check if context exists and filters are enabled for the given context
$context = $request->get('context');
if (!$this->getManager()->hasContext($context)) {
throw new UnknownContextException($context... | php | {
"resource": ""
} |
q25193 | FilterController.postAction | train | public function postAction(Request $request)
{
try {
$filter = $this->getManager()->save(
$request->request->all(),
$this->getRequestParameter($request, 'locale', true),
$this->getUser()->getId()
);
$view = $this->view($filt... | php | {
"resource": ""
} |
q25194 | FilterController.fieldsAction | train | public function fieldsAction(Request $request)
{
$locale = $this->getRequestParameter($request, 'locale', true);
return $this->handleView(
| php | {
"resource": ""
} |
q25195 | CountryController.getAction | train | public function getAction($id)
{
return $this->handleView(
$this->view(
| php | {
"resource": ""
} |
q25196 | InvalidationSubscriber.invalidateDocumentBeforeUnpublishing | train | public function invalidateDocumentBeforeUnpublishing(UnpublishEvent $event)
{
$document = $event->getDocument();
if ($document instanceof StructureBehavior) {
$this->invalidateDocumentStructure($document);
}
if ($document instanceof ResourceSegmentBehavior
&... | php | {
"resource": ""
} |
q25197 | InvalidationSubscriber.invalidateDocumentBeforeRemoving | train | public function invalidateDocumentBeforeRemoving(RemoveEvent $event)
{
$document = $event->getDocument();
if ($document instanceof StructureBehavior) {
$this->invalidateDocumentStructure($document);
}
if ($document instanceof ResourceSegmentBehavior) {
forea... | php | {
"resource": ""
} |
q25198 | InvalidationSubscriber.invalidateDocumentStructure | train | private function invalidateDocumentStructure($document)
{
if (!$this->cacheManager) {
return;
}
$structureBridge = $this->structureManager->wrapStructure(
$this->documentInspector->getMetadata($document)->getAlias(),
| php | {
"resource": ""
} |
q25199 | InvalidationSubscriber.invalidateDocumentUrls | train | private function invalidateDocumentUrls($document, $locale)
{
if (!$this->cacheManager) {
return;
}
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.