_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245100 | ItemList.addFilterRule | validation | public function addFilterRule($objFilterRule)
{
if (!$this->objFilter) {
$this->objFilter = $this->objMetaModel->getEmptyFilter();
}
$this->objFilter->addFilterRule($objFilterRule);
return $this;
} | php | {
"resource": ""
} |
q245101 | ItemList.getAttributeNames | validation | protected function getAttributeNames()
{
$arrAttributes = $this->objView->getSettingNames();
// Get the right jumpTo.
$strDesiredLanguage = $this->getMetaModel()->getActiveLanguage();
$strFallbackLanguage = $this->getMetaModel()->getFallbackLanguage();
$intFilterSettings =... | php | {
"resource": ""
} |
q245102 | ItemList.prepare | validation | public function prepare()
{
if ($this->objItems) {
return $this;
}
// Create an empty filter object if not done before.
if (!$this->objFilter) {
$this->objFilter = $this->objMetaModel->getEmptyFilter();
}
if ($this->objFilterSettings) {
... | php | {
"resource": ""
} |
q245103 | ItemList.getOutputFormat | validation | public function getOutputFormat()
{
if (isset($this->strOutputFormat)) {
return $this->strOutputFormat;
}
if (isset($this->objView) && $this->objView->get('format')) {
return $this->objView->get('format');
}
$page = $this->getPage();
if ($pa... | php | {
"resource": ""
} |
q245104 | ItemList.getCaptionText | validation | private function getCaptionText($langKey)
{
$tableName = $this->getMetaModel()->getTableName();
if (isset($this->objView)
&& isset($GLOBALS['TL_LANG']['MSC'][$tableName][$this->objView->get('id')][$langKey])
) {
return $GLOBALS['TL_LANG']['MSC'][$tableName][$this->obj... | php | {
"resource": ""
} |
q245105 | ItemList.setTitleAndDescription | validation | private function setTitleAndDescription()
{
$page = $this->getPage();
if ($page && $this->objItems->getCount()) {
// Add title if needed.
if (!empty($this->strTitleAttribute)) {
while ($this->objItems->next()) {
/** @var IItem $objCurrentIt... | php | {
"resource": ""
} |
q245106 | ItemList.render | validation | public function render($blnNoNativeParsing, $objCaller)
{
$event = new RenderItemListEvent($this, $this->objTemplate, $objCaller);
$this->getEventDispatcher()->dispatch(MetaModelsEvents::RENDER_ITEM_LIST, $event);
$this->objTemplate->noItemsMsg = $this->getNoItemsCaption();
$this->o... | php | {
"resource": ""
} |
q245107 | BasicDefinitionBuilder.getOrCreateBasicDefinition | validation | private function getOrCreateBasicDefinition(IMetaModelDataDefinition $container)
{
if ($container->hasBasicDefinition()) {
return $container->getBasicDefinition();
}
$config = new DefaultBasicDefinition();
$container->setBasicDefinition($config);
return $config;
... | php | {
"resource": ""
} |
q245108 | TlClassWizardListener.handle | validation | public function handle(ManipulateWidgetEvent $event)
{
if (!($this->wantToHandle($event) && ('tl_class' === $event->getProperty()->getName()))) {
return;
}
$link = ' <a href="%1$s" onclick="Backend.getScrollOffset();Backend.openModalIframe({' .
'\'width\':765,' .
... | php | {
"resource": ""
} |
q245109 | SearchablePages.getConfigs | validation | protected function getConfigs()
{
if (!count($this->configs)) {
// Init the config from database.
$statement = $this->connection->query('SELECT * FROM tl_metamodel_searchable_pages');
$this->configs = $statement->fetchAll(\PDO::FETCH_ASSOC);
}
return $th... | php | {
"resource": ""
} |
q245110 | SearchablePages.getMetaModel | validation | protected function getMetaModel($identifier, $ignoreError)
{
// Get the factory.
$factory = $this->getMetaModelsFactory();
// Id to name.
if (is_numeric($identifier)) {
$identifier = $factory->translateIdToMetaModelName($identifier);
}
// Create mm, if y... | php | {
"resource": ""
} |
q245111 | SearchablePages.getView | validation | protected function getView($identifier, $view)
{
$metaModels = $this->getMetaModel($identifier, false);
return $metaModels->getView($view);
} | php | {
"resource": ""
} |
q245112 | SearchablePages.getLanguage | validation | protected function getLanguage($singleLanguage, $metaModels)
{
if (!empty($singleLanguage)) {
return array($singleLanguage);
} elseif ($metaModels->isTranslated() && $metaModels->getAvailableLanguages()) {
return $metaModels->getAvailableLanguages();
}
return... | php | {
"resource": ""
} |
q245113 | SearchablePages.getJumpTosFor | validation | protected function getJumpTosFor($metaModels, $filter, $view, $rootPage = null)
{
$entries = array();
// Get the object.
$items = $metaModels->findByFilter($filter);
/** @var Item $item */
foreach ($items as $item) {
$jumpTo = $item->buildJumpToLink($view);
... | php | {
"resource": ""
} |
q245114 | SearchablePages.getBaseUrl | validation | private function getBaseUrl($pageDetails, $path = null, $ignoreSSL = false)
{
$url = new UrlBuilder();
// Set the domain (see contao/core#6421)
if ($pageDetails['domain']) {
$url->setHost($pageDetails['domain']);
} else {
$url->setHost(\Environment::get('host... | php | {
"resource": ""
} |
q245115 | SearchablePages.removeEmptyDetailPages | validation | protected function removeEmptyDetailPages($jumpTos)
{
// Remove the detail pages.
foreach ($jumpTos as $jumpTo) {
// Get the page from the url.
$event = new GetPageDetailsEvent($jumpTo['value']);
$this->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_GET_P... | php | {
"resource": ""
} |
q245116 | SearchablePages.addPages | validation | public function addPages($pages, $rootPage = null, $fromSiteMap = false, $language = null)
{
// Save the pages.
$this->foundPages = $pages;
unset($pages);
// Run each entry in the published config array.
foreach ($this->getConfigs() as $config) {
if (!$config['pu... | php | {
"resource": ""
} |
q245117 | SearchablePages.getMetaModelsPages | validation | private function getMetaModelsPages(
$config,
$rootPage = null,
$language = null
) {
$metaModelsIdentifier = $config['pid'];
$filterIdentifier = $config['filter'];
$presetParams = StringUtil::deserialize($config['filterparams'], true);
$renderSetti... | php | {
"resource": ""
} |
q245118 | FilterBuilderSql.build | validation | public function build()
{
if (!$this->isEmpty()) {
return new SimpleQuery(
sprintf('SELECT id FROM %s WHERE %s', $this->tableName, $this->getProcedure()),
$this->getParameters(),
'id',
$this->connection
);
}
... | php | {
"resource": ""
} |
q245119 | FilterBuilderSql.addChild | validation | public function addChild($child)
{
if (!\is_array($child)) {
throw new \RuntimeException('Error Processing sub filter: ' . var_export($child, true), 1);
}
switch (strtoupper($child['operation'])) {
case '=':
case '>':
case '<':
... | php | {
"resource": ""
} |
q245120 | FilterBuilderSql.addSubProcedure | validation | public function addSubProcedure(FilterBuilderSql $subProcedure)
{
$this->procedures[] = $subProcedure->getProcedure();
$this->parameter = array_merge($this->parameter, $subProcedure->getParameters());
return $this;
} | php | {
"resource": ""
} |
q245121 | Collection.getJumpToLabel | validation | private function getJumpToLabel()
{
$tableName = $this->metaModel->getTableName();
if (isset($GLOBALS['TL_LANG']['MSC'][$tableName][$this->get('id')]['details'])) {
return $GLOBALS['TL_LANG']['MSC'][$tableName][$this->get('id')]['details'];
} elseif (isset($GLOBALS['TL_LANG']['M... | php | {
"resource": ""
} |
q245122 | Collection.getPageDetails | validation | private function getPageDetails($pageId)
{
if (empty($pageId)) {
return array();
}
$event = new GetPageDetailsEvent($pageId);
$this->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_GET_PAGE_DETAILS, $event);
return $event->getPageDetails();
} | php | {
"resource": ""
} |
q245123 | Collection.determineJumpToInformation | validation | private function determineJumpToInformation()
{
// Get the right jumpto.
$translated = $this->metaModel->isTranslated();
$desiredLanguage = $this->metaModel->getActiveLanguage();
$fallbackLanguage = $this->metaModel->getFallbackLanguage();
$jumpToPageId = '';
... | php | {
"resource": ""
} |
q245124 | IconBuilder.getBackendIcon | validation | public function getBackendIcon($icon, $defaultIcon = 'bundles/metamodelscore/images/icons/metamodels.png')
{
$realIcon = $this->convertValueToPath($icon, $defaultIcon);
$targetPath = $this->outputPath . '/' . basename($realIcon);
if (\file_exists($targetPath)) {
return $this->w... | php | {
"resource": ""
} |
q245125 | FilterSettingFactory.createSetting | validation | private function createSetting($dbResult, $filterSettings)
{
$factory = $this->getTypeFactory($dbResult['type']);
if ($factory) {
$setting = $factory->createInstance($dbResult, $filterSettings);
if (!$setting) {
return null;
}
// Coll... | php | {
"resource": ""
} |
q245126 | FilterSettingFactory.collectRulesFor | validation | private function collectRulesFor($parentSetting, $filterSettings)
{
$childInformation = $this->database
->createQueryBuilder()
->select('*')
->from('tl_metamodel_filtersetting')
->where('pid=:pid')
->andWhere('enabled=1')
->orderBy('sor... | php | {
"resource": ""
} |
q245127 | FilterSettingFactory.collectRules | validation | public function collectRules($filterSettings)
{
$information = $this->database
->createQueryBuilder()
->select('*')
->from('tl_metamodel_filtersetting')
->where('fid=:fid')
->andWhere('pid=0')
->andWhere('enabled=1')
->order... | php | {
"resource": ""
} |
q245128 | AbstractContentElementAndModuleCallback.editRenderSettingButton | validation | public function editRenderSettingButton(\DC_Table $dataContainer)
{
if ($dataContainer->value < 1) {
return '';
}
$url = $this->urlBuilderFactory->create('contao/main.php?do=metamodels&table=tl_metamodel_rendersetting')
->setQueryParameter(
'pid',
... | php | {
"resource": ""
} |
q245129 | AbstractContentElementAndModuleCallback.getAttributeNames | validation | public function getAttributeNames(\DC_Table $objDc)
{
$attributeNames = [
'sorting' => $GLOBALS['TL_LANG']['MSC']['metamodels_sorting'],
'random' => $GLOBALS['TL_LANG']['MSC']['random'],
'id' => $GLOBALS['TL_LANG']['MSC']['id'][0]
];
$metaModelName ... | php | {
"resource": ""
} |
q245130 | AbstractContentElementAndModuleCallback.getFilterSettings | validation | public function getFilterSettings(\DC_Table $objDC)
{
$filterSettings = $this->connection->createQueryBuilder()
->select('f.id', 'f.name')
->from('tl_metamodel_filter', 'f')
->where('f.pid=:id')
->setParameter('id', $objDC->activeRecord->metamodel)
... | php | {
"resource": ""
} |
q245131 | AbstractContentElementAndModuleCallback.buildFilterParamsFor | validation | protected function buildFilterParamsFor(\DC_Table $dataContainer, $elementName)
{
if (!$this->requestStack->getCurrentRequest()->query->get('act')) {
return;
}
$filterId = $this->connection->createQueryBuilder()
->select('c.metamodel_filtering')
->from(st... | php | {
"resource": ""
} |
q245132 | AbstractContentElementAndModuleCallback.loadCallback | validation | public function loadCallback(string $value = null)
{
return null === $value ? null : trim(\base64_encode($value), '=');
} | php | {
"resource": ""
} |
q245133 | AbstractContentElementAndModuleCallback.getFilterParameterNames | validation | public function getFilterParameterNames(\DC_Table $objDc)
{
$return = array();
$filter = $objDc->activeRecord->metamodel_filtering;
if (!$filter) {
return $return;
}
$collection = $this->filterFactory->createCollection($filter);
return $collection->getP... | php | {
"resource": ""
} |
q245134 | AbstractContentElementAndModuleCallback.renderEditButton | validation | private function renderEditButton($caption, $title, UrlBuilder $url)
{
$icon = $this->iconBuilder->getBackendIconImageTag(
'system/themes/flexible/icons/alias.svg',
$caption,
'style="vertical-align:top"'
);
return sprintf(
'<a href="%s" title=... | php | {
"resource": ""
} |
q245135 | AbstractContentElementAndModuleCallback.getFilteredAttributeNames | validation | private function getFilteredAttributeNames($metaModelId, $allowedTypes = array())
{
$attributeNames = array();
if ($metaModel = $this->factory->getMetaModel($this->factory->translateIdToMetaModelName($metaModelId))) {
foreach ($metaModel->getAttributes() as $attribute) {
... | php | {
"resource": ""
} |
q245136 | GetMetaModelTrait.getMetaModel | validation | protected function getMetaModel($metaModelId)
{
if (null === $this->factory) {
throw new \RuntimeException('No factory set.');
}
$metaModelName = $this->factory->translateIdToMetaModelName($metaModelId);
$metaModel = $this->factory->getMetaModel($metaModelName);
... | php | {
"resource": ""
} |
q245137 | ModuleCallback.getTemplates | validation | public function getTemplates(\DC_Table $objDC)
{
/** @noinspection PhpUndefinedFieldInspection */
$type = $objDC->activeRecord->type;
return $this->getTemplateList('mod_' . $type);
} | php | {
"resource": ""
} |
q245138 | LanguageCodeWizardListener.pagePicker | validation | public function pagePicker(ManipulateWidgetEvent $event)
{
if (!$this->scopeDeterminator->currentScopeIsBackend()
|| !('tl_metamodel_rendersettings' === $event->getEnvironment()->getDataDefinition()->getName())
|| !((0 === strpos($event->getProperty()->getName(), 'jumpTo'))
... | php | {
"resource": ""
} |
q245139 | BaseSimple.handleMetaChange | validation | public function handleMetaChange($strMetaName, $varNewValue)
{
// By default we accept any change of meta information.
if ($strMetaName == 'colname') {
if ($this->get($strMetaName) != $varNewValue) {
$this->renameColumn($varNewValue);
}
return $thi... | php | {
"resource": ""
} |
q245140 | BaseSimple.setDataFor | validation | public function setDataFor($arrValues)
{
$strTable = $this->getMetaModel()->getTableName();
$strColName = $this->getColName();
foreach ($arrValues as $intId => $varData) {
if (is_array($varData)) {
$varData = serialize($varData);
}
$this... | php | {
"resource": ""
} |
q245141 | BaseSimple.searchFor | validation | public function searchFor($strPattern)
{
// Base implementation, do a simple search on given column.
$strPattern = str_replace(array('*', '?'), array('%', '_'), $strPattern);
$arrIds = $this->connection->createQueryBuilder()
->select('id')
->from($this->getMetaMod... | php | {
"resource": ""
} |
q245142 | BaseSimple.createColumn | validation | public function createColumn()
{
if ($this->getColName()) {
$this->tableManipulator->createColumn(
$this->getMetaModel()->getTableName(),
$this->getColName(),
$this->getSQLDataType()
);
}
} | php | {
"resource": ""
} |
q245143 | BaseSimple.deleteColumn | validation | public function deleteColumn()
{
$schemaManager = $this->connection->getSchemaManager();
$columns = $schemaManager->listTableColumns($this->getMetaModel()->getTableName());
// Try to delete the column. If it does not exist as we can assume it has been deleted already then.
if ... | php | {
"resource": ""
} |
q245144 | BaseSimple.renameColumn | validation | public function renameColumn($strNewColumnName)
{
$this->tableManipulator->checkColumnName($strNewColumnName);
$schemaManager = $this->connection->getSchemaManager();
$columns = $schemaManager->listTableIndexes($this->getMetaModel()->getTableName());
if ($this->getColName() &... | php | {
"resource": ""
} |
q245145 | InputScreenOptionListener.handle | validation | public function handle(GetOptionsEvent $event)
{
if (('tl_metamodel_dca_combine' !== $event->getEnvironment()->getDataDefinition()->getName())
|| ('rows' !== $event->getPropertyName())
|| ('dca_id' !== $event->getSubPropertyName())) {
return;
}
$screens =... | php | {
"resource": ""
} |
q245146 | Model.getPropertyNames | validation | protected function getPropertyNames()
{
$propertyNames = array('id', 'pid', 'tstamp', 'sorting');
if ($this->getItem()->getMetaModel()->hasVariants()) {
$propertyNames[] = 'varbase';
$propertyNames[] = 'vargroup';
}
return array_merge($propertyNames, array_k... | php | {
"resource": ""
} |
q245147 | GroupOptionListener.handle | validation | public function handle(GetOptionsEvent $event)
{
if (('tl_metamodel_dca_combine' !== $event->getEnvironment()->getDataDefinition()->getName())
|| ('rows' !== $event->getPropertyName())
|| !in_array($event->getSubPropertyName(), ['be_group', 'fe_group'])) {
return;
... | php | {
"resource": ""
} |
q245148 | MetaModelDefinitionBuilderTrait.handle | validation | public function handle(BuildDataDefinitionEvent $event)
{
$container = $event->getContainer();
if ($container instanceof IMetaModelDataDefinition) {
$this->build($container);
}
} | php | {
"resource": ""
} |
q245149 | ToolboxFile.setAcceptedExtensions | validation | public function setAcceptedExtensions($acceptedExtensions)
{
// We must not allow file extensions that are globally disabled.
$allowedDownload = StringUtil::trimsplit(',', $GLOBALS['TL_CONFIG']['allowedDownload']);
if (!is_array($acceptedExtensions)) {
$acceptedExtensions = Stri... | php | {
"resource": ""
} |
q245150 | ToolboxFile.addPathById | validation | public function addPathById($strId)
{
// Check if empty.
if (empty($strId)) {
return $this;
}
if (!Validator::isBinaryUuid($strId)) {
$this->pendingIds[] = StringUtil::uuidToBin($strId);
return $this;
}
$this->pendingIds[] = $strI... | php | {
"resource": ""
} |
q245151 | ToolboxFile.getDownloadLink | validation | protected function getDownloadLink($strFile)
{
if (!isset($_SESSION['metaModels_downloads'][$strFile])) {
$_SESSION['metaModels_downloads'][$strFile] = md5(uniqid());
}
return UrlBuilder::fromUrl(Environment::get('request'))
->setQueryParameter('file', urlencode($str... | php | {
"resource": ""
} |
q245152 | ToolboxFile.fetchAdditionalData | validation | protected function fetchAdditionalData()
{
$this->modifiedTime = array();
$this->outputBuffer = array();
if (!$this->foundFiles) {
return;
}
foreach ($this->foundFiles as $strFile) {
$this->processFile($strFile);
}
} | php | {
"resource": ""
} |
q245153 | ToolboxFile.remapSorting | validation | protected function remapSorting($arrFiles, $arrSource)
{
$files = array();
$source = array();
foreach (array_keys($arrFiles) as $k) {
$files[] = $arrFiles[$k];
$source[] = $arrSource[$k];
}
$this->addClasses($source);
return array
... | php | {
"resource": ""
} |
q245154 | ToolboxFile.sortFiles | validation | public function sortFiles($sortType, $sortIds = array())
{
switch ($sortType) {
case 'name_desc':
return $this->sortByName(false);
case 'date_asc':
return $this->sortByDate(true);
case 'date_desc':
return $this->sortByDate... | php | {
"resource": ""
} |
q245155 | ToolboxFile.sortByName | validation | protected function sortByName($blnAscending = true)
{
$arrFiles = $this->foundFiles;
if (!$arrFiles) {
return array('files' => array(), 'source' => array());
}
\uasort($arrFiles, ($blnAscending) ? '\basename_natcasecmp' : '\basename_natcasercmp');
return $this-... | php | {
"resource": ""
} |
q245156 | ToolboxFile.sortByDate | validation | protected function sortByDate($blnAscending = true)
{
$arrFiles = $this->foundFiles;
$arrDates = $this->modifiedTime;
if (!$arrFiles) {
return array('files' => array(), 'source' => array());
}
if ($blnAscending) {
array_multisort($arrFiles, SORT_NUME... | php | {
"resource": ""
} |
q245157 | ToolboxFile.sortByIdList | validation | protected function sortByIdList($sortIds)
{
$fileMap = $this->foundFiles;
if (!$fileMap) {
return array('files' => array(), 'source' => array());
}
$fileKeys = array_flip(array_keys($this->uuidMap));
$sorted = array();
foreach ($sortIds as $sortStringId)... | php | {
"resource": ""
} |
q245158 | ToolboxFile.sortByRandom | validation | protected function sortByRandom()
{
$arrFiles = $this->foundFiles;
$arrSource = $this->outputBuffer;
if (!$arrFiles) {
return array('files' => array(), 'source' => array());
}
$keys = array_keys($arrFiles);
$files = array();
shuffle($keys);
... | php | {
"resource": ""
} |
q245159 | ToolboxFile.checkDownloads | validation | private function checkDownloads()
{
// If images are to be shown, get out.
if ($this->getShowImages()) {
return;
}
if (($file = Input::get('file')) && ($key = Input::get('fileKey'))) {
// Check key and return 403 if mismatch.
if (!(array_key_exists... | php | {
"resource": ""
} |
q245160 | ToolboxFile.convertUuidsOrPathsToMetaModels | validation | public static function convertUuidsOrPathsToMetaModels($values)
{
$values = array_filter((array) $values);
if (empty($values)) {
return array(
'bin' => array(),
'value' => array(),
'path' => array(),
'meta' => array()
... | php | {
"resource": ""
} |
q245161 | ToolboxFile.addFileModels | validation | private function addFileModels($files, $skipPaths = array())
{
$baseLanguage = $this->getBaseLanguage();
$fallbackLanguage = $this->getFallbackLanguage();
foreach ($files as $file) {
if ('folder' === $file->type && !in_array($file->path, $skipPaths)) {
$this->... | php | {
"resource": ""
} |
q245162 | ToolboxFile.processFile | validation | private function processFile($fileName)
{
$file = new File($fileName);
$meta = $this->metaInformation[dirname($fileName)][$file->basename];
$title = strlen($meta['title']) ? $meta['title'] : StringUtil::specialchars($file->basename);
if (strlen($meta['caption'])) {
$alt... | php | {
"resource": ""
} |
q245163 | ToolboxFile.resizeImage | validation | private function resizeImage($fileName)
{
list($width, $height, $mode) = $this->getResizeImages();
if ($this->getShowImages() && ($width || $height || $mode)) {
if ($this->imageFactory) {
$image = $this->imageFactory->create(
$this->rootDir . '/' . $fi... | php | {
"resource": ""
} |
q245164 | MetaModelHybrid.getConnection | validation | protected function getConnection()
{
if (null === $this->connection) {
// @codingStandardsIgnoreStart
@trigger_error(
'Connection is missing in class ' . static::class .
'. The automatic fallback will be dropped in MetaModels 3.0. Please use dependency... | php | {
"resource": ""
} |
q245165 | ValueListener.getValueOptions | validation | public function getValueOptions(GetPropertyOptionsEvent $event)
{
if (!$this->wantToHandle($event)) {
return;
}
$model = $event->getModel();
$metaModel = $this->getMetaModel($event->getEnvironment());
$attribute = $metaModel->getAttributeById($model->getPrope... | php | {
"resource": ""
} |
q245166 | ValueListener.decodeValue | validation | public function decodeValue(DecodePropertyValueForWidgetEvent $event)
{
if (!$this->wantToHandle($event)) {
return;
}
if (is_array($event->getValue())) {
$values = [];
foreach ($event->getValue() as $value) {
$values[] = 'value_' . $value... | php | {
"resource": ""
} |
q245167 | ValueListener.encodeValue | validation | public function encodeValue(EncodePropertyValueFromWidgetEvent $event)
{
if (!$this->wantToHandle($event)) {
return;
}
if (is_array($event->getValue())) {
$values = [];
foreach ($event->getValue() as $value) {
$values[] = substr($value, 6... | php | {
"resource": ""
} |
q245168 | ValueListener.setValueOptionsMultiple | validation | public function setValueOptionsMultiple(ManipulateWidgetEvent $event)
{
if (!$this->wantToHandle($event)) {
return;
}
if ($event->getModel()->getProperty('type') !== 'conditionpropertycontainanyof') {
return;
}
$metaModel = $this->getMetaModel($event... | php | {
"resource": ""
} |
q245169 | ValueListener.getOptionsViaDcGeneral | validation | private function getOptionsViaDcGeneral($metaModel, $environment, $attribute)
{
$factory = DcGeneralFactory::deriveEmptyFromEnvironment($environment)
->setContainerName($metaModel->getTableName());
$dcGeneral = $factory->createDcGeneral();
$subEnv = $dcGeneral->getEnvironment(... | php | {
"resource": ""
} |
q245170 | PropertyDefinitionBuilder.build | validation | protected function build(IMetaModelDataDefinition $container)
{
$inputScreen = $this->viewCombination->getScreen($container->getName());
if (!$inputScreen) {
return;
}
if ($container->hasPropertiesDefinition()) {
$definition = $container->getPropertiesDefinit... | php | {
"resource": ""
} |
q245171 | PropertyDefinitionBuilder.buildProperty | validation | private function buildProperty(PropertiesDefinitionInterface $definition, IAttribute $attribute, array $propInfo)
{
if (!$attribute) {
return;
}
$property = $this->getOrCreateProperty($definition, $attribute->getColName());
$this->setLabel($property, $propInfo, $attribut... | php | {
"resource": ""
} |
q245172 | PropertyDefinitionBuilder.getOrCreateProperty | validation | private function getOrCreateProperty(PropertiesDefinitionInterface $definition, $propName)
{
if ($definition->hasProperty($propName)) {
return $definition->getProperty($propName);
}
$property = new DefaultProperty($propName);
$definition->addProperty($property);
... | php | {
"resource": ""
} |
q245173 | PropertyDefinitionBuilder.setLabel | validation | private function setLabel(PropertyInterface $property, $propInfo, IAttribute $attribute)
{
if ($property->getLabel()) {
return;
}
if (!isset($propInfo['label'])) {
$property->setLabel($attribute->getName());
return;
}
$lang = $propInfo['lab... | php | {
"resource": ""
} |
q245174 | PropertyDefinitionBuilder.setDescription | validation | private function setDescription(PropertyInterface $property, $propInfo)
{
if ($property->getDescription() || !isset($propInfo['description'])) {
return;
}
$property->setDescription($propInfo['description']);
} | php | {
"resource": ""
} |
q245175 | PropertyDefinitionBuilder.setExcluded | validation | private function setExcluded(PropertyInterface $property, $propInfo)
{
if (!isset($propInfo['exclude'])) {
return;
}
$property->setExcluded((bool) $propInfo['exclude']);
} | php | {
"resource": ""
} |
q245176 | PropertyDefinitionBuilder.setSearchable | validation | private function setSearchable(PropertyInterface $property, $propInfo)
{
if (!isset($propInfo['search'])) {
return;
}
$property->setSearchable((bool) $propInfo['search']);
} | php | {
"resource": ""
} |
q245177 | PropertyDefinitionBuilder.setWidgetType | validation | private function setWidgetType(PropertyInterface $property, $propInfo)
{
if (null !== $property->getWidgetType() || !isset($propInfo['inputType'])) {
return;
}
$property->setWidgetType($propInfo['inputType']);
} | php | {
"resource": ""
} |
q245178 | PropertyDefinitionBuilder.setOptions | validation | private function setOptions(PropertyInterface $property, $propInfo)
{
if (null !== $property->getOptions() || !isset($propInfo['options'])) {
return;
}
$property->setOptions($propInfo['options']);
} | php | {
"resource": ""
} |
q245179 | PropertyDefinitionBuilder.setExplanation | validation | private function setExplanation(PropertyInterface $property, $propInfo)
{
if ($property->getExplanation() || !isset($propInfo['explanation'])) {
return;
}
$property->setExplanation($propInfo['explanation']);
} | php | {
"resource": ""
} |
q245180 | PropertyDefinitionBuilder.setEval | validation | private function setEval($property, $propInfo, $isTranslated)
{
$extra = isset($propInfo['eval']) ? $propInfo['eval'] : [];
if ($isTranslated) {
$extra['tl_class'] = 'translat-attr' . (!empty($extra['tl_class']) ? ' ' . $extra['tl_class'] : '');
}
$property->setExtra(arr... | php | {
"resource": ""
} |
q245181 | PropertyDefinitionBuilder.setEmptyValue | validation | private function setEmptyValue(PropertyInterface $property, array $propInfo)
{
if (!array_key_exists('empty_value', $propInfo) || !($property instanceof EmptyValueAwarePropertyInterface)) {
return;
}
$property->setEmptyValue($propInfo['empty_value']);
} | php | {
"resource": ""
} |
q245182 | FallbackPropertyConditionFactory.maxChildren | validation | public function maxChildren($conditionType)
{
if (!isset($GLOBALS['METAMODELS']['inputscreen_conditions'][$conditionType]['maxChildren'])) {
return null;
}
// @codingStandardsIgnoreStart Silencing errors is discouraged
@trigger_error('Configuring input screen conditions ... | php | {
"resource": ""
} |
q245183 | Helper.buildLanguageArray | validation | private static function buildLanguageArray(IMetaModel $metaModel, TranslatorInterface $translator)
{
$languages = array();
foreach ((array) $metaModel->getAvailableLanguages() as $langCode) {
$languages[$langCode] = $translator->translate('LNG.' . $langCode, 'languages');
}
... | php | {
"resource": ""
} |
q245184 | Helper.prepareLanguageAwareWidget | validation | public static function prepareLanguageAwareWidget(
EnvironmentInterface $environment,
PropertyInterface $property,
IMetaModel $metaModel,
$languageLabel,
$valueLabel,
$isTextArea,
$arrValues
) {
if (!$metaModel->isTranslated()) {
$extra = $... | php | {
"resource": ""
} |
q245185 | Helper.searchFiles | validation | public static function searchFiles($folder, $extension)
{
$scanResult = array();
$result = array();
// Check if we have a file or folder.
if (is_dir(TL_ROOT . '/' . $folder)) {
$scanResult = scan(TL_ROOT . '/' . $folder);
}
// Run each value.
... | php | {
"resource": ""
} |
q245186 | LoadDataContainer.onLoadDataContainer | validation | public function onLoadDataContainer($tableName)
{
static $tableExists;
// Test that the tables have been created.
if (null === $tableExists) {
$tableExists = \System::getContainer()
->get('database_connection')
->getSchemaManager()
... | php | {
"resource": ""
} |
q245187 | LoadDataContainer.handleMetaModelTable | validation | private function handleMetaModelTable($tableName)
{
static $tableNames;
if (!$tableNames) {
$tableNames = $this->factory->collectNames();
}
// Not a MetaModel, get out now.
if (!in_array($tableName, $tableNames)) {
return;
}
$this->con... | php | {
"resource": ""
} |
q245188 | LoadDataContainer.handleNonMetaModelTable | validation | private function handleNonMetaModelTable($tableName)
{
// Nothing to do for MetaModel tables.
if (substr($tableName, 0, 3) === 'mm_') {
return;
}
static $map;
if (!isset($map)) {
$map = $this->buildMap();
}
// No children for this tab... | php | {
"resource": ""
} |
q245189 | LoadDataContainer.buildMap | validation | private function buildMap()
{
$map = [];
foreach ($this->combination->getParented() as $childName => $child) {
$map[$child['meta']['ptable']][$childName] = $child;
}
return $map;
} | php | {
"resource": ""
} |
q245190 | LoadDataContainer.buildCaption | validation | private function buildCaption($metaModel, $inputScreen): array
{
$caption = [
sprintf($GLOBALS['TL_LANG']['MSC']['metamodel_edit_as_child']['label'], $metaModel->getName()),
''
];
foreach ($inputScreen['label'] as $langCode => $label) {
if ($label !== '' ... | php | {
"resource": ""
} |
q245191 | LoadDataContainer.buildChildOperationButton | validation | private function buildChildOperationButton($idParameter, $itemId, $href, $label, $name, $icon, $attributes, $table)
{
$modelId = ModelId::fromValues($table, $itemId);
$url = $href . '&' . $idParameter . '=' . $modelId->getSerialized();
// If id parameter different, we have to override i... | php | {
"resource": ""
} |
q245192 | Item.isEmptyValue | validation | protected function isEmptyValue($mixValue)
{
if (is_array($mixValue)) {
return $this->isArrayEmpty($mixValue);
} elseif ($mixValue === '') {
return true;
} elseif ($mixValue === null) {
return true;
}
return false;
} | php | {
"resource": ""
} |
q245193 | Item.isArrayEmpty | validation | protected function isArrayEmpty($arrArray)
{
// First off check for simple types.
if (empty($arrArray)) {
return true;
}
// Next check for a value array.
if (is_array($arrArray) && array_key_exists('value', $arrArray)) {
return $this->isArrayEmpty($arr... | php | {
"resource": ""
} |
q245194 | Item.get | validation | public function get($strAttributeName)
{
return array_key_exists($strAttributeName, $this->arrData) ? $this->arrData[$strAttributeName] : null;
} | php | {
"resource": ""
} |
q245195 | Item.getVariants | validation | public function getVariants($objFilter)
{
if ($this->isVariantBase()) {
return $this->getMetaModel()->findVariants(array($this->get('id')), $objFilter);
}
return null;
} | php | {
"resource": ""
} |
q245196 | Item.getVariantBase | validation | public function getVariantBase()
{
if ($this->getMetaModel()->hasVariants() && !$this->isVariantBase()) {
return $this->getMetaModel()->findById($this->get('vargroup'));
}
return $this;
} | php | {
"resource": ""
} |
q245197 | Item.getSiblings | validation | public function getSiblings($objFilter)
{
if (!$this->getMetaModel()->hasVariants()) {
return null;
}
return $this->getMetaModel()->findVariantsWithBase(array($this->get('id')), $objFilter);
} | php | {
"resource": ""
} |
q245198 | Item.save | validation | public function save($timestamp = null)
{
if (null === $timestamp) {
// @codingStandardsIgnoreStart
@\trigger_error(
'Not passing a timestamp has been deprecated and will cause an error in MetaModels 3',
E_USER_DEPRECATED
);
// ... | php | {
"resource": ""
} |
q245199 | Item.registerAssets | validation | protected function registerAssets($objSettings)
{
if (!$objSettings) {
return;
}
// Include CSS.
$arrCss = $objSettings->get('additionalCss');
foreach ((array) $arrCss as $arrFile) {
if ($arrFile['published']) {
$GLOBALS['TL_CSS'][md5... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.