idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
42,400
private function determineEmptyValueFromSql ( PropertyInterface $ property , $ sqlType ) { if ( $ property instanceof EmptyValueAwarePropertyInterface ) { $ property -> setEmptyValue ( Widget :: getEmptyValueByFieldType ( $ sqlType ) ) ; } }
Try to determine the empty type from SQL type .
42,401
protected function checkCreatable ( $ model ) { $ environment = $ this -> getEnvironment ( ) ; $ definition = $ this -> getDataDefinition ( ) ; if ( ! ( $ model -> getId ( ) || $ definition -> getBasicDefinition ( ) -> isCreatable ( ) ) ) { $ message = 'DataContainer ' . $ definition -> getName ( ) . ' is closed' ; $ e...
Ensure the view is editable and throw an Exception if not .
42,402
protected function handlePrePersist ( ) { $ environment = $ this -> getEnvironment ( ) ; if ( null !== $ this -> preFunction ) { \ call_user_func ( $ this -> preFunction , $ environment , $ this -> model , $ this -> originalModel ) ; } $ environment -> getEventDispatcher ( ) -> dispatch ( PrePersistModelEvent :: NAME ,...
Trigger the pre persist event and handle the prePersist function if available .
42,403
protected function getButtonLabel ( $ buttonLabel ) { $ translator = $ this -> getEnvironment ( ) -> getTranslator ( ) ; if ( ( $ label = $ translator -> translate ( $ buttonLabel , $ this -> getDataDefinition ( ) -> getName ( ) ) ) !== $ buttonLabel ) { return $ label ; } if ( ( $ label = $ translator -> translate ( '...
Get the label for a button from the translator .
42,404
protected function buildFieldSet ( $ widgetManager , $ palette , $ propertyValues ) { $ environment = $ this -> getEnvironment ( ) ; $ definition = $ this -> getDataDefinition ( ) ; $ translator = $ environment -> getTranslator ( ) ; $ propertyDefinitions = $ definition -> getPropertiesDefinition ( ) ; $ isAutoSubmit =...
Build the field sets .
42,405
protected function handleSubmit ( ModelInterface $ model ) { $ environment = $ this -> getEnvironment ( ) ; $ dispatcher = $ environment -> getEventDispatcher ( ) ; $ inputProvider = $ environment -> getInputProvider ( ) ; if ( $ inputProvider -> hasValue ( 'save' ) ) { $ newUrlEvent = new AddToUrlEvent ( 'act=edit&id=...
Handle the submit and determine which button has been triggered .
42,406
protected function getHeadline ( ) { $ definitionName = $ this -> getDataDefinition ( ) -> getName ( ) ; $ translator = $ this -> getEnvironment ( ) -> getTranslator ( ) ; if ( $ this -> model -> getId ( ) ) { $ headline = $ translator -> translate ( 'editRecord' , $ definitionName , [ $ this -> model -> getId ( ) ] ) ...
Determine the headline to use .
42,407
protected function doPersist ( ) { $ environment = $ this -> getEnvironment ( ) ; $ dataProvider = $ environment -> getDataProvider ( $ this -> model -> getProviderName ( ) ) ; $ inputProvider = $ environment -> getInputProvider ( ) ; if ( ! $ this -> model -> getMeta ( ModelInterface :: IS_CHANGED ) ) { return true ; ...
Handle the persisting of the currently loaded model .
42,408
protected function allValuesUnique ( ) { $ environment = $ this -> getEnvironment ( ) ; $ translator = $ environment -> getTranslator ( ) ; $ dataProvider = $ environment -> getDataProvider ( $ this -> model -> getProviderName ( ) ) ; $ editInformation = $ GLOBALS [ 'container' ] [ 'dc-general.edit-information' ] ; for...
Check if all values are unique but only for the fields which have the option enabled .
42,409
private function isLegendVisible ( $ legend , $ legendStates ) { if ( \ array_key_exists ( $ legend -> getName ( ) , $ legendStates ) ) { return $ legendStates [ $ legend -> getName ( ) ] ; } return $ legend -> isInitialVisible ( ) ; }
Determine if the passed legend is visible or collapsed .
42,410
private function getLegendStates ( ) { $ environment = $ this -> getEnvironment ( ) ; $ definition = $ environment -> getDataDefinition ( ) ; $ legendStates = $ environment -> getSessionStorage ( ) -> get ( 'LEGENDS' ) ? : [ ] ; if ( \ array_key_exists ( $ definition -> getName ( ) , $ legendStates ) ) { $ legendStates...
Obtain the legend states .
42,411
public function getSerialized ( ) { if ( \ is_numeric ( $ this -> modelId ) ) { return \ sprintf ( '%s::%s' , $ this -> dataProviderName , $ this -> modelId ) ; } return \ sprintf ( '%s::%s' , $ this -> dataProviderName , \ base64_encode ( \ json_encode ( $ this -> modelId ) ) ) ; }
Serialize the id .
42,412
public function update ( $ event , $ value ) { if ( null === $ value ) { return ; } $ event -> setAdditional ( $ value ) ; $ event -> stopPropagation ( ) ; }
Update the event with the information returned by the callback .
42,413
public function handleAction ( ActionEvent $ event ) { if ( ! $ this -> scopeDeterminator -> currentScopeIsBackend ( ) ) { return ; } $ this -> checkLanguage ( $ event -> getEnvironment ( ) , 'create' === $ event -> getAction ( ) -> getName ( ) ) ; }
Handle action events .
42,414
private function checkLanguage ( $ environment , $ resetToFallback ) { $ sessionStorage = $ environment -> getSessionStorage ( ) ; $ dataProvider = $ environment -> getDataProvider ( ) ; $ providerName = $ environment -> getDataDefinition ( ) -> getName ( ) ; $ modelId = $ this -> modelIdFromInput ( $ environment -> ge...
Check if the data provider is multi language and prepare the data provider with the selected language .
42,415
private function checkLanguageSubmit ( $ environment , $ languages ) { $ inputProvider = $ environment -> getInputProvider ( ) ; if ( 'language_switch' !== $ inputProvider -> getValue ( 'FORM_SUBMIT' ) ) { return ; } if ( $ inputProvider -> hasValue ( 'language' ) && \ array_key_exists ( $ inputProvider -> getValue ( '...
Check if the language has been switched .
42,416
private function modelIdFromInput ( InputProviderInterface $ inputProvider ) { if ( $ inputProvider -> hasParameter ( 'id' ) && $ inputProvider -> getParameter ( 'id' ) ) { return ModelId :: fromSerialized ( $ inputProvider -> getParameter ( 'id' ) ) -> getId ( ) ; } return null ; }
Obtain the model id from the input provider .
42,417
public function convertUuidToFileSource ( DecodePropertyValueForWidgetEvent $ event ) { if ( ! $ this -> scopeDeterminator -> currentScopeIsBackend ( ) ) { return ; } $ propertiesDefinition = $ event -> getEnvironment ( ) -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; $ property = $ propertiesDefinition -> g...
Convert uuid to file source to see the right source in the rich text editor . After convert this back to the original source .
42,418
private function updateValue ( ) { $ session = $ this -> getSessionStorage ( ) ; $ input = $ this -> getInputProvider ( ) ; $ value = null ; if ( $ input -> hasValue ( $ this -> getPropertyName ( ) ) && $ this -> getPanel ( ) -> getContainer ( ) -> updateValues ( ) ) { $ value = $ input -> getValue ( $ this -> getPrope...
Update the local value property with data from either the session or from the input provider .
42,419
private function loadFilterOptions ( ) { $ otherConfig = $ this -> getOtherConfig ( ) ; $ otherConfig -> setFields ( [ $ this -> getPropertyName ( ) ] ) ; $ filterOptions = $ this -> getEnvironment ( ) -> getDataProvider ( ) -> getFilterOptions ( $ otherConfig ) ; $ options = [ ] ; foreach ( $ filterOptions as $ filter...
Load the filter options from the configured property .
42,420
private function checkPermission ( ActionEvent $ event ) { if ( true === $ event -> getEnvironment ( ) -> getDataDefinition ( ) -> getBasicDefinition ( ) -> isEditable ( ) ) { return true ; } $ event -> setResponse ( '<div style="text-align:center; font-weight:bold; padding:40px;"> You have no permis...
Check permission for paste a model .
42,421
private function needTreeModeShowAll ( BasicDefinitionInterface $ definition , InputProviderInterface $ input ) { if ( BasicDefinitionInterface :: MODE_HIERARCHICAL !== $ definition -> getMode ( ) ) { return false ; } if ( $ input -> hasParameter ( 'after' ) || $ input -> hasParameter ( 'into' ) ) { return false ; } re...
Check if paste into or after parameter is present if not perform showAll in tree mode .
42,422
private function isSimpleCreatePaste ( ClipboardInterface $ clipboard , $ provider ) { $ all = $ clipboard -> fetch ( new Filter ( ) ) ; return ( ( 1 === \ count ( $ all ) ) && $ all [ 0 ] -> isCreate ( ) && ( null === $ all [ 0 ] -> getModelId ( ) ) && $ all [ 0 ] -> getDataProviderName ( ) === $ provider ) ; }
Test if the current paste action is a simple paste for the passed data provider .
42,423
private function modelIdFromParameter ( InputProviderInterface $ input , $ name ) { if ( $ input -> hasParameter ( $ name ) && ( $ value = $ input -> getParameter ( $ name ) ) ) { return ModelId :: fromSerialized ( $ value ) ; } return null ; }
Obtain the parameter with the given name from the input provider if it exists .
42,424
protected function loadAdditionalDefinitions ( ContainerInterface $ container ) { if ( null !== $ this -> getFromDca ( 'dca_config/data_provider' ) ) { $ dataContainerName = $ container -> getName ( ) ; $ this -> getDispatcher ( ) -> addListener ( PopulateEnvironmentEvent :: NAME , function ( PopulateEnvironmentEvent $...
Load all additional definitions like naming of parent data provider etc .
42,425
protected function parseClassNames ( ContainerInterface $ container ) { if ( $ container -> hasDefinition ( ExtendedDca :: NAME ) ) { $ definition = $ container -> getDefinition ( ExtendedDca :: NAME ) ; if ( ! ( $ definition instanceof ExtendedDca ) ) { throw new DcGeneralInvalidArgumentException ( \ sprintf ( 'Defini...
Parse all class names for view controller and callback class .
42,426
protected function parseSingleDataProvider ( ContainerInterface $ container , DataProviderDefinitionInterface $ providers , array $ information , $ name ) { if ( isset ( $ information [ 'factory' ] ) ) { $ providerInformation = ( new \ ReflectionClass ( $ information [ 'factory' ] ) ) -> newInstance ( ) -> build ( $ in...
Parse a single data provider information and prepare the definition object for it .
42,427
protected function parsePalettes ( ContainerInterface $ container ) { $ palettesDca = $ this -> getFromDca ( 'palettes' ) ; if ( ! \ is_callable ( $ palettesDca ) ) { return ; } if ( $ container -> hasDefinition ( PalettesDefinitionInterface :: NAME ) ) { $ palettesDefinition = $ container -> getDefinition ( PalettesDe...
Parse the palette information .
42,428
protected function parseConditions ( ContainerInterface $ container ) { if ( $ container -> hasDefinition ( ModelRelationshipDefinitionInterface :: NAME ) ) { $ definition = $ container -> getDefinition ( ModelRelationshipDefinitionInterface :: NAME ) ; } else { $ definition = new DefaultModelRelationshipDefinition ( )...
Parse the conditions for model relationships from the definition .
42,429
protected function parseDynamicParentTableProperty ( ContainerInterface $ container ) { if ( ( null === ( $ propertyName = $ this -> getFromDca ( 'dca_config/parent_table_property' ) ) ) || ( null === ( $ sourceProvider = $ this -> getFromDca ( 'config/ptable' ) ) ) || ( null === ( $ dynamicParentTable = $ this -> getF...
Parse the dynamic parent table .
42,430
protected function calculateTotal ( ) { $ otherConfig = $ this -> getOtherConfig ( ) ; $ total = $ this -> getEnvironment ( ) -> getDataProvider ( ) -> fetchAll ( $ otherConfig -> setIdOnly ( true ) ) ; if ( \ is_array ( $ total ) ) { $ this -> intTotal = $ total ? \ count ( $ total ) : 0 ; return ; } if ( \ is_object ...
Calculate the total amount of items .
42,431
private function process ( EnvironmentInterface $ environment ) { $ collection = $ this -> getCollection ( $ environment ) ; if ( \ count ( $ collection ) < 1 ) { return ; } $ inputProvider = $ environment -> getInputProvider ( ) ; $ clipboard = $ environment -> getClipboard ( ) ; $ inputProvider -> setParameter ( 'pas...
Process the paste all handler .
42,432
protected function getClipboardItems ( EnvironmentInterface $ environment ) { $ basicDefinition = $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) ; $ filter = new Filter ( ) ; $ filter -> andModelIsFromProvider ( $ basicDefinition -> getDataProvider ( ) ) ; if ( $ basicDefinition -> getParentDataProvid...
Get the items from the clipboard .
42,433
protected function getCollection ( EnvironmentInterface $ environment ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ relationShip = $ dataDefinition -> getModelRelationshipDefinition ( ) ; if ( ! $ relationShip -> getChildCondition ( $ dataDefinition -> getName ( ) , $ dataDefinition -> getName ( ) )...
Get the collection .
42,434
protected function getFlatCollection ( EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ previousItem = null ; $ collection = [ ] ; foreach ( $ this -> getClipboardItems ( $ environment ) as $ clipboardItem ) { if ( 'create' === $ clipboardItem -> getAction ( ) ) { conti...
Get the flat collection .
42,435
protected function getHierarchyCollection ( array $ clipboardItems , EnvironmentInterface $ environment ) { $ dataProvider = $ environment -> getDataProvider ( ) ; $ inputProvider = $ environment -> getInputProvider ( ) ; $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ relationShip = $ dataDefinition -> g...
Get hierarchy collection .
42,436
protected function getSubClipboardItems ( array $ clipboardItems , CollectionInterface $ collection ) { $ subClipboardItems = [ ] ; $ modelIds = $ collection -> getModelIds ( ) ; foreach ( $ clipboardItems as $ clipboardItem ) { if ( ! \ in_array ( $ clipboardItem -> getModelId ( ) -> getId ( ) , $ modelIds ) ) { conti...
Get the sub items from the clipboard .
42,437
protected function setSubItemsToCollection ( ItemInterface $ previousItem , array $ subClipboardItems , array $ collection , EnvironmentInterface $ environment ) { if ( empty ( $ subClipboardItems ) ) { return $ collection ; } $ dataProvider = $ environment -> getDataProvider ( ) ; $ dataDefinition = $ environment -> g...
Set the sub items to the collection .
42,438
protected function addDispatchDuplicateModel ( EnvironmentInterface $ environment ) { $ environment -> getEventDispatcher ( ) -> addListener ( PostDuplicateModelEvent :: NAME , function ( PostDuplicateModelEvent $ event ) { $ this -> copiedModel = $ event -> getModel ( ) ; $ this -> originalModel = $ event -> getSource...
Add the event to the listeners for post duplicate model event .
42,439
protected function setParameterForPaste ( array $ collectionItem , EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ clipboardItem = $ collectionItem [ 'item' ] ; $ inputProvider -> unsetParameter ( 'after' ) ; $ inputProvider -> unsetParameter ( 'into' ) ; $ inputProvid...
Set the parameter for paste .
42,440
public function setCondition ( $ condition ) { if ( ( ! $ condition instanceof PaletteConditionInterface ) && ( ! $ condition instanceof PropertyConditionInterface ) ) { throw new DcGeneralInvalidArgumentException ( 'The condition is invalid. ' . ' Only use PaletteConditionInterface or PropertyConditionInterface.' ) ; ...
Set the condition .
42,441
protected function renderPanelElement ( $ element , $ cssClass ) { $ environment = $ this -> getEnvironment ( ) ; $ event = new GetPanelElementTemplateEvent ( $ environment , $ element ) ; $ environment -> getEventDispatcher ( ) -> dispatch ( $ event :: NAME , $ event ) ; $ template = $ event -> getTemplate ( ) ; if ( ...
Render a single panel element .
42,442
protected function isIgnoredPanel ( PanelElementInterface $ element , $ ignoredPanels ) { if ( empty ( $ ignoredPanels ) ) { return false ; } foreach ( ( array ) $ ignoredPanels as $ class ) { if ( $ element instanceof $ class ) { return true ; } } return false ; }
Check if the current element is in the ignored list .
42,443
protected function renderPanelRow ( $ panel , $ ignoredPanels ) { $ parsedElements = [ ] ; $ index = 0 ; $ max = ( \ count ( $ panel ) - 1 ) ; foreach ( $ panel as $ element ) { if ( $ this -> isIgnoredPanel ( $ element , $ ignoredPanels ) ) { $ max -- ; continue ; } $ parsedElements [ ] = $ this -> renderPanelElement ...
Render a panel .
42,444
public function render ( $ ignoredPanels = [ ] ) { $ environment = $ this -> getEnvironment ( ) ; if ( 'properties' === $ environment -> getInputProvider ( ) -> getParameter ( 'select' ) ) { return '' ; } if ( null === $ this -> view -> getPanel ( ) ) { throw new DcGeneralRuntimeException ( 'No panel information stored...
Render the panels .
42,445
private function getPropertyDataProvider ( EnvironmentInterface $ environment ) { $ providerName = 'property.' . $ environment -> getDataDefinition ( ) -> getName ( ) ; $ dataProvider = new NoOpDataProvider ( ) ; $ dataProvider -> setBaseConfig ( [ 'name' => $ providerName ] ) ; $ this -> setPropertyLabelFormatter ( $ ...
Return the property data provider .
42,446
private function setPropertyLabelFormatter ( $ providerName , EnvironmentInterface $ environment ) { $ properties = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; $ labelFormatter = ( new DefaultModelFormatterConfig ( ) ) -> setPropertyNames ( [ 'name' , 'description' ] ) -> setFormat ( '%s <sp...
Set the label formatter for property data provider to the listing configuration .
42,447
private function getCollection ( DataProviderInterface $ dataProvider , EnvironmentInterface $ environment ) { $ collection = $ dataProvider -> getEmptyCollection ( ) ; foreach ( $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) as $ property ) { if ( ! $ this -> isPropertyAllowed ( $ property , $ e...
Return the field collection for each properties .
42,448
private function isPropertyAllowed ( PropertyInterface $ property , EnvironmentInterface $ environment ) { if ( ! $ property -> getWidgetType ( ) || ( 'dummyProperty' === $ property -> getWidgetType ( ) ) ) { return false ; } $ translator = $ environment -> getTranslator ( ) ; $ extra = ( array ) $ property -> getExtra...
Is property allowed for edit multiple .
42,449
private function isPropertyAllowedByOverride ( array $ extra , EnvironmentInterface $ environment ) { return ( ( true === $ extra [ 'unique' ] ) || $ extra [ 'readonly' ] || ( true === $ extra [ 'doNotOverrideMultiple' ] ) ) && ( 'override' === $ environment -> getInputProvider ( ) -> getParameter ( 'mode' ) ) ; }
Is property allowed by override mode .
42,450
private function isPropertyAllowedByIntersectProperties ( PropertyInterface $ property , EnvironmentInterface $ environment ) { $ sessionStorage = $ environment -> getSessionStorage ( ) ; $ inputProvider = $ environment -> getInputProvider ( ) ; $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ session = $ ...
Is property allowed by intersect properties .
42,451
private function handlePropertyFileTree ( PropertyInterface $ property ) { if ( 'fileTree' !== $ property -> getWidgetType ( ) ) { return ; } $ extra = $ property -> getExtra ( ) ; if ( true === empty ( $ extra [ 'orderField' ] ) ) { return ; } $ script = '<script type="text/javascript"> $("%s")....
Handle property file tree .
42,452
private function handlePropertyFileTreeOrder ( PropertyInterface $ property , ModelInterface $ model ) { if ( 'fileTreeOrder' !== $ property -> getWidgetType ( ) ) { return ; } $ model -> setMeta ( $ model :: CSS_ROW_CLASS , 'invisible' ) ; }
Handle property file tree order .
42,453
private function excludePaletteSelectorProperty ( Action $ action , PropertyInterface $ property , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; if ( 1 === \ count ( $ palettesDefinition -> getPalettes ( ) ) ) { return false ; } retur...
Excluded the palette selector property .
42,454
private function analyzeExcludeProperty ( Action $ action , EnvironmentInterface $ environment , PropertyInterface $ property , PalettesDefinitionInterface $ palettesDefinition ) { $ defaultPalette = $ palettesDefinition -> findPalette ( ) ; $ defaultProperties = $ defaultPalette -> getProperties ( ) ; if ( empty ( $ d...
Analyze property for exclude .
42,455
private function makePropertyInvisibleByPalette ( DataDefinition \ Definition \ Properties \ PropertyInterface $ property , EnvironmentInterface $ environment ) { $ palettes = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; foreach ( $ palettes -> getPalettes ( ) as $ palette ) { foreach ( $ palet...
Make the property invisible in all legends of each palette .
42,456
protected function ensurePropertyVisibleInModel ( Action $ action , $ propertyName , ModelInterface $ model , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; $ propertyValues = $ this -> getPropertyValueBagFromModel ( $ action , $ model...
Ensure if the property is visible by the model .
42,457
private function matchVisibilityOfPropertyInAnyPalette ( Action $ action , PropertyInterface $ property , $ invisible , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; if ( true === $ invisible || 1 === \ count ( $ palettesDefinition ->...
Match visibility of property in any palette .
42,458
private function findInvisiblePaletteSelectorProperty ( Action $ action , ModelInterface $ model , array & $ invisibleProperties , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; if ( ! empty ( $ invisibleProperties ) || 1 > \ count ( $...
Find the invisible palette selector property .
42,459
private function matchInvisibleProperty ( ConditionInterface $ visibleCondition , array & $ invisibleProperties , EnvironmentInterface $ environment ) { $ propertiesDefinition = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; foreach ( $ visibleCondition -> getConditions ( ) as $ condition ) { i...
Match the invisible property .
42,460
private function matchInvisibleSubProperties ( ModelInterface $ model , DataDefinition \ Definition \ Properties \ PropertyInterface $ property , PropertyValueBagInterface $ propertyValueBag , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition (...
Match invisible sub properties .
42,461
private function matchParentInvisibleProperty ( ConditionInterface $ visibleCondition , DataDefinition \ Definition \ Properties \ PropertyInterface $ property , DataDefinition \ Palette \ PropertyInterface $ legendProperty , array & $ invisibleProperties , EnvironmentInterface $ environment ) { $ propertiesDefinition ...
Match the parent invisible property .
42,462
protected function getIntersectionModel ( Action $ action , EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ dataProvider = $ environment -> getDataProvider ( ) ; $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ propertiesDefinition = $ dataDefinition -> ge...
Get the intersection Model . If all select models has the same value by their property then is the value set it .
42,463
private function useIntersectValue ( $ intersectPropertyName , array $ legendPropertyNames , EnvironmentInterface $ environment , PaletteInterface $ defaultPalette = null ) { $ propertiesDefinition = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; $ useIntersectValue = ( bool ) $ defaultPalette ...
Use intersect value .
42,464
private function intersectModelSetPrimaryId ( Action $ action , $ intersectModel , $ idProperty , EnvironmentInterface $ environment ) { if ( null !== $ intersectModel -> getId ( ) ) { return ; } $ session = $ this -> getSession ( $ action , $ environment ) ; $ intersectModel -> setId ( $ session [ 'intersectValues' ] ...
Set the primaray id to the model from intersect values .
42,465
private function intersectModelSetParentId ( ModelInterface $ intersectModel , EnvironmentInterface $ environment ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ parentDataDefinition = $ environment -> getParentDataDefinition ( ) ; if ( null === $ parentDataDefinition ) { return ; } $ relationships = ...
Set the parent id to the inersect model .
42,466
private function getLegendPropertyNames ( ModelInterface $ intersectModel , EnvironmentInterface $ environment , PaletteInterface & $ defaultPalette = null ) { $ inputProvider = $ environment -> getInputProvider ( ) ; $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; $ legendP...
Get legend property names .
42,467
protected function getWidgetClass ( PropertyInterface $ property ) { if ( isset ( static :: $ widgetMapping [ $ property -> getWidgetType ( ) ] ) ) { return static :: $ widgetMapping [ $ property -> getWidgetType ( ) ] ; } if ( ! isset ( $ GLOBALS [ 'BE_FFL' ] [ $ property -> getWidgetType ( ) ] ) ) { return null ; } $...
Try to resolve the class name for the widget .
42,468
private function isGetOptionsAllowed ( PropertyInterface $ property ) : bool { $ propExtra = $ property -> getExtra ( ) ; if ( \ is_array ( $ propExtra ) && \ array_key_exists ( 'fetchOptions' , $ propExtra ) && ( true === $ propExtra [ 'fetchOptions' ] ) ) { return true ; } if ( 'checkbox' !== $ property -> getWidgetT...
Check if the current widget is allowed to get options .
42,469
protected function getTableWizard ( ) { $ environment = $ this -> getEnvironment ( ) ; $ dispatcher = $ environment -> getEventDispatcher ( ) ; $ defName = $ environment -> getDataDefinition ( ) -> getName ( ) ; $ translator = $ environment -> getTranslator ( ) ; $ urlEvent = new AddToUrlEvent ( 'key=table' ) ; $ impor...
Get the table import wizard .
42,470
protected function getListWizard ( ) { $ environment = $ this -> getEnvironment ( ) ; $ dispatcher = $ environment -> getEventDispatcher ( ) ; $ defName = $ environment -> getDataDefinition ( ) -> getName ( ) ; $ translator = $ environment -> getTranslator ( ) ; $ urlEvent = new AddToUrlEvent ( 'key=list' ) ; $ importL...
Get the list import wizard .
42,471
protected function getHelpWizard ( $ propInfo ) { $ helpWizard = '' ; $ environment = $ this -> getEnvironment ( ) ; $ translator = $ environment -> getTranslator ( ) ; if ( $ propInfo -> getExtra ( ) && \ array_key_exists ( 'helpwizard' , $ propInfo -> getExtra ( ) ) ) { $ event = new GenerateHtmlEvent ( 'about.svg' ,...
Get the help wizard .
42,472
public function buildWidget ( PropertyInterface $ property , ModelInterface $ model ) { if ( static :: $ scopeDeterminator -> currentScopeIsUnknown ( ) || ! static :: $ scopeDeterminator -> currentScopeIsBackend ( ) ) { throw new DcGeneralRuntimeException ( \ sprintf ( 'WidgetBuilder only supports the backend mode. Run...
Build a widget for a given property .
42,473
private function valueToWidget ( ModelInterface $ model , PropertyInterface $ property ) { $ environment = $ this -> getEnvironment ( ) ; $ event = new DecodePropertyValueForWidgetEvent ( $ environment , $ model ) ; $ event -> setProperty ( $ property -> getName ( ) ) -> setValue ( $ model -> getProperty ( $ property -...
Decode the value for the widget .
42,474
private function prepareWidgetAttributes ( ModelInterface $ model , PropertyInterface $ property ) { $ environment = $ this -> getEnvironment ( ) ; $ defName = $ environment -> getDataDefinition ( ) -> getName ( ) ; $ propExtra = $ property -> getExtra ( ) ; $ value = $ this -> valueToWidget ( $ model , $ property ) ; ...
Prepare the attributes for the widget .
42,475
public function __isset ( $ strKey ) { switch ( $ strKey ) { case 'subTemplate' : return isset ( $ this -> subTemplate ) ; case 'thumbnailHeight' : return isset ( $ this -> thumbnailHeight ) ; case 'thumbnailWidth' : return isset ( $ this -> thumbnailWidth ) ; case 'placeholderImage' : return isset ( $ this -> placehol...
Check whether an object property exists
42,476
private function setUp ( ) { $ GLOBALS [ 'TL_CONFIG' ] [ 'loadGoogleFonts' ] = true ; $ this -> rootDir = \ dirname ( System :: getContainer ( ) -> getParameter ( 'kernel.root_dir' ) ) ; if ( ! $ this -> dataContainer || ! $ this -> orderField ) { return ; } $ value = $ this -> dataContainer -> getModel ( ) -> getPrope...
Setup the file tree widget .
42,477
private function renderList ( array & $ icons , Collection $ collection = null , $ followSubDirs = false ) { if ( ! $ collection ) { return ; } foreach ( $ collection -> getModels ( ) as $ model ) { if ( ! \ file_exists ( $ this -> rootDir . '/' . $ model -> path ) ) { continue ; } if ( ( 'folder' === $ model -> type )...
Render the file list .
42,478
protected function renderFileInfo ( File $ file ) { return \ sprintf ( '%s <span class="tl_gray">(%s%s)</span>' , $ file -> path , static :: getReadableSize ( $ file -> size ) , ( ( $ file -> isGdImage || $ file -> isSvgImage ) ? ', ' . $ file -> width . 'x' . $ file -> height . ' px' : '' ) ) ; }
Render the file info .
42,479
protected function renderIcon ( $ model , $ imagesOnly = false , $ downloads = false ) { if ( 'folder' === $ model -> type ) { if ( $ imagesOnly || $ downloads ) { return false ; } return Image :: getHtml ( 'folderC.svg' ) . ' ' . $ model -> path ; } $ file = new File ( $ model -> path ) ; $ info = $ this -> renderFile...
Render the image of a file .
42,480
private function generateGalleryImage ( $ model , File $ file , $ info ) { $ image = $ this -> placeholderImage ; if ( $ file -> isSvgImage || ( ( $ file -> height <= Config :: get ( 'gdMaxImgHeight' ) ) && ( $ file -> width <= Config :: get ( 'gdMaxImgWidth' ) ) ) ) { $ width = \ min ( $ file -> width , $ this -> thum...
Generate a image for use as gallery listing .
42,481
private function applySorting ( $ icons ) { if ( ( '' !== $ this -> orderField ) && \ is_array ( $ this -> orderFieldValue ) ) { $ ordered = [ ] ; foreach ( $ this -> orderFieldValue as $ uuid ) { $ iconKey = \ md5 ( $ uuid ) ; if ( isset ( $ icons [ $ iconKey ] ) ) { $ ordered [ $ iconKey ] = $ icons [ $ iconKey ] ; u...
Apply the sorting to the icons .
42,482
private function generateLink ( ) { $ extras = [ 'fieldType' => $ this -> fieldType ] ; if ( $ this -> files ) { $ extras [ 'files' ] = ( bool ) $ this -> files ; } if ( $ this -> filesOnly ) { $ extras [ 'filesOnly' ] = ( bool ) $ this -> filesOnly ; } if ( $ this -> path ) { $ extras [ 'path' ] = ( string ) $ this ->...
Generate the adjust selection link .
42,483
public function getBackButton ( ) { $ container = $ GLOBALS [ 'container' ] ; $ dataContainer = $ container [ 'dc-general.data-definition-container' ] ; $ dataDefinition = $ dataContainer -> getDefinition ( $ this -> table ) ; $ environment = new DefaultEnvironment ( ) ; $ environment -> setDataDefinition ( $ dataDefin...
Get the back button .
42,484
public static function process ( BuildDataDefinitionEvent $ event , $ eventName , $ dispatcher ) { $ builder = new static ( ) ; $ builder -> eventName = $ eventName ; $ builder -> dispatcher = $ dispatcher ; $ builder -> build ( $ event -> getContainer ( ) , $ event ) ; }
Creates an instance of itself and processes the event .
42,485
protected function buildHref ( CommandInterface $ command ) { $ arrParameters = ( array ) $ command -> getParameters ( ) ; $ strHref = '' ; foreach ( $ arrParameters as $ key => $ value ) { $ strHref .= \ sprintf ( '&%s=%s' , $ key , $ value ) ; } return $ strHref ; }
Build reduced href required by legacy callbacks .
42,486
public function first ( ) { $ this -> index = \ count ( $ this -> children ) ? 0 : ( - 1 ) ; if ( $ this -> index === - 1 ) { return null ; } return $ this -> current ( ) ; }
Rewind the Iterator to the first element and return it .
42,487
public function indexOf ( $ filter ) { foreach ( $ this -> children as $ i => $ child ) { if ( $ child === $ filter ) { return $ i ; } } return - 1 ; }
Get the position index of a given filter builder in this instance .
42,488
public function add ( $ filter ) { $ index = $ this -> indexOf ( $ filter ) ; if ( $ index === - 1 ) { $ this -> children [ ] = $ filter ; $ filter -> setBuilder ( $ this -> builder ) -> setParent ( $ this ) ; } return $ this ; }
Add a given filter builder to this instance .
42,489
public function remove ( $ filter ) { $ index = $ this -> indexOf ( $ filter ) ; if ( $ index > - 1 ) { $ this -> offsetUnset ( $ index ) ; } return $ this ; }
Remove a given filter builder from this instance .
42,490
protected function getOtherConfig ( ) { if ( ! isset ( $ this -> objOtherConfig ) ) { $ this -> objOtherConfig = $ this -> getEnvironment ( ) -> getBaseConfigRegistry ( ) -> getBaseConfig ( ) ; $ this -> getPanel ( ) -> getContainer ( ) -> initialize ( $ this -> objOtherConfig , $ this ) ; } return $ this -> objOtherCo...
Let all other elements initialize and apply themselves to this config .
42,491
public static function addField ( ConfigInterface $ config , $ idProperty , QueryBuilder $ queryBuilder ) { if ( $ config -> getIdOnly ( ) ) { $ queryBuilder -> select ( $ idProperty ) ; return ; } if ( null !== $ config -> getFields ( ) ) { $ connection = $ queryBuilder -> getConnection ( ) ; $ fields = implode ( ', '...
Add the field list .
42,492
public static function addSorting ( ConfigInterface $ config , QueryBuilder $ queryBuilder ) { if ( empty ( $ config -> getSorting ( ) ) || ! is_array ( $ config -> getSorting ( ) ) ) { return ; } foreach ( $ config -> getSorting ( ) as $ sort => $ order ) { if ( ! empty ( $ order ) ) { $ order = strtoupper ( $ order )...
Add the order by part of a query .
42,493
private static function determineFilterComparing ( array $ filter , QueryBuilder $ queryBuilder ) { if ( ! \ in_array ( $ filter [ 'operation' ] , [ '=' , '>' , '>=' , '<' , '<=' , '<>' ] ) ) { return null ; } return static :: filterComparing ( $ filter , $ queryBuilder ) ; }
Determine sql filter for comparing .
42,494
private static function determineFilterInOrNotInList ( array $ filter , QueryBuilder $ queryBuilder ) { if ( ! \ in_array ( $ filter [ 'operation' ] , [ 'IN' , 'NOT IN' ] ) ) { return null ; } return static :: filterInOrNotInList ( $ filter , $ queryBuilder ) ; }
Determine sql filter for in or not in list .
42,495
private static function determineFilterLikeOrNotLike ( array $ filter , QueryBuilder $ queryBuilder ) { if ( ! \ in_array ( $ filter [ 'operation' ] , [ 'LIKE' , 'NOT LIKE' ] ) ) { return null ; } return static :: filterLikeOrNotLike ( $ filter , $ queryBuilder ) ; }
Determine sql filter for like or not like .
42,496
private static function determineFilterIsNullOrIsNotNull ( array $ filter , QueryBuilder $ queryBuilder ) { if ( ! \ in_array ( $ filter [ 'operation' ] , [ 'IS NULL' , 'IS NOT NULL' ] ) ) { return null ; } return static :: filterIsNullOrIsNotNull ( $ filter , $ queryBuilder ) ; }
Determine sql filter for is null or is not null .
42,497
public static function deriveEmptyFromEnvironment ( EnvironmentInterface $ environment ) { $ factory = new DcGeneralFactory ( ) ; $ factory -> setEventDispatcher ( $ environment -> getEventDispatcher ( ) ) ; $ factory -> setTranslator ( $ environment -> getTranslator ( ) ) ; $ factory -> setEnvironmentClassName ( \ get...
Create a new factory with basic settings from the environment .
42,498
public static function deriveFromEnvironment ( EnvironmentInterface $ environment ) { $ factory = static :: deriveEmptyFromEnvironment ( $ environment ) ; $ factory -> setContainerName ( $ environment -> getDataDefinition ( ) -> getName ( ) ) ; return $ factory ; }
Create a new factory with basic settings and same container name as the given environment is build for .
42,499
public function setParent ( FilterBuilderWithChildren $ parent ) { if ( $ this -> parent && $ this -> parent !== $ parent ) { $ this -> parent -> remove ( $ this ) ; } $ this -> parent = $ parent ; $ this -> parent -> add ( $ this ) ; return $ this ; }
Set the parent and return self .