_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q17500 | DefaultFormFactory.getFormActions | train | protected function getFormActions(RequestHandler $controller = null, $name, $context = [])
{
// @todo Deprecate or formalise support for getCMSActions()
$actions = $context['Record']->getCMSActions();
| php | {
"resource": ""
} |
q17501 | RememberLoginHash.getNewHash | train | public function getNewHash(Member $member)
{
$generator = new RandomGenerator();
$this->setToken($generator->randomToken('sha1')); | php | {
"resource": ""
} |
q17502 | RememberLoginHash.generate | train | public static function generate(Member $member)
{
if (!$member->exists()) {
return null;
}
if (static::config()->force_single_token) {
RememberLoginHash::get()->filter('MemberID', $member->ID)->removeAll();
}
/** @var RememberLoginHash $rememberLoginHa... | php | {
"resource": ""
} |
q17503 | RememberLoginHash.renew | train | public function renew()
{
$hash = $this->getNewHash($this->Member());
$this->Hash = $hash;
| php | {
"resource": ""
} |
q17504 | RememberLoginHash.clear | train | public static function clear(Member $member, $alcDevice = null)
{
if (!$member->exists()) {
return;
}
$filter = array('MemberID'=>$member->ID);
if (!static::config()->logout_across_devices && $alcDevice) {
| php | {
"resource": ""
} |
q17505 | ContentNegotiator.enabled_for | train | public static function enabled_for($response)
{
$contentType = $response->getHeader("Content-Type");
// Disable content negotiation for other content types
if ($contentType
&& substr($contentType, 0, 9) != 'text/html' | php | {
"resource": ""
} |
q17506 | CsvBulkLoader.splitFile | train | protected function splitFile($path, $lines = null)
{
Deprecation::notice('5.0', 'splitFile is deprecated, please process files using a stream');
$previous = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', true);
if (!is_int($lines)) {
$lines = $... | php | {
"resource": ""
} |
q17507 | FormSchema.getSchema | train | public function getSchema(Form $form)
{
$schema = [
'name' => $form->getName(),
'id' => $form->FormName(),
'action' => $form->FormAction(),
'method' => $form->FormMethod(),
'attributes' => $form->getAttributes(),
'data' => [],
... | php | {
"resource": ""
} |
q17508 | FormSchema.getState | train | public function getState(Form $form)
{
$state = [
'id' => $form->FormName(),
'fields' => [],
'messages' => [],
'notifyUnsavedChanges' => $form->getNotifyUnsavedChanges(),
];
// flattened nested fields are returned, rather than only top level f... | php | {
"resource": ""
} |
q17509 | FormSchema.getSchemaForMessage | train | protected function getSchemaForMessage($message)
{
// Form schema messages treat simple strings as plain text, so nest for html messages
$value = $message['message'];
if ($message['messageCast'] === ValidationResult::CAST_HTML) {
$value = ['html' => $message];
}
| php | {
"resource": ""
} |
q17510 | PjaxResponseNegotiator.respond | train | public function respond(HTTPRequest $request, $extraCallbacks = array())
{
// Prepare the default options and combine with the others
$callbacks = array_merge($this->callbacks, $extraCallbacks);
$response = $this->getResponse();
$responseParts = array();
if (isset($this->fr... | php | {
"resource": ""
} |
q17511 | GridFieldExportButton.getExportColumnsForGridField | train | protected function getExportColumnsForGridField(GridField $gridField)
{
if ($this->exportColumns) {
return $this->exportColumns;
}
/** @var GridFieldDataColumns $dataCols */
$dataCols = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
if ... | php | {
"resource": ""
} |
q17512 | ListboxField.Field | train | public function Field($properties = array())
{
$properties = array_merge($properties, array( | php | {
"resource": ""
} |
q17513 | CookieAuthenticationHandler.clearCookies | train | protected function clearCookies()
{
$secure = $this->getTokenCookieSecure();
Cookie::set($this->getTokenCookieName(), null, null, null, null, $secure);
| php | {
"resource": ""
} |
q17514 | Extensible.add_extension | train | public static function add_extension($classOrExtension, $extension = null)
{
if ($extension) {
$class = $classOrExtension;
} else {
$class = get_called_class();
$extension = $classOrExtension;
}
if (!preg_match('/^([^(]*)/', $extension, $matches))... | php | {
"resource": ""
} |
q17515 | Extensible.get_extra_config_sources | train | public static function get_extra_config_sources($class = null)
{
if (!$class) {
$class = get_called_class();
}
// If this class is unextendable, NOP
if (in_array($class, self::$unextendable_classes)) {
return null;
}
// Variable to hold sourc... | php | {
"resource": ""
} |
q17516 | Extensible.extend | train | public function extend($method, &$a1 = null, &$a2 = null, &$a3 = null, &$a4 = null, &$a5 = null, &$a6 = null, &$a7 = null)
{
$values = array();
if (!empty($this->beforeExtendCallbacks[$method])) {
foreach (array_reverse($this->beforeExtendCallbacks[$method]) as $callback) {
... | php | {
"resource": ""
} |
q17517 | Extensible.getExtensionInstance | train | public function getExtensionInstance($extension)
{
$instances = $this->getExtensionInstances();
if (array_key_exists($extension, $instances)) {
return $instances[$extension];
}
// in case Injector has been used to replace an extension
| php | {
"resource": ""
} |
q17518 | LogoutForm.getFormFields | train | protected function getFormFields()
{
$fields = FieldList::create();
$controller = $this->getController();
$backURL = $controller->getBackURL()
?: $controller->getReturnReferer();
// Protect against infinite redirection back to the logout URL after logging out
| php | {
"resource": ""
} |
q17519 | HTTP.filename2url | train | public static function filename2url($filename)
{
$filename = realpath($filename);
if (!$filename) {
return null;
}
// Filter files outside of the webroot
$base = realpath(BASE_PATH);
$baseLength = strlen($base);
if (substr($filename, 0, $baseLengt... | php | {
"resource": ""
} |
q17520 | HTTP.absoluteURLs | train | public static function absoluteURLs($html)
{
$html = str_replace('$CurrentPageURL', Controller::curr()->getRequest()->getURL(), $html);
return HTTP::urlRewriter($html, function ($url) {
//no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character ":... | php | {
"resource": ""
} |
q17521 | HTTP.urlRewriter | train | public static function urlRewriter($content, $code)
{
if (!is_callable($code)) {
throw new InvalidArgumentException(
'HTTP::urlRewriter expects a callable as the second parameter'
);
}
// Replace attributes
$attribs = ["src", "background", "a"... | php | {
"resource": ""
} |
q17522 | HTTP.findByTagAndAttribute | train | public static function findByTagAndAttribute($content, $attributes)
{
$regexes = [];
foreach ($attributes as $tag => $attribute) {
$regexes[] = "/<{$tag} [^>]*$attribute *= *([\"'])(.*?)\\1[^>]*>/i";
$regexes[] = "/<{$tag} [^>]*$attribute *= *([^ \"'>]+)/i";
}
... | php | {
"resource": ""
} |
q17523 | HTTP.get_mime_type | train | public static function get_mime_type($filename)
{
// If the finfo module is compiled into PHP, use it.
$path = BASE_PATH . DIRECTORY_SEPARATOR . $filename;
if (class_exists('finfo') && file_exists($path)) {
$finfo = new finfo(FILEINFO_MIME_TYPE);
return $finfo->file($... | php | {
"resource": ""
} |
q17524 | HTTP.set_cache_age | train | public static function set_cache_age($age)
{
Deprecation::notice('5.0', 'Use HTTPCacheControlMiddleware::singleton()->setMaxAge($age) instead');
| php | {
"resource": ""
} |
q17525 | HTTP.augmentState | train | public static function augmentState(HTTPRequest $request, HTTPResponse $response)
{
// Skip if deprecated API is disabled
$config = Config::forClass(HTTP::class);
if ($config->get('ignoreDeprecatedCaching')) {
return;
}
$cacheControlMiddleware = HTTPCacheControlM... | php | {
"resource": ""
} |
q17526 | ComparisonFilter.applyOne | train | protected function applyOne(DataQuery $query)
{
$this->model = $query->applyRelation($this->relation);
$predicate = sprintf("%s %s ?", $this->getDbName(), $this->getOperator());
$clause = [$predicate => $this->getDbFormattedValue()];
| php | {
"resource": ""
} |
q17527 | ArrayList.dataClass | train | public function dataClass()
{
if ($this->dataClass) {
return $this->dataClass;
| php | {
"resource": ""
} |
q17528 | ArrayList.toNestedArray | train | public function toNestedArray()
{
$result = [];
foreach ($this->items as $item) {
if (is_object($item)) {
if (method_exists($item, 'toMap')) {
| php | {
"resource": ""
} |
q17529 | ArrayList.limit | train | public function limit($length, $offset = 0)
{
// Type checking: designed for consistency with DataList::limit()
if (!is_numeric($length) || !is_numeric($offset)) {
Deprecation::notice(
'4.3',
'Arguments to ArrayList::limit() should be numeric'
... | php | {
"resource": ""
} |
q17530 | ArrayList.remove | train | public function remove($item)
{
$renumberKeys = false;
foreach ($this->items as $key => $value) {
if ($item === $value) {
$renumberKeys = true;
| php | {
"resource": ""
} |
q17531 | ArrayList.replace | train | public function replace($item, $with)
{
foreach ($this->items as $key => $candidate) {
| php | {
"resource": ""
} |
q17532 | ArrayList.removeDuplicates | train | public function removeDuplicates($field = 'ID')
{
$seen = [];
$renumberKeys = false;
foreach ($this->items as $key => $item) {
$value = $this->extractValue($item, $field);
if (array_key_exists($value, $seen)) {
$renumberKeys = true;
u... | php | {
"resource": ""
} |
q17533 | ArrayList.find | train | public function find($key, $value)
{
foreach ($this->items as $item) {
if ($this->extractValue($item, $key) == $value) {
| php | {
"resource": ""
} |
q17534 | ArrayList.column | train | public function column($colName = 'ID')
{
$result = [];
foreach ($this->items as | php | {
"resource": ""
} |
q17535 | ArrayList.sort | train | public function sort()
{
$args = func_get_args();
if (count($args)==0) {
return $this;
}
if (count($args)>2) {
throw new InvalidArgumentException('This method takes zero, one or two arguments');
}
$columnsToSort = [];
// One argument ... | php | {
"resource": ""
} |
q17536 | ArrayList.canFilterBy | train | public function canFilterBy($by)
{
if (empty($this->items)) {
return false;
}
| php | {
"resource": ""
} |
q17537 | ArrayList.filter | train | public function filter()
{
$keepUs = call_user_func_array([$this, 'normaliseFilterArgs'], func_get_args());
$itemsToKeep = [];
foreach ($this->items as $item) {
$keepItem = true;
foreach ($keepUs as $column => $value) {
if ((is_array($value) && !in_a... | php | {
"resource": ""
} |
q17538 | ArrayList.filterAny | train | public function filterAny()
{
$keepUs = $this->normaliseFilterArgs(...func_get_args());
$itemsToKeep = [];
foreach ($this->items as $item) {
foreach ($keepUs as $column => $value) {
$extractedValue = $this->extractValue($item, $column);
| php | {
"resource": ""
} |
q17539 | ArrayList.exclude | train | public function exclude()
{
$removeUs = $this->normaliseFilterArgs(...func_get_args());
$hitsRequiredToRemove = count($removeUs);
$matches = [];
foreach ($removeUs as $column => $excludeValue) {
foreach ($this->items as $key => $item) {
if (!is_array($exc... | php | {
"resource": ""
} |
q17540 | UnsavedRelationList.changeToList | train | public function changeToList(RelationList $list)
{
foreach ($this->items as $key => $item) {
| php | {
"resource": ""
} |
q17541 | UnsavedRelationList.push | train | public function push($item, $extraFields = null)
{
if ((is_object($item) && !$item instanceof $this->dataClass)
|| (!is_object($item) && !is_numeric($item))) {
throw new InvalidArgumentException(
| php | {
"resource": ""
} |
q17542 | UnsavedRelationList.toArray | train | public function toArray()
{
$items = array();
foreach ($this->items as $key => $item) {
if (is_numeric($item)) {
$item = DataObject::get_by_id($this->dataClass, $item);
}
if (!empty($this->extraFields[$key])) {
| php | {
"resource": ""
} |
q17543 | UnsavedRelationList.first | train | public function first()
{
$item = reset($this->items);
if (is_numeric($item)) {
$item = DataObject::get_by_id($this->dataClass, $item);
}
| php | {
"resource": ""
} |
q17544 | UnsavedRelationList.last | train | public function last()
{
$item = end($this->items);
if (!empty($this->extraFields[key($this->items)])) {
| php | {
"resource": ""
} |
q17545 | UnsavedRelationList.forForeignID | train | public function forForeignID($id)
{
$singleton = DataObject::singleton($this->baseClass);
/** @var Relation $relation */
| php | {
"resource": ""
} |
q17546 | GridFieldPageCount.getPaginator | train | protected function getPaginator($gridField)
{
/** @var GridFieldPaginator $paginator */
$paginator = $gridField->getConfig()->getComponentByType(GridFieldPaginator::class);
if (!$paginator && GridFieldPageCount::config()->uninherited('require_paginator')) {
throw new LogicExcept... | php | {
"resource": ""
} |
q17547 | DBClassName.getBaseClass | train | public function getBaseClass()
{
// Use explicit base class
if ($this->baseClass) {
return $this->baseClass;
}
// Default to the basename of the record
$schema = DataObject::getSchema();
if ($this->record) {
return $schema->baseDataClass($this-... | php | {
"resource": ""
} |
q17548 | DBClassName.getShortName | train | public function getShortName()
{
$value = $this->getValue();
if (empty($value) || | php | {
"resource": ""
} |
q17549 | DBClassName.getEnum | train | public function getEnum()
{
$classNames = ClassInfo::subclassesFor($this->getBaseClass());
$dataobject = strtolower(DataObject::class);
| php | {
"resource": ""
} |
q17550 | FormField.name_to_label | train | public static function name_to_label($fieldName)
{
// Handle dot delimiters
if (strpos($fieldName, '.') !== false) {
$parts = explode('.', $fieldName);
// Ensure that any letter following a dot is uppercased, so that the regex below can break it up
// into words
... | php | {
"resource": ""
} |
q17551 | FormField.Link | train | public function Link($action = null)
{
if (!$this->form) {
throw new LogicException(
'Field must be associated with a form to call Link(). Please use $field->setForm($form);'
);
}
$link | php | {
"resource": ""
} |
q17552 | FormField.getAttributes | train | public function getAttributes()
{
$attributes = array(
'type' => $this->getInputType(),
'name' => $this->getName(),
'value' => $this->Value(),
'class' => $this->extraClass(),
'id' => $this->ID(),
'disabled' => $this->isDisabled(),
| php | {
"resource": ""
} |
q17553 | FormField.Field | train | public function Field($properties = array())
{
$context = $this;
$this->extend('onBeforeRender', $context, $properties);
if (count($properties)) {
$context = $context->customise($properties);
}
$result = $context->renderWith($this->getTemplates());
// ... | php | {
"resource": ""
} |
q17554 | FormField.FieldHolder | train | public function FieldHolder($properties = array())
{
$context = $this;
if (count($properties)) {
$context = $this->customise($properties);
| php | {
"resource": ""
} |
q17555 | FormField._templates | train | protected function _templates($customTemplate = null, $customTemplateSuffix = null)
{
$templates = SSViewer::get_templates_by_class(static::class, $customTemplateSuffix, __CLASS__);
// Prefer any custom template
if ($customTemplate) {
| php | {
"resource": ""
} |
q17556 | FormField.performReadonlyTransformation | train | public function performReadonlyTransformation()
{
$readonlyClassName = static::class . '_Readonly';
if (ClassInfo::exists($readonlyClassName)) {
$clone = $this->castedCopy($readonlyClassName);
} else {
| php | {
"resource": ""
} |
q17557 | FormField.performDisabledTransformation | train | public function performDisabledTransformation()
{
$disabledClassName = static::class . '_Disabled';
if (ClassInfo::exists($disabledClassName)) {
| php | {
"resource": ""
} |
q17558 | FormField.hasClass | train | public function hasClass($class)
{
$classes = explode(' ', strtolower($this->extraClass()));
| php | {
"resource": ""
} |
q17559 | FormField.castedCopy | train | public function castedCopy($classOrCopy)
{
$field = $classOrCopy;
if (!is_object($field)) {
$field = $classOrCopy::create($this->name);
}
$field
->setValue($this->value)
->setForm($this->form)
->setTitle($this->Title())
->... | php | {
"resource": ""
} |
q17560 | FormField.getSchemaData | train | public function getSchemaData()
{
$defaults = $this->getSchemaDataDefaults();
return | php | {
"resource": ""
} |
q17561 | FormField.getSchemaState | train | public function getSchemaState()
{
$defaults = $this->getSchemaStateDefaults();
return | php | {
"resource": ""
} |
q17562 | PaginatedList.getPageStart | train | public function getPageStart()
{
$request = $this->getRequest();
if ($this->pageStart === null) {
if ($request
&& isset($request[$this->getPaginationGetVar()])
&& $request[$this->getPaginationGetVar()] > 0
) {
| php | {
"resource": ""
} |
q17563 | PaginatedList.getTotalItems | train | public function getTotalItems()
{
if ($this->totalItems === null) { | php | {
"resource": ""
} |
q17564 | PaginatedList.setPaginationFromQuery | train | public function setPaginationFromQuery(SQLSelect $query)
{
if ($limit = $query->getLimit()) {
$this->setPageLength($limit['limit']);
$this->setPageStart($limit['start']);
| php | {
"resource": ""
} |
q17565 | PaginatedList.Pages | train | public function Pages($max = null)
{
$result = new ArrayList();
if ($max) {
$start = ($this->CurrentPage() - floor($max / 2)) - 1;
$end = $this->CurrentPage() + floor($max / 2);
if ($start < 0) {
$start = 0;
$end = $max;
... | php | {
"resource": ""
} |
q17566 | PaginatedList.PaginationSummary | train | public function PaginationSummary($context = 4)
{
$result = new ArrayList();
$current = $this->CurrentPage();
$total = $this->TotalPages();
// Make the number even for offset calculations.
if ($context % 2) {
$context--;
}
// If the first or last... | php | {
"resource": ""
} |
q17567 | PaginatedList.LastItem | train | public function LastItem()
{
$pageLength = $this->getPageLength();
if (!$pageLength) {
return $this->getTotalItems();
} elseif ($start = $this->getPageStart()) {
| php | {
"resource": ""
} |
q17568 | PaginatedList.FirstLink | train | public function FirstLink()
{
return HTTP::setGetVar(
$this->getPaginationGetVar(),
0,
| php | {
"resource": ""
} |
q17569 | PaginatedList.LastLink | train | public function LastLink()
{
return HTTP::setGetVar(
$this->getPaginationGetVar(),
($this->TotalPages() - 1) * $this->getPageLength(),
| php | {
"resource": ""
} |
q17570 | PaginatedList.NextLink | train | public function NextLink()
{
if ($this->NotLastPage()) {
return HTTP::setGetVar(
$this->getPaginationGetVar(),
| php | {
"resource": ""
} |
q17571 | PaginatedList.PrevLink | train | public function PrevLink()
{
if ($this->NotFirstPage()) {
return HTTP::setGetVar(
$this->getPaginationGetVar(),
| php | {
"resource": ""
} |
q17572 | FormScaffolder.addManyManyRelationshipFields | train | public static function addManyManyRelationshipFields(
FieldList &$fields,
$relationship,
$overrideFieldClass,
$tabbed,
DataObject $dataObject
) {
if ($tabbed) {
$fields->findOrMakeTab(
"Root.$relationship",
$dataObject->fiel... | php | {
"resource": ""
} |
q17573 | ShortcodeParser.register | train | public function register($shortcode, $callback)
{
if (is_callable($callback)) {
$this->shortcodes[$shortcode] = $callback;
} else {
| php | {
"resource": ""
} |
q17574 | ShortcodeParser.callShortcode | train | public function callShortcode($tag, $attributes, $content, $extra = array())
{
if (!$tag || !isset($this->shortcodes[$tag])) {
| php | {
"resource": ""
} |
q17575 | ShortcodeParser.replaceTagsWithText | train | protected function replaceTagsWithText($content, $tags, $generator)
{
// The string with tags replaced with markers
$str = '';
// The start index of the next tag, remembered as we step backwards through the list
$li = null;
$i = count($tags);
while ($i--) {
... | php | {
"resource": ""
} |
q17576 | ShortcodeParser.replaceAttributeTagsWithContent | train | protected function replaceAttributeTagsWithContent($htmlvalue)
{
$attributes = $htmlvalue->query('//@*[contains(.,"[")][contains(.,"]")]');
$parser = $this;
for ($i = 0; $i < $attributes->length; $i++) {
$node = $attributes->item($i);
$tags = $this->extractTags($node... | php | {
"resource": ""
} |
q17577 | ShortcodeParser.replaceElementTagsWithMarkers | train | protected function replaceElementTagsWithMarkers($content)
{
$tags = $this->extractTags($content);
if ($tags) {
$markerClass = self::$marker_class;
$content = $this->replaceTagsWithText($content, $tags, function ($idx, $tag) use ($markerClass) {
| php | {
"resource": ""
} |
q17578 | ShortcodeParser.moveMarkerToCompliantHome | train | protected function moveMarkerToCompliantHome($node, $parent, $location)
{
// Move before block parent
if ($location == self::BEFORE) {
if (isset($parent->parentNode)) {
$parent->parentNode->insertBefore($node, $parent);
}
} elseif ($location == self::A... | php | {
"resource": ""
} |
q17579 | ShortcodeParser.replaceMarkerWithContent | train | protected function replaceMarkerWithContent($node, $tag)
{
$content = $this->getShortcodeReplacementText($tag);
if ($content) {
/** @var HTMLValue $parsed */
$parsed = HTMLValue::create($content);
$body = $parsed->getBody();
| php | {
"resource": ""
} |
q17580 | ShortcodeParser.parse | train | public function parse($content)
{
$this->extend('onBeforeParse', $content);
$continue = true;
// If no shortcodes defined, don't try and parse any
if (!$this->shortcodes) {
$continue = false;
} elseif (!trim($content)) {
// If no content, don't try a... | php | {
"resource": ""
} |
q17581 | ArrayData.getField | train | public function getField($field)
{
$value = $this->array[$field];
if (is_object($value) && !$value instanceof ViewableData) {
return new ArrayData($value);
| php | {
"resource": ""
} |
q17582 | ArrayData.array_to_object | train | public static function array_to_object($arr = null)
{
$obj = new stdClass();
if ($arr) {
foreach ($arr as $name => $value) {
| php | {
"resource": ""
} |
q17583 | ClassManifest.getParser | train | public function getParser()
{
if (!$this->parser) {
$this->parser = (new | php | {
"resource": ""
} |
q17584 | ClassManifest.getTraverser | train | public function getTraverser()
{
if (!$this->traverser) {
$this->traverser = new NodeTraverser;
$this->traverser->addVisitor(new NameResolver);
| php | {
"resource": ""
} |
q17585 | ClassManifest.getItemPath | train | public function getItemPath($name)
{
$lowerName = strtolower($name);
foreach ([
$this->classes,
$this->interfaces,
$this->traits,
] as $source) {
| php | {
"resource": ""
} |
q17586 | ClassManifest.getItemName | train | public function getItemName($name)
{
$lowerName = strtolower($name);
foreach ([
$this->classNames,
$this->interfaceNames,
$this->traitNames,
] as $source) {
| php | {
"resource": ""
} |
q17587 | ClassManifest.getImplementorsOf | train | public function getImplementorsOf($interface)
{
$lowerInterface = strtolower($interface);
if (array_key_exists($lowerInterface, $this->implementors)) | php | {
"resource": ""
} |
q17588 | ClassManifest.regenerate | train | public function regenerate($includeTests)
{
// Reset the manifest so stale info doesn't cause errors.
$this->loadState([]);
$this->roots = [];
$this->children = [];
$finder = new ManifestFileFinder();
$finder->setOptions(array(
'name_regex' => '/^[^_].*\\... | php | {
"resource": ""
} |
q17589 | ClassManifest.coalesceDescendants | train | protected function coalesceDescendants($class)
{
// Reset descendents to immediate children initially
$lowerClass = strtolower($class);
if (empty($this->children[$lowerClass])) {
return [];
}
// Coalasce children into descendent list
$this->descendants[$l... | php | {
"resource": ""
} |
q17590 | ClassManifest.loadState | train | protected function loadState($data)
{
$success = true;
foreach ($this->serialisedProperties as $property) {
if (!isset($data[$property]) || !is_array($data[$property])) {
| php | {
"resource": ""
} |
q17591 | ClassManifest.getState | train | protected function getState()
{
$data = [];
foreach ($this->serialisedProperties as | php | {
"resource": ""
} |
q17592 | ClassManifest.validateItemCache | train | protected function validateItemCache($data)
{
if (!$data || !is_array($data)) {
return false;
}
foreach (['classes', 'interfaces', 'traits'] as $key) {
// Must be set
if (!isset($data[$key])) {
return false;
}
// and... | php | {
"resource": ""
} |
q17593 | HTMLValue.getDocument | train | public function getDocument()
{
if (!$this->valid) {
return false;
} elseif ($this->document) {
return $this->document;
} else {
$this->document = new DOMDocument('1.0', 'UTF-8');
| php | {
"resource": ""
} |
q17594 | GridField.getModelClass | train | public function getModelClass()
{
if ($this->modelClassName) {
return $this->modelClassName;
}
/** @var DataList|ArrayList $list */
$list = $this->list;
if ($list && $list->hasMethod('dataClass')) { | php | {
"resource": ""
} |
q17595 | GridField.performReadonlyTransformation | train | public function performReadonlyTransformation()
{
$copy = clone $this;
$copy->setReadonly(true);
$copyConfig = $copy->getConfig();
// get the whitelist for allowable readonly components
$allowedComponents = $this->getReadonlyComponents();
foreach ($this->getConfig()-... | php | {
"resource": ""
} |
q17596 | GridField.getColumns | train | public function getColumns()
{
$columns = array();
foreach ($this->getComponents() as $item) {
| php | {
"resource": ""
} |
q17597 | GridField.getColumnContent | train | public function getColumnContent($record, $column)
{
if (!$this->columnDispatch) {
$this->buildColumnDispatch();
}
if (!empty($this->columnDispatch[$column])) {
$content = '';
foreach ($this->columnDispatch[$column] as $handler) {
/**
... | php | {
"resource": ""
} |
q17598 | GridField.addDataFields | train | public function addDataFields($fields)
{
if ($this->customDataFields) {
$this->customDataFields | php | {
"resource": ""
} |
q17599 | GridField.getDataFieldValue | train | public function getDataFieldValue($record, $fieldName)
{
if (isset($this->customDataFields[$fieldName])) {
$callback = $this->customDataFields[$fieldName];
return $callback($record);
}
if ($record->hasMethod('relField')) {
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.