_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24300 | Plugin.onPostDependenciesSolving | train | public function onPostDependenciesSolving(Installer\InstallerEvent $ev)
{
if ($this->disabled) {
return;
| php | {
"resource": ""
} |
q24301 | FrontMatterParser.extractContent | train | public function extractContent($content)
{
$regex = '~^('
. '---' // $matches[1] start separator
. "){1}[\r\n|\n]*(.*?)[\r\n|\n]+(" // $matches[2] front matter
. '---' // $matches[3] end separator
... | php | {
"resource": ""
} |
q24302 | Demojibakefier.dropVariants | train | private function dropVariants(&$Arr)
{
if (isset($Arr['GB18030'], $Arr['GB2312'])) {
unset($Arr['GB2312']);
}
if (isset($Arr['UCS-2']) && (isset($Arr['UTF-16BE']) || isset($Arr['UTF-16LE']))) {
unset($Arr['UCS-2']);
}
if (isset($Arr['UCS-4']) && (isset... | php | {
"resource": ""
} |
q24303 | Demojibakefier.normalise | train | public function normalise($String)
{
$this->Last = '';
$this->Len = strlen($String);
/** Potential valid candidates will be populated here. */
$Valid = [];
/** Suppress errors (because every failed normalisation attempt will generate errors and fill logs otherwise). */
... | php | {
"resource": ""
} |
q24304 | Demojibakefier.guard | train | public function guard($String)
{
return !function_exists('iconv') || $this->checkConformity($String, | php | {
"resource": ""
} |
q24305 | Cache.getEntry | train | public function getEntry($Entry)
{
if ($this->Using === 'APCu') {
return $this->unserializeEntry(apcu_fetch($Entry));
}
if ($this->Using === 'Memcached' || $this->Using === 'Redis') {
return $this->unserializeEntry($this->WorkingData->get($Entry));
}
i... | php | {
"resource": ""
} |
q24306 | Cache.setEntry | train | public function setEntry($Key, $Value, $TTL = 3600)
{
$Value = $this->serializeEntry($Value);
if ($this->Using === 'APCu') {
if (apcu_store($Key, $Value, $TTL)) {
return $this->Modified = true;
}
return false;
}
if ($this->Using ===... | php | {
"resource": ""
} |
q24307 | Cache.deleteEntry | train | public function deleteEntry($Entry)
{
if ($this->Using === 'APCu') {
if (apcu_delete($Entry)) {
return $this->Modified = true;
}
return false;
}
if ($this->Using === 'Memcached' || $this->Using === 'Redis') {
if ($this->WorkingD... | php | {
"resource": ""
} |
q24308 | Cache.clearCache | train | public function clearCache()
{
if ($this->Using === 'APCu') {
return $this->Modified = apcu_clear_cache();
}
if ($this->Using === 'Memcached') {
return ($this->WorkingData->flush() && ($this->Modified = true));
}
if ($this->Using === 'Redis') {
... | php | {
"resource": ""
} |
q24309 | Cache.clearExpiredPDO | train | public function clearExpiredPDO()
{
if ($this->Using !== 'PDO') {
return false;
}
$PDO = $this->WorkingData->prepare(self::clearExpiredQuery);
if | php | {
"resource": ""
} |
q24310 | Cache.unserializeEntry | train | public function unserializeEntry($Entry)
{
if (!$Entry || !is_string($Entry) || !preg_match('~^a\:\d+\:\{.*\}$~', $Entry)) {
return $Entry;
}
$Arr = unserialize($Entry);
| php | {
"resource": ""
} |
q24311 | ComplexStringHandler.generateMarkers | train | public function generateMarkers($Pattern)
{
preg_match_all($Pattern, $this->Input, $this->Markers, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
$Start = 0;
$this->Working = [];
foreach ($this->Markers as $Marker) {
| php | {
"resource": ""
} |
q24312 | ComplexStringHandler.iterateClosure | train | public function iterateClosure($Closure, $Glue = false)
{
if (!is_callable($Closure) || empty($this->Input)) {
return;
}
if (!$Glue) {
foreach ($this->Working as &$Segment) {
| php | {
"resource": ""
} |
q24313 | ComplexStringHandler.recompile | train | public function recompile()
{
$Output = '';
$Glue = 0;
foreach ($this->Working as $Segment) {
$Output .= $Segment;
| php | {
"resource": ""
} |
q24314 | L10N.getPlural | train | public function getPlural($Number, $String)
{
if (isset($this->Data[$String])) {
$Choices = $this->Data[$String];
$IntegerRule = $this->IntegerRule;
$FractionRule = $this->FractionRule;
} elseif (isset($this->Fallback[$String])) {
$Choices = $this->Fal... | php | {
"resource": ""
} |
q24315 | L10N.getString | train | public function getString($String)
{
if (isset($this->Data[$String])) {
return $this->Data[$String];
} | php | {
"resource": ""
} |
q24316 | YAML.normaliseValue | train | private function normaliseValue(&$Value, $ValueLen, $ValueLow)
{
foreach ([
['"', '"', 1],
["'", "'", 1],
['`', '`', 1],
["\x91", "\x92", 1],
["\x93", "\x94", 1],
["\xe2\x80\x98", "\xe2\x80\x99", 3],
["\xe2\x80\x9c", "\xe2\x... | php | {
"resource": ""
} |
q24317 | CompressionHandler.TryX | train | private function TryX($Using)
{
/** Guard. */
if (!function_exists($Using)) {
/** Missing prerequisite. */
return 1;
}
/** Try to decompress. */
$Try = $Using($this->Data);
/** Success. */ | php | {
"resource": ""
} |
q24318 | CompressionHandler.TryEverything | train | public function TryEverything()
{
/** Fetch original data state. */
$Original = $this->Data;
/** For tracking errors. */
$Errors = &$this->Errors;
/**
* Seeing as we're effectively guessing which compression format has
* been used, and possibly it mightn't... | php | {
"resource": ""
} |
q24319 | ZipHandler.EntryCRC | train | public function EntryCRC()
{
return (isset($this->StatIndex['crc']) | php | {
"resource": ""
} |
q24320 | TarHandler.EntryIsDirectory | train | public function EntryIsDirectory()
{
$Name = $this->EntryName();
return ((substr($Name, -1, | php | {
"resource": ""
} |
q24321 | ParentSubscriber.mapParent | train | private function mapParent($document, NodeInterface $node, $options = [])
{
// TODO: performance warning: We are eagerly fetching the parent node
$targetNode = $node->getParent();
| php | {
"resource": ""
} |
q24322 | MediaSearchSubscriber.getImageUrl | train | private function getImageUrl($media, $locale)
{
$mediaApi = new Media($media, $locale);
$this->mediaManager->addFormatsAndUrl($mediaApi);
$formats = $mediaApi->getThumbnails();
if (!isset($formats[$this->searchImageFormat])) {
$this->logger->warning(sprintf(
... | php | {
"resource": ""
} |
q24323 | Document.removeSystemFields | train | public function removeSystemFields()
{
$properties = $this->fields;
unset(
$properties['created'],
$properties['changed'],
$properties['changer'],
$properties['changer_id'],
| php | {
"resource": ""
} |
q24324 | NodeManager.find | train | public function find($identifier)
{
try {
if (UUIDHelper::isUUID($identifier)) {
return $this->session->getNodeByIdentifier($identifier);
}
return $this->session->getNode($identifier);
} catch (RepositoryException $e) {
| php | {
"resource": ""
} |
q24325 | NodeManager.has | train | public function has($identifier)
{
$this->normalizeToPath($identifier);
try {
| php | {
"resource": ""
} |
q24326 | NodeManager.remove | train | public function remove($identifier)
{
$identifier = $this->normalizeToPath($identifier);
| php | {
"resource": ""
} |
q24327 | NodeManager.createPath | train | public function createPath($path)
{
$current = $this->session->getRootNode();
$segments = preg_split('#/#', $path, null, PREG_SPLIT_NO_EMPTY);
foreach ($segments as $segment) {
if ($current->hasNode($segment)) {
| php | {
"resource": ""
} |
q24328 | NodeManager.normalizeToPath | train | private function normalizeToPath($identifier)
{
if (UUIDHelper::isUUID($identifier)) { | php | {
"resource": ""
} |
q24329 | KeywordManager.handleOverwrite | train | private function handleOverwrite(KeywordInterface $keyword, CategoryInterface $category)
{
if (null !== $synonym = $this->findSynonym($keyword)) {
// reset entity and remove it from category
if ($this->entityManager->contains($keyword)) {
$this->entityManager->refresh... | php | {
"resource": ""
} |
q24330 | KeywordManager.handleDetach | train | private function handleDetach(KeywordInterface $keyword, CategoryInterface $category)
{
$keywordString = $keyword->getKeyword();
$keywordLocale = $keyword->getLocale();
// if keyword wont be deleted (because of multiple references)
// refresh it to be sure hat changes wont be writte... | php | {
"resource": ""
} |
q24331 | KeywordManager.findSynonym | train | private function findSynonym(KeywordInterface $keyword)
{
return | php | {
"resource": ""
} |
q24332 | KeywordManager.createTranslation | train | private function createTranslation(CategoryInterface $category, $locale)
{
$categoryTranslation = $this->categoryTranslationRepository->createNew();
$categoryTranslation->setLocale($locale);
$categoryTranslation->setTranslation('');
$categoryTranslation->setCategory($category); | php | {
"resource": ""
} |
q24333 | DispositionTypeTwigExtension.getMediaUrl | train | public function getMediaUrl(Media $media, $dispositionType = null)
{
$url = $media->getUrl();
if (ResponseHeaderBag::DISPOSITION_INLINE === $dispositionType) {
$url .= (false === strpos($url, '?') ? '?inline=1' : '&inline=1'); | php | {
"resource": ""
} |
q24334 | Url.isValidLocale | train | public function isValidLocale($language, $country)
{
return ($this->getLanguage() === $language && $this->getCountry() === $country)
| php | {
"resource": ""
} |
q24335 | TimestampSubscriber.setTimestampsOnDocument | train | public function setTimestampsOnDocument(HydrateEvent $event)
{
$document = $event->getDocument();
if (!$this->supports($document)) {
return;
}
$accessor = $event->getAccessor();
$node = $event->getNode();
$locale = $this->documentInspector->getOriginalLoc... | php | {
"resource": ""
} |
q24336 | TimestampSubscriber.setTimestampsOnNodeForPersist | train | public function setTimestampsOnNodeForPersist(PersistEvent $event)
{
$document = $event->getDocument();
if (!$this->supports($document)) {
return;
}
$this->setTimestampsOnNode(
$document,
| php | {
"resource": ""
} |
q24337 | TimestampSubscriber.setTimestampsOnNode | train | public function setTimestampsOnNode(
LocalizedTimestampBehavior $document,
NodeInterface $node,
DocumentAccessor $accessor,
$locale,
$timestamp = null
) {
if (!$document instanceof TimestampBehavior && !$locale) {
return;
}
$encoding = $th... | php | {
"resource": ""
} |
q24338 | TimestampSubscriber.setChangedForRestore | train | public function setChangedForRestore(RestoreEvent $event)
{
$document = $event->getDocument();
if (!$this->supports($document)) {
return;
}
$encoding = $this->getPropertyEncoding($document);
$event->getNode()->setProperty(
$this->propertyEncoder->enc... | php | {
"resource": ""
} |
q24339 | LegacyPropertyFactory.createTranslatedProperty | train | public function createTranslatedProperty($property, $locale, StructureInterface $structure = null)
{
if ($property instanceof ItemMetadata) {
$property = $this->createProperty($property, $structure);
}
$property = new TranslatedProperty(
| php | {
"resource": ""
} |
q24340 | LegacyPropertyFactory.createProperty | train | public function createProperty(ItemMetadata $property, StructureInterface $structure = null)
{
if ($property instanceof SectionMetadata) {
return $this->createSectionProperty($property, $structure);
}
if ($property instanceof BlockMetadata) {
return $this->createBloc... | php | {
"resource": ""
} |
q24341 | ChildrenSubscriber.onPostSerialize | train | public function onPostSerialize(ObjectEvent $event)
{
$document = $event->getObject();
if (!$document instanceof ChildrenBehavior || !$this->documentRegistry->hasDocument($document)) {
return;
}
$visitor = | php | {
"resource": ""
} |
q24342 | Import.getParser | train | protected function getParser($format)
{
if (!isset($this->formatFilePaths[$format])) { | php | {
"resource": ""
} |
q24343 | Import.importProperty | train | protected function importProperty(
PropertyInterface $property,
NodeInterface $node,
StructureInterface $structure,
$value,
$webspaceKey,
$locale,
$format
) {
$contentType = $property->getContentTypeName();
if (!$this->importManager->hasImport... | php | {
"resource": ""
} |
q24344 | BaseDataProvider.decorateResourceItems | train | protected function decorateResourceItems(array $data, $locale)
{
return array_map(
function($item) {
$itemData = $this->serializer->serialize($item, 'array', $this->getSerializationContext());
$id = $this->getIdForItem($item);
| php | {
"resource": ""
} |
q24345 | UrlType.addUrl | train | public function addUrl(\Sulu\Bundle\ContactBundle\Entity\Url $urls)
{
| php | {
"resource": ""
} |
q24346 | UrlType.removeUrl | train | public function removeUrl(\Sulu\Bundle\ContactBundle\Entity\Url $urls)
{
| php | {
"resource": ""
} |
q24347 | StructureSubscriber.indexDocumentAfterRemoveDraft | train | public function indexDocumentAfterRemoveDraft(RemoveDraftEvent $event)
{
$document = $event->getDocument();
if ($document instanceof WorkflowStageBehavior) {
// Set the workflowstage to test for indexing, because the wrong index will be updated otherwise
$document->setWorkfl... | php | {
"resource": ""
} |
q24348 | StructureSubscriber.indexDocument | train | private function indexDocument($document)
{
if (!$document instanceof StructureBehavior) {
return;
}
if ($document | php | {
"resource": ""
} |
q24349 | StructureSubscriber.deindexRemovedDocument | train | public function deindexRemovedDocument(RemoveEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof StructureBehavior) {
return;
}
if (!$document instanceof WorkflowStageBehavior) {
$this->searchManager->deindex($document);
} el... | php | {
"resource": ""
} |
q24350 | StructureSubscriber.deindexUnpublishedDocument | train | public function deindexUnpublishedDocument(UnpublishEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof StructureBehavior) {
| php | {
"resource": ""
} |
q24351 | RedirectController.redirectWebspaceAction | train | public function redirectWebspaceAction(Request $request)
{
@trigger_error(__METHOD__ . '() is deprecated since version 1.6 and will be removed in 2.0. Replaced by ExceptionListener::redirectPartialMatch.', E_USER_DEPRECATED);
$url = $this->resolveRedirectUrl(
$request->get('redirect'),
... | php | {
"resource": ""
} |
q24352 | RedirectController.redirectToRouteAction | train | public function redirectToRouteAction(Request $request, $route, $permanent = false)
{
if ('' === $route) {
throw new HttpException($permanent ? 410 : 404);
}
$attributes = array_merge($request->attributes->get('_route_params'), $request->query->all());
| php | {
"resource": ""
} |
q24353 | CollectionManager.setBreadcrumbToCollection | train | protected function setBreadcrumbToCollection(Collection $collection, $locale, $breadcrumbEntities)
{
$breadcrumbApiEntities = [];
foreach ($breadcrumbEntities as $entity) {
$breadcrumbApiEntities[] = | php | {
"resource": ""
} |
q24354 | CollectionManager.getApiEntity | train | protected function getApiEntity(CollectionInterface $entity, $locale, $entities = null, $breadcrumbEntities = null)
{
$apiEntity = new Collection($entity, $locale);
$children = null;
if (null !== $entities) {
$children = [];
foreach ($entities as $possibleChild) {
... | php | {
"resource": ""
} |
q24355 | CollectionManager.getCurrentUser | train | protected function getCurrentUser()
{
if ($this->tokenStorage && ($token = $this->tokenStorage->getToken())) {
| php | {
"resource": ""
} |
q24356 | XmlUtil.getValueFromXPath | train | public static function getValueFromXPath($path, \DOMXPath $xpath, \DomNode $context = null, $default = null)
{
$result = $xpath->query($path, $context);
if (0 === $result->length) {
return $default;
| php | {
"resource": ""
} |
q24357 | XmlUtil.getBooleanValueFromXPath | train | public static function getBooleanValueFromXPath($path, \DOMXPath $xpath, \DomNode $context = null, $default = null)
{
$value = self::getValueFromXPath($path, $xpath, $context, $default);
if (null | php | {
"resource": ""
} |
q24358 | SeoTwigExtension.renderSeoTags | train | public function renderSeoTags(
\Twig_Environment $twig,
array $seoExtension,
array $content,
array $urls,
$shadowBaseLocale
) {
$template = 'SuluWebsiteBundle:Extension:seo.html.twig';
@trigger_error(sprintf(
'This twig extension is deprecated and... | php | {
"resource": ""
} |
q24359 | Scaler.getHeightWidth | train | private function getHeightWidth($x, $y, $retina, $forceRatio, $size, $mode)
{
$newWidth = $x;
$newHeight = $y;
// retina x2
if ($retina) {
$newWidth = $x * 2;
$newHeight = $y * 2;
}
// calculate height when not set
if (!$newHeight) {
... | php | {
"resource": ""
} |
q24360 | CustomUrlRequestProcessor.matchCustomUrl | train | private function matchCustomUrl($url, PortalInformation $portalInformation, Request $request)
{
$webspace = $portalInformation->getWebspace();
$routeDocument = $this->customUrlManager->findRouteByUrl(
rawurldecode($url),
$webspace->getKey()
);
if (!$routeDocu... | php | {
"resource": ""
} |
q24361 | FormatManager.checkMimeTypeSupported | train | private function checkMimeTypeSupported($mimeType)
{
foreach ($this->supportedMimeTypes as $supportedMimeType) {
if (fnmatch($supportedMimeType, $mimeType)) {
| php | {
"resource": ""
} |
q24362 | ContactLocale.setContact | train | public function setContact(\Sulu\Bundle\ContactBundle\Entity\ContactInterface $contact)
{
| php | {
"resource": ""
} |
q24363 | Email.setEmailType | train | public function setEmailType(\Sulu\Bundle\ContactBundle\Entity\EmailType $emailType)
{
| php | {
"resource": ""
} |
q24364 | RegistratorSubscriber.handleDefaultLocale | train | public function handleDefaultLocale(HydrateEvent $event)
{
// set the default locale
if (null === $event->getLocale()) {
| php | {
"resource": ""
} |
q24365 | RegistratorSubscriber.handleDocumentFromRegistry | train | public function handleDocumentFromRegistry(HydrateEvent $event)
{
if ($event->hasDocument()) {
return;
}
$node = $event->getNode();
if (!$this->documentRegistry->hasNode($node, $event->getLocale())) {
return;
}
$document = $this->documentRegi... | php | {
"resource": ""
} |
q24366 | RegistratorSubscriber.handleStopPropagationAndResetLocale | train | public function handleStopPropagationAndResetLocale(HydrateEvent $event)
{
if (!$event->hasDocument()) {
return;
}
$locale = $event->getLocale();
$document = $event->getDocument();
$options = $event->getOptions();
$originalLocale = $this->documentRegistry... | php | {
"resource": ""
} |
q24367 | RegistratorSubscriber.handleNodeFromRegistry | train | public function handleNodeFromRegistry($event)
{
if ($event->hasNode()) {
return;
}
$document = $event->getDocument();
| php | {
"resource": ""
} |
q24368 | RegistratorSubscriber.handleRemove | train | public function handleRemove(RemoveEvent $event)
{
$document = $event->getDocument();
| php | {
"resource": ""
} |
q24369 | RegistratorSubscriber.handleRegister | train | private function handleRegister(AbstractMappingEvent $event)
{
$node = $event->getNode();
$locale = $event->getLocale();
if (!$this->documentRegistry->hasNode($node, $locale)) {
| php | {
"resource": ""
} |
q24370 | BlockProperty.doSetValue | train | public function doSetValue($value)
{
$items = $value;
if ($value instanceof PropertyValue) {
$items = $value->getValue();
}
if (null == $items) {
return;
}
// check value for single value
if (array_keys($items) !== range(0, count($ite... | php | {
"resource": ""
} |
q24371 | BlockProperty.getValue | train | public function getValue()
{
// if size of children smaller than minimum
if (count($this->properties) < $this->getMinOccurs()) {
for ($i = count($this->properties); $i < $this->getMinOccurs(); ++$i) {
$this->initProperties($i, $this->getDefaultTypeName());
}
... | php | {
"resource": ""
} |
q24372 | PersistenceExtensionTrait.defineRepositories | train | private function defineRepositories(array $objects, ContainerBuilder $container)
{
foreach ($objects as $object => $services) {
if (array_key_exists('model', $services)) {
$repositoryDefinition = $this->getRepositoryDefinition($object, $services, $container);
$co... | php | {
"resource": ""
} |
q24373 | PersistenceExtensionTrait.getRepositoryDefinition | train | private function getRepositoryDefinition($object, array $services, ContainerBuilder $container)
{
$repositoryKey = $this->getContainerKey('repository', $object, '.class');
// default repository
$repositoryClass = 'Sulu\Component\Persistence\Repository\ORM\EntityRepository';
if ($co... | php | {
"resource": ""
} |
q24374 | PersistenceExtensionTrait.remapObjectParameters | train | private function remapObjectParameters(array $objects, ContainerBuilder $container)
{
foreach ($objects as $object => $services) {
foreach ($services as $service => $class) {
$container->setParameter(
sprintf(
'sulu.%s.%s.class',
... | php | {
"resource": ""
} |
q24375 | Localization.createFromString | train | public static function createFromString($locale, $format = self::UNDERSCORE)
{
$delimiter = '-';
if (in_array($format, [self::UNDERSCORE, self::LCID])) {
$delimiter = '_';
}
$parts = explode($delimiter, $locale);
$localization = new self();
| php | {
"resource": ""
} |
q24376 | Localization.getLocalization | train | public function getLocalization($delimiter = '_')
{
@trigger_error(__METHOD__ . '() is deprecated since version 1.2 and will be removed in 2.0. Use getLocale() instead.', E_USER_DEPRECATED);
$localization = $this->getLanguage();
| php | {
"resource": ""
} |
q24377 | Localization.getLocale | train | public function getLocale($format = self::UNDERSCORE)
{
$localization = strtolower($this->getLanguage());
if (null != $this->getCountry()) {
$country = strtolower($this->getCountry());
$delimiter = '-';
switch ($format) {
case self::UNDERSCORE:
... | php | {
"resource": ""
} |
q24378 | TextEditor.validate | train | private function validate($content, $locale)
{
$validation = $this->markupParser->validate($content, $locale);
$regex = sprintf(self::INVALID_REGEX, $this->markupNamespace, $this->markupNamespace);
foreach ($validation as $tag => $state) {
if (false === strpos($tag, 'sulu-valida... | php | {
"resource": ""
} |
q24379 | ListToTreeConverter.convert | train | public function convert($data)
{
if (empty($data)) {
return [];
}
$map = [];
$minDepth = 99;
foreach ($data as $item) {
$path = rtrim('/root' . $item['path'], '/');
$map[$path] = $item;
$parts = explode('/', $path);
... | php | {
"resource": ""
} |
q24380 | ListToTreeConverter.explodeTree | train | private function explodeTree($array, $delimiter = '_', $baseval = false)
{
if (!is_array($array)) {
return false;
}
$splitRE = '/' . preg_quote($delimiter, '/') . '/';
$returnArr = [];
foreach ($array as $key => $val) {
// Get parent parts and the curr... | php | {
"resource": ""
} |
q24381 | RemoveSubscriber.handleRemove | train | public function handleRemove(RemoveEvent $event)
{
$document = $event->getDocument();
$node | php | {
"resource": ""
} |
q24382 | WebspaceCopyCommand.clearDestinationWebspace | train | protected function clearDestinationWebspace()
{
$homeDocument = $this->documentManager->find(
$this->sessionManager->getContentPath($this->webspaceKeyDestination)
| php | {
"resource": ""
} |
q24383 | WebspaceCopyCommand.updateBlocksStructure | train | protected function updateBlocksStructure(
array &$structureArray,
BlockMetadata $property,
$localeSource,
$localeDestination
) {
if (!array_key_exists($property->getName(), $structureArray) || !$structureArray[$property->getName()]) {
return;
}
fo... | php | {
"resource": ""
} |
q24384 | WebspaceCopyCommand.updateSmartContentStructure | train | protected function updateSmartContentStructure(
array &$structureArray,
PropertyMetadata $property,
$localeSource,
$localeDestination
) {
/** @var PropertyParameter $parameter */
foreach ($property->getParameters() as $parameter) {
if (!array_key_exists($p... | php | {
"resource": ""
} |
q24385 | WebspaceCopyCommand.updatePageSelection | train | protected function updatePageSelection(
array &$structureArray,
PropertyMetadata $property,
$localeSource,
$localeDestination
) {
if (!array_key_exists($property->getName(), $structureArray) || !$structureArray[$property->getName()]) {
return;
}
f... | php | {
"resource": ""
} |
q24386 | WebspaceCopyCommand.updateSinglePageSelection | train | protected function updateSinglePageSelection(
array &$structureArray,
PropertyMetadata $property,
$localeSource,
$localeDestination
) {
if (!array_key_exists($property->getName(), $structureArray) || !$structureArray[$property->getName()]) {
| php | {
"resource": ""
} |
q24387 | PositionController.getAction | train | public function getAction($id)
{
$view = $this->responseGetById(
$id,
function($id) {
return $this->getDoctrine()
->getRepository(self::$entityName)
| php | {
"resource": ""
} |
q24388 | PositionController.cgetAction | train | public function cgetAction()
{
$list = new CollectionRepresentation(
$this->getDoctrine()->getRepository(self::$entityName)->findBy([], ['position' => 'ASC']),
self::$entityKey
| php | {
"resource": ""
} |
q24389 | PositionController.postAction | train | public function postAction(Request $request)
{
$name = $request->get('position');
try {
if (null == $name) {
throw new RestException(
'There is no position-name for the given name'
);
}
$em = $this->getDoctrine... | php | {
"resource": ""
} |
q24390 | FormatCacheClearer.clear | train | public function clear($cache = null)
{
if (null !== $cache) {
if (!array_key_exists($cache, $this->caches)) {
throw new CacheNotFoundException($cache);
}
$this->caches[$cache]->clear();
| php | {
"resource": ""
} |
q24391 | ConditionGroup.getConditions | train | public function getConditions()
{
$conditions = $this->entity->getConditions();
$result = [];
if ($conditions) {
foreach ($conditions as $condition) {
$result[] = | php | {
"resource": ""
} |
q24392 | DoctrineConcatenationFieldDescriptor.getSelect | train | public function getSelect()
{
$concat = null;
foreach ($this->fieldDescriptors as $fieldDescriptor) {
if (null == $concat) {
$concat = $fieldDescriptor->getSelect();
} else {
| php | {
"resource": ""
} |
q24393 | DoctrineConcatenationFieldDescriptor.getJoins | train | public function getJoins()
{
$joins = [];
foreach ($this->fieldDescriptors as $fieldDescriptor) {
$joins = array_merge($joins, | php | {
"resource": ""
} |
q24394 | CacheController.clearAction | train | public function clearAction()
{
if (!$this->checkLivePermissionForAllWebspaces()) {
return new JsonResponse(null, 403);
}
| php | {
"resource": ""
} |
q24395 | CacheController.checkLivePermissionForAllWebspaces | train | private function checkLivePermissionForAllWebspaces()
{
foreach ($this->get('sulu_core.webspace.webspace_manager')->getWebspaceCollection() as $webspace) {
$context = PageAdmin::SECURITY_CONTEXT_PREFIX . $webspace->getKey();
| php | {
"resource": ""
} |
q24396 | Analytics.addDomain | train | public function addDomain(Domain $domain)
{
if ($this->domains->contains($domain)) {
return $this;
| php | {
"resource": ""
} |
q24397 | Analytics.getDomains | train | public function getDomains()
{
if (0 === count($this->domains)) {
return null;
}
| php | {
"resource": ""
} |
q24398 | ShadowLocaleSubscriber.handleHydrate | train | public function handleHydrate(AbstractMappingEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof ShadowLocaleBehavior || !$event->getOption('load_shadow_content')) {
return;
}
$node = $event->getNode();
$locale = $this->inspector->getOri... | php | {
"resource": ""
} |
q24399 | ShadowLocaleSubscriber.handlePersistUpdateUrl | train | public function handlePersistUpdateUrl(PersistEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof ShadowLocaleBehavior) {
return;
}
if (!$document->isShadowLocaleEnabled()) {
return;
}
$node = $event->getNode();
... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.