_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24400 | DocumentInspector.getContentPath | train | public function getContentPath(PathBehavior $document)
{
$path = $this->getPath($document);
$webspaceKey = $this->getWebspace($document);
return str_replace(
sprintf(
'/%s/%s/%s',
| php | {
"resource": ""
} |
q24401 | DocumentInspector.getStructureMetadata | train | public function getStructureMetadata(StructureBehavior $document)
{
try {
return $this->structureFactory->getStructureMetadata(
$this->getMetadata($document)->getAlias(),
$document->getStructureType()
| php | {
"resource": ""
} |
q24402 | DocumentInspector.getLocalizationState | train | public function getLocalizationState($document)
{
if ($document instanceof ShadowLocaleBehavior) {
if (true === $document->isShadowLocaleEnabled()) {
return LocalizationState::SHADOW;
}
}
$originalLocale = $document->getOriginalLocale();
| php | {
"resource": ""
} |
q24403 | DocumentInspector.getLocale | train | public function getLocale($document)
{
if ($document instanceof LocaleBehavior) {
return $document->getLocale();
| php | {
"resource": ""
} |
q24404 | DocumentInspector.getLocales | train | public function getLocales($document)
{
$locales = [];
$node = $this->getNode($document);
$prefix = $this->namespaceRegistry->getPrefix('system_localized');
foreach ($node->getProperties() as $property) {
preg_match(
sprintf('/^%s:([a-zA-Z_]*?)-.*/', $pre... | php | {
"resource": ""
} |
q24405 | DocumentInspector.getConcreteLocales | train | public function getConcreteLocales($document)
{
$locales = $this->getLocales($document);
if ($document instanceof ShadowLocaleBehavior) {
$locales = array_diff($locales, | php | {
"resource": ""
} |
q24406 | DocumentInspector.getShadowLocales | train | public function getShadowLocales(ShadowLocaleBehavior $document)
{
$shadowLocales = [];
$locales = $this->getLocales($document);
$node = $this->getNode($document);
foreach ($locales as $locale) {
$shadowEnabledName = $this->encoder->localizedSystemName(
Sh... | php | {
"resource": ""
} |
q24407 | DocumentInspector.getPublishedLocales | train | public function getPublishedLocales(ShadowLocaleBehavior $document)
{
$node = $this->getNode($document);
$locales = $this->getLocales($document);
$publishedLocales = [];
foreach ($locales as $locale) {
| php | {
"resource": ""
} |
q24408 | DocumentInspector.getLocalizedUrlsForPage | train | public function getLocalizedUrlsForPage(BasePageDocument $page)
{
$localizedUrls = [];
$webspaceKey = $this->getWebspace($page);
$webspace = $this->webspaceManager->findWebspaceByKey($webspaceKey);
$node = $this->getNode($page);
$structure = $this->getStructureMetadata($page... | php | {
"resource": ""
} |
q24409 | PageResourcelocatorController.postGenerateAction | train | public function postGenerateAction(Request $request)
{
$parentUuid = $this->getRequestParameter($request, 'parent');
$parts = $this->getRequestParameter($request, 'parts', true);
$templateKey = $this->getRequestParameter($request, 'template', true);
$webspaceKey = $this->getRequestPa... | php | {
"resource": ""
} |
q24410 | PageResourcelocatorController.cgetAction | train | public function cgetAction($id, Request $request)
{
list($webspaceKey, $languageCode) = $this->getWebspaceAndLanguage($request);
$result | php | {
"resource": ""
} |
q24411 | PageResourcelocatorController.cdeleteAction | train | public function cdeleteAction($id, Request $request)
{
list($webspaceKey, $languageCode) = $this->getWebspaceAndLanguage($request);
$path = $this->getRequestParameter($request, 'ids', true); // TODO rename path to id in all function names
| php | {
"resource": ""
} |
q24412 | PageResourcelocatorController.getWebspaceAndLanguage | train | private function getWebspaceAndLanguage(Request $request)
{
$webspaceKey = $this->getRequestParameter($request, 'webspace', true);
| php | {
"resource": ""
} |
q24413 | NavigationMapper.generateNavigation | train | private function generateNavigation(
$contents,
$webspace,
$language,
$flat = false,
$context = null,
$breakOnNotInNavigation = false,
$recursive = true
) {
$result = [];
/** @var StructureInterface $content */
foreach ($contents as $c... | php | {
"resource": ""
} |
q24414 | NavigationMapper.generateChildNavigation | train | private function generateChildNavigation(
StructureInterface $content,
$webspace,
$language,
$flat = false,
$context = null
) {
$children = [];
if (is_array($content->getChildren()) && count($content->getChildren()) > 0) {
$children = $this->genera... | php | {
"resource": ""
} |
q24415 | NavigationMapper.inNavigation | train | public function inNavigation(StructureInterface $content, $context = null)
{
$contexts = $content->getNavContexts();
if (Structure::STATE_PUBLISHED !== $content->getNodeState()) {
// if node state is not published do not show page
return false;
}
| php | {
"resource": ""
} |
q24416 | UserController.getAction | train | public function getAction($id)
{
$find = function($id) {
return $this->getUserManager()->getUserById($id);
};
| php | {
"resource": ""
} |
q24417 | UserController.postAction | train | public function postAction(Request $request)
{
try {
$this->checkArguments($request);
$locale = $this->getRequestParameter($request, 'locale', true);
$data = $request->request->all();
$data['contactId'] = $request->query->get('contactId');
$user = ... | php | {
"resource": ""
} |
q24418 | UserController.putAction | train | public function putAction(Request $request, $id)
{
try {
$this->checkArguments($request);
$locale = $this->getRequestParameter($request, 'locale', true);
$user = $this->getUserManager()->save($request->request->all(), $locale, $id);
$view = $this->view($user, ... | php | {
"resource": ""
} |
q24419 | UserController.deleteAction | train | public function deleteAction($id)
{
$delete = $this->getUserManager()->delete();
$view | php | {
"resource": ""
} |
q24420 | UserController.cgetAction | train | public function cgetAction(Request $request)
{
$view = null;
if ('true' == $request->get('flat')) {
/** @var RestHelperInterface $restHelper */
$restHelper = $this->get('sulu_core.doctrine_rest_helper');
/** @var DoctrineListBuilderFactory $factory */
... | php | {
"resource": ""
} |
q24421 | LocalizationController.cgetAction | train | public function cgetAction()
{
/** @var LocalizationManagerInterface $localizationManager */
$localizationManager = $this->get('sulu.core.localization_manager');
$representation = new CollectionRepresentation(
| php | {
"resource": ""
} |
q24422 | SitemapController.indexAction | train | public function indexAction(Request $request)
{
if (null !== ($response = $this->getDumpedIndexResponse($request))) {
return $response;
}
$sitemap = $this->get('sulu_website.sitemap.xml_renderer')->renderIndex();
if (!$sitemap) {
| php | {
"resource": ""
} |
q24423 | SitemapController.sitemapAction | train | public function sitemapAction($alias)
{
if (!$this->get('sulu_website.sitemap.pool')->hasProvider($alias)) {
return new Response(null, 404);
}
return | php | {
"resource": ""
} |
q24424 | SitemapController.sitemapPaginatedAction | train | public function sitemapPaginatedAction(Request $request, $alias, $page)
{
if (null !== ($response = $this->getDumpedSitemapResponse($request, $alias, $page))) {
return $response;
}
$portal = $request->get('_sulu')->getAttribute('portal');
$localization = $request->get('_... | php | {
"resource": ""
} |
q24425 | SitemapController.setCacheLifetime | train | private function setCacheLifetime(Response $response)
{
$response->headers->set(
SuluHttpCache::HEADER_REVERSE_PROXY_TTL,
| php | {
"resource": ""
} |
q24426 | SitemapController.createBinaryFileResponse | train | private function createBinaryFileResponse($file)
{
$response = new BinaryFileResponse($file); | php | {
"resource": ""
} |
q24427 | DoctrineAccessControlProvider.setPermissions | train | public function setPermissions($type, $identifier, $permissions)
{
foreach ($permissions as $roleId => $rolePermissions) {
$accessControl = $this->accessControlRepository->findByTypeAndIdAndRole($type, $identifier, $roleId);
if ($accessControl) {
$accessControl->setP... | php | {
"resource": ""
} |
q24428 | DoctrineAccessControlProvider.getPermissions | train | public function getPermissions($type, $identifier)
{
$accessControls = $this->accessControlRepository->findByTypeAndId($type, $identifier);
$permissions = [];
foreach ($accessControls as $accessControl) {
| php | {
"resource": ""
} |
q24429 | RoleSettingController.getAction | train | public function getAction($roleId, $key)
{
$settingValue = $this->get('sulu.repository.role_setting')->findSettingValue($roleId, $key);
| php | {
"resource": ""
} |
q24430 | RoleSettingController.putAction | train | public function putAction(Request $request, $roleId, $key)
{
/** @var EntityManagerInterface $entityManager */
$entityManager = $this->get('doctrine.orm.entity_manager');
/** @var RoleSettingRepository $repository */
$repository = $this->get('sulu.repository.role_setting');
| php | {
"resource": ""
} |
q24431 | ChainRouteGenerator.getClassMappingConfiguration | train | protected function getClassMappingConfiguration($className)
{
if (array_key_exists($className, $this->mappings)) {
return [
'className' => $className,
'mapping' => $this->mappings[$className],
];
}
$reflection = new \ReflectionClass($c... | php | {
"resource": ""
} |
q24432 | RoleController.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": ""
} |
q24433 | RoleController.getAction | train | public function getAction($id)
{
$find = function($id) {
/** @var RoleInterface $role */
$role = $this->getRoleRepository()->findRoleById($id);
return $this->convertRole($role);
| php | {
"resource": ""
} |
q24434 | RoleController.postAction | train | public function postAction(Request $request)
{
$name = $request->get('name');
$system = $request->get('system');
try {
if (null === $name) {
throw new InvalidArgumentException('Role', 'name');
}
if (null === $system) {
thro... | php | {
"resource": ""
} |
q24435 | RoleController.putAction | train | public function putAction(Request $request, $id)
{
/** @var RoleInterface $role */
$role = $this->getRoleRepository()->findRoleById($id);
try {
if (!$role) {
throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
} else {
... | php | {
"resource": ""
} |
q24436 | RoleController.deleteAction | train | public function deleteAction($id)
{
$delete = function($id) {
$role = $this->getRoleRepository()->findRoleById($id);
if (!$role) {
throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
}
$em = $this->getDoctrine(... | php | {
"resource": ""
} |
q24437 | RoleController.processPermissions | train | protected function processPermissions(RoleInterface $role, $permissions)
{
/** @var RestHelperInterface $restHelper */
$restHelper = $this->get('sulu_core.doctrine_rest_helper');
$get = function($entity) {
/* @var Permission $entity */
return $entity->getId();
... | php | {
"resource": ""
} |
q24438 | RoleController.addPermission | train | protected function addPermission(RoleInterface $role, $permissionData)
{
$em = $this->getDoctrine()->getManager();
$alreadyContains = false;
if (isset($permissionData['id'])) {
$permission = $em->getRepository(static::ENTITY_NAME_PERMISSION)->find($permissionData['id']);
... | php | {
"resource": ""
} |
q24439 | RoleController.updatePermission | train | private function updatePermission(Permission $permission, $permissionData)
{
$permission->setContext($permissionData['context']);
| php | {
"resource": ""
} |
q24440 | RoleController.convertRole | train | protected function convertRole(RoleInterface $role)
{
$roleData['id'] = $role->getId();
$roleData['name'] = $role->getName();
$roleData['identifier'] = $role->getIdentifier();
$roleData['system'] = $role->getSystem();
$roleData['permissions'] = [];
$permissions = $ro... | php | {
"resource": ""
} |
q24441 | RoleController.setSecurityType | train | private function setSecurityType($role, $securityTypeData)
{
$securityType = $this->getDoctrine()
->getRepository('SuluSecurityBundle:SecurityType')
->findSecurityTypeById($securityTypeData['id']);
if (!$securityType) {
| php | {
"resource": ""
} |
q24442 | ContentQueryBuilder.buildSelectForStructures | train | private function buildSelectForStructures($locale, $structures, &$names)
{
$result = '';
// add node name and url to selector
/** @var StructureInterface $structure */
foreach ($structures as $structure) {
| php | {
"resource": ""
} |
q24443 | ContentQueryBuilder.buildSelectForStructure | train | private function buildSelectForStructure($locale, StructureInterface $structure, &$names)
{
$nodeNameProperty = $structure->getProperty('title');
$result = '';
$name = $this->getTranslatedProperty($nodeNameProperty, $locale)->getName();
if (!in_array($name, $names)) {
$n... | php | {
"resource": ""
} |
q24444 | ContentQueryBuilder.buildSelectorForExcerpt | train | private function buildSelectorForExcerpt($locale, &$additionalFields)
{
$excerptStructure = $this->structureManager->getStructure('excerpt');
$extension = $this->extensionManager->getExtension('', 'excerpt');
foreach ($excerptStructure->getProperties(true) as $property) {
$addit... | php | {
"resource": ""
} |
q24445 | AbstractContactManager.unsetMain | train | public function unsetMain($arrayCollection)
{
if ($arrayCollection && !$arrayCollection->isEmpty()) {
return $arrayCollection->forAll(
function($index, $entry) {
if (true === $entry->getMain()) {
| php | {
"resource": ""
} |
q24446 | AbstractContactManager.setMainForCollection | train | public function setMainForCollection($arrayCollection)
{
if ($arrayCollection && !$arrayCollection->isEmpty() && !$this->hasMain($arrayCollection)) { | php | {
"resource": ""
} |
q24447 | AbstractContactManager.hasMain | train | private function hasMain($arrayCollection, &$mainEntity = null)
{
if ($arrayCollection && !$arrayCollection->isEmpty()) {
return $arrayCollection->exists(
function($index, $entity) {
| php | {
"resource": ""
} |
q24448 | AbstractContactManager.setMainEmail | train | public function setMainEmail($entity)
{
// set main to first entry or to null
if ($entity->getEmails()->isEmpty()) {
| php | {
"resource": ""
} |
q24449 | AbstractContactManager.setMainPhone | train | public function setMainPhone($entity)
{
// set main to first entry or to null
if ($entity->getPhones()->isEmpty()) {
| php | {
"resource": ""
} |
q24450 | AbstractContactManager.setMainFax | train | public function setMainFax($entity)
{
// set main to first entry or to null
if ($entity->getFaxes()->isEmpty()) {
$entity->setMainFax(null);
| php | {
"resource": ""
} |
q24451 | AbstractContactManager.setMainUrl | train | public function setMainUrl($entity)
{
// set main to first entry or to null
if ($entity->getUrls()->isEmpty()) {
$entity->setMainUrl(null);
| php | {
"resource": ""
} |
q24452 | AbstractContactManager.getAccounContact | train | public function getAccounContact(AccountInterface $account, Contact $contact)
{
foreach ($contact->getAccountContacts() as $accountContact) {
| php | {
"resource": ""
} |
q24453 | AbstractContactManager.getMainAccountContact | train | public function getMainAccountContact($contact)
{
foreach ($contact->getAccountContacts() as $accountContact) {
/** @var AccountContact $accountContact */
| php | {
"resource": ""
} |
q24454 | AbstractContactManager.createMainAccountContact | train | public function createMainAccountContact(Contact $contact, AccountInterface $account, $position = null)
{
$accountContact = new AccountContact();
$accountContact->setAccount($account);
$accountContact->setContact($contact);
$accountContact->setMain(true); | php | {
"resource": ""
} |
q24455 | AbstractContactManager.deleteAllRelations | train | public function deleteAllRelations($entity)
{
$this->deleteNotes($entity);
$this->deleteAddresses($entity);
$this->deleteEmails($entity);
$this->deleteFaxes($entity);
| php | {
"resource": ""
} |
q24456 | AbstractContactManager.deleteAddresses | train | public function deleteAddresses($entity)
{
// clear addresses
if ($entity->getAccountAddresses()) {
foreach ($entity->getAccountAddresses() as $accountAddresses) {
| php | {
"resource": ""
} |
q24457 | AbstractContactManager.getDeliveryAddress | train | public function getDeliveryAddress($entity, $force = false)
{
/* @var Address $address */
$conditionCallback = function($address) {
return $address->getDeliveryAddress();
| php | {
"resource": ""
} |
q24458 | AbstractContactManager.contactIsEmployeeOfAccount | train | public function contactIsEmployeeOfAccount($contact, $account)
{
if ($contact->getAccountContacts() && !$contact->getAccountContacts()->isEmpty()) {
foreach ($contact->getAccountContacts() as $accountContact) {
| php | {
"resource": ""
} |
q24459 | AbstractContactManager.getAddresses | train | private function getAddresses($entity)
{
if ($entity instanceof AccountInterface) {
return $entity->getAccountAddresses(); | php | {
"resource": ""
} |
q24460 | AbstractContactManager.getAddressByCondition | train | public function getAddressByCondition($entity, callable $conditionCallback, $force = false)
{
$addresses = $this->getAddresses($entity);
$address = null;
$main = null;
if (!is_null($addresses)) {
/* @var AccountAddress $accountAddress */
foreach ($addresses a... | php | {
"resource": ""
} |
q24461 | AbstractContactManager.addNewContactRelations | train | public function addNewContactRelations($contact, $data)
{
// urls
$urls = $this->getProperty($data, 'urls');
if (!empty($urls)) {
foreach ($urls as $urlData) {
$this->addUrl($contact, $urlData);
}
$this->setMainUrl($contact);
}
... | php | {
"resource": ""
} |
q24462 | AbstractContactManager.processEmails | train | public function processEmails($contact, $emails)
{
$get = function($email) {
/* @var Email $email */
return $email->getId();
};
$delete = function($email) use ($contact) {
return $contact->removeEmail($email);
};
$update = function($emai... | php | {
"resource": ""
} |
q24463 | AbstractContactManager.addEmail | train | protected function addEmail($contact, $emailData)
{
$success = true;
$emailType = $this->em
->getRepository(self::$emailTypeEntityName)
->find($emailData['emailType']['id']);
if (isset($emailData['id'])) {
throw new EntityIdAlreadySetException(self::$ema... | php | {
"resource": ""
} |
q24464 | AbstractContactManager.updateEmail | train | protected function updateEmail(Email $email, $entry)
{
$success = true;
$emailType = $this->em
->getRepository(self::$emailTypeEntityName)
->find($entry['emailType']['id']);
if (!$emailType) {
| php | {
"resource": ""
} |
q24465 | AbstractContactManager.processUrls | train | public function processUrls($contact, $urls)
{
$get = function($url) {
return $url->getId();
};
$delete = function($url) use ($contact) {
return $contact->removeUrl($url);
};
$update = function($url, $matchedEntry) {
return $this->updateU... | php | {
"resource": ""
} |
q24466 | AbstractContactManager.processCategories | train | public function processCategories($contact, $categoryIds)
{
$contact->getCategories()->clear();
if (!$categoryIds) {
return true;
}
foreach ($categoryIds as $categoryId) {
$category = $this->em->getRepository(self::$categoryEntityName)->find($categoryId);
... | php | {
"resource": ""
} |
q24467 | AbstractContactManager.addUrl | train | protected function addUrl($contact, $data)
{
$success = true;
$urlType = $this->em->getRepository(
self::$urlTypeEntityName
)->find($data['urlType']['id']);
if (isset($data['id'])) {
throw new EntityIdAlreadySetException(self::$urlEntityName, $data['id']);
... | php | {
"resource": ""
} |
q24468 | AbstractContactManager.processPhones | train | public function processPhones($contact, $phones)
{
$get = function($phone) {
return $phone->getId();
};
$delete = function($phone) use ($contact) {
return $contact->removePhone($phone);
};
$update = function($phone, $matchedEntry) {
retur... | php | {
"resource": ""
} |
q24469 | AbstractContactManager.addPhone | train | protected function addPhone($contact, $phoneData)
{
$success = true;
$phoneType = $this->em->getRepository(
self::$phoneTypeEntityName
)->find($phoneData['phoneType']['id']);
if (isset($phoneData['id'])) {
throw new EntityIdAlreadySetException(self::$phoneEn... | php | {
"resource": ""
} |
q24470 | AbstractContactManager.updatePhone | train | protected function updatePhone(Phone $phone, $entry)
{
$success = true;
$phoneType = $this->em->getRepository(
self::$phoneTypeEntityName
)->find($entry['phoneType']['id']);
| php | {
"resource": ""
} |
q24471 | AbstractContactManager.getBooleanValue | train | protected function getBooleanValue($value)
{
if (is_string($value)) {
return 'true' === $value ? true : false;
} elseif (is_bool($value)) {
return $value;
| php | {
"resource": ""
} |
q24472 | AbstractContactManager.processNotes | train | public function processNotes($contact, $notes)
{
$get = function($note) {
return $note->getId();
};
$delete = function($note) use ($contact) {
$contact->removeNote($note);
return true;
};
$update = function($note, $matchedEntry) {
... | php | {
"resource": ""
} |
q24473 | AbstractContactManager.processTags | train | public function processTags($contact, $tags)
{
$get = function($tag) {
return $tag->getId();
};
$delete = function($tag) use ($contact) {
return $contact->removeTag($tag);
};
$update = function() {
return true;
| php | {
"resource": ""
} |
q24474 | AbstractContactManager.addTag | train | protected function addTag($contact, $data)
{
$success = true;
$resolvedTag = $this->getTagManager()->findByName($data);
| php | {
"resource": ""
} |
q24475 | AbstractContactManager.processBankAccounts | train | public function processBankAccounts($contact, $bankAccounts)
{
$get = function($bankAccount) {
return $bankAccount->getId();
};
$delete = function($bankAccounts) use ($contact) {
$contact->removeBankAccount($bankAccounts);
return true;
};
... | php | {
"resource": ""
} |
q24476 | AbstractContactManager.processAddresses | train | public function processAddresses($contact, $addresses)
{
$getAddressId = function($addressRelation) {
return $addressRelation->getAddress()->getId();
};
$delete = function($addressRelation) use ($contact) {
$this->removeAddressRelation($contact, $addressRelation);
... | php | {
"resource": ""
} |
q24477 | RouteSubscriber.handleHydrate | train | public function handleHydrate(HydrateEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof RouteBehavior) | php | {
"resource": ""
} |
q24478 | RouteSubscriber.handleSetNodeOnPersist | train | public function handleSetNodeOnPersist(PersistEvent $event)
{
$document = $event->getDocument();
$options = $event->getOptions();
if (!$document instanceof RouteBehavior || !array_key_exists('path', $options)) {
return;
}
$parentPath = PathHelper::getParentPath($... | php | {
"resource": ""
} |
q24479 | RouteSubscriber.handlePersist | train | public function handlePersist(PersistEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof RouteBehavior) {
return;
}
$node = $event->getNode();
$node->setProperty(self::NODE_HISTORY_FIELD, $document->isHistory());
$targetDocument... | php | {
"resource": ""
} |
q24480 | RouteSubscriber.handleRemove | train | public function handleRemove(RemoveEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof RouteBehavior) {
| php | {
"resource": ""
} |
q24481 | RouteSubscriber.handlePublish | train | public function handlePublish(PublishEvent $event)
{
$document = $event->getDocument();
if (!$document instanceof | php | {
"resource": ""
} |
q24482 | RouteSubscriber.recursivelyRemoveRoutes | train | private function recursivelyRemoveRoutes(RouteBehavior $document)
{
$referrers = $this->documentInspector->getReferrers($document);
foreach ($referrers as $referrer) {
if (!$referrer instanceof RouteBehavior) {
| php | {
"resource": ""
} |
q24483 | RouteSubscriber.changeOldPathToHistoryRoutes | train | private function changeOldPathToHistoryRoutes(RouteBehavior $oldDocument, RouteBehavior $newDocument)
{
$oldDocument->setTargetDocument($newDocument);
$oldDocument->setHistory(true);
$oldRouteNode = $this->documentInspector->getNode($oldDocument);
$oldRouteNode->setProperty(self::NOD... | php | {
"resource": ""
} |
q24484 | PageSelectionContainer.getData | train | public function getData()
{
if (null === $this->data) { | php | {
"resource": ""
} |
q24485 | PageSelectionContainer.loadData | train | private function loadData()
{
$result = [];
if (null !== $this->ids && count($this->ids) > 0) {
$this->contentQueryBuilder->init(
[
'ids' => $this->ids,
'properties' => (isset($this->params['properties']) ? $this->params['properties... | php | {
"resource": ""
} |
q24486 | SuluVersionPass.getSuluVersion | train | private function getSuluVersion($dir)
{
$version = '_._._';
/** @var SplFileInfo $composerFile */
$composerFile = new SplFileInfo($dir . '/composer.lock', '', '');
if (!$composerFile->isFile()) {
return $version;
}
$composer = json_decode($composerFile->... | php | {
"resource": ""
} |
q24487 | SuluVersionPass.getAppVersion | train | private function getAppVersion($dir)
{
$version = null;
/** @var SplFileInfo $composerFile */
$composerFile = new SplFileInfo($dir . '/composer.json', '', '');
if (!$composerFile->isFile()) {
return $version;
}
| php | {
"resource": ""
} |
q24488 | FieldDescriptorFactory.resolveOptions | train | private function resolveOptions($string, array $options)
{
foreach ($options as $key => $value) {
$string | php | {
"resource": ""
} |
q24489 | MediaPreviewController.postAction | train | public function postAction($id, Request $request)
{
try {
$mediaManager = $this->getMediaManager();
$systemCollectionManager = $this->get('sulu_media.system_collections.manager');
$locale = $this->getLocale($request);
$media = $mediaManager->getById($id, $lo... | php | {
"resource": ""
} |
q24490 | MediaPreviewController.deleteAction | train | public function deleteAction($id, Request $request)
{
try {
$mediaManager = $this->getMediaManager();
$locale = $this->getLocale($request);
$media = $mediaManager->getById($id, $locale);
/** @var MediaInterface $mediaEntity */
$mediaEntity = $med... | php | {
"resource": ""
} |
q24491 | ListQueryBuilder.find | train | public function find($prefix = 'u')
{
$selectFromDQL = $this->getSelectFrom($prefix);
$whereDQL = $this->getWhere($prefix);
if (true != $this->countQuery) {
$orderDQL = $this->getOrderBy($prefix);
} else {
| php | {
"resource": ""
} |
q24492 | ListQueryBuilder.justCount | train | public function justCount($countAttribute = 'u.id', $alias = 'totalcount')
{
$this->countQuery = true;
| php | {
"resource": ""
} |
q24493 | ListQueryBuilder.getSelectFrom | train | private function getSelectFrom($prefix = 'u')
{
$this->joins = '';
$this->prefixes = [$prefix];
// select and where fields
$fieldsWhere = array_merge(
(null != $this->fields) ? $this->fields : [],
array_keys($this->where)
);
$fieldsWhere = ar... | php | {
"resource": ""
} |
q24494 | ListQueryBuilder.performSelectFromField | train | private function performSelectFromField($field, $prefix = 'u')
{
// Relation name and field delimited by underscore
$fieldParts = explode('_', $field);
// temporary variable for saving field name (needed for array results like [0])
$realFieldName = $field;
// check if a cert... | php | {
"resource": ""
} |
q24495 | ListQueryBuilder.generateJoinCondition | train | private function generateJoinCondition($field)
{
if (!array_key_exists($field, $this->joinConditions)) {
return '';
}
// ON {joinConditino} | php | {
"resource": ""
} |
q24496 | ListQueryBuilder.getWhere | train | private function getWhere($prefix)
{
$result = '';
// Only return where clause if there actually is some data
if (count($this->where) > 0 || count($this->searchFields) > 0) {
$wheres = [];
$searches = [];
$whereKeys = array_keys($this->where);
... | php | {
"resource": ""
} |
q24497 | ListQueryBuilder.getOrderBy | train | private function getOrderBy($prefix)
{
$result = '';
// If sorting is defined
if (null != $this->sorting && count($this->sorting) > 0) {
$orderBy = '';
// TODO OrderBy relations translations_value
foreach ($this->sorting as $col => $dir) {
... | php | {
"resource": ""
} |
q24498 | Phone.setPhoneType | train | public function setPhoneType(\Sulu\Bundle\ContactBundle\Entity\PhoneType $phoneType)
{
| php | {
"resource": ""
} |
q24499 | SnippetImport.import | train | public function import($locale, $filePath, OutputInterface $output = null, $format = '1.2.xliff')
{
$parsedDataList = $this->getParser($format)->parse($filePath, $locale);
$failedImports = [];
$importedCounter = 0;
$successCounter = 0;
if (null === $output) {
$ou... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.