_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q17800
DataList.innerJoin
train
public function innerJoin($table, $onClause, $alias = null, $order = 20, $parameters = []) { return $this->alterDataQuery(function (DataQuery $query) use ($table, $onClause, $alias, $order, $parameters) {
php
{ "resource": "" }
q17801
DataList.toArray
train
public function toArray() { $query = $this->dataQuery->query(); $rows = $query->execute(); $results = []; foreach ($rows as $row) {
php
{ "resource": "" }
q17802
DataList.getGenerator
train
public function getGenerator() { $query = $this->dataQuery->query()->execute(); while ($row = $query->record()) {
php
{ "resource": "" }
q17803
DataList.createDataObject
train
public function createDataObject($row) { $class = $this->dataClass; if (empty($row['ClassName'])) { $row['ClassName'] = $class; } // Failover from RecordClassName to ClassName if (empty($row['RecordClassName'])) { $row['RecordClassName'] = $row['Clas...
php
{ "resource": "" }
q17804
DataList.first
train
public function first() { foreach ($this->dataQuery->firstRow()->execute() as
php
{ "resource": "" }
q17805
DataList.last
train
public function last() { foreach ($this->dataQuery->lastRow()->execute() as
php
{ "resource": "" }
q17806
DataList.setQueriedColumns
train
public function setQueriedColumns($queriedColumns) { return $this->alterDataQuery(function (DataQuery $query) use ($queriedColumns) {
php
{ "resource": "" }
q17807
DataList.setByIDList
train
public function setByIDList($idList) { $has = []; // Index current data foreach ($this->column() as $id) { $has[$id] = true; } // Keep track of items to delete $itemsToDelete = $has; // add items in the list // $id is the database ID of ...
php
{ "resource": "" }
q17808
DataList.newObject
train
public function newObject($initialFields = null) { $class = $this->dataClass;
php
{ "resource": "" }
q17809
SilverStripeServiceConfigurationLocator.configFor
train
protected function configFor($name) { // Return cached result if (array_key_exists($name, $this->configs)) {
php
{ "resource": "" }
q17810
SSViewer.fromString
train
public static function fromString($content, $cacheTemplate = null) { $viewer = SSViewer_FromString::create($content); if ($cacheTemplate !== null) {
php
{ "resource": "" }
q17811
SSViewer.add_themes
train
public static function add_themes($themes = []) { $currentThemes = SSViewer::get_themes(); $finalThemes = array_merge($themes, $currentThemes); // array_values is used to ensure sequential array keys
php
{ "resource": "" }
q17812
SSViewer.get_themes
train
public static function get_themes() { $default = [self::PUBLIC_THEME, self::DEFAULT_THEME]; if (!SSViewer::config()->uninherited('theme_enabled')) { return $default; } // Explicit list is assigned $themes = static::$current_themes; if (!isset($themes)) {...
php
{ "resource": "" }
q17813
SSViewer.getParser
train
public function getParser() { if (!$this->parser) { $this->setParser(Injector::inst()->get('
php
{ "resource": "" }
q17814
SSViewer.flush_template_cache
train
public static function flush_template_cache($force = false) { if (!self::$template_cache_flushed || $force) { $dir = dir(TEMP_PATH); while (false !== ($file = $dir->read())) { if (strstr($file, '.cache')) {
php
{ "resource": "" }
q17815
SSViewer.flush_cacheblock_cache
train
public static function flush_cacheblock_cache($force = false) { if (!self::$cacheblock_cache_flushed || $force) { $cache = Injector::inst()->get(CacheInterface::class . '.cacheblock');
php
{ "resource": "" }
q17816
SSViewer.includeGeneratedTemplate
train
protected function includeGeneratedTemplate($cacheFile, $item, $overlay, $underlay, $inheritedScope = null) { if (isset($_GET['showtemplate']) && $_GET['showtemplate'] && Permission::check('ADMIN')) { $lines = file($cacheFile); echo "<h2>Template: $cacheFile</h2>"; echo "...
php
{ "resource": "" }
q17817
SSViewer.getSubtemplateFor
train
protected function getSubtemplateFor($subtemplate) { // Get explicit subtemplate name if (isset($this->subTemplates[$subtemplate])) { return $this->subTemplates[$subtemplate]; } // Don't apply sub-templates if type is already specified (e.g. 'Includes') if (isset...
php
{ "resource": "" }
q17818
SSViewer.execute_string
train
public static function execute_string($content, $data, $arguments = null, $globalRequirements = false) { $v = SSViewer::fromString($content); if ($globalRequirements) { $v->includeRequirements(false); } else { //nest a requirements backend for our template rendering ...
php
{ "resource": "" }
q17819
SSViewer.parseTemplateContent
train
public function parseTemplateContent($content, $template = "") { return $this->getParser()->compileString( $content, $template,
php
{ "resource": "" }
q17820
FixtureFactory.createObject
train
public function createObject($name, $identifier, $data = null) { if (!isset($this->blueprints[$name])) { $this->blueprints[$name] = new FixtureBlueprint($name); } $blueprint = $this->blueprints[$name];
php
{ "resource": "" }
q17821
FixtureFactory.createRaw
train
public function createRaw($table, $identifier, $data) { $fields = array(); foreach ($data as $fieldName => $fieldVal) { $fields["\"{$fieldName}\""] = $this->parseValue($fieldVal);
php
{ "resource": "" }
q17822
FixtureFactory.getId
train
public function getId($class, $identifier) { if (isset($this->fixtures[$class][$identifier])) {
php
{ "resource": "" }
q17823
FixtureFactory.get
train
public function get($class, $identifier) { $id = $this->getId($class, $identifier); if (!$id) { return null; } // If the class doesn't exist, look for a table instead if (!class_exists($class)) {
php
{ "resource": "" }
q17824
TempFolder.getTempFolder
train
public static function getTempFolder($base) { $parent = static::getTempParentFolder($base); // The actual temp folder is a subfolder of getTempParentFolder(),
php
{ "resource": "" }
q17825
TempFolder.getTempFolderUsername
train
public static function getTempFolderUsername() { $user = Environment::getEnv('APACHE_RUN_USER'); if (!$user) { $user = Environment::getEnv('USER'); } if (!$user) { $user = Environment::getEnv('USERNAME'); } if (!$user && function_exists('posix_...
php
{ "resource": "" }
q17826
TempFolder.getTempParentFolder
train
protected static function getTempParentFolder($base) { // first, try finding a silverstripe-cache dir built off the base path $localPath = Path::join($base, 'silverstripe-cache'); if (@file_exists($localPath)) { if ((fileperms($localPath) & 0777) != 0777) { @chmod...
php
{ "resource": "" }
q17827
Sources.getSortedModules
train
public function getSortedModules() { $i18nOrder = Sources::config()->uninherited('module_priority'); $sortedModules = []; if ($i18nOrder) { Deprecation::notice('5.0', sprintf( '%s.module_priority is deprecated. Use %s.module_priority
php
{ "resource": "" }
q17828
Sources.getLangFiles
train
protected function getLangFiles() { if (static::$cache_lang_files) { return static::$cache_lang_files; } $locales = []; foreach ($this->getLangDirs() as $langPath) { $langFiles = scandir($langPath); foreach ($langFiles as $langFile)
php
{ "resource": "" }
q17829
InjectorLoader.getManifest
train
public function getManifest() { if ($this !== self::$instance) { throw new BadMethodCallException( "Non-current injector manifest cannot be accessed. Please call ->activate() first" ); } if
php
{ "resource": "" }
q17830
CheckboxField.performReadonlyTransformation
train
public function performReadonlyTransformation() { $field = new CheckboxField_Readonly($this->name,
php
{ "resource": "" }
q17831
GroupedDropdownField.getFieldOption
train
protected function getFieldOption($valueOrGroup, $titleOrOptions) { // Return flat option if (!is_array($titleOrOptions)) { return parent::getFieldOption($valueOrGroup, $titleOrOptions); } // Build children from options list $options = new ArrayList(); fo...
php
{ "resource": "" }
q17832
EnvironmentLoader.loadFile
train
public function loadFile($path, $overload = false) { // Not readable if (!file_exists($path) || !is_readable($path)) { return null; } // Parse and cleanup content $result = []; $variables = Parser::parse(file_get_contents($path)); foreach ($variab...
php
{ "resource": "" }
q17833
GridFieldFilterHeader.handleAction
train
public function handleAction(GridField $gridField, $actionName, $arguments, $data) { if (!$this->checkDataType($gridField->getList())) { return; } $state = $gridField->State->GridFieldFilterHeader; $state->Columns = null; if ($actionName === 'filter') { ...
php
{ "resource": "" }
q17834
GridFieldFilterHeader.getSearchFieldSchema
train
public function getSearchFieldSchema(GridField $gridField) { $schemaUrl = Controller::join_links($gridField->Link(), 'schema/SearchForm'); $context = $this->getSearchContext($gridField); $params = $gridField->getRequest()->postVar('filter') ?: []; if (array_key_exists($gridField->ge...
php
{ "resource": "" }
q17835
GridFieldFilterHeader.getSearchForm
train
public function getSearchForm(GridField $gridField) { $searchContext = $this->getSearchContext($gridField); $searchFields = $searchContext->getSearchFields(); if ($searchFields->count() === 0) { return null; } if ($this->searchForm) { return $this->s...
php
{ "resource": "" }
q17836
GridFieldFilterHeader.getSearchFormSchema
train
public function getSearchFormSchema(GridField $gridField) { $form = $this->getSearchForm($gridField); // If there are no filterable fields, return a 400 response if (!$form) { return new HTTPResponse(_t(__CLASS__ . '.SearchFormFaliure', 'No search form could be generated'), 400)...
php
{ "resource": "" }
q17837
GridFieldFilterHeader.getHTMLFragments
train
public function getHTMLFragments($gridField) { $forTemplate = new ArrayData([]); if (!$this->canFilterAnyColumns($gridField)) { return null; } if ($this->useLegacyFilterHeader) { $fieldsList = $this->getLegacyFilterHeader($gridField); $forTemplat...
php
{ "resource": "" }
q17838
Diff.finalize
train
public function finalize() { $lines = array(); foreach ($this->edits as $edit) {
php
{ "resource": "" }
q17839
DatabaseAdapterRegistry.register
train
public static function register($config) { // Validate config $missing = array_diff(['title', 'class', 'helperClass', 'supported'], array_keys($config)); if ($missing) { throw new InvalidArgumentException( "Missing database helper config keys: '" . implode("', '",...
php
{ "resource": "" }
q17840
DatabaseAdapterRegistry.getDatabaseConfigurationHelper
train
public static function getDatabaseConfigurationHelper($databaseClass) { $adapters = static::get_adapters(); if (empty($adapters[$databaseClass]) || empty($adapters[$databaseClass]['helperClass'])) { return null; } // Load if path given if
php
{ "resource": "" }
q17841
ExtensionMiddleware.getExtraConfig
train
protected function getExtraConfig($class, $classConfig, $excludeMiddleware) { // Note: 'extensions' config needs to come from it's own middleware call in case // applied by delta middleware (e.g. Object::add_extension) $extensionSourceConfig = Config::inst()->get($class, null, Config::UNINHE...
php
{ "resource": "" }
q17842
ErrorDirector.handleRequestWithTokenChain
train
public function handleRequestWithTokenChain( HTTPRequest $request, ConfirmationTokenChain $confirmationTokenChain, Kernel $kernel ) { Injector::inst()->registerService($request, HTTPRequest::class); // Next, check if we're in dev mode, or the database doesn't have any securi...
php
{ "resource": "" }
q17843
LogoutHandler.logout
train
public function logout() { $member = Security::getCurrentUser(); // If the user doesn't have a security token, show them a form where they can get one. // This protects against nuisance CSRF attacks to log out users. if ($member && !SecurityToken::inst()->checkRequest($this->getRequ...
php
{ "resource": "" }
q17844
Group.collateFamilyIDs
train
public function collateFamilyIDs() { if (!$this->exists()) { throw new \InvalidArgumentException("Cannot call collateFamilyIDs on unsaved Group."); } $familyIDs = array(); $chunkToAdd = array($this->ID); while ($chunkToAdd) { $familyIDs = array_merge...
php
{ "resource": "" }
q17845
Group.collateAncestorIDs
train
public function collateAncestorIDs() { $parent = $this; $items = []; while ($parent instanceof Group) { $items[] =
php
{ "resource": "" }
q17846
Group.inGroups
train
public function inGroups($groups, $requireAll = false) { $ancestorIDs = $this->collateAncestorIDs(); $candidateIDs = []; foreach ($groups as $group) { $groupID = $this->identifierToGroupID($group); if ($groupID) { $candidateIDs[] = $groupID; ...
php
{ "resource": "" }
q17847
Group.identifierToGroupID
train
protected function identifierToGroupID($groupID) { if (is_numeric($groupID) && Group::get()->byID($groupID)) { return $groupID; } elseif (is_string($groupID) && $groupByCode = Group::get()->filter(['Code' => $groupID])->first()) {
php
{ "resource": "" }
q17848
Group.stageChildren
train
public function stageChildren() { return Group::get() ->filter("ParentID", $this->ID)
php
{ "resource": "" }
q17849
Group.canEdit
train
public function canEdit($member = null) { if (!$member) { $member = Security::getCurrentUser(); } // extended access checks $results = $this->extend('canEdit', $member); if ($results && is_array($results)) { if (!min($results)) { retur...
php
{ "resource": "" }
q17850
Group.canView
train
public function canView($member = null) { if (!$member) { $member = Security::getCurrentUser(); } // extended access checks $results = $this->extend('canView', $member); if ($results && is_array($results)) { if (!min($results)) { retur...
php
{ "resource": "" }
q17851
Group.AllChildrenIncludingDeleted
train
public function AllChildrenIncludingDeleted() { $children = parent::AllChildrenIncludingDeleted(); $filteredChildren = new ArrayList(); if ($children) { foreach ($children as $child) { /** @var
php
{ "resource": "" }
q17852
CSVParser.mapColumns
train
public function mapColumns($columnMap) { if ($columnMap) { $lowerColumnMap = array(); foreach ($columnMap as $k => $v) { $lowerColumnMap[strtolower($k)] = $v;
php
{ "resource": "" }
q17853
CSVParser.openFile
train
protected function openFile() { ini_set('auto_detect_line_endings', 1); $this->fileHandle = fopen($this->filename, 'r'); if ($this->providedHeaderRow) {
php
{ "resource": "" }
q17854
CSVParser.closeFile
train
protected function closeFile() { if ($this->fileHandle) { fclose($this->fileHandle);
php
{ "resource": "" }
q17855
CSVParser.fetchCSVHeader
train
protected function fetchCSVHeader() { $srcRow = fgetcsv( $this->fileHandle, 0, $this->delimiter,
php
{ "resource": "" }
q17856
ThemeManifest.getCacheKey
train
public function getCacheKey($includeTests = false) { return sha1(sprintf(
php
{ "resource": "" }
q17857
ThemeManifest.handleDirectory
train
public function handleDirectory($basename, $pathname, $depth) { if ($basename !== self::TEMPLATES_DIR) {
php
{ "resource": "" }
q17858
ThemeResourceLoader.getSet
train
public function getSet($set) { if (isset($this->sets[$set])) {
php
{ "resource": "" }
q17859
ThemeResourceLoader.getPath
train
public function getPath($identifier) { $slashPos = strpos($identifier, '/'); $parts = explode(':', $identifier, 2); // If identifier starts with "/", it's a path from root if ($slashPos === 0) { if (count($parts) > 1) { throw new InvalidArgumentException(...
php
{ "resource": "" }
q17860
ThemeResourceLoader.findTemplate
train
public function findTemplate($template, $themes = null) { if ($themes === null) { $themes = SSViewer::get_themes(); } // Look for a cached result for this data set $cacheKey = md5(json_encode($template) . json_encode($themes)); if ($this->getCache()->has($cacheKe...
php
{ "resource": "" }
q17861
ThemeResourceLoader.findThemedJavascript
train
public function findThemedJavascript($name, $themes = null) { if ($themes === null) { $themes = SSViewer::get_themes(); } if (substr($name, -3) !== '.js') { $name .= '.js'; }
php
{ "resource": "" }
q17862
ThemeResourceLoader.findThemedResource
train
public function findThemedResource($resource, $themes = null) { if ($themes === null) { $themes = SSViewer::get_themes(); } $paths = $this->getThemePaths($themes); foreach ($paths as $themePath) { $relativePath = Path::join($themePath, $resource); ...
php
{ "resource": "" }
q17863
ThemeResourceLoader.getThemePaths
train
public function getThemePaths($themes = null) { if ($themes === null) { $themes = SSViewer::get_themes(); } $paths = []; foreach ($themes as $themename) { // Expand theme sets $set = $this->getSet($themename);
php
{ "resource": "" }
q17864
HTTPRequest.setUrl
train
public function setUrl($url) { $this->url = $url; // Normalize URL if its relative (strictly speaking), or has leading slashes if (Director::is_relative_url($url) || preg_match('/^\//', $url)) { $this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'), array('/','',''), $this->...
php
{ "resource": "" }
q17865
HTTPRequest.addHeader
train
public function addHeader($header, $value) { $header = strtolower($header);
php
{ "resource": "" }
q17866
HTTPRequest.getURL
train
public function getURL($includeGetVars = false) { $url = ($this->getExtension()) ? $this->url . '.' . $this->getExtension() : $this->url; if ($includeGetVars) {
php
{ "resource": "" }
q17867
HTTPRequest.shiftAllParams
train
public function shiftAllParams() { $keys = array_keys($this->allParams); $values = array_values($this->allParams); $value = array_shift($values); // push additional unparsed URL parts onto the parameter stack if (array_key_exists($this->unshiftedButParsedParts, $this->...
php
{ "resource": "" }
q17868
HTTPRequest.isEmptyPattern
train
public function isEmptyPattern($pattern) { if (preg_match('/^([A-Za-z]+) +(.*)$/', $pattern, $matches)) {
php
{ "resource": "" }
q17869
HTTPRequest.shift
train
public function shift($count = 1) { $return = array(); if ($count == 1) { return array_shift($this->dirParts); } for ($i=0; $i<$count; $i++) { $value = array_shift($this->dirParts);
php
{ "resource": "" }
q17870
HTTPRequest.setIP
train
public function setIP($ip) { if (!filter_var($ip, FILTER_VALIDATE_IP)) {
php
{ "resource": "" }
q17871
HTTPRequest.getAcceptMimetypes
train
public function getAcceptMimetypes($includeQuality = false) { $mimetypes = array(); $mimetypesWithQuality = preg_split('#\s*,\s*#', $this->getHeader('accept')); foreach ($mimetypesWithQuality as $mimetypeWithQuality) {
php
{ "resource": "" }
q17872
HTTPRequest.detect_method
train
public static function detect_method($origMethod, $postVars) { if (isset($postVars['_method'])) { if (!in_array(strtoupper($postVars['_method']), array('GET','POST','PUT','DELETE','HEAD'))) { user_error('HTTPRequest::detect_method():
php
{ "resource": "" }
q17873
DBField.create_field
train
public static function create_field($spec, $value, $name = null, ...$args) { // Raise warning if inconsistent with DataObject::dbObject() behaviour // This will cause spec args to be shifted down by the number of provided $args if ($args && strpos($spec, '(') !== false) { trigger...
php
{ "resource": "" }
q17874
DBField.setName
train
public function setName($name) { if ($this->name && $this->name !== $name) { user_error("DBField::setName() shouldn't be called once a
php
{ "resource": "" }
q17875
DBField.prepValueForDB
train
public function prepValueForDB($value) { if ($value === null || $value === "" || $value === false || ($this->scalarValueOnly() && !is_scalar($value))
php
{ "resource": "" }
q17876
DBField.saveInto
train
public function saveInto($dataObject) { $fieldName = $this->name; if (empty($fieldName)) { throw new \BadMethodCallException( "DBField::saveInto()
php
{ "resource": "" }
q17877
DBField.scaffoldFormField
train
public function scaffoldFormField($title = null, $params =
php
{ "resource": "" }
q17878
Rule.compile
train
function compile($indent) { $function_name = $this->function_name( $this->name ) ; // Build the typestack $typestack = array(); $class=$this; do { $typestack[] = $this->function_name($class->name); } while($class = $class->extends); $typestack = "array('" . implode("','", $typestack) . "')"; /...
php
{ "resource": "" }
q17879
SQLDelete.addDelete
train
public function addDelete($tables) { if (is_array($tables)) { $this->delete = array_merge($this->delete, $tables); } elseif (!empty($tables)) {
php
{ "resource": "" }
q17880
SymfonyMessageProvider.load
train
protected function load($locale) { if (isset($this->loadedLocales[$locale])) { return; } // Add full locale file. E.g. 'en_NZ' $this ->getTranslator() ->addResource('ss', $this->getSourceDirs(), $locale); // Add lang-only file. E.g. 'en' ...
php
{ "resource": "" }
q17881
SymfonyMessageProvider.templateInjection
train
protected function templateInjection($injection) { $injection = $injection ?: []; // Rewrite injection to {} surrounded placeholders $arguments = array_combine( array_map(function ($val) {
php
{ "resource": "" }
q17882
DBSchemaManager.schemaUpdate
train
public function schemaUpdate($callback) { // Begin schema update $this->schemaIsUpdating = true; // Update table list $this->tableList = array(); $tables = $this->tableList(); foreach ($tables as $table) { $this->tableList[strtolower($table)] = $table; ...
php
{ "resource": "" }
q17883
DBSchemaManager.transCreateTable
train
public function transCreateTable($table, $options = null, $advanced_options = null) { $this->schemaUpdateTransaction[$table] = array( 'command' => 'create', 'newFields' => array(),
php
{ "resource": "" }
q17884
DBSchemaManager.transAlterTable
train
public function transAlterTable($table, $options, $advanced_options) { $this->transInitTable($table); $this->schemaUpdateTransaction[$table]['alteredOptions'] = $options;
php
{ "resource": "" }
q17885
DBSchemaManager.transCreateField
train
public function transCreateField($table, $field, $schema) { $this->transInitTable($table);
php
{ "resource": "" }
q17886
DBSchemaManager.transCreateIndex
train
public function transCreateIndex($table, $index, $schema) { $this->transInitTable($table);
php
{ "resource": "" }
q17887
DBSchemaManager.transAlterField
train
public function transAlterField($table, $field, $schema) { $this->transInitTable($table);
php
{ "resource": "" }
q17888
DBSchemaManager.transAlterIndex
train
public function transAlterIndex($table, $index, $schema) { $this->transInitTable($table);
php
{ "resource": "" }
q17889
DBSchemaManager.determineIndexType
train
protected function determineIndexType($spec) { // check array spec if (is_array($spec) && isset($spec['type'])) { return $spec['type'];
php
{ "resource": "" }
q17890
DBSchemaManager.hasField
train
public function hasField($tableName, $fieldName) { if (!$this->hasTable($tableName)) {
php
{ "resource": "" }
q17891
DBSchemaManager.alterationMessage
train
public function alterationMessage($message, $type = "") { if (!$this->supressOutput) { if (Director::is_cli()) { switch ($type) { case "created": case "changed": case "repaired": $sign = "+"; ...
php
{ "resource": "" }
q17892
DBSchemaManager.fixTableCase
train
public function fixTableCase($tableName) { // Check if table exists $tables = $this->tableList(); if (!array_key_exists(strtolower($tableName), $tables)) { return; } // Check if case differs $currentName = $tables[strtolower($tableName)]; if ($cur...
php
{ "resource": "" }
q17893
i18nTextCollectorTask.getIsMerge
train
protected function getIsMerge($request) { $merge = $request->getVar('merge'); // Default to true if not given if (!isset($merge)) { return true; }
php
{ "resource": "" }
q17894
ManyManyList.linkJoinTable
train
protected function linkJoinTable() { // Join to the many-many join table $dataClassIDColumn = DataObject::getSchema()->sqlColumnForField($this->dataClass(), 'ID'); $this->dataQuery->innerJoin( $this->joinTable, "\"{$this->joinTable}\".\"{$this->localKey}\" = {$dataCla...
php
{ "resource": "" }
q17895
ManyManyList.createDataObject
train
public function createDataObject($row) { // remove any composed fields $add = []; if ($this->_compositeExtraFields) { foreach ($this->_compositeExtraFields as $fieldName => $composed) { // convert joined extra fields into their composite field types. ...
php
{ "resource": "" }
q17896
ManyManyList.foreignIDFilter
train
protected function foreignIDFilter($id = null) { if ($id === null) { $id = $this->getForeignID(); } // Apply relation filter $key = "\"{$this->joinTable}\".\"{$this->foreignKey}\""; if (is_array($id)) {
php
{ "resource": "" }
q17897
ManyManyList.getExtraData
train
public function getExtraData($componentName, $itemID) { $result = []; // Skip if no extrafields or unsaved record if (empty($this->extraFields) || empty($itemID)) { return $result; } if (!is_numeric($itemID)) { throw new InvalidArgumentException('Man...
php
{ "resource": "" }
q17898
Hierarchy.AllChildrenIncludingDeleted
train
public function AllChildrenIncludingDeleted() { /** @var DataObject|Hierarchy|Versioned $owner */ $owner = $this->owner; $stageChildren = $owner->stageChildren(true); // Add live site content that doesn't exist on the stage site, if required. if ($owner->hasExtension(Version...
php
{ "resource": "" }
q17899
Hierarchy.AllHistoricalChildren
train
public function AllHistoricalChildren() { /** @var DataObject|Versioned|Hierarchy $owner */ $owner = $this->owner; if (!$owner->hasExtension(Versioned::class) || !$owner->hasStages()) { throw new Exception( 'Hierarchy->AllHistoricalChildren() only works with Versi...
php
{ "resource": "" }