_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q24100
UserList.filterByInAnyGroup
train
public function filterByInAnyGroup($groups, $inGroups = true) { $this->checkGroupJoin(); $groupIDs = []; $orX = $this->getQueryObject()->expr()->orX(); $app = Application::getFacadeApplication(); /** @var $likeBuilder LikeBuilder */ $likeBuilder = $app->make(LikeBuild...
php
{ "resource": "" }
q24101
Image.loadPictureSettingsFromTheme
train
protected function loadPictureSettingsFromTheme() { $c = Page::getCurrentPage(); if (is_object($c)) { $pt = $c->getPageController()->getTheme(); if (is_object($pt)) {
php
{ "resource": "" }
q24102
PageIndex.clear
train
public function clear() { /** @var PageCategory $pageCategory */ $pageCategory = $this->app[PageCategory::class]; /** @var PageKey $key */ foreach ($pageCategory->getList() as $key) { /** @var SearchIndexerInterface $indexer */ $indexer = $key->getSearchIndex...
php
{ "resource": "" }
q24103
QueueableJob.getJobQueueBatchSize
train
public function getJobQueueBatchSize() { // If there's no batch size set, let's pull the batch size from the config if ($this->jQueueBatchSize === null) {
php
{ "resource": "" }
q24104
QueueableJob.getQueueObject
train
public function getQueueObject() { if ($this->jQueueObject === null) { $this->jQueueObject = Queue::get('job_' .
php
{ "resource": "" }
q24105
QueueableJob.markCompleted
train
public function markCompleted($code = 0, $message = false) { $obj = parent::markCompleted($code, $message); $queue = $this->getQueueObject();
php
{ "resource": "" }
q24106
QueueableJob.executeJob
train
public function executeJob() { // If the job's already running, don't try to restart it if ($this->getJobStatus() !== 'RUNNING') { $queue = $this->markStarted(); // Prepare the queue for processing $this->start($queue); } else { $queue = $this...
php
{ "resource": "" }
q24107
QueueableJob.executeBatch
train
public function executeBatch($batch, ZendQueue $queue) { foreach ($batch as
php
{ "resource": "" }
q24108
Library.getActive
train
public static function getActive() { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection();
php
{ "resource": "" }
q24109
Library.getByHandle
train
public static function getByHandle($sclHandle) { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $r = $db->fetchAssoc('select sclHandle, sclIsActive, pkgID, sclName from SystemCaptchaLibraries where sclHandle = ?', [$sclHandle]);
php
{ "resource": "" }
q24110
Library.add
train
public static function add($sclHandle, $sclName, $pkg = false) { if (is_object($pkg)) { $pkgID = $pkg->getPackageID(); } else { $pkgID = (int) $pkg; }
php
{ "resource": "" }
q24111
Library.activate
train
public function activate() { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $db->executeQuery('update SystemCaptchaLibraries set sclIsActive = 0');
php
{ "resource": "" }
q24112
Library.getList
train
public static function getList() { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $libraries = []; foreach ($db->fetchAll('select sclHandle from SystemCaptchaLibraries order by sclHandle asc') as $row) {
php
{ "resource": "" }
q24113
Library.getListByPackage
train
public static function getListByPackage($pkg) { if (is_object($pkg)) { $pkgID = $pkg->getPackageID(); } else { $pkgID = (int) $pkg; } $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $libraries = []; fo...
php
{ "resource": "" }
q24114
Library.export
train
public function export(\SimpleXMLElement $xml) { $type = $xml->addChild('library'); $type->addAttribute('handle', $this->getSystemCaptchaLibraryHandle()); $type->addAttribute('name', $this->getSystemCaptchaLibraryName());
php
{ "resource": "" }
q24115
Library.exportList
train
public static function exportList(\SimpleXMLElement $xml) { $list = self::getList(); $nxml = $xml->addChild('systemcaptcha');
php
{ "resource": "" }
q24116
Library.hasOptionsForm
train
public function hasOptionsForm() { $path = DIRNAME_SYSTEM . '/' . DIRNAME_SYSTEM_CAPTCHA . '/' . $this->sclHandle . '/' . FILENAME_FORM; if (file_exists(DIR_FILES_ELEMENTS . '/' . $path)) { return true; } elseif ($this->pkgID > 0) { $pkgHandle = $this->getPackageHandl...
php
{ "resource": "" }
q24117
CommunityStoreTranslationProvider.getEntryPoint
train
public function getEntryPoint() { if ($this->entryPoint === null) { $this->
php
{ "resource": "" }
q24118
CommunityStoreTranslationProvider.getApiToken
train
public function getApiToken() { if ($this->apiToken === null) { $this->apiToken = (string)
php
{ "resource": "" }
q24119
CommunityStoreTranslationProvider.getProgressLimit
train
public function getProgressLimit() { if ($this->progressLimit === null) { $this->setProgressLimit($this->config->get('concrete.i18n.community_translat
php
{ "resource": "" }
q24120
Version20181116072400.fixOverlappingStartEndDates
train
protected function fixOverlappingStartEndDates() { $rs = $this->connection->executeQuery(<<<'EOT' select cv1.cID, cv1.cvID from CollectionVersions as cv1 inner join CollectionVersions as cv2 on cv1.cID = cv2.cID and cv1.cvID <> cv2.cvID and cv1.cvIsApproved = cv2.cvIs...
php
{ "resource": "" }
q24121
AttributedItemList.filterByAttribute
train
public function filterByAttribute($handle, $value, $comparison = '=') { $ak = call_user_func_array(array($this->getAttributeKeyClassName(), 'getByHandle'), array($handle)); if (!is_object($ak)) {
php
{ "resource": "" }
q24122
SvgSanitizerProcessor.process
train
public function process(Version $version) { $resource = $version->getFileResource(); $originalData = $resource->read(); $sanitizedData = $this->sanitizer->sanitizeData($originalData, $this->sanitizerOptions);
php
{ "resource": "" }
q24123
PageList.filterByParentID
train
public function filterByParentID($cParentID) { $db = Loader::db(); if (is_array($cParentID)) { $cth = '('; for ($i = 0; $i < count($cParentID); ++$i) { if ($i > 0) { $cth .= ','; } $cth .= $db->quote($cParent...
php
{ "resource": "" }
q24124
PageList.get
train
public function get($itemsToGet = 0, $offset = 0) { $pages = []; if ($this->getQuery() == '') { $this->setBaseQuery(); } $this->setItemsPerPage($itemsToGet); $r = parent::get($itemsToGet, $offset); foreach ($r as $row) {
php
{ "resource": "" }
q24125
AbstractMigration.nullifyInvalidForeignKey
train
protected function nullifyInvalidForeignKey($table, $field, $linkedTable, $linkedField) { $platform = $this->connection->getDatabasePlatform(); $sqlTable = $platform->quoteSingleIdentifier($table); $sqlField = $platform->quoteSingleIdentifier($field); $sqlLinkedTable = $platform->quo...
php
{ "resource": "" }
q24126
ConsoleAwareTrait.setConsole
train
public function setConsole(SymfonyApplication $console, OutputInterface $output = null, InputInterface $input = null) { $this->traitConsole = $console;
php
{ "resource": "" }
q24127
Cloner.cloneCollection
train
public function cloneCollection(Collection $c, ClonerOptions $options) { $cDate = $this->dateHelper->getOverridableNow(); $this->connection->insert('Collections', [ 'cDateAdded' => $cDate, 'cDateModified' => $cDate, 'cHandle' => $c->getCollectionHandle(), ...
php
{ "resource": "" }
q24128
Cloner.cloneCollectionVersion
train
public function cloneCollectionVersion(Version $cvSource, Collection $cDestination, ClonerOptions $options) { $cSourceID = $cvSource->getCollectionID(); $cvSourceID = $cvSource->getVersionID(); $cSource = Page::getByID($cSourceID, $cvSourceID); $cDestinationID = $cDestination->getC...
php
{ "resource": "" }
q24129
Cloner.cloneBlock
train
public function cloneBlock(Block $block, Collection $destinationCollection) { $bID = $block->getBlockID(); $aHandle = $block->getAreaHandle(); $toID = $destinationCollection->getCollectionID(); $toCVID = $destinationCollection->getVersionID(); $already = $this->connection->fe...
php
{ "resource": "" }
q24130
Cloner.getUniquePageName
train
protected function getUniquePageName($pageName, $parentID) { $uniquePageName = $pageName; $parentID = (int) $parentID; $index = 1; for (; ;) { $pageWithSameName = $this->connection->fetchColumn( 'select Pages.cID from CollectionVersions inner join Pages on...
php
{ "resource": "" }
q24131
Cloner.getUniquePageHandle
train
protected function getUniquePageHandle($handle, $parentID) { $uniqueHandle = $handle; $parentID = (int) $parentID; $index = 1; for (; ;) { $pageWithSameHandle = $this->connection->fetchColumn( 'select Pages.cID from CollectionVersions inner join Pages on (...
php
{ "resource": "" }
q24132
DragRequestData.canDoAnyOf
train
public function canDoAnyOf(array $operations) { foreach ($operations as $operation) {
php
{ "resource": "" }
q24133
DragRequestData.whyCantDo
train
public function whyCantDo($operation) { if (!is_string($operation)) { return 'Invalid $operation'; } if (!isset($this->operationErrors[$operation])) { switch ($operation) { case static::OPERATION_MOVE: $error = $this->whyCantMove();...
php
{ "resource": "" }
q24134
DragRequestData.whyCantMove
train
protected function whyCantMove() { $destinationPageChecker = new Checker($this->getDestinationPage()); $destinationPageID = $this->getDestinationPage()->getCollectionID(); foreach ($this->getOriginalPages() as $originalPage) { if ($originalPage->getCollectionParentID() == $destin...
php
{ "resource": "" }
q24135
DragRequestData.whyCantAlias
train
protected function whyCantAlias() { if ($this->isSomeOriginalPageAnAlias()) { return t('It\'s not possible to create aliases of aliases.'); } $destinationPageChecker = new Checker($this->getDestinationPage()); foreach ($this->getOriginalPages() as $originalPage) { ...
php
{ "resource": "" }
q24136
DragRequestData.whyCantCopyVersion
train
protected function whyCantCopyVersion() { $originalPage = $this->getSingleOriginalPage(); if ($originalPage === null) { return t("It's possible to copy just one page version at a time."); } if ($originalPage->isExternalLink()) { return t("It's not possible to ...
php
{ "resource": "" }
q24137
FileManager.get
train
public static function get() { $db = Database::connection(); $treeID = $db->fetchColumn('select Trees.treeID from TreeTypes inner join Trees on TreeTypes.treeTypeID = Trees.treeTypeID
php
{ "resource": "" }
q24138
Conversation.getConversationUsersToEmail
train
public function getConversationUsersToEmail() { $db = Loader::db(); $ids = array(); if (!$this->getConversationNotificationOverridesEnabled() > 0) { $ids = $db->GetCol('select uID from ConversationSubscriptions where cnvID = 0'); } $r = $db->Execute('select uID,...
php
{ "resource": "" }
q24139
FileFolderResponse.getAllowedFileExtensions
train
public function getAllowedFileExtensions() { $pk = $this->category->getPermissionKeyByHandle('add_file'); $pk->setPermissionObject($this->object);
php
{ "resource": "" }
q24140
HeadLink.create
train
public static function create($href = '#', $rel = null, $type = null, $media = null) {
php
{ "resource": "" }
q24141
ApiServiceProvider.register
train
public function register() { $config = $this->app->make("config"); if ($this->app->isInstalled() && $config->get('concrete.api.enabled')) {
php
{ "resource": "" }
q24142
ApiServiceProvider.getKeyPair
train
private function getKeyPair() { $config = $this->app->make('config/database'); // Seee if we already have a kypair $keyPair = $config->get('api.keypair'); if (!$keyPair) { $rsa = $this->app->make(RSA::class);
php
{ "resource": "" }
q24143
ApiServiceProvider.getKey
train
private function getKey($handle) { if (!$this->keyPair) { $this->keyPair = $this->getKeyPair(); }
php
{ "resource": "" }
q24144
OAuthErrorMiddleware.process
train
public function process(Request $request, DelegateInterface $frame) { try { // Try returning the response normally return $frame->next($request); } catch (OAuthServerException $e) { // Generate
php
{ "resource": "" }
q24145
Service.addAttachmentWithHeaders
train
public function addAttachmentWithHeaders(File $file, array $headers) { $fileVersion = $file->getVersion(); $resource = $fileVersion->getFileResource(); if (array_key_exists('filename', $headers)) { $filename = $headers['filename'];
php
{ "resource": "" }
q24146
Service.addRawAttachmentWithHeaders
train
public function addRawAttachmentWithHeaders($content, $filename, array $headers = []) { $headers += [ 'mimetype' => 'application/octet-stream', 'disposition' => Mime::DISPOSITION_ATTACHMENT, 'encoding' => Mime::ENCODING_BASE64, 'charset' => '', 'bo...
php
{ "resource": "" }
q24147
Service.to
train
public function to($email, $name = null) { if (strpos($email, ',') > 0) { $email = explode(',', $email); foreach ($email as $em) { $this->to[] = [$em,
php
{ "resource": "" }
q24148
Service.generateEmailStrings
train
protected function generateEmailStrings($arr) { $str = ''; for ($i = 0; $i < count($arr); ++$i) { $v = $arr[$i]; if (isset($v[1])) {
php
{ "resource": "" }
q24149
Service.isInlineAttachment
train
protected function isInlineAttachment(MimePart $attachment) { return $this->bodyHTML !== false && $attachment->getId()
php
{ "resource": "" }
q24150
ReuseValidator.hasBeenUsed
train
private function hasBeenUsed($string, $id) { $repository = $this->entityManager->getRepository(UsedString::class); $allUses = $repository->findBy(['subject' => $id],
php
{ "resource": "" }
q24151
ConversationService.trackReview
train
public function trackReview(Message $message, Block $block) { $average
php
{ "resource": "" }
q24152
Node.transformNode
train
public function transformNode($treeNodeType) { $class = self::getClassByType($treeNodeType); $node = new $class();
php
{ "resource": "" }
q24153
Node.getTreeNodeParentArray
train
public function getTreeNodeParentArray() { $db = Database::connection(); $nodeArray = []; $currentNodeParentID = $this->getTreeNodeParentID(); if ($currentNodeParentID > 0) { while (is_numeric($currentNodeParentID) && $currentNodeParentID > 0 && $currentNodeParentID) {
php
{ "resource": "" }
q24154
Node.selectChildrenNodesByID
train
public function selectChildrenNodesByID($nodeID, $loadMissingChildren = false) { if ($this->getTreeNodeID() == $nodeID) { $this->treeNodeIsSelected = true; } else { foreach ($this->getChildNodes() as $childnode) { if ($loadMissingChildren && !$childnode->getCh...
php
{ "resource": "" }
q24155
Node.checkMove
train
public function checkMove(Node $newParent) { $result = null; if ($this->getTreeNodeParentID() != $newParent->getTreeNodeID()) { if ($this->getTreeNodeID() == $newParent->getTreeNodeID()) { $result = new MoveException(t("It's not possible to move a node under itself")); ...
php
{ "resource": "" }
q24156
Node.move
train
public function move(Node $newParent) { $error = $this->checkMove($newParent); if ($error !== null) { throw $error; } if ($this->getTreeNodeParentID() != $newParent->getTreeNodeID()) { $db = Database::connection(); $existingDisplayOrder = $this->tr...
php
{ "resource": "" }
q24157
Node.updateDateModified
train
public function updateDateModified() { $dateModified = Core::make('date')->toDB();
php
{ "resource": "" }
q24158
Node.add
train
public static function add($parent = false) { $db = Database::connection(); $treeNodeParentID = 0; $treeID = 0; $treeNodeDisplayOrder = 0; $inheritPermissionsFromTreeNodeID = 0; if (is_object($parent)) { $treeNodeParentID = $parent->getTreeNodeID(); ...
php
{ "resource": "" }
q24159
Repository.hasGroup
train
public function hasGroup($key) { list($namespace, $group) = $this->parseKey($key);
php
{ "resource": "" }
q24160
Repository.save
train
public function save($key, $value) { list($namespace, $group, $item) = $this->parseKey($key); $collection = $this->getCollection($group, $namespace); unset($this->items[$collection]); if ($this->saver->save($item, $value, $this->environment, $group, $namespace)) {
php
{ "resource": "" }
q24161
Repository.withKey
train
public function withKey($key, $value, callable $callable) { $initialValue = $this->get($key);
php
{ "resource": "" }
q24162
PasswordValidatorServiceProvider.applyLengthValidators
train
protected function applyLengthValidators(ValidatorManagerInterface $manager) { $minimum = $this->getMinimumRequirement(); $maximum = $this->getMaximumRequirement(); $this->applyMinMaxStrings($minimum, $maximum); // Set validators if ($maximum) {
php
{ "resource": "" }
q24163
PasswordValidatorServiceProvider.getMaximumRequirement
train
protected function getMaximumRequirement() { $maximumLength = $this->config->get('concrete.user.password.maximum');
php
{ "resource": "" }
q24164
PasswordValidatorServiceProvider.getMinimumRequirement
train
protected function getMinimumRequirement() { $minimumLength = $this->config->get('concrete.user.password.minimum', 8);
php
{ "resource": "" }
q24165
PasswordValidatorServiceProvider.applyMinMaxStrings
train
protected function applyMinMaxStrings($minimum, $maximum) { if ($minimum && $maximum) { $errorString = t('A password must be between %s and %s characters long.', $minimum->getMinimumLength(), $maximum->getMaximumLength()); $requirement = t('Must be between %s and %s characters long.'...
php
{ "resource": "" }
q24166
PasswordValidatorServiceProvider.applyStringRequirementValidators
train
protected function applyStringRequirementValidators(ValidatorManagerInterface $manager) { $specialCharacters = (int) $this->config->get('concrete.user.password.required_special_characters', 0); $lowerCase = (int) $this->config->get('concrete.user.password.required_lower_case', 0); $upperCase...
php
{ "resource": "" }
q24167
PasswordValidatorServiceProvider.regexValidator
train
protected function regexValidator($regex, $requirement) { $validator = $this->app->make(RegexValidator::class, [$regex]);
php
{ "resource": "" }
q24168
PasswordValidatorServiceProvider.wrappedRegexValidator
train
protected function wrappedRegexValidator($regex, $requirementString) { $regexValidator = $this->regexValidator($regex, $requirementString); $validator = $this->app->make(ClosureValidator::class, [ function (ClosureValidator $validator, $string, ArrayAccess $error = null) use ($regexValid...
php
{ "resource": "" }
q24169
Menu.getPageHeaderMenuItems
train
public function getPageHeaderMenuItems($position = false) { if ($position) { $tmpItems = array(); foreach ($this->pageHeaderMenuItems as $mi) {
php
{ "resource": "" }
q24170
Replace.getReplacingFile
train
protected function getReplacingFile() { if ($this->replacingFile === false) { $replacingFile = null; $fID = $this->request->request->get('fID', $this->request->query->get('fID')); if ($fID && is_scalar($fID)) {
php
{ "resource": "" }
q24171
Replace.setReplacingFile
train
protected function setReplacingFile(File $value = null) { if ($value !==
php
{ "resource": "" }
q24172
ProcessorQueue.process
train
public function process() { $queue = $this->getQueue(); $tasks = $this->getTasks(); foreach ($this->target->getItems() as $targetItem) { foreach ($tasks as $task) { $action
php
{ "resource": "" }
q24173
Site.getConfigRepository
train
public function getConfigRepository() { if (!$this->siteConfig) { $app = Application::getFacadeApplication();
php
{ "resource": "" }
q24174
Site.getSiteHomePageObject
train
public function getSiteHomePageObject($version = 'RECENT') { $tree = $this->getSiteTreeObject();
php
{ "resource": "" }
q24175
Site.getTimezone
train
public function getTimezone() { $timezone = null; $config = $this->getConfigRepository(); if ($config) { $timezone = $config->get('timezone'); } if (!$timezone) {
php
{ "resource": "" }
q24176
File.reindex
train
public function reindex() { $category = \Core::make('Concrete\Core\Attribute\Category\FileCategory'); $indexer = $category->getSearchIndexer(); $values = $category->getAttributeValues($this);
php
{ "resource": "" }
q24177
File.setFileStorageLocation
train
public function setFileStorageLocation(\Concrete\Core\Entity\File\StorageLocation\StorageLocation $newLocation) { $fh = Loader::helper('concrete/file'); $currentLocation = $this->getFileStorageLocationObject(); if ($newLocation->getID() == $currentLocation->getID()) { return fals...
php
{ "resource": "" }
q24178
File.setPassword
train
public function setPassword($pw) { $fe = new \Concrete\Core\File\Event\FileWithPassword($this);
php
{ "resource": "" }
q24179
File.setUser
train
public function setUser(\Concrete\Core\Entity\User\User $user) {
php
{ "resource": "" }
q24180
File.getFileSetIDs
train
public function getFileSetIDs() { $app = Application::getFacadeApplication(); $db = $app->make(Connection::class); $rows = $db->fetchAll('select fsID from FileSetFiles where fID = ?',
php
{ "resource": "" }
q24181
File.getFileSets
train
public function getFileSets() { $filesets = []; foreach ($this->getFileSetIDs() as $fsID) { $fs = FileSet::getByID($fsID); if ($fs !== null) {
php
{ "resource": "" }
q24182
File.isStarred
train
public function isStarred($u = false) { if (!$u) { $u = new User(); } $db = Loader::db(); $r = $db->GetOne( 'select fsfID from FileSetFiles fsf inner join FileSets fs on fs.fsID = fsf.fsID where fsf.fID = ?
php
{ "resource": "" }
q24183
File.createNewVersion
train
public function createNewVersion($copyUnderlyingFile = false) { $fv = $this->getRecentVersion(); $fav = $this->getApprovedVersion(); $fv2 = $fv->duplicate();
php
{ "resource": "" }
q24184
File.getVersionToModify
train
public function getVersionToModify($forceCreateNew = false) { $u = new User(); $createNew = false; $fv = $this->getRecentVersion(); $fav = $this->getApprovedVersion(); // first test. Does the user ID of the most recent version match ours? If not, then we create new ...
php
{ "resource": "" }
q24185
File.setFileFolder
train
public function setFileFolder(FileFolder $folder) { $em = \ORM::entityManager('core');
php
{ "resource": "" }
q24186
File.inFileSet
train
public function inFileSet(Set $fs) { $db = Loader::db(); $r = $db->GetOne( 'select fsfID from FileSetFiles where fID = ? and fsID = ?',
php
{ "resource": "" }
q24187
File.delete
train
public function delete($removeNode = true) { // first, we remove all files from the drive $db = Core::make(Connection::class); $em = $db->getEntityManager(); $em->beginTransaction(); try { // fire an on_page_delete event $fve = new \Concrete\Core\File\...
php
{ "resource": "" }
q24188
File.getRecentVersion
train
public function getRecentVersion() { $em = \ORM::entityManager(); $r = $em->getRepository('\Concrete\Core\Entity\File\Version');
php
{ "resource": "" }
q24189
File.getVersion
train
public function getVersion($fvID = null) { if (!$fvID) { return $this->getApprovedVersion(); } $em = \ORM::entityManager();
php
{ "resource": "" }
q24190
File.getDownloadStatistics
train
public function getDownloadStatistics($limit = 20) { $db = Loader::db(); $limitString = ''; if ($limit != false) { $limitString = 'limit ' . intval($limit); } if (is_object($this) && $this instanceof self) { return $db->getAll( "SELECT...
php
{ "resource": "" }
q24191
File.trackDownload
train
public function trackDownload($rcID = null) { $u = new User(); $uID = intval($u->getUserID()); $fv = $this->getApprovedVersion(); $fvID = $fv->getFileVersionID(); if (!isset($rcID) || !is_numeric($rcID)) { $rcID = 0; } $fve = new \Concrete\Core\Fi...
php
{ "resource": "" }
q24192
Type.delete
train
public function delete() { $list = StorageLocation::getList(); foreach ($list as $item) { if ($item->getTypeObject()->getHandle() == $this->getHandle()) { throw new \Exception(t('Please remove all storage locations using this storage type.'));
php
{ "resource": "" }
q24193
Preset.getStyleValueList
train
public function getStyleValueList() { if (!isset($this->styleValueList)) { $this->styleValueList
php
{ "resource": "" }
q24194
Collection.getByID
train
public static function getByID($cID, $version = 'RECENT') { $db = Loader::db(); $q = 'select Collections.cDateAdded, Collections.cDateModified, Collections.cID from Collections where cID = ?'; $row = $db->getRow($q, [$cID]); $c = new self();
php
{ "resource": "" }
q24195
Collection.createCollection
train
public static function createCollection($data) { $db = Loader::db(); $dh = Loader::helper('date'); $cDate = $dh->getOverridableNow(); $data = array_merge( [ 'name' => '', 'pTemplateID' => 0, 'handle' => null, ...
php
{ "resource": "" }
q24196
Collection.getNextVersionComments
train
public function getNextVersionComments() { $c = Page::getByID($this->getCollectionID(), 'ACTIVE');
php
{ "resource": "" }
q24197
Collection.clearCollectionAttributes
train
public function clearCollectionAttributes($retainAKIDs = []) { $db = Loader::db(); if (count($retainAKIDs) > 0) { $cleanAKIDs = []; foreach ($retainAKIDs as $akID) { $cleanAKIDs[] = (int) $akID; } $akIDStr = implode(',', $cleanAKIDs); ...
php
{ "resource": "" }
q24198
Collection.getSetCollectionAttributes
train
public function getSetCollectionAttributes() { $category = $this->vObj->getObjectAttributeCategory(); $values = $category->getAttributeValues($this->vObj); $attribs = [];
php
{ "resource": "" }
q24199
Collection.hasAliasedContent
train
public function hasAliasedContent() { $db = Loader::db(); // aliased content is content on the particular page that is being // used elsewhere - but the content on the PAGE is the original version $v = [$this->cID]; $q = 'select bID from CollectionVersionBlocks where cID = ? ...
php
{ "resource": "" }