_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q23500 | Package.upgradeCoreData | train | public function upgradeCoreData()
{
$entity = $this->getPackageEntity();
if ($entity !== null) {
$em = $this->app->make(EntityManagerInterface::class);
$entity->setPackageName($this->getPackageName());
| php | {
"resource": ""
} |
q23501 | Package.upgrade | train | public function upgrade()
{
$this->upgradeDatabase();
// now we refresh all blocks
$manager = new Manager($this->app);
$items = $manager->driver('block_type')->getItems($this->getPackageEntity());
| php | {
"resource": ""
} |
q23502 | Package.upgradeDatabase | train | public function upgradeDatabase()
{
$em = $this->getPackageEntityManager();
if ($em !== null) {
$this->destroyProxyClasses($em);
| php | {
"resource": ""
} |
q23503 | Package.getPackageEntityManager | train | public function getPackageEntityManager()
{
$providerFactory = new PackageProviderFactory($this->app, $this);
$provider = $providerFactory->getEntityManagerProvider();
$drivers = $provider->getDrivers();
if (empty($drivers)) {
$result = null;
} else {
... | php | {
"resource": ""
} |
q23504 | Package.getErrorText | train | protected function getErrorText($errorCode)
{
if (is_array($errorCode)) {
$code = array_shift($errorCode);
$result = vsprintf($this->getErrorText($code), $errorCode);
} else {
$config = $this->app->make('config');
$dictionary = [
self::... | php | {
"resource": ""
} |
q23505 | Package.destroyProxyClasses | train | protected function destroyProxyClasses(EntityManagerInterface $em)
{
$config = $em->getConfiguration();
$proxyGenerator = new ProxyGenerator($config->getProxyDir(), $config->getProxyNamespace());
$classes = $em->getMetadataFactory()->getAllMetadata();
foreach ($classes as $class) {
... | php | {
"resource": ""
} |
q23506 | CategoryService.getByHandle | train | public function getByHandle($akCategoryHandle)
{
$r = $this->entityManager->getRepository(Category::class);
| php | {
"resource": ""
} |
q23507 | CategoryService.getByID | train | public function getByID($akCategoryID)
{
$r = $this->entityManager->getRepository(Category::class);
| php | {
"resource": ""
} |
q23508 | CategoryService.getListByPackage | train | public function getListByPackage(Package $pkg)
{
$r = $this->entityManager->getRepository( | php | {
"resource": ""
} |
q23509 | CategoryService.add | train | public function add($akCategoryHandle, $allowSets = StandardSetManager::ASET_ALLOW_SINGLE, $pkg = null)
{
$category = new Category();
$category->setAttributeKeyCategoryHandle($akCategoryHandle);
$category->setAllowAttributeSets($allowSets);
if ($pkg) {
$category->setPacka... | php | {
"resource": ""
} |
q23510 | Set.getByID | train | public static function getByID($btsID)
{
$result = null;
$btsID = (int) $btsID;
if ($btsID !== 0) {
$app = Application::getFacadeApplication();
$cache = $app->make('cache/request');
$identifier = sprintf('block/type/set/%s', $btsID);
$item = $c... | php | {
"resource": ""
} |
q23511 | Set.getByHandle | train | public static function getByHandle($btsHandle)
{
$result = null;
$btsHandle = (string) $btsHandle;
if ($btsHandle !== '') {
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$row = $db->fetchAssoc('select btsID, btsHandle, pk... | php | {
"resource": ""
} |
q23512 | Set.getListByPackage | train | public static function getListByPackage($pkg)
{
$result = [];
$pkgID = (int) (is_object($pkg) ? $pkg->getPackageID() : $pkg);
if ($pkgID !== 0) {
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$rs = $db->executeQuery('sele... | php | {
"resource": ""
} |
q23513 | Set.getList | train | public static function getList($excluded = ['core_desktop'])
{
$result = [];
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
if (empty($excluded)) {
$rs = $db->executeQuery('select btsID from BlockTypeSets order by btsDisplayOrder asc'); | php | {
"resource": ""
} |
q23514 | Set.add | train | public static function add($btsHandle, $btsName, $pkg = false)
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$pkgID = (int) (is_object($pkg) ? $pkg->getPackageID() : $pkg);
$displayOrder = $db->fetchColumn('select max(btsDisplayOrder) from BlockTy... | php | {
"resource": ""
} |
q23515 | Set.exportList | train | public static function exportList($xml)
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$bxml = $xml->addChild('blocktypesets');
$rs = $db->executeQuery('select btsID from BlockTypeSets order by btsID asc'); | php | {
"resource": ""
} |
q23516 | Set.getUnassignedBlockTypes | train | public static function getUnassignedBlockTypes($includeInternalBlockTypes = false)
{
$result = [];
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$rs = $db->executeQuery(<<<EOT
select BlockTypes.btID
from BlockTypes
left join BlockTypeSetBlockTypes o... | php | {
"resource": ""
} |
q23517 | Set.getPackageHandle | train | public function getPackageHandle()
{
$pkgID = $this->getPackageID();
| php | {
"resource": ""
} |
q23518 | Set.updateBlockTypeSetName | train | public function updateBlockTypeSetName($btsName)
{
$btsName = (string) $btsName;
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
| php | {
"resource": ""
} |
q23519 | Set.updateBlockTypeSetHandle | train | public function updateBlockTypeSetHandle($btsHandle)
{
$btsHandle = (string) $btsHandle;
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
| php | {
"resource": ""
} |
q23520 | Set.updateBlockTypeSetDisplayOrder | train | public function updateBlockTypeSetDisplayOrder($displayOrder)
{
$displayOrder = (string) $displayOrder;
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
| php | {
"resource": ""
} |
q23521 | Set.addBlockType | train | public function addBlockType(BlockTypeEntity $bt)
{
if (!$this->contains($bt)) {
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$displayOrder = $db->fetchColumn('select max(displayOrder) from BlockTypeSetBlockTypes where btsID = ?', [$thi... | php | {
"resource": ""
} |
q23522 | Set.setBlockTypeDisplayOrder | train | public function setBlockTypeDisplayOrder(BlockTypeEntity $bt, $displayOrder)
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$db->update(
'BlockTypeSetBlockTypes',
['displayOrder' => | php | {
"resource": ""
} |
q23523 | Set.clearBlockTypes | train | public function clearBlockTypes()
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
| php | {
"resource": ""
} |
q23524 | Set.deleteKey | train | public function deleteKey($bt)
{
$btID = (int) (is_object($bt) ? $bt->getBlockTypeID() : $bt);
if ($btID !== 0) {
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
| php | {
"resource": ""
} |
q23525 | Set.export | train | public function export($axml)
{
$bset = $axml->addChild('blocktypeset');
$bset->addAttribute('handle', $this->getBlockTypeSetHandle());
$bset->addAttribute('name', $this->getBlockTypeSetName());
$bset->addAttribute('package', $this->getPackageHandle());
$types = $this->getBlo... | php | {
"resource": ""
} |
q23526 | Set.getBlockTypes | train | public function getBlockTypes()
{
$result = [];
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$rs = $db->executeQuery('select btID from BlockTypeSetBlockTypes where btsID | php | {
"resource": ""
} |
q23527 | Set.contains | train | public function contains($bt)
{
$result = false;
$btID = (int) (is_object($bt) ? $bt->getBlockTypeID() : $bt);
if ($btID !== 0) {
$app = Application::getFacadeApplication();
| php | {
"resource": ""
} |
q23528 | Set.delete | train | public function delete()
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$db->delete('BlockTypeSetBlockTypes', | php | {
"resource": ""
} |
q23529 | Set.rescanDisplayOrder | train | protected function rescanDisplayOrder()
{
$displayOrder = 0;
$btsID = $this->getBlockTypeSetID();
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$rs = $db->executeQuery('select btID from BlockTypeSetBlockTypes where btsID = ? order by display... | php | {
"resource": ""
} |
q23530 | Messages.getDefaultMessageFilter | train | protected function getDefaultMessageFilter()
{
$filter = 'all';
$db = \Database::get();
$count = $db->GetOne('select count(cpa.paID) from ConversationPermissionAssignments cpa
inner join PermissionAccess pa on cpa.paID = pa.paID
inner join ConversationPermissionAddMes... | php | {
"resource": ""
} |
q23531 | SeoCanonical.getPageCanonicalURL | train | public function getPageCanonicalURL($page, $querystring = null)
{
$result = null;
if ($page) {
if ($this->valn->integer($page, 1)) {
$page = Page::getByID($page);
}
if ($page instanceof Page && !$page->isError()) {
$cID = $page->get... | php | {
"resource": ""
} |
q23532 | CsvSchema.getStaticValues | train | public function getStaticValues(array $cells)
{
$result = [];
foreach ($this->fieldsMap as $cellIndex => $info) {
if ($info['kind'] === 'staticHeader') {
$fieldName = $info['staticHeaderName'];
| php | {
"resource": ""
} |
q23533 | CsvSchema.getAttributesValues | train | public function getAttributesValues(array $cells)
{
$result = [];
foreach ($this->fieldsMap as $cellIndex => $info) {
switch ($info['kind']) {
case 'singleAttributeHeader':
$attributeIndex = $info['attributeIndex'];
$result[$attribu... | php | {
"resource": ""
} |
q23534 | LogEntry.getLevelIcon | train | public function getLevelIcon()
{
switch ($this->getLevel()) {
case Monolog::EMERGENCY:
return '<i class="text-danger fa fa-fire launch-tooltip" title="' . $this->getLevelDisplayName() . '"></i>';
case Monolog::CRITICAL:
case Monolog::ALERT:
... | php | {
"resource": ""
} |
q23535 | LogEntry.getUserObject | train | public function getUserObject()
{
if ($this->getUserID()) {
$u = | php | {
"resource": ""
} |
q23536 | LogEntry.getDisplayTimestamp | train | public function getDisplayTimestamp()
{
$app = Application::getFacadeApplication();
$dh = $app->make('helper/date'); /* @var | php | {
"resource": ""
} |
q23537 | LogEntry.getByID | train | public static function getByID($logID)
{
$app = Application::getFacadeApplication();
$db = $app->make('database')->connection();
$row = $db->fetchAssoc('select * from Logs where logID = ?', [$logID]);
if ($row) {
| php | {
"resource": ""
} |
q23538 | LogEntry.delete | train | public function delete()
{
$app = Application::getFacadeApplication();
$db = $app->make('database')->connection();
$logID = $this->getID();
| php | {
"resource": ""
} |
q23539 | StorageLocation.hasFiles | train | public function hasFiles()
{
$app = Application::getFacadeApplication();
$db = $app->make('database');
$fIDs | php | {
"resource": ""
} |
q23540 | GenericOauthTypeController.attemptAuthentication | train | protected function attemptAuthentication()
{
$extractor = $this->getExtractor();
if (!$this->isValid()) {
throw new Exception(
'Invalid account, user cannot be logged in.');
}
$user_id = $this->getBoundUserID($extractor->getUniqueId());
if ($use... | php | {
"resource": ""
} |
q23541 | GenericOauthTypeController.getBindingForUser | train | public function getBindingForUser($user)
{
$result = null;
if (is_object($user)) {
$userID = $user->getUserID();
} else {
$userID = (int) $user;
}
if ($userID) {
$db = $this->app->make(Connection::class);
$qb = $db->createQueryB... | php | {
"resource": ""
} |
q23542 | Controller.authorize | train | public function authorize()
{
$response = new Response();
try {
$request = $this->getAuthorizationRequest();
$step = $this->determineStep($request);
// Handle login step
if ($step === self::STEP_LOGIN) {
if (!$this->user) {
... | php | {
"resource": ""
} |
q23543 | Controller.handleLogin | train | public function handleLogin(AuthorizationRequest $request)
{
$error = new ErrorList();
$emailLogin = $this->config->get('concrete.user.registration.email_registration');
while ($this->request->getMethod() === 'POST') {
if (!$this->token->validate('oauth_login_' . $request->getC... | php | {
"resource": ""
} |
q23544 | Controller.handleAuthorizeClient | train | public function handleAuthorizeClient(AuthorizationRequest $request)
{
$error = new ErrorList();
$client = $request->getClient();
while ($this->request->getMethod() === 'POST') {
if (!$this->token->validate('oauth_authorize_' . $client->getClientKey())) {
$error... | php | {
"resource": ""
} |
q23545 | Controller.pruneTokens | train | private function pruneTokens()
{
$now = new \DateTime('now');
// Delete access tokens that have no refresh token associated
$qb = $this->entityManager->createQueryBuilder();
$items = $qb->select('token')
->from(AccessToken::class, 'token')
->where($qb->expr()-... | php | {
"resource": ""
} |
q23546 | Controller.pruneResults | train | private function pruneResults(/*iterable*/ $results)
{
$buffer = [];
foreach ($results as $item) {
$buffer[] = $item;
if (count($buffer) > 50) {
| php | {
"resource": ""
} |
q23547 | Controller.clearTokenBuffer | train | private function clearTokenBuffer(array $buffer)
{
foreach ($buffer as $bufferItem) {
// Clear out associated access token
if ($bufferItem instanceof AccessToken) {
// We have to use this method of retrieving the entity because the refresh token
// is ... | php | {
"resource": ""
} |
q23548 | Controller.getConsentType | train | private function getConsentType(AuthorizationRequest $request)
{
$client = $request->getClient();
| php | {
"resource": ""
} |
q23549 | Controller.storeRequest | train | private function storeRequest(AuthorizationRequest $request)
{
$data = [
'user' => $request->getUser() ? $request->getUser()->getIdentifier() : null,
'client' => $request->getClient()->getIdentifier(),
'challenge' => $request->getCodeChallenge(),
'challenge_me... | php | {
"resource": ""
} |
q23550 | Controller.restoreRequest | train | private function restoreRequest(array $data)
{
if (!$data) {
return null;
}
// Inflate identifiers into objects
$scopeData = (array) array_get($data, 'scopes', []);
$scopes = array_filter(array_map([$this, 'inflateType'], $scopeData));
$user = $this->infl... | php | {
"resource": ""
} |
q23551 | Controller.clearRequest | train | private function clearRequest(AuthorizationRequest $request)
{
/** @var Client $client */
$client = $request->getClient();
| php | {
"resource": ""
} |
q23552 | Controller.inflateType | train | private function inflateType($identifier, $type = Scope::class)
{
if ($identifier === null) | php | {
"resource": ""
} |
q23553 | Controller.determineStep | train | private function determineStep(AuthorizationRequest $request)
{
// If the request doesn't have a user attached, we need to login still.
if (!$request->getUser()) {
return self::STEP_LOGIN;
}
/** @todo Track this authorization in the database and notify the user if the sc... | php | {
"resource": ""
} |
q23554 | Controller.createLoginView | train | private function createLoginView(array $data)
{
// Get the client that we're rendering login for
$consentType = $this->getConsentType($this->getAuthorizationRequest());
switch ($consentType) {
case Client::CONSENT_NONE:
// Don't set anything if the consent type i... | php | {
"resource": ""
} |
q23555 | Library.activate | train | public function activate()
{
$db = Loader::db();
self::deactivateAll();
$db->Execute('update | php | {
"resource": ""
} |
q23556 | CookieJar.has | train | public function has($name)
{
if (in_array($name, $this->responseCookies->getClearedCookies(), true)) { | php | {
"resource": ""
} |
q23557 | Group.getByID | train | public static function getByID($gID)
{
$db = Database::connection();
$g = CacheLocal::getEntry('group', $gID);
if (is_object($g)) {
return $g;
}
$row = $db->fetchAssoc('select * from ' . $db->getDatabasePlatform()->quoteSingleIdentifier('Groups') . ' where gID = ... | php | {
"resource": ""
} |
q23558 | Group.getByName | train | public static function getByName($gName)
{
$db = Database::connection();
$row = $db->fetchAssoc('select * from ' . $db->getDatabasePlatform()->quoteSingleIdentifier('Groups') . ' where gName = ?', [$gName]);
if ($row) { | php | {
"resource": ""
} |
q23559 | Page.getByPath | train | public static function getByPath($path, $version = 'RECENT', TreeInterface $tree = null)
{
$path = rtrim($path, '/'); // if the path ends in a / remove it.
$cache = \Core::make('cache/request');
if ($tree) {
$item = $cache->getItem(sprintf('site/page/path/%s/%s', $tree->getSiteT... | php | {
"resource": ""
} |
q23560 | Page.populatePage | train | protected function populatePage($cInfo, $where, $cvID)
{
$db = Database::connection();
$q0 = 'select Pages.cID, Pages.pkgID, Pages.siteTreeID, Pages.cPointerID, Pages.cPointerExternalLink, Pages.cIsDraft, Pages.cIsActive, Pages.cIsSystemPage, Pages.cPointerExternalLinkNewWindow, Pages.cFilename, Pa... | php | {
"resource": ""
} |
q23561 | Page.isEditMode | train | public function isEditMode()
{
if ($this->getCollectionPath() == STACKS_LISTING_PAGE_PATH) {
return true;
}
| php | {
"resource": ""
} |
q23562 | Page.getPackageHandle | train | public function getPackageHandle()
{
if (!isset($this->pkgHandle)) {
| php | {
"resource": ""
} |
q23563 | Page.forceCheckIn | train | public function forceCheckIn()
{
$db = Database::connection();
$q = 'update Pages set cIsCheckedOut | php | {
"resource": ""
} |
q23564 | Page.getFromRequest | train | public static function getFromRequest(Request $request)
{
// if something has already set a page object, we return it
$c = $request->getCurrentPage();
if (is_object($c)) {
return $c;
}
if ($request->getPath() != '') {
$path = $request->getPath();
... | php | {
"resource": ""
} |
q23565 | Page.processArrangement | train | public function processArrangement($area_id, $moved_block_id, $block_order)
{
$area_handle = Area::getAreaHandleFromID($area_id);
$db = Database::connection();
// Remove the moved block from its old area, and all blocks from the destination area.
$db->executeQuery('UPDATE Collection... | php | {
"resource": ""
} |
q23566 | Page.isCheckedOut | train | public function isCheckedOut()
{
// function to inform us as to whether the current collection is checked out
$db = Database::connection();
if (isset($this->isCheckedOutCache)) {
return $this->isCheckedOutCache;
}
$q = "select cIsCheckedOut, cCheckedOutDatetimeLa... | php | {
"resource": ""
} |
q23567 | Page.getCollectionCheckedOutUserName | train | public function getCollectionCheckedOutUserName()
{
$db = Database::connection();
$query = 'select cCheckedOutUID from Pages where cID = ?';
$vals = [$this->cID];
$checkedOutId = $db->fetchColumn($query, $vals);
if (is_object(UserInfo::getByID($checkedOutId))) {
| php | {
"resource": ""
} |
q23568 | Page.getDraftsParentPage | train | public static function getDraftsParentPage(Site $site = null)
{
$db = Database::connection();
$site = $site ? $site : \Core::make('site')->getSite();
$cParentID = $db->fetchColumn('select p.cID from PagePaths pp inner join Pages p on pp.cID = p.cID inner join SiteLocales sl on p.siteTreeID | php | {
"resource": ""
} |
q23569 | Page.getDrafts | train | public static function getDrafts(Site $site)
{
$db = Database::connection();
$nc = self::getDraftsParentPage($site);
$r = $db->executeQuery('select Pages.cID from Pages inner join Collections c on Pages.cID = c.cID where cParentID = ? order by cDateAdded desc', [$nc->getCollectionID()]);
... | php | {
"resource": ""
} |
q23570 | Page.populateRecursivePages | train | public function populateRecursivePages($pages, $pageRow, $cParentID, $level, $includeThisPage = true)
{
$db = Database::connection();
$children = $db->GetAll('select cID, cDisplayOrder from Pages where cParentID = ? order by cDisplayOrder asc', [$pageRow['cID']]);
if ($includeThisPage) {
... | php | {
"resource": ""
} |
q23571 | Page.queueForDuplicationSort | train | public function queueForDuplicationSort($a, $b)
{
if ($a['level'] > $b['level']) {
return 1;
}
if ($a['level'] < $b['level']) {
return -1;
}
if ($a['cDisplayOrder'] > $b['cDisplayOrder']) {
| php | {
"resource": ""
} |
q23572 | Page.queueForDeletion | train | public function queueForDeletion()
{
$pages = [];
$includeThisPage = true;
if ($this->getCollectionPath() == Config::get('concrete.paths.trash')) {
// we're in the trash. we can't delete the trash. we're skipping over the trash node.
$includeThisPage = false;
... | php | {
"resource": ""
} |
q23573 | Page.addAdditionalPagePath | train | public function addAdditionalPagePath($cPath, $commit = true)
{
$em = \ORM::entityManager();
$path = new \Concrete\Core\Entity\Page\PagePath();
$path->setPagePath('/'.trim($cPath, '/'));
| php | {
"resource": ""
} |
q23574 | Page.setCanonicalPagePath | train | public function setCanonicalPagePath($cPath, $isAutoGenerated = false)
{
$em = \ORM::entityManager();
$path = $this->getCollectionPathObject();
if (is_object($path)) {
$path->setPagePath($cPath);
} else {
$path = new \Concrete\Core\Entity\Page\PagePath();
... | php | {
"resource": ""
} |
q23575 | Page.getAdditionalPagePaths | train | public function getAdditionalPagePaths()
{
$em = \ORM::entityManager();
return $em->getRepository('\Concrete\Core\Entity\Page\PagePath')->findBy(
| php | {
"resource": ""
} |
q23576 | Page.isBlockAliasedFromMasterCollection | train | public function isBlockAliasedFromMasterCollection($b)
{
if (!$b->isAlias()) {
return false;
}
//Retrieve info for all of this page's blocks at once (and "cache" it)
// so we don't have to query the database separately for every block on the page.
if (is_null($thi... | php | {
"resource": ""
} |
q23577 | Page.getCollectionThemeObject | train | public function getCollectionThemeObject()
{
if (!isset($this->themeObject)) {
$app = Facade::getFacadeApplication();
$tmpTheme = $app->make(ThemeRouteCollection::class)
->getThemeByRoute($this->getCollectionPath());
if (isset($tmpTheme[0])) {
... | php | {
"resource": ""
} |
q23578 | Page.getCollectionName | train | public function getCollectionName()
{
if (isset($this->vObj)) {
return isset($this->vObj->cvName) ? $this->vObj->cvName : null;
| php | {
"resource": ""
} |
q23579 | Page.getCollectionParentIDFromChildID | train | public static function getCollectionParentIDFromChildID($cID)
{
$db = Database::connection();
$q = 'select cParentID from Pages where cID = ?'; | php | {
"resource": ""
} |
q23580 | Page.setTheme | train | public function setTheme($pl)
{
$db = Database::connection();
$db->executeQuery('update CollectionVersions set pThemeID = ? where cID = ? and | php | {
"resource": ""
} |
q23581 | Page.setPageType | train | public function setPageType(\Concrete\Core\Page\Type\Type $type = null)
{
$ptID = 0;
if (is_object($type)) {
| php | {
"resource": ""
} |
q23582 | Page.getMasterCollectionID | train | public function getMasterCollectionID()
{
$pt = PageType::getByID($this->getPageTypeID());
if (!is_object($pt)) {
return 0;
}
| php | {
"resource": ""
} |
q23583 | Page.getFirstChild | train | public function getFirstChild($sortColumn = 'cDisplayOrder asc')
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$now = $app->make('date')->getOverridableNow();
$cID = $db->fetchColumn(
<<<EOT
select
Pages.cID
from
Pages
inne... | php | {
"resource": ""
} |
q23584 | Page.getCollectionChildrenArray | train | public function getCollectionChildrenArray($oneLevelOnly = 0)
{
$this->childrenCIDArray = [];
| php | {
"resource": ""
} |
q23585 | Page.getCollectionChildren | train | public function getCollectionChildren()
{
$children = [];
$db = Database::connection();
$q = 'select cID from Pages where cParentID = ? and cIsTemplate = 0 order by cDisplayOrder asc';
$r = $db->executeQuery($q, [$this->getCollectionID()]);
if ($r) {
while ($row =... | php | {
"resource": ""
} |
q23586 | Page.getPageRelations | train | public function getPageRelations()
{
$em = \Database::connection()->getEntityManager();
$r = $em->getRepository('Concrete\Core\Entity\Page\Relation\SiblingRelation');
$relation = $r->findOneBy(['cID' => $this->getCollectionID()]);
$relations = array();
if (is_object($relation... | php | {
"resource": ""
} |
q23587 | Page.duplicateAll | train | public function duplicateAll($nc = null, $preserveUserID = false, Site $site = null)
{
$nc2 = $this->duplicate($nc, $preserveUserID, $site);
| php | {
"resource": ""
} |
q23588 | Page._duplicateAll | train | protected function _duplicateAll($cParent, $cNewParent, $preserveUserID = false, Site $site = null)
{
$db = Database::connection();
$cID = $cParent->getCollectionID();
$q = 'select cID, ptHandle from Pages p left join PageTypes pt on p.ptID = pt.ptID where cParentID = ? order by cDisplayOrde... | php | {
"resource": ""
} |
q23589 | Page.duplicate | train | public function duplicate($nc = null, $preserveUserID = false, TreeInterface $site = null)
{
$app = Application::getFacadeApplication();
$cloner = $app->make(Cloner::class);
$clonerOptions = $app->build(ClonerOptions::class)
| php | {
"resource": ""
} |
q23590 | Page.moveToTrash | train | public function moveToTrash()
{
// run any internal event we have for page trashing
$pe = new Event($this);
Events::dispatch('on_page_move_to_trash', $pe);
$trash = self::getByPath(Config::get('concrete.paths.trash'));
$app = Facade::getFacadeApplication();
$logger ... | php | {
"resource": ""
} |
q23591 | Page.getHomePageID | train | public static function getHomePageID($page = null)
{
if ($page) {
if (!$page instanceof self) {
$page = self::getByID($page);
}
if ($page instanceof Page) {
$siteTree = $page->getSiteTreeObject();
if ($siteTree !== null) {
... | php | {
"resource": ""
} |
q23592 | Page.getAutoGeneratedPagePathObject | train | public function getAutoGeneratedPagePathObject()
{
$path = new PagePath();
$path->setPagePathIsAutoGenerated(true);
//if (!$this->isHomePage()) {
| php | {
"resource": ""
} |
q23593 | Page.getNextSubPageDisplayOrder | train | public function getNextSubPageDisplayOrder()
{
$db = Database::connection();
$max = $db->fetchColumn('select | php | {
"resource": ""
} |
q23594 | Page.rescanCollectionPath | train | public function rescanCollectionPath()
{
//if ($this->cParentID > 0) {
$newPath = $this->generatePagePath();
$pathObject = $this->getCollectionPathObject();
$ppIsAutoGenerated = true;
if (is_object($pathObject) && !$pathObject->isPagePathAutoGenerated()) {
... | php | {
"resource": ""
} |
q23595 | Page.computeCanonicalPagePath | train | protected function computeCanonicalPagePath()
{
$parent = self::getByID($this->cParentID);
$parentPath = $parent->getCollectionPathObject();
$path = '';
if ($parentPath instanceof PagePath) {
$path = $parentPath->getPagePath();
}
$path .= '/';
$cID... | php | {
"resource": ""
} |
q23596 | Page.movePageDisplayOrderToBottom | train | public function movePageDisplayOrderToBottom()
{
// find the highest cDisplayOrder and increment by 1
$db = Database::connection();
$mx = $db->fetchAssoc('select max(cDisplayOrder) as m from Pages where cParentID | php | {
"resource": ""
} |
q23597 | Page.movePageDisplayOrderToSibling | train | public function movePageDisplayOrderToSibling(Page $c, $position = 'before')
{
$myCID = $this->getCollectionPointerOriginalID() ?: $this->getCollectionID();
$relatedCID = $c->getCollectionPointerOriginalID() ?: $c->getCollectionID();
$pageIDs = [];
$db = Database::connection();
... | php | {
"resource": ""
} |
q23598 | Page.rescanSystemPageStatus | train | public function rescanSystemPageStatus()
{
$systemPage = false;
$db = Database::connection();
$cID = $this->getCollectionID();
if (!$this->isHomePage()) {
if ($this->getSiteTreeID() == 0) {
$systemPage = true;
} else {
$cID = ($... | php | {
"resource": ""
} |
q23599 | Page.isInTrash | train | public function isInTrash()
{
return $this->getCollectionPath() != Config::get('concrete.paths.trash') | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.